Çözüldü 'module' object has no attribute 'SetRefineStatus'

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ı.

karew1

MT Üye
MT Üye
Mesaj
150
Çözümler
1
Beğeni
91
Puan
689
Ticaret Puanı
0
Merhabalar K envanter sistemini ekliyorum fakat 2 adet sorunum var tabii dahada çıkacaktır sanırım baya bir fix isteyecek neyse,

1. Sorun K tuşuna basıldığında K envanter açılıyor fakat " I " tuşuna bastığımda yada Envanter butonuna tıkladığımda hiçbir şekilde Envanteri açamıyorum ( Normal Envanter ) ne bir Syserr var nede başka birşey.

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


2. Sorun ise şu K envanter penceresinde bir Check Box var Envanter ile beraber K envanteri açılsın mı diyor. Burayı işaretlediğim zaman Envanter açılıyor sonrada ya biri yada 2 envanter birden kapanıyor.

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


Buradaki Syserr :

Envanter ile birlikte Açılsın mı ?:
0905 10:04:14472 ::   File "ui.py", line 4154, in OnMouseLeftButtonUp

0905 10:04:14474 :: AttributeError
0905 10:04:14479 :: :
0905 10:04:14481 :: 'module' object has no attribute 'SetRefineStatus'
0905 10:04:14483 ::

Ui.py'de bu soruna yol açan kod bloğu

Ui.py:
class CheckBox(Window):
    def __init__(self):
        Window.__init__(self)
    
        self.backgroundImage = None
        self.checkImage = None

        self.eventFunc = { "ON_CHECK" : None, "ON_UNCKECK" : None, }
        self.eventArgs = { "ON_CHECK" : None, "ON_UNCKECK" : None, }

        self.CreateElements()
    
    def __del__(self):
        Window.__del__(self)
    
        self.backgroundImage = None
        self.checkImage = None
    
        self.eventFunc = { "ON_CHECK" : None, "ON_UNCKECK" : None, }
        self.eventArgs = { "ON_CHECK" : None, "ON_UNCKECK" : None, }
    
    def CreateElements(self):
        self.backgroundImage = ImageBox()
        self.backgroundImage.SetParent(self)
        self.backgroundImage.AddFlag("not_pick")
        self.backgroundImage.LoadImage("d:/ymir work/ui/game/refine/checkbox.tga")
        self.backgroundImage.Show()
    
        self.checkImage = ImageBox()
        self.checkImage.SetParent(self)
        self.checkImage.AddFlag("not_pick")
        self.checkImage.SetPosition(0, -4)
        self.checkImage.LoadImage("d:/ymir work/ui/game/refine/checked.tga")
        self.checkImage.Hide()
    
        self.textInfo = TextLine()
        self.textInfo.SetParent(self)
        self.textInfo.SetPosition(20, -2)
        self.textInfo.Show()
    
        self.SetSize(self.backgroundImage.GetWidth() + self.textInfo.GetTextSize()[0], self.backgroundImage.GetHeight())
    
    def SetTextInfo(self, info):
        if self.textInfo:
            self.textInfo.SetText(info)
        
        self.SetSize(self.backgroundImage.GetWidth() + self.textInfo.GetTextSize()[0], self.backgroundImage.GetHeight())
    
    def SetCheckStatus(self, flag):
        if flag:
            self.checkImage.Show()
        else:
            self.checkImage.Hide()

    def GetCheckStatus(self):
        if self.checkImage:
            return self.checkImage.IsShow()
        
        return False
    
    def SetEvent(self, func, *args) :
        result = self.eventFunc.has_key(args[0])   
        if result :
            self.eventFunc[args[0]] = func
            self.eventArgs[args[0]] = args
        else :
            print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
    
    def OnMouseLeftButtonUp(self):
        if self.checkImage:
            if self.checkImage.IsShow():
                self.checkImage.Hide()

                if self.eventFunc["ON_UNCKECK"]:
                    apply(self.eventFunc["ON_UNCKECK"], self.eventArgs["ON_UNCKECK"])
                    systemSetting.SetRefineStatus(False)
            else:
                self.checkImage.Show()

                if self.eventFunc["ON_CHECK"]:
                    apply(self.eventFunc["ON_CHECK"], self.eventArgs["ON_CHECK"])
                    systemSetting.SetRefineStatus(True)

Sizce bu sorunu çözebilir miyiz ?

Veya bu sistemin fix halini paylaşabilecek var mı ?
( Forumda aradım ama bulamyorum :( )
 
Son düzenleme:
Çözüm
Sistem dosyalarını inceledim şimdi. ui.py ekleyin dediği kodda SetRefineStatus kullanılmış ama src tarafında nasıl eklenildiği yazmamış.
Python:
                if self.eventFunc["ON_UNCKECK"]:
                    apply(self.eventFunc["ON_UNCKECK"], self.eventArgs["ON_UNCKECK"])
                    systemSetting.SetRefineStatus(False)

True ve False değer aldığı için isterseniz bunu kendinizde ekleyebilirsiniz. Sırasıyla şu adımları uygulayın.
Not: Kodları denemedim. Forumun editöründe yazarak ilerledim. :D Umarım bi sorun çıkmaz.

PythonSystem.h, TConfig'e şunu ekleyin;
C++:
            bool                bRefineStatus;


Daha sonra fonksiyonların olduğu kısıma şunları ekleyin;
C++:
bool                            IsRefineStatus();
void...
Ne demek efendim. Mesajımı düzenledim tekrardan. Eğer akşam kodları aldıysanız tekrardan değiştirmeniz gerekiyor. :boom:
 
612. satır hangisine denk geliyor? Editörün işaretleme seçeneğini kullanabilirsiniz.
self.wndTaskBar.RefreshQuickSlot() sanırsam burası için hata veriyor ama taskbar.py'de bi düzenleme yaptınız mı?
Envanter açılıyor mu?

Düzenle dediğim yeri şu şekilde değiştirebilir misiniz?
Python:
    def ToggleInventoryWindow(self):
        if self.State == "Kapali":
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Envanteri acabilmek icin " + str(int(int(self.LastContactTimeStamp) + self.WaitTime) - int(app.GetTime())) + " saniye beklemelisin.")
            return
        else:
            if False == player.IsObserverMode():
                if False == self.wndInventory.IsShow():
                    self.wndInventory.Show()
                    self.wndInventory.SetTop()
                    if 1 == constInfo.EnvanterAcilsinmi and False == self.wndExtendedInventory.IsShow():
                        self.wndExtendedInventory.Show()
                else:
                    self.wndInventory.OverOutItem()
                    self.wndInventory.Close()
                    if 1 == constInfo.EnvanterAcilsinmi and self.wndExtendedInventory.IsShow():
                        self.wndExtendedInventory.Close()

    def ToggleExtendedInventoryWindow(self):
        if False == player.IsObserverMode():
            if False == self.wndExtendedInventory.IsShow():
                self.wndExtendedInventory.Show()
            else:
                self.wndExtendedInventory.OverOutItem()
                self.wndExtendedInventory.Close()

Şimdi,

Söylediğin gibi tamda 612. satır
self.wndTaskBar.RefreshQuickSlot() a denk geliyor.

taskbar.py'de bir düzenleme yapmadım.
Envanter ancak " Envanter ile Açılsın mı ? " bölümünü işaretlediğim zaman açılıyor fakat, " I " tuşu veya Envanter Butonu asla çalışmıyor.

Hemen orayı düzenliyorum tekrar sonucu yazacağım.

Hata derken warningden bahsediyorum
Tam olarak hangi kodu nasıl değiştireyim ? ( Kusura bakma anlayamadım )
 
@Whistle Dediğin şekilde o bloğu değiştirdim :

Syserr:
0906 16:00:37607 :: Traceback (most recent call last):

0906 16:00:37608 ::   File "networkModule.py", line 253, in SetGamePhase

0906 16:00:37611 ::   File "game.py", line 125, in __init__

0906 16:00:37612 ::   File "interfaceModule.py", line 309, in MakeInterface

0906 16:00:37612 ::   File "interfaceModule.py", line 115, in __MakeMessengerWindow

0906 16:00:37613 :: AttributeError
0906 16:00:37613 :: : 
0906 16:00:37614 :: 'Interface' object has no attribute 'ToggleGuildWindow'
0906 16:00:37614 :: 

0906 16:00:37615 :: Traceback (most recent call last):

0906 16:00:37617 ::   File "game.py", line 910, in RefreshInventory

0906 16:00:37618 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:00:37619 :: AttributeError
0906 16:00:37619 :: : 
0906 16:00:37620 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:00:37620 :: 

0906 16:00:37622 :: Traceback (most recent call last):

0906 16:00:37623 ::   File "game.py", line 772, in RefreshStatus

0906 16:00:37623 ::   File "game.py", line 766, in CheckGameButton

0906 16:00:37624 :: AttributeError
0906 16:00:37624 :: : 
0906 16:00:37627 :: 'Interface' object has no attribute 'CheckGameButton'
0906 16:00:37627 :: 

0906 16:00:37628 :: Traceback (most recent call last):

0906 16:00:37629 ::   File "game.py", line 910, in RefreshInventory

0906 16:00:37630 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:00:37630 :: AttributeError
0906 16:00:37631 :: : 
0906 16:00:37631 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:00:37632 :: 

0906 16:00:37633 :: Traceback (most recent call last):

0906 16:00:37634 ::   File "game.py", line 910, in RefreshInventory

0906 16:00:37634 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:00:37635 :: AttributeError
0906 16:00:37635 :: : 
0906 16:00:37636 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:00:37639 :: 

0906 16:00:37640 :: Traceback (most recent call last):

0906 16:00:37641 ::   File "game.py", line 784, in RefreshSkill

0906 16:00:37641 ::   File "game.py", line 766, in CheckGameButton

0906 16:00:37642 :: AttributeError
0906 16:00:37642 :: : 
0906 16:00:37643 :: 'Interface' object has no attribute 'CheckGameButton'
0906 16:00:37643 :: 

0906 16:00:37644 :: Traceback (most recent call last):

0906 16:00:37645 ::   File "game.py", line 772, in RefreshStatus

0906 16:00:37646 ::   File "game.py", line 766, in CheckGameButton

0906 16:00:37646 :: AttributeError
0906 16:00:37647 :: : 
0906 16:00:37649 :: 'Interface' object has no attribute 'CheckGameButton'
0906 16:00:37650 :: 

0906 16:00:29149 :: Traceback (most recent call last):

0906 16:00:29150 ::   File "game.py", line 910, in RefreshInventory

0906 16:00:29151 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:00:29154 :: AttributeError
0906 16:00:29155 :: : 
0906 16:00:29156 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:00:29157 :: 

0906 16:00:29157 :: Traceback (most recent call last):

0906 16:00:29158 ::   File "game.py", line 910, in RefreshInventory

0906 16:00:29161 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:00:29162 :: AttributeError
0906 16:00:29164 :: : 
0906 16:00:29164 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:00:29165 :: 

0906 16:01:29159 :: Traceback (most recent call last):

0906 16:01:29160 ::   File "game.py", line 910, in RefreshInventory

0906 16:01:29161 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:01:29162 :: AttributeError
0906 16:01:29165 :: : 
0906 16:01:29165 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:01:29166 :: 

0906 16:01:29167 :: Traceback (most recent call last):

0906 16:01:29168 ::   File "game.py", line 910, in RefreshInventory

0906 16:01:29169 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:01:29169 :: AttributeError
0906 16:01:29170 :: : 
0906 16:01:29172 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:01:29174 :: 

0906 16:02:29153 :: Traceback (most recent call last):

0906 16:02:29154 ::   File "game.py", line 910, in RefreshInventory

0906 16:02:29155 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:02:29157 :: AttributeError
0906 16:02:29158 :: : 
0906 16:02:29158 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:02:29159 :: 

0906 16:02:29160 :: Traceback (most recent call last):

0906 16:02:29161 ::   File "game.py", line 910, in RefreshInventory

0906 16:02:29162 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:02:29164 :: AttributeError
0906 16:02:29165 :: : 
0906 16:02:29167 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:02:29168 :: 

0906 16:03:29147 :: Traceback (most recent call last):

0906 16:03:29148 ::   File "game.py", line 910, in RefreshInventory

0906 16:03:29149 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:03:29150 :: AttributeError
0906 16:03:29152 :: : 
0906 16:03:29152 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:03:29154 :: 

0906 16:03:29154 :: Traceback (most recent call last):

0906 16:03:29155 ::   File "game.py", line 910, in RefreshInventory

0906 16:03:29156 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:03:29157 :: AttributeError
0906 16:03:29159 :: : 
0906 16:03:29161 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:03:29161 :: 

0906 16:04:29158 :: Traceback (most recent call last):

0906 16:04:29158 ::   File "game.py", line 910, in RefreshInventory

0906 16:04:29160 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:04:29162 :: AttributeError
0906 16:04:29162 :: : 
0906 16:04:29164 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:04:29164 :: 

0906 16:04:29164 :: Traceback (most recent call last):

0906 16:04:29166 ::   File "game.py", line 910, in RefreshInventory

0906 16:04:29167 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:04:29167 :: AttributeError
0906 16:04:29171 :: : 
0906 16:04:29172 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:04:29174 :: 

0906 16:05:29152 :: Traceback (most recent call last):

0906 16:05:29153 ::   File "game.py", line 910, in RefreshInventory

0906 16:05:29154 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:05:29155 :: AttributeError
0906 16:05:29158 :: : 
0906 16:05:29158 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:05:29158 :: 

0906 16:05:29159 :: Traceback (most recent call last):

0906 16:05:29160 ::   File "game.py", line 910, in RefreshInventory

0906 16:05:29161 ::   File "interfaceModule.py", line 612, in RefreshInventory

0906 16:05:29162 :: AttributeError
0906 16:05:29164 :: : 
0906 16:05:29165 :: 'NoneType' object has no attribute 'RefreshQuickSlot'
0906 16:05:29167 :: 

0906 16:06:42047 :: granny_shared_vbs:
0906 16:06:42047 ::     0: 40
0906 16:06:42048 ::     1: 20
0906 16:06:42049 ::     2: 20
0906 16:06:42053 ::     3: 40
0906 16:06:42053 ::     4: 3
0906 16:06:42054 ::     5: 20
0906 16:06:42055 ::     6: 0
0906 16:06:42055 ::     7: 0
0906 16:06:42056 ::     8: 0

Bloğu bu şekilde değiştirdim :

interfaceModule.py:
    def ToggleInventoryWindow(self):
        if self.State == "Kapali":
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Envanteri acabilmek icin " + str(int(int(self.LastContactTimeStamp) + self.WaitTime) - int(app.GetTime())) + " saniye beklemelisin.")
            return
        else:
            if False == player.IsObserverMode():
                if False == self.wndInventory.IsShow():
                    self.wndInventory.Show()
                    self.wndInventory.SetTop()
                    if 1 == constInfo.EnvanterAcilsinmi and False == self.wndExtendedInventory.IsShow():
                        self.wndExtendedInventory.Show()
                else:
                    self.wndInventory.OverOutItem()
                    self.wndInventory.Close()
                    if 1 == constInfo.EnvanterAcilsinmi and self.wndExtendedInventory.IsShow():
                        self.wndExtendedInventory.Close()

if app.WJ_SPLIT_INVENTORY_SYSTEM:
    def ToggleExtendedInventoryWindow(self):
        if False == player.IsObserverMode():
            if False == self.wndExtendedInventory.IsShow():
                self.wndExtendedInventory.Show()
            else:
                self.wndExtendedInventory.OverOutItem()
                self.wndExtendedInventory.Close()
Game.py :

game.py-1.png


game.py-2.png


game.py-3.png


game.py-4.png


interfacemodule.py :

interfacemodule.py-1.png


interfacemodule.py-2.png


interfacemodule.py-3.png


networkmodule.py :

networkmodule.py-1.png


Umarım açıklayıcı olmuştur :(
 
@Reached Bu hata oluştu...

client.png


PythonSystemModule.cpp:
PyObject* systemSetRefineStatus(PyObject* poSelf, PyObject* poArgs)
{
    bool iFlag;
    if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
        return Py_BuildException();

    CPythonSystem::Instance().SetRefineStatus(iFlag);

    return Py_BuildNone();
}

bu PyTuple_GetInteger yoksa PyTuple_GetBvalue mı olacak ?
Sadece mantıklı olmaya çalışıyorum :D
 
Son düzenleme:
@Reached Bu hata oluştu...

3439 eklentisini görüntüle

PythonSystemModule.cpp:
PyObject* systemSetRefineStatus(PyObject* poSelf, PyObject* poArgs)
{
    bool iFlag;
    if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
        return Py_BuildException();

    CPythonSystem::Instance().SetRefineStatus(iFlag);

    return Py_BuildNone();
}

bu PyTuple_GetInteger PyTuple_GetBvalue mı olacak ?
Sadece mantıklı olmaya çalışıyorum :D
Argüman şudur;

Void bilmemneclass::bilmemnefonksiyon(argüman1 türü Argüman1, argüman2 türü argüman2)
 
@Reached Bu hata oluştu...

3439 eklentisini görüntüle

PythonSystemModule.cpp:
PyObject* systemSetRefineStatus(PyObject* poSelf, PyObject* poArgs)
{
    bool iFlag;
    if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
        return Py_BuildException();

    CPythonSystem::Instance().SetRefineStatus(iFlag);

    return Py_BuildNone();
}

bu PyTuple_GetInteger yoksa PyTuple_GetBvalue mı olacak ?
Sadece mantıklı olmaya çalışıyorum :D
PyTuple_GetInteger olacak. Oyunun diğer kodlarına bakarsanız true ve false alınan python fonksiyonları bu şekilde yapılmış. Verdiğim kodları olduğu gibi ekleyin. Zaten bu sorun çözülmemiş miydi?

Bu arada bu sistem dışındaki başka sistemleri eklerken hata alıyorsanız ayrı bi yardım konusu açabilirsiniz. Bu şekilde ortalık çok karışmış. :D
 
PyTuple_GetInteger olacak. Oyunun diğer kodlarına bakarsanız true ve false alınan python fonksiyonları bu şekilde yapılmış. Verdiğim kodları olduğu gibi ekleyin. Zaten bu sorun çözülmemiş miydi?

Bu arada bu sistem dışındaki başka sistemleri eklerken hata alıyorsanız ayrı bi yardım konusu açabilirsiniz. Bu şekilde ortalık çok karışmış. :D
Evet o hatayı İnteger olarak çözdüm :loveya:

Yalnız... Sistem hem karmaşık geldi hemde çiçek ve efsun bölümleri biraz gereksiz geldi diğer sisteme geçtim.
Dilerseniz bu konuyu kapatabilirsiniz.

Yardımlarınız için çok teşekkür ederim :)
 
Tamamdır. O halde kapatıyorum. İsterseniz diğer sistemle ilgili aldığınız hata mesajını ayrı bi konuya taşıyabilirim :)
 
PyTuple_GetInteger olacak. Oyunun diğer kodlarına bakarsanız true ve false alınan python fonksiyonları bu şekilde yapılmış. Verdiğim kodları olduğu gibi ekleyin. Zaten bu sorun çözülmemiş miydi?

Bu arada bu sistem dışındaki başka sistemleri eklerken hata alıyorsanız ayrı bi yardım konusu açabilirsiniz. Bu şekilde ortalık çok karışmış. :D
Burdaki iFlag'dan bahsetmiyorum argüman olandan bahsediyordum
 
Burdaki iFlag'dan bahsetmiyorum argüman olandan bahsediyordum
Bahsettiğiniz düzenlemeyi yapınca #27 mesajında hata aldığını belirtmiş. İsterseniz bi bakınız. :)

@Whistle Dediğin şekilde o bloğu değiştirdim :
Bu mesajı yeni fark ettim. Çözdünüz mü bilmiyorum ama şu şekilde değiştirin.
Python:
    def ToggleInventoryWindow(self):
        if self.State == "Kapali":
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Envanteri acabilmek icin " + str(int(int(self.LastContactTimeStamp) + self.WaitTime) - int(app.GetTime())) + " saniye beklemelisin.")
            return
        else:
            if False == player.IsObserverMode():
                if False == self.wndInventory.IsShow():
                    self.wndInventory.Show()
                    self.wndInventory.SetTop()
                    if 1 == constInfo.EnvanterAcilsinmi and False == self.wndExtendedInventory.IsShow():
                        self.wndExtendedInventory.Show()
                else:
                    self.wndInventory.OverOutItem()
                    self.wndInventory.Close()
                    if 1 == constInfo.EnvanterAcilsinmi and self.wndExtendedInventory.IsShow():
                        self.wndExtendedInventory.Close()

    if app.WJ_SPLIT_INVENTORY_SYSTEM:
        def ToggleExtendedInventoryWindow(self):
            if False == player.IsObserverMode():
                if False == self.wndExtendedInventory.IsShow():
                    self.wndExtendedInventory.Show()
                else:
                    self.wndExtendedInventory.OverOutItem()
                    self.wndExtendedInventory.Close()


Yeni bir konu açtım daha iyi olacağını düşündüm çünkü dediğiniz gibi 2 ayrı sistem ne kadar ortak yönleri olsada fixlelenirlerse ayrı konularda olsunlar :)
O halde o sistemle ilgili bu konuda yer alan mesajları kaldırdım. Çünkü karışıyordu. :D
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst