Hey,
habe da ein Problem bin gerade dabei Quest Categories einzufügen nun habe ich das Problem das ich da was nicht verstehe / finde ...
Code
- ## Btw, not sure if you have it, but if not, just add this extra function in ui.Button() (ui.py - class Button).
- def SetTextAlignLeft(self, text, height = 4):
- if not self.ButtonText:
- textLine = TextLine()
- textLine.SetParent(self)
- textLine.SetPosition(27, self.GetHeight()/2)
- textLine.SetVerticalAlignCenter()
- textLine.SetHorizontalAlignLeft()
- textLine.Show()
- self.ButtonText = textLine
- #Äù½ºÆ® ¸®½ºÆ® UI¿¡ ¸ÂÃç À§Ä¡ ÀâÀ½
- self.ButtonText.SetText(text)
- self.ButtonText.SetPosition(27, self.GetHeight()/2)
- self.ButtonText.SetVerticalAlignCenter()
- self.ButtonText.SetHorizontalAlignLeft()
ich finde die funktion ui.Button nicht unter class Button (auch nicht in der kompletten ui.py
Python
- class Button(Window):
- def GetText(self):
- if not self.ButtonText:
- return# ""
- return self.ButtonText.GetText()
- def __init__(self, layer = "UI"):
- Window.__init__(self, layer)
- self.eventFunc = None
- self.eventArgs = None
- self.ButtonText = None
- self.ToolTipText = None
- def __del__(self):
- Window.__del__(self)
- self.eventFunc = None
- self.eventArgs = None
- def RegisterWindow(self, layer):
- self.hWnd = wndMgr.RegisterButton(self, layer)
- def SetUpVisual(self, filename):
- wndMgr.SetUpVisual(self.hWnd, filename)
- def SetOverVisual(self, filename):
- wndMgr.SetOverVisual(self.hWnd, filename)
- def SetDownVisual(self, filename):
- wndMgr.SetDownVisual(self.hWnd, filename)
- def SetDisableVisual(self, filename):
- wndMgr.SetDisableVisual(self.hWnd, filename)
- def GetUpVisualFileName(self):
- return wndMgr.GetUpVisualFileName(self.hWnd)
- def GetOverVisualFileName(self):
- return wndMgr.GetOverVisualFileName(self.hWnd)
- def GetDownVisualFileName(self):
- return wndMgr.GetDownVisualFileName(self.hWnd)
- def Flash(self):
- wndMgr.Flash(self.hWnd)
- def Enable(self):
- wndMgr.Enable(self.hWnd)
- def Disable(self):
- wndMgr.Disable(self.hWnd)
- def Down(self):
- wndMgr.Down(self.hWnd)
- def SetUp(self):
- wndMgr.SetUp(self.hWnd)
- def SAFE_SetEvent(self, func, *args):
- self.eventFunc = __mem_func__(func)
- self.eventArgs = args
- def SetEvent(self, func, *args):
- self.eventFunc = func
- self.eventArgs = args
- def SetTextColor(self, color):
- if not self.ButtonText:
- return
- self.ButtonText.SetPackedFontColor(color)
- def SetText(self, text, height = 4):
- 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 SetFormToolTipText(self, type, text, x, y):
- if not self.ToolTipText:
- toolTip=createToolTipWindowDict[type]()
- toolTip.SetParent(self)
- toolTip.SetSize(0, 0)
- toolTip.SetHorizontalAlignCenter()
- toolTip.SetOutline()
- toolTip.Hide()
- toolTip.SetPosition(x + self.GetWidth()/2, y)
- self.ToolTipText=toolTip
- self.ToolTipText.SetText(text)
- def SetToolTipWindow(self, toolTip):
- self.ToolTipText=toolTip
- self.ToolTipText.SetParentProxy(self)
- def SetToolTipText(self, text, x=0, y = -19):
- self.SetFormToolTipText("TEXT", text, x, y)
- def CallEvent(self):
- snd.PlaySound("sound/ui/click.wav")
- if self.eventFunc:
- apply(self.eventFunc, self.eventArgs)
- def ShowToolTip(self):
- if self.ToolTipText:
- self.ToolTipText.Show()
- def HideToolTip(self):
- if self.ToolTipText:
- self.ToolTipText.Hide()
- def IsDown(self):
- return wndMgr.IsDown(self.hWnd)
kann mir jemand sagen wie ich das eingefügt bekomme oO
mfg