Çözüldü İç içe olan itemleri ayırırken açılan won yang penceresi

  • Konuyu açan Konuyu açan MEKA
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 5
  • Gösterim Gösterim 505
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

MEKA

Discord: mekaprojects
Süper Moderatör
Grafiker
Geliştirici
Yardımsever Üye
Mesaj
2.849
Çözümler
297
Beğeni
2.129
Puan
1.850
Ticaret Puanı
2
Resimde gördügünüz gibi bir itemi ayırırken bu pencere çıkıyor k envanterde item ayırma yaparken herhangi bi problem yok fakat envanterde ayırma yaptıgımda açılıyor

Kod:
Genişlet Daralt Kopyala
0418 18:34:01213 :: Traceback (most recent call last):

0418 18:34:01213 ::   File "ui.py", line 1493, in CallEvent

0418 18:34:01213 ::   File "ui.py", line 129, in __call__

0418 18:34:01213 ::   File "ui.py", line 111, in __call__

0418 18:34:01214 ::   File "uiPickMoney.py", line 130, in OnAccept

0418 18:34:01214 ::   File "ui.py", line 129, in __call__

0418 18:34:01214 ::   File "ui.py", line 120, in __call__

0418 18:34:01215 :: TypeError
0418 18:34:01215 :: :
0418 18:34:01215 :: OnPickItem() takes exactly 2 arguments (3 given)
0418 18:34:01215 ::


Adsız.png
 
Çözüm
@Whistle uzun aramlar karşılaştırmalar sonucu çözmüş bulunmaktayım :D fakat 2li ayırma problemini hala çözemedim

Çözüm Konusu : Lonca Bağış ve İtem Ayırma Won / Yang Penceresi Çözümü

Edit : 2li ayırma problemini fazladan ekli kodu kaldırarak çözdüm


Python:
Genişlet Daralt Kopyala
                itemCount = player.GetItemCount(attachedSlotPos)
                attachedCount = mouseModule.mouseController.GetAttachedItemCount()
                self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
Şu vereceğim kodlar ile kendi kodlarınızı bi karşılaştırın isterseniz;
Python:
Genişlet Daralt Kopyala
import wndMgr
import ui
import ime
import localeInfo
import app

class PickMoneyDialog(ui.ScriptWindow):
    def __init__(self):
        ui.ScriptWindow.__init__(self)

        self.unitValue = 1
        self.maxValue = 0
        self.eventAccept = 0
        if app.ENABLE_GUILDRENEWAL_SYSTEM:
            self.eventClose = 0
       
        if app.ENABLE_CHEQUE_SYSTEM:
            self.chequeMaxValue = 0

    def __del__(self):
        ui.ScriptWindow.__del__(self)

    def LoadDialog(self):
        try:
            pyScrLoader = ui.PythonScriptLoader()
            pyScrLoader.LoadScriptFile(self, "UIScript/PickMoneyDialog.py")
        except:
            import exception
            exception.Abort("MoneyDialog.LoadDialog.LoadScript")

        try:
            self.board = self.GetChild("board")
            self.maxValueTextLine = self.GetChild("max_value")
            self.pickValueEditLine = self.GetChild("money_value")
            self.acceptButton = self.GetChild("accept_button")
            self.cancelButton = self.GetChild("cancel_button")
           
            if app.ENABLE_CHEQUE_SYSTEM:
                self.maxChequeValueTextLine = self.GetChild("cheque_max_value")
                self.pickChequeValueEditLine = self.GetChild("cheque_value")
                self.pickChequeValueEditLine.OnMouseLeftButtonDown = ui.__mem_func__(self.__ClickChequeEditLine)
                self.pickValueEditLine.OnMouseLeftButtonDown = ui.__mem_func__(self.__ClickValueEditLine)
           
        except:
            import exception
            exception.Abort("MoneyDialog.LoadDialog.BindObject")

        self.pickValueEditLine.SetReturnEvent(ui.__mem_func__(self.OnAccept))
        self.pickValueEditLine.SetEscapeEvent(ui.__mem_func__(self.Close))
        self.acceptButton.SetEvent(ui.__mem_func__(self.OnAccept))
        self.cancelButton.SetEvent(ui.__mem_func__(self.Close))
        self.board.SetCloseEvent(ui.__mem_func__(self.Close))

    def Destroy(self):
        self.ClearDictionary()
        self.eventAccept = 0
        self.maxValue = 0
        self.pickValueEditLine = 0       
        self.acceptButton = 0
        self.cancelButton = 0
        self.board = None
        if app.ENABLE_CHEQUE_SYSTEM:
            self.chequeMaxValue = 0
        if app.ENABLE_GUILDRENEWAL_SYSTEM:
            self.eventClose = 0
       
    def SetTitleName(self, text):
        self.board.SetTitleName(text)

    def SetAcceptEvent(self, event):
        self.eventAccept = event
   
    if app.ENABLE_GUILDRENEWAL_SYSTEM:
        def SetCloseEvent(self, event):
            self.eventClose = event

    def SetMax(self, max):
        self.pickValueEditLine.SetMax(max)

    if app.ENABLE_CHEQUE_SYSTEM:
        def SetFocus(self, focus_idx) :
            if focus_idx == 1:
                self.pickChequeValueEditLine.SetText("")
                self.pickChequeValueEditLine.SetFocus()
                self.pickValueEditLine.SetText(str(0))
            else :
                return
       
        def __ClickChequeEditLine(self) :
            self.pickChequeValueEditLine.SetFocus()
            if len(self.pickValueEditLine.GetText()) <= 0:
                self.pickValueEditLine.SetText(str(0))

        def __ClickValueEditLine(self) :
            self.pickValueEditLine.SetFocus()
            if len(self.pickChequeValueEditLine.GetText()) <= 0:
                self.pickChequeValueEditLine.SetText(str(0))
       
        def Open(self, maxValue, chequeMaxValue = 0):

            width = self.GetWidth()
            (mouseX, mouseY) = wndMgr.GetMousePosition()

            if mouseX + width/2 > wndMgr.GetScreenWidth():
                xPos = wndMgr.GetScreenWidth() - width
            elif mouseX - width/2 < 0:
                xPos = 0
            else:
                xPos = mouseX - width/2

            self.SetPosition(xPos, mouseY - self.GetHeight() - 20)

            if localeInfo.IsARABIC():
                self.maxValueTextLine.SetText("/" + str(maxValue))
                self.maxChequeValueTextLine.SetText("/" + str(chequeMaxValue))
            else:
                self.maxValueTextLine.SetText(" / " + str(maxValue))
                self.maxChequeValueTextLine.SetText(" / " + str(chequeMaxValue))
           
            self.pickChequeValueEditLine.SetText(str(0))
           
            self.pickValueEditLine.SetText("")
            self.pickValueEditLine.SetFocus()

            ime.SetCursorPosition(1)

            self.chequeMaxValue = chequeMaxValue
            self.maxValue = maxValue
            self.Show()
            self.SetTop()
    else:
        def Open(self, maxValue, unitValue=1):

            if localeInfo.IsYMIR() or localeInfo.IsCHEONMA() or localeInfo.IsHONGKONG():
                unitValue = ""

            width = self.GetWidth()
            (mouseX, mouseY) = wndMgr.GetMousePosition()

            if mouseX + width/2 > wndMgr.GetScreenWidth():
                xPos = wndMgr.GetScreenWidth() - width
            elif mouseX - width/2 < 0:
                xPos = 0
            else:
                xPos = mouseX - width/2

            self.SetPosition(xPos, mouseY - self.GetHeight() - 20)

            if localeInfo.IsARABIC():
                self.maxValueTextLine.SetText("/" + str(maxValue))
            else:
                self.maxValueTextLine.SetText(" / " + str(maxValue))

            self.pickValueEditLine.SetText(str(unitValue))
            self.pickValueEditLine.SetFocus()

            ime.SetCursorPosition(1)

            self.unitValue = unitValue
            self.maxValue = maxValue
            self.Show()
            self.SetTop()

    def Close(self):
        if app.ENABLE_CHEQUE_SYSTEM:
            self.pickChequeValueEditLine.KillFocus()
       
        self.pickValueEditLine.KillFocus()
        self.Hide()
        if app.ENABLE_GUILDRENEWAL_SYSTEM:
            if self.eventClose:
                self.eventClose()

    if app.ENABLE_CHEQUE_SYSTEM :
        def OnAccept(self):
            cheque_text    = self.pickChequeValueEditLine.GetText()
            money_text    = self.pickValueEditLine.GetText()

            if len(cheque_text) > 0 and cheque_text.isdigit() \
                 and len(money_text) > 0 and money_text.isdigit():
               
                cheque = int(cheque_text)
                cheque = min(cheque, self.chequeMaxValue)
               
                money = int(money_text)
                money = min(money, self.maxValue)

                if cheque > 0 or money > 0 :
                    if self.eventAccept:
                        self.eventAccept(money, cheque)

            self.Close()
    else :
        def OnAccept(self):

            text = self.pickValueEditLine.GetText()

            if len(text) > 0 and text.isdigit():

                money = int(text)
                money = min(money, self.maxValue)

                if money > 0:
                    if self.eventAccept:
                        self.eventAccept(money)

            self.Close()
 
Karşılaştırma yaptım sizin kodları direk olarakta kullandım tek farkı won yazma kısmı aktif oluyor
 
@Whistle Eski yedeklerden uipickmoney dosyasını kullandım test etmek için won yang kısmı gözüküyor ama item ayırması yapılıyor bu belki çözüme götürebilir bi fikriniz varmıdır ?

Edit : Ayırma işlemini tekli yapmıyor eski olanda 1 yazınca 2 olarak ayırlıyor 11 yazınca 22 olarka ayırıyor
 
Ayırma özelliğini düzgün çalışan bir filesin kodları ile kendi kodlarınızı karşılaştırmayı deneyin. Yapabileceğim tek öneri bu :oops:
 
@Whistle uzun aramlar karşılaştırmalar sonucu çözmüş bulunmaktayım :D fakat 2li ayırma problemini hala çözemedim

Çözüm Konusu : Lonca Bağış ve İtem Ayırma Won / Yang Penceresi Çözümü

Edit : 2li ayırma problemini fazladan ekli kodu kaldırarak çözdüm


Python:
Genişlet Daralt Kopyala
                itemCount = player.GetItemCount(attachedSlotPos)
                attachedCount = mouseModule.mouseController.GetAttachedItemCount()
                self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
 
Son düzenleme:
Çözüm
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Üst