- Mesaj
- 4.951
- Çözümler
- 210
- Beğeni
- 5.263
- Puan
- 2.850
- Ticaret Puanı
- 7
ilk başta bazı sorunları vardı yüzdüm yüzdüm kuyruğuna geldim ama buradan sonra tıkandım.
önce aldığım logu paylaşayım sonra kimse okumuyor
. bu hata neyden kaynaklı olabilir şimdi src ve pack taraflı her şey doğru gözüküyor sanki ama çözemedim bir türlü. butona basarak açamıyorum fakat atadığım tuşla açabiliyorum orada sıkıntı yok. hatta gui çift tıkla wiki penceresini açıyor. wiki penceresini açarsa log tutup ona göre syserr veriyor ama tek tıklamada herhangi bir tepki veya syserr vermiyor.
şimdi guiyi açan kod aşağıda tam guiyi açan kısmını da parlatıcam.
bu da onclickeventicon
burada sıkıntı yok ui.pydeki imagebox classından çektiriyor her şey doğru. hatta orayı da paylaşayım.
önce aldığım logu paylaşayım sonra kimse okumuyor

Kod:
0629 16:22:16480 :: LOAD IMAGE0629 16:22:16480 :: 0629 16:22:16480 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFEBD0>0629 16:22:16480 :: 0629 16:22:16480 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E041E8>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04148>}0629 16:22:16480 ::
0629 16:22:16484 :: LOAD IMAGE0629 16:22:16484 :: 0629 16:22:16484 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFEC50>0629 16:22:16484 :: 0629 16:22:16484 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E042D8>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04288>}0629 16:22:16484 ::
0629 16:22:16484 :: LOAD IMAGE0629 16:22:16484 :: 0629 16:22:16484 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFECD0>0629 16:22:16484 :: 0629 16:22:16484 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E043C8>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04378>}0629 16:22:16485 ::
0629 16:22:16485 :: LOAD IMAGE0629 16:22:16485 :: 0629 16:22:16485 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFED70>0629 16:22:16485 :: 0629 16:22:16485 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E044B8>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04468>}0629 16:22:16486 ::
0629 16:22:16486 :: LOAD IMAGE0629 16:22:16486 :: 0629 16:22:16486 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFEE10>0629 16:22:16486 :: 0629 16:22:16486 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E045D0>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04558>}0629 16:22:16486 ::
0629 16:22:16486 :: LOAD IMAGE0629 16:22:16486 :: 0629 16:22:16486 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFEEB0>0629 16:22:16488 :: 0629 16:22:16488 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E046E8>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04698>}0629 16:22:16489 ::
0629 16:22:16490 :: LOAD IMAGE0629 16:22:16490 :: 0629 16:22:16490 :: <uiEventCalendar.ImageBoxSpecial object at 0x06DFEF50>0629 16:22:16490 :: 0629 16:22:16490 :: {'MOUSE_OVER_OUT': <ui.__mem_func__ instance at 0x06E047D8>, 'MOUSE_OVER_IN': <ui.__mem_func__ instance at 0x06E04788>}0629 16:22:16490 ::
şimdi guiyi açan kod aşağıda tam guiyi açan kısmını da parlatıcam.
Python:
def __init__(self, isMiniIcon = False):
ui.ImageBox.__init__(self)
self.Destroy()
self.isMiniIcon = isMiniIcon
self.waitingTime = 2.0
self.alphaValue = 0.3
self.increaseValue = 0.05
self.minAlpha = 0.3
self.maxAlpha = 1.0
self.isActiveWindowWheelofFortune = False
self.idforwiki = None
if isMiniIcon:
self.AddFlag("attach")
self.AddFlag("movable")
#self.SetSize(57, 57)
(x,y) = (wndMgr.GetScreenWidth()-150, 200)
self.SetPosition(x, y)
self.SetEvent(ui.__mem_func__(self.OnClickEventIcon),"mouse_click")
self.SetMouseLeftButtonDoubleClickEvent(ui.__mem_func__(self.OnClickDouble))
self.SetMouseRightButtonDownEvent(ui.__mem_func__(self.NextEventWithKey))
bu da onclickeventicon
Python:
def OnClickEventIcon(self):
(_index, eventID) = self.GetNextImage(self.imageIndex)
if GetEventIDData(eventID) != None:
if GetEventIDData(eventID)[EVENT_IS_ACTIVE] == True:
interface = constInfo.GetInterfaceInstance()
if interface:
if interface.wndEventManager:
interface.wndEventManager.OnClick(GetEventIDData(eventID)[EVENT_INDEX])
burada sıkıntı yok ui.pydeki imagebox classından çektiriyor her şey doğru. hatta orayı da paylaşayım.
Python:
class ImageBox(Window):
def __init__(self, layer = "UI"):
Window.__init__(self, layer)
self.eventDict = {}
self.eventFunc = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}
self.eventArgs = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}
def __del__(self):
Window.__del__(self)
def RegisterWindow(self, layer):
self.hWnd = wndMgr.RegisterImageBox(self, layer)
def ImageClear(self):
wndMgr.ImageClear(self.hWnd)
def LoadImageInstance(self, image):
wndMgr.LoadImageInstance(self.hWnd, image)
def LoadImage(self, imageName):
self.name = imageName
wndMgr.LoadImage(self.hWnd, imageName)
if len(self.eventDict)!=0:
print "LOAD IMAGE", self, self.eventDict
def SetDiffuseColor(self, r, g, b, a):
wndMgr.SetDiffuseColor(self.hWnd, r, g, b, a)
def SetAlpha(self, alpha):
wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha)
def GetWidth(self):
return wndMgr.GetWidth(self.hWnd)
def GetHeight(self):
return wndMgr.GetHeight(self.hWnd)
def SAFE_SetStringEvent(self, event, func, *args):
self.eventDict[event] =__mem_func__(func)
self.eventArgs[event] = args
def SetMouseOverInEvent(self, func, *args):
self.eventDict["MOUSE_OVER_IN"] = func
self.eventArgs["MOUSE_OVER_IN"] = args
def SetMouseOverOutEvent(self, func, *args):
self.eventDict["MOUSE_OVER_OUT"] = func
self.eventArgs["MOUSE_OVER_OUT"] = args
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.eventFunc["mouse_click"]:
apply(self.eventFunc["mouse_click"], self.eventArgs["mouse_click"])
Window.OnMouseLeftButtonUp(self)
def OnMouseOverIn(self):
if self.eventFunc["mouse_over_in"]:
apply(self.eventFunc["mouse_over_in"], self.eventArgs["mouse_over_in"])
if self.eventDict.has_key("MOUSE_OVER_IN"):
if self.eventArgs["MOUSE_OVER_IN"]:
apply(self.eventDict["MOUSE_OVER_IN"], self.eventArgs["MOUSE_OVER_IN"])
else:
self.eventDict["MOUSE_OVER_IN"]()
def OnMouseOverOut(self):
if self.eventFunc["mouse_over_out"]:
apply(self.eventFunc["mouse_over_out"], self.eventArgs["mouse_over_out"])
if self.eventDict.has_key("MOUSE_OVER_OUT"):
if self.eventArgs["MOUSE_OVER_OUT"]:
apply(self.eventDict["MOUSE_OVER_OUT"], self.eventArgs["MOUSE_OVER_OUT"])
else:
self.eventDict["MOUSE_OVER_OUT"]()