[C++/Python] Kanal Değiştirme Sistemi

Forgiven

burakhangunduz
Geliştirici
Yardımsever Üye
Usta Üye
Editör
Mesaj
568
Çözümler
42
Beğeni
579
Puan
939
Ticaret Puanı
0
Kendime eklediğim ch değiştirme sistemi hoşuma gitmemişti.
Sökmüşken paylaşmak istedim.
Rohan2 filesinden sökülmüştür.
Port ayarı gerektirmez.
Sistemi sabahtan beri kontrol ediyorum şuan herhangi bir bug yada saçma bi olayı yok.

Not; Sistemin tek sıkıntısı anlık chyi güncellemiyor.
Bu yüzden alttaki eklentiyi eklemeniz gerekmektedir.
Ekledikten sonra kanal değiştirdiğinizde anlık olarak güncellenicektir.


Eklenmesi gereken eklenti; Anlık Kanal Güncelleme
İndirme Linki;
Linkleri görebilmek için giriş yap veya kayıt ol.

Scan;
Linkleri görebilmek için giriş yap veya kayıt ol.


Serveriniz 6 ch ise bu işlemleri yapın.
cmd_general.cpp'ye eklediğiniz kodda bunu aratın.

C++:
    if (channel < 0 || channel > 4)
4 bölümünü 6 yapın.

uisystem.py eklediğiniz bu kodu aratın.
Python:
cnt = 5
bunu ise 7 olarak değiştirin.

DB build olurken patlar ise
Clientmanager.cpp ve h dosyalarına

#include "../../common/service.h"
bunu ekleyiniz.

tables.h'de patlar ise

#include "service.h"

bunu ekleyiniz.​



Honeycam_2020-11-23_16-27-29.gif
 
@burakhangunduz sistemi ekledim. Bundan da herhangi bir sorun vs almadım fakat koordinatları nasıl ayarlayabilirim? Sizinki gibi direk eklediğimde gelmesi lazım mıydı yoksa koordinat yok diye mi sistem çalışmıyor?
 
En son bir moderatör tarafından düzenlenmiş:
Direk gelmesi derken biraz açar mısınız?
 
Paylaşım için teşekkürler,

@burakhangunduz Şöyle bir hata alıyorum sebebini bulamadım yardımcı olabilir misin?

ESC menüden "Kanal Değiştir" butonuna tıkladıktan sonra syserr oluşuyor.

Kod:
1227 20:58:50204 :: Traceback (most recent call last):

1227 20:58:50204 ::   File "ui.py", line 1095, in CallEvent

1227 20:58:50205 ::   File "ui.py", line 90, in __call__

1227 20:58:50205 ::   File "ui.py", line 72, in __call__

1227 20:58:50205 ::   File "uiSystem.py", line 189, in __ClickMoveChannelButton

1227 20:58:50205 ::   File "uiSystem.py", line 231, in __init__

1227 20:58:50205 ::   File "uiSystem.py", line 248, in __LoadDialog

1227 20:58:50205 ::   File "ui.py", line 2769, in GetChild

1227 20:58:50205 :: KeyError
1227 20:58:50205 :: :
1227 20:58:50205 :: 'BlackBoard'
1227 20:58:50205 ::
 
Paylaşım için teşekkürler,

@burakhangunduz Şöyle bir hata alıyorum sebebini bulamadım yardımcı olabilir misin?

ESC menüden "Kanal Değiştir" butonuna tıkladıktan sonra syserr oluşuyor.

Kod:
1227 20:58:50204 :: Traceback (most recent call last):

1227 20:58:50204 ::   File "ui.py", line 1095, in CallEvent

1227 20:58:50205 ::   File "ui.py", line 90, in __call__

1227 20:58:50205 ::   File "ui.py", line 72, in __call__

1227 20:58:50205 ::   File "uiSystem.py", line 189, in __ClickMoveChannelButton

1227 20:58:50205 ::   File "uiSystem.py", line 231, in __init__

1227 20:58:50205 ::   File "uiSystem.py", line 248, in __LoadDialog

1227 20:58:50205 ::   File "ui.py", line 2769, in GetChild

1227 20:58:50205 :: KeyError
1227 20:58:50205 :: :
1227 20:58:50205 :: 'BlackBoard'
1227 20:58:50205 ::
Linkleri görebilmek için giriş yap veya kayıt ol.

Bunu uygulayın.
Python:
class ThinBoard(Window):

Aratılır

Üstüne Eklenilir

class ThinBoardCircle(Window):
    CORNER_WIDTH = 4
    CORNER_HEIGHT = 4
    LINE_WIDTH = 4
    LINE_HEIGHT = 4
    BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 1.0)

    LT = 0
    LB = 1
    RT = 2
    RB = 3
    L = 0
    R = 1
    T = 2
    B = 3

    def __init__(self, layer = "UI"):
        Window.__init__(self, layer)

        CornerFileNames = [ "d:/ymir work/ui/pattern/thinboardcircle/ThinBoard_Corner_"+dir+"_Circle.tga" for dir in ["LeftTop","LeftBottom","RightTop","RightBottom"] ]
        LineFileNames = [ "d:/ymir work/ui/pattern/thinboardcircle/ThinBoard_Line_"+dir+"_Circle.tga" for dir in ["Left","Right","Top","Bottom"] ]

        self.Corners = []
        for fileName in CornerFileNames:
            Corner = ExpandedImageBox()
            Corner.AddFlag("attach")
            Corner.AddFlag("not_pick")
            Corner.LoadImage(fileName)
            Corner.SetParent(self)
            Corner.SetPosition(0, 0)
            Corner.Show()
            self.Corners.append(Corner)

        self.Lines = []
        for fileName in LineFileNames:
            Line = ExpandedImageBox()
            Line.AddFlag("attach")
            Line.AddFlag("not_pick")
            Line.LoadImage(fileName)
            Line.SetParent(self)
            Line.SetPosition(0, 0)
            Line.Show()
            self.Lines.append(Line)

        Base = Bar()
        Base.SetParent(self)
        Base.AddFlag("attach")
        Base.AddFlag("not_pick")
        Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
        Base.SetColor(self.BOARD_COLOR)
        Base.Show()
        self.Base = Base
        
        self.ButtonText = None
        self.BonusId = 0

        self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
        self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)

    def __del__(self):
        Window.__del__(self)

    def SetSize(self, width, height):

        width = max(self.CORNER_WIDTH*2, width)
        height = max(self.CORNER_HEIGHT*2, height)
        Window.SetSize(self, width, height)

        self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
        self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
        self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
        self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
        self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

        verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
        horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
        self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
        self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
        self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
        self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
        self.Base.SetSize(width - self.CORNER_WIDTH*2, height - self.CORNER_HEIGHT*2)
        
    def SetText(self, text):
        if not self.ButtonText:
            textLine = TextLine()
            textLine.SetParent(self)
            textLine.SetPosition(self.GetWidth()/2, self.GetHeight()/2)
            textLine.SetVerticalAlignCenter()
            textLine.SetHorizontalAlignCenter()
            textLine.Show()
            self.ButtonText = textLine

        self.ButtonText.SetText(text)
        
    def GetText(self):
        if not self.ButtonText:
            return ""
        return self.ButtonText.GetText()
        
    def SetBonusId(self, bnsId):
        self.BonusId = bnsId
        
    def GetBonusId(self):
        if self.BonusId != 0:
            return self.BonusId

    def ShowInternal(self):
        self.Base.Show()
        for wnd in self.Lines:
            wnd.Show()
        for wnd in self.Corners:
            wnd.Show()

    def HideInternal(self):
        self.Base.Hide()
        for wnd in self.Lines:
            wnd.Hide()
        for wnd in self.Corners:
            wnd.Hide()



Aratılır : elif Type == "thinboard":

kod bloğu altına eklenilir

            elif Type == "thinboard_circle":
                parent.Children[Index] = ThinBoardCircle()
                parent.Children[Index].SetParent(parent)
                self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)


Son olarak

def LoadElementBoardWithTitleBar(self, window, value, parentWindow): 

 Aratılır


Kod bloğunun altına eklenilir

    def LoadElementThinBoardCircle(self, window, value, parentWindow):
        if FALSE == self.CheckKeyList(value["name"], value, self.BOARD_KEY_LIST):
            return FALSE

        window.SetSize(int(value["width"]), int(value["height"]))
        self.LoadDefaultData(window, value, parentWindow)
        return TRUE

NOT : rokador.epk eix packa atılıp indekse eklenir

Linkleri görebilmek için giriş yap veya kayıt ol.

Bunuda pack içine atıp indexe ekleyin.
 
burak hocamın verdiği rokador.eix epk dosyasının linki kırık olduğu için buraya yüklüyorum işine yarayan olursa kullabilir aynı şekilde index'e ekleyeceksiniz.
 

Dosya Eklentileri

  • uysalmt2.rar
    725 byte · Gösterim: 4
Geri
Üst