Jump to content

Search the Community

Showing results for tags 'python'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Forum
    • Anúncios
    • Apresentacoes
    • F.A.Q's & Guias
    • Arquivos
  • Hospedagem de imagens
  • Member special
  • Hardware
    • Tutoriais
    • Duvidas
  • Software
    • Programas
    • Guias & Tutoriais
    • Problemas & Duvidas
    • Segurança e Desempenho
  • Sistemas Operativos
    • FreeBSD
    • Windows
    • Linux
    • Android
  • Programação
    • PHP
    • C & C++
    • SQL
    • C# & .NET & VisualBasic
    • Python
    • Outros
  • Metin2
    • Geral
    • Servidores Privado
    • Tutoriais
    • Serverfiles
    • Quests
    • Cliente
    • Ferramentas/Software
    • 3D & 2D
    • Download
    • Duvidas & Problemas & Pedidos
  • Websites
    • Design
    • Codificado
  • Other Games
    • Dota2
    • League Of Legends
    • Payday 2
  • Design
    • Galeria
    • Tutoriais
    • Pedidos
    • Ferramentas/Diversos
  • Espaço web
    • Webmaster
    • Duvidas
    • Servidores
  • Classificados
    • Trocas e Vendas
    • Outros
  • Tema Livre
    • Filmes & Series
    • Anime
    • Mundo Livre
    • Outros
    • Youtube


  • Metin2
    • Quests
    • Clientes
    • Serverfiles
    • Tools
    • Other Downloads
    • Weapons & Armors
    • NPC & MOB
  • Software
  • Operating Systems
    • Windows
  • Member special
  • Honor Room

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me




Yahoo! Messenger




Google Analytics Client ID

Found 6 results

  1. Talkshow: Example for the AniImage: class Window(object): #Replace or expand with those functions which you will need in the future. #(I have the target info system included in this, so watch out!) class Window(object): def NoneMethod(cls): pass NoneMethod = classmethod(NoneMethod) def __init__(self, layer = "UI"): self.hWnd = None self.parentWindow = 0 self.RegisterWindow(layer) self.onMouseLeftButtonUpEvent = None self.Hide() self.mouseLeftButtonDownEvent = None self.mouseLeftButtonDownArgs = None self.mouseLeftButtonUpEvent = None self.mouseLeftButtonUpArgs = None self.mouseLeftButtonDoubleClickEvent = None self.mouseRightButtonDownEvent = None self.mouseRightButtonDownArgs = None self.moveWindowEvent = None self.renderEvent = None self.renderArgs = None self.overInEvent = None self.overInArgs = None self.overOutEvent = None self.overOutArgs = None self.baseX = 0 self.baseY = 0 self.SetWindowName("NONAME_Window") def __del__(self): wndMgr.Destroy(self.hWnd) def RegisterWindow(self, layer): self.hWnd = wndMgr.Register(self, layer) def Destroy(self): pass def GetWindowHandle(self): return self.hWnd def AddFlag(self, style): wndMgr.AddFlag(self.hWnd, style) def IsRTL(self): return wndMgr.IsRTL(self.hWnd) def SetWindowName(self, Name): wndMgr.SetName(self.hWnd, Name) def GetWindowName(self): return wndMgr.GetName(self.hWnd) if app.ENABLE_SEND_TARGET_INFO: def SetParent(self, parent): if parent: wndMgr.SetParent(self.hWnd, parent.hWnd) else: wndMgr.SetParent(self.hWnd, 0) def SetAttachParent(self, parent): wndMgr.SetAttachParent(self.hWnd, parent.hWnd) else: def SetParent(self, parent): wndMgr.SetParent(self.hWnd, parent.hWnd) def SetParentProxy(self, parent): self.parentWindow=proxy(parent) wndMgr.SetParent(self.hWnd, parent.hWnd) def GetParentProxy(self): return self.parentWindow def SetPickAlways(self): wndMgr.SetPickAlways(self.hWnd) def SetWindowHorizontalAlignLeft(self): wndMgr.SetWindowHorizontalAlign(self.hWnd, wndMgr.HORIZONTAL_ALIGN_LEFT) def SetWindowHorizontalAlignCenter(self): wndMgr.SetWindowHorizontalAlign(self.hWnd, wndMgr.HORIZONTAL_ALIGN_CENTER) def SetWindowHorizontalAlignRight(self): wndMgr.SetWindowHorizontalAlign(self.hWnd, wndMgr.HORIZONTAL_ALIGN_RIGHT) def SetWindowVerticalAlignTop(self): wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_TOP) def SetWindowVerticalAlignCenter(self): wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_CENTER) def SetWindowVerticalAlignBottom(self): wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_BOTTOM) def SetTop(self): wndMgr.SetTop(self.hWnd) def Show(self): wndMgr.Show(self.hWnd) def Hide(self): wndMgr.Hide(self.hWnd) def SetVisible(self, is_show): if is_show: self.Show() else: self.Hide() def Lock(self): wndMgr.Lock(self.hWnd) def Unlock(self): wndMgr.Unlock(self.hWnd) def IsShow(self): return wndMgr.IsShow(self.hWnd) def UpdateRect(self): wndMgr.UpdateRect(self.hWnd) def SetSize(self, width, height): wndMgr.SetWindowSize(self.hWnd, width, height) def GetWidth(self): return wndMgr.GetWindowWidth(self.hWnd) def GetHeight(self): return wndMgr.GetWindowHeight(self.hWnd) def GetLocalPosition(self): return wndMgr.GetWindowLocalPosition(self.hWnd) def GetLeft(self): x, y = self.GetLocalPosition() return x def GetGlobalLeft(self): x, y = self.GetGlobalPosition() return x def GetTop(self): x, y = self.GetLocalPosition() return y def GetGlobalTop(self): x, y = self.GetGlobalPosition() return y def GetRight(self): return self.GetLeft() + self.GetWidth() def GetBottom(self): return self.GetTop() + self.GetHeight() def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd) def GetMouseLocalPosition(self): return wndMgr.GetMouseLocalPosition(self.hWnd) def GetRect(self): return wndMgr.GetWindowRect(self.hWnd) def SetPosition(self, x, y): wndMgr.SetWindowPosition(self.hWnd, x, y) def SetCenterPosition(self, x = 0, y = 0): self.SetPosition((wndMgr.GetScreenWidth() - self.GetWidth()) / 2 + x, (wndMgr.GetScreenHeight() - self.GetHeight()) / 2 + y) def SavePosition(self): self.baseX = self.GetLeft() self.baseY = self.GetTop() def UpdatePositionByScale(self, scale): self.SetPosition(self.baseX * scale, self.baseY * scale) def SetLeft(self, x): wndMgr.SetWindowPosition(self.hWnd, x, self.GetTop()) def IsFocus(self): return wndMgr.IsFocus(self.hWnd) def SetFocus(self): wndMgr.SetFocus(self.hWnd) def KillFocus(self): wndMgr.KillFocus(self.hWnd) def GetChildCount(self): return wndMgr.GetChildCount(self.hWnd) def IsIn(self): return wndMgr.IsIn(self.hWnd) def IsInPosition(self): xMouse, yMouse = wndMgr.GetMousePosition() x, y = self.GetGlobalPosition() return xMouse >= x and xMouse < x + self.GetWidth() and yMouse >= y and yMouse < y + self.GetHeight() def SetMouseLeftButtonDownEvent(self, event, *args): self.mouseLeftButtonDownEvent = event self.mouseLeftButtonDownArgs = args def OnMouseLeftButtonDown(self): if self.mouseLeftButtonDownEvent: apply(self.mouseLeftButtonDownEvent, self.mouseLeftButtonDownArgs) if app.ENABLE_SEND_TARGET_INFO: def SetOnMouseLeftButtonUpEvent(self, event, *args): self.mouseLeftButtonUpEvent = event self.mouseLeftButtonUpArgs = args else: def SetOnMouseLeftButtonUpEvent(self, event): self.onMouseLeftButtonUpEvent = ev def SetMouseLeftButtonDoubleClickEvent(self, event): self.mouseLeftButtonDoubleClickEvent = event def OnMouseLeftButtonDoubleClick(self): if self.mouseLeftButtonDoubleClickEvent: self.mouseLeftButtonDoubleClickEvent() def SetMouseRightButtonDownEvent(self, event, *args): self.mouseRightButtonDownEvent = event self.mouseRightButtonDownArgs = args def OnMouseRightButtonDown(self): if self.mouseRightButtonDownEvent: apply(self.mouseRightButtonDownEvent, self.mouseRightButtonDownArgs) def SetMoveWindowEvent(self, event): self.moveWindowEvent = event def OnMoveWindow(self, x, y): if self.moveWindowEvent: self.moveWindowEvent(x, y) def SAFE_SetOverInEvent(self, func, *args): self.overInEvent = __mem_func__(func) self.overInArgs = args def SetOverInEvent(self, func, *args): self.overInEvent = func self.overInArgs = args def SAFE_SetOverOutEvent(self, func, *args): self.overOutEvent = __mem_func__(func) self.overOutArgs = args def SetOverOutEvent(self, func, *args): self.overOutEvent = func self.overOutArgs = args def OnMouseOverIn(self): if self.overInEvent: apply(self.overInEvent, self.overInArgs) def OnMouseOverOut(self): if self.overOutEvent: apply(self.overOutEvent, self.overOutArgs) def SAFE_SetRenderEvent(self, event, *args): self.renderEvent = __mem_func__(event) self.renderArgs = args def ClearRenderEvent(self): self.renderEvent = None self.renderArgs = None def OnRender(self): if self.renderEvent: apply(self.renderEvent, self.renderArgs) def SetOnMouseLeftButtonUpEvent(self, event): self.onMouseLeftButtonUpEvent = event def OnMouseLeftButtonUp(self): if self.onMouseLeftButtonUpEvent: self.onMouseLeftButtonUpEvent() class TextLine(Window): #Replace or expand with those functions which you will need in the future. class TextLine(Window): def __init__(self): Window.__init__(self) self.max = 0 self.SetFontName(localeInfo.UI_DEF_FONT) def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterTextLine(self, layer) def SetMax(self, max): wndMgr.SetMax(self.hWnd, max) def SetLimitWidth(self, width): wndMgr.SetLimitWidth(self.hWnd, width) def SetMultiLine(self): wndMgr.SetMultiLine(self.hWnd, True) def SetHorizontalAlignArabic(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_ARABIC) def SetHorizontalAlignLeft(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_LEFT) def SetHorizontalAlignRight(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_RIGHT) def SetHorizontalAlignCenter(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_CENTER) def SetVerticalAlignTop(self): wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_TOP) def SetVerticalAlignBottom(self): wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_BOTTOM) def SetVerticalAlignCenter(self): wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_CENTER) def SetSecret(self, Value=True): wndMgr.SetSecret(self.hWnd, Value) def SetOutline(self, Value=True): wndMgr.SetOutline(self.hWnd, Value) def SetFeather(self, value=True): wndMgr.SetFeather(self.hWnd, value) def SetFontName(self, fontName): wndMgr.SetFontName(self.hWnd, fontName) def SetDefaultFontName(self): wndMgr.SetFontName(self.hWnd, localeInfo.UI_DEF_FONT) def SetFontColor(self, red, green, blue): wndMgr.SetFontColor(self.hWnd, red, green, blue) def SetPackedFontColor(self, color): wndMgr.SetFontColor(self.hWnd, color) def SetText(self, text): wndMgr.SetText(self.hWnd, text) def GetText(self): return wndMgr.GetText(self.hWnd) def GetTextSize(self): return wndMgr.GetTextSize(self.hWnd) def GetTextWidth(self): w, h = self.GetTextSize() return w def GetTextHeight(self): w, h = self.GetTextSize() return h def AdjustSize(self): x, y = self.GetTextSize() wndMgr.SetWindowSize(self.hWnd, x, y) def GetRight(self): return self.GetLeft() + self.GetTextWidth() def GetBottom(self): return self.GetTop() + self.GetTextHeight() def SetCenter(self): wndMgr.SetWindowPosition(self.hWnd, self.GetLeft() - self.GetTextWidth()/2, self.GetTop()) def ShowPercentage(self, xStartPct, xEndPct): wndMgr.SetRenderingRect(self.hWnd, xStartPct, 0.0, xEndPct, 0.0) def SetParent(self, parent): wndMgr.SetParent(self.hWnd, parent.hWnd) class ImageBox(Window): #Replace or expand with those functions which you will need in the future. class ImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.name="" self.eventDict={} self.argDict={} self.argsDict={} def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name = imageName wndMgr.LoadImage(self.hWnd, imageName) if len(self.eventDict)!=0: print "LOAD IMAGE", self, self.eventDict def GetImageName(self): return self.name 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 ForceRender(self): wndMgr.ImageForceRender(self.hWnd) def SetMouseOverInEvent(self, func, *args): self.eventDict["MOUSE_OVER_IN"]=__mem_func__(func) self.argsDict["MOUSE_OVER_IN"]=args def SetMouseOverOutEvent(self, func, *args): self.eventDict["MOUSE_OVER_OUT"]=__mem_func__(func) self.argsDict["MOUSE_OVER_OUT"]=args def SetMouseClickEvent(self, event, *args): self.eventDict["MOUSE_BUTTON_DOWN"]=__mem_func__(event) self.argsDict["MOUSE_BUTTON_DOWN"]=args def SetMouseButtonUpEvent(self, event, *args): self.eventDict["MOUSE_BUTTON_UP"]=__mem_func__(event) self.argsDict["MOUSE_BUTTON_UP"]=args def SetMouseRightClickEvent(self, func, *args): self.eventDict["MOUSE_RIGHT_BUTTON_DOWN"]=__mem_func__(func) self.argsDict["MOUSE_RIGHT_BUTTON_DOWN"]=args def SetMouseDoubleClickEvent(self, func, *args): self.eventDict["MOUSE_DOUBLE_CLICK_EVENT"]=__mem_func__(func) self.argsDict["MOUSE_DOUBLE_CLICK_EVENT"]=args def OnMouseOverIn(self): try: apply(self.eventDict["MOUSE_OVER_IN"], self.argDict["MOUSE_OVER_IN"]) except KeyError: pass def OnMouseOverOut(self): try: apply(self.eventDict["MOUSE_OVER_OUT"], self.argDict["MOUSE_OVER_OUT"]) except KeyError: pass def OnMouseLeftButtonUp(self): try: apply(self.eventDict["MOUSE_LEFT_UP"], self.argDict["MOUSE_LEFT_UP"]) except KeyError: pass def OnMouseLeftButtonDown(self): try: apply(self.eventDict["MOUSE_LEFT_DOWN"], self.argDict["MOUSE_LEFT_DOWN"]) except KeyError: pass def OnMouseRightButtonDown(self): try: if self.eventDict["MOUSE_RIGHT_BUTTON_DOWN"]: apply(self.eventDict["MOUSE_RIGHT_BUTTON_DOWN"], self.argsDict["MOUSE_RIGHT_BUTTON_DOWN"]) except KeyError: pass def OnMouseLeftButtonDoubleClick(self): try: if self.eventDict["MOUSE_DOUBLE_CLICK_EVENT"]: apply(self.eventDict["MOUSE_DOUBLE_CLICK_EVENT"], self.argsDict["MOUSE_DOUBLE_CLICK_EVENT"]) except KeyError: pass def SAFE_SetStringEvent(self, event, func,isa=FALSE): if not isa: self.eventDict[event]=__mem_func__(func) else: self.eventDict[event]=func def SAFE_SetMouseClickEvent(self, func, *args): self.eventDict["MOUSE_LEFT_DOWN"]=__mem_func__(func) self.argDict["MOUSE_LEFT_DOWN"]=args class ExpandedImageBox(ImageBox): #Replace or expand with those functions which you will need in the future. class ExpandedImageBox(ImageBox): ANIMATION_DIRECTION_RIGHT = 0 ANIMATION_DIRECTION_LEFT = 1 def __init__(self, layer = "UI"): ImageBox.__init__(self, layer) self.isAnimated = False self.animationDuration = 0 self.animationDurationCounter = 0 self.animationIndex = 0 self.animationDirection = self.ANIMATION_DIRECTION_RIGHT self.baseX = 0 self.baseY = 0 self.isScalingOverTime = False self.xScaleStart = 0 self.xScaleEnd = 0 self.yScaleStart = 0 self.yScaleEnd = 0 self.scaleTimeStart = 0 self.scaleTimeDur = 0 self.SetWindowName("NONAME_ExpandedImageBox") def __del__(self): ImageBox.__del__(self) def LoadImage(self, imageName): ImageBox.LoadImage(self, imageName) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterExpandedImageBox(self, layer) def SetAnimationDirectionRight(self): self.animationDirection = self.ANIMATION_DIRECTION_RIGHT def SetAnimationDirectionLeft(self): self.animationDirection = self.ANIMATION_DIRECTION_LEFT def SetPosition(self, x, y): ImageBox.SetPosition(self, x, y) self.baseX = x self.baseY = y def SetScale(self, xScale, yScale): wndMgr.SetScale(self.hWnd, xScale, yScale) def SetScaleOverTime(self, xScaleStart, xScaleEnd, yScaleStart, yScaleEnd, time): self.isScalingOverTime = True self.xScaleStart = xScaleStart self.xScaleEnd = xScaleEnd self.yScaleStart = yScaleStart self.yScaleEnd = yScaleEnd self.scaleTimeStart = app.GetTime() self.scaleTimeDur = float(time) self.SetScale(xScaleStart, yScaleStart) def SetOrigin(self, x, y): wndMgr.SetOrigin(self.hWnd, x, y) def SetRotation(self, rotation): wndMgr.SetRotation(self.hWnd, rotation) def SetRenderingMode(self, mode): wndMgr.SetRenderingMode(self.hWnd, mode) def SetRenderingRect(self, left, top, right, bottom): wndMgr.SetRenderingRect(self.hWnd, left, top, right, bottom) def SetExpandedRenderingRect(self, left_top, left_bottom, top_left, top_right, right_top, right_bottom, bottom_left, bottom_right): wndMgr.SetExpandedRenderingRect(self.hWnd, left_top, left_bottom, top_left, top_right, right_top, right_bottom, bottom_left, bottom_right) def SetTextureRenderingRect(self, left, top, right, bottom): wndMgr.SetTextureRenderingRect(self.hWnd, left, top, right, bottom) def GetPixelColor(self, x, y): if x < 0 or x >= self.GetWidth() or y < 0 or y >= self.GetHeight(): return (0, 0, 0, 0) r, g, b, a = wndMgr.GetPixelColor(self.hWnd, x, y) return (r, g, b, a) def LoadFilterImage(self, filterImageName): self.filterName=filterImageName if len(self.eventDict)!=0: print "LOAD FILTER IMAGE", self, self.eventDict def SetPercentage(self, curValue, maxValue): if maxValue: self.SetRenderingRect(0.0, 0.0, -1.0 + float(curValue) / float(maxValue), 0.0) else: self.SetRenderingRect(0.0, 0.0, 0.0, 0.0) def SetVPercentage(self, curValue, maxValue): if maxValue: self.SetRenderingRect(0.0, -1.0 + float(curValue) / float(maxValue), 0.0, 0.0) else: self.SetRenderingRect(0.0, 0.0, 0.0, 0.0) def IsInRenderingPosition(self, xMouse = -1, yMouse = -1): if xMouse == -1 and yMouse == -1: xMouse, yMouse = self.GetMouseLocalPosition() color = self.GetPixelColor(xMouse, yMouse) if color[3] == 0.0: return FALSE return self.IsInPosition() def SetAnimated(self, duration): if duration > 0: self.isAnimated = True self.animationDuration = duration self.animationDurationCounter = 0 self.animationIndex = 0 self.OnUpdate() else: self.isAnimated = False def OnUpdate(self): if self.isAnimated == True: aniIndex = self.animationIndex self.animationDurationCounter += 1 if self.animationDurationCounter >= self.animationDuration: self.animationDurationCounter = 0 self.animationIndex += 1 if self.animationIndex >= self.GetWidth(): self.animationIndex = 0 if self.GetWidth() > 0: if self.animationDirection == self.ANIMATION_DIRECTION_RIGHT: self.SetTextureRenderingRect((float(aniIndex) / float(self.GetWidth())), 0.0, -(float(aniIndex) / float(self.GetWidth())), 0.0) else: self.SetTextureRenderingRect(-(float(aniIndex) / float(self.GetWidth())), 0.0, (float(aniIndex) / float(self.GetWidth())), 0.0) if self.isScalingOverTime: perc = (app.GetTime() - self.scaleTimeStart) / float(self.scaleTimeDur) if perc >= 1.0: self.SetScale(self.xScaleEnd, self.yScaleEnd) self.isScalingOverTime = False else: self.SetScale(self.xScaleStart + (self.xScaleEnd - self.xScaleStart) * perc, self.yScaleStart + (self.yScaleEnd - self.yScaleStart) * perc) self.UpdateRect() class AniImageBox(Window): #Replace or expand with those functions which you will need in the future. class AniImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.nextFrameEvent = None self.nextFrameArgs = None self.endFrameEvent = None self.endFrameArgs = None self.SetWindowName("NONAME_AniImageBox") def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterAniImageBox(self, layer) def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def SetDelay(self, delay): wndMgr.SetDelay(self.hWnd, delay) def SetSkipCount(self, skip_count): wndMgr.SetSkipCount(self.hWnd, skip_count) def ResetFrame(self): wndMgr.ResetFrame(self.hWnd) def GetFrameIndex(self): return wndMgr.GetFrameIndex(self.hWnd) def AppendImage(self, filename): wndMgr.AppendImage(self.hWnd, filename) def ClearImages(self): wndMgr.ClearImages(self.hWnd) def SetPercentage(self, curValue, maxValue): if maxValue == 0: import dbg dbg.TraceError("AniImageBox.SetPercentage(%d, %d) -> invalid max value", curValue, maxValue) maxValue = 1 wndMgr.SetRenderingRect(self.hWnd, 0.0, 0.0, -1.0 + float(curValue) / float(maxValue), 0.0) def SetVPercentage(self, curValue, maxValue): if maxValue == 0: import dbg dbg.TraceError("AniImageBox.SetVPercentage(%d, %d) -> invalid max value", curValue, maxValue) maxValue = 1 wndMgr.SetRenderingRect(self.hWnd, 0.0, -1.0 + float(curValue) / float(maxValue), 0.0, 0.0) def SAFE_SetNextFrameEvent(self, event, *args): self.nextFrameEvent = __mem_func__(event) self.nextFrameArgs = args def SAFE_SetEndFrameEvent(self, event, *args): self.endFrameEvent = __mem_func__(event) self.endFrameArgs = args def OnNextFrame(self): if self.nextFrameEvent: apply(self.nextFrameEvent, self.nextFrameArgs) def OnEndFrame(self): if self.endFrameEvent: apply(self.endFrameEvent, self.endFrameArgs) class Button(Window): #Replace or expand with those functions which you will need in the future. class Button(Window): 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 = 0): if not self.ButtonText: textLine = TextLine() textLine.SetParent(self) textLine.SetPosition(0, self.GetHeight()/2-1) textLine.SetVerticalAlignCenter() #textLine.SetHorizontalAlignCenter() textLine.SetWindowHorizontalAlignCenter() textLine.SetHorizontalAlignCenter() textLine.SetPackedFontColor(0xffe8b478) 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) Have fun with creating cool stuffs in Python!
  2. Hi I am running a server and I need someone who can add systems to my server and clear some existing bugs The person should know c++ and and python program and if you have Lua knowledge its an added advantage Should have skype ID Will pay for the work via paypal PM me here on this forum
  3. Boas Encontrei um sistema que faz cair chuva no jogo . Não testei apenas estou a partilhar para quem quiser testar. Vamos lá! -------------------------------------------------------------------------------------------------- Adicionar o codigo ao interfacemodule.py import uiRainSystem procurar: def __MakeChatWindow (self): Adicionar a cima: def __MakeRain (self): wndRain = uiRainSystem.uiRainSystem () wndrain.loadwindow () self.wndRain = wndRain Call me again: Procurar de novo: def MakeInterface (self): Adicione à parte inferior direita abaixo: The camera has a self .__ () Deve ficar algo parecido a isto Fonte: FreakGames.
  4. Boas a todos, andei a procura de um ch switcher que funcionasse, encontrei alguns e experimentei com source envolvida e sem, achei melhor este via python e sem precisar mexer em source... Vamos passar ao tutorial: 1- Fazer download do anexo, password: tlthings 2-uichangechannel and ui_wrapper na pasta root 3-*networkmodule.py Procurar: Adicionar: locale/xx/ui/systemdialog.py Procurar: Adicionar em baixo: game.py Procurar por: Adicionar em baixo: Procurar: Adicionar em baixo: intrologin.py Procurar: Adicionar em cima: interfacemodule.py Procurar: Adicionar em baixo: Procurar por: Trocar por: uisystem.py Adionar aos imports: Procurar por: Mudar por: Procurar por: Procurar por: Adicionar em baixo: Procurar por: Adicionar em cima: Procurar por: Adicionar em cima: Procurar por: Adicionar em baixo: Procurar por: Adicionar em baixo: Está testado e funcional no meu servidor, qualquer duvida não exitem em perguntar e CUIDADO com os espaços em vez de tabs que os foruns metem, qualquer dúvida ou se quiserem prints em relação à formatação mandem mensagem aqui neste tópico. Créditos Koray e JD9 CH SWITCHER.rar
  5. Hi folks! i'd like to share an easier way to configure your inventory page buttons. First of all you need to remove the old one so just search for the following lines and delete them: #In class InventoryWindow(ui.ScriptWindow): #Search for this lines and delete them: self.inventoryTab = [] self.inventoryTab.append(self.GetChild("Inventory_Tab_01")) self.inventoryTab.append(self.GetChild("Inventory_Tab_02")) self.inventoryTab.append(self.GetChild("Inventory_Tab_03")) self.inventoryTab.append(self.GetChild("Inventory_Tab_04")) self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg)) self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg)) self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg)) self.inventoryTab[3].SetEvent(lambda arg=3: self.SetInventoryPage(arg)) self.inventoryTab[0].Down() self.SetInventoryPage(0) self.inventoryTab = [] def SetInventoryPage(self, page): self.inventoryTab[self.inventoryPageIndex].SetUp() self.inventoryPageIndex = page self.inventoryTab[self.inventoryPageIndex].Down() self.RefreshBagSlotWindow() So basically you deleted the old inventory page navigator functions, now lets add the new one! #In the InventoryWindow(ui.ScriptWindow): class #Search for: def __LoadWindow(self): #After the: self.RefreshStatus() #Add the following lines: self.__MakeMeANewInventoryButtonFunctionHehe(9) #9 must be replaced by your inventory page count! self.RefreshBagSlotWindow() #After this you have to define the __MakePageButton function. #Search for this: def SetEquipmentPage(self, page): #And add this after the definition of SetEquipmentPage: def __MakeMeANewInventoryButtonFunctionHehe(self, pageCount): self.curPageIndex = 0 self.pageButtonList = [] idx_page = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"] #Replace this with your inventory page count! idx_pos = [-30, -30, -30, -30, -30, -30, -30, -30, -30] #Replace this with your inventory page count! And position it by yourself. pos = -130 #Position it by yourself. for i in xrange(9): #Replace the 9 with your inventory page count! button = ui.RadioButton() button.SetParent(self) button.SetUpVisual("REPLACE THIS WITH YOUR BUTTON IMAGE!!!") button.SetOverVisual("REPLACE THIS WITH YOUR BUTTON IMAGE!!!") button.SetDownVisual("REPLACE THIS WITH YOUR BUTTON IMAGE!!!") button.SetWindowHorizontalAlignCenter() button.SetWindowVerticalAlignCenter() if i < 9: #Replace the 9 with your inventory page count! button.SetPosition(pos, idx_pos[i]) pos += 32 button.SetText(idx_page[i]) button.SetEvent(lambda arg=i: self.SelectPage(arg)) button.Show() self.pageButtonList.append(button) self.pageButtonList[0].Down() def SelectPage(self, index): self.inventoryPageIndex = index for btn in self.pageButtonList: btn.SetUp() self.pageButtonList[index].Down() self.RefreshBagSlotWindow() Now search for your inventory.py in locale or uiscript whatever you use and delete the old buttons. And thats it! Since my design is so much different than any other design please DO NOT FORGET to replace the button visuals with yours and the positions of the button! Good luck with that!
  6. Hi folks! Lets make a Did you know line into your introloading! Because its funny. SCREENSHOT (Translate: Tudtad-e? = Did you know? A (K) Gomb lenyomásával használhatod a Bátorság köpenyedet amely végleges! = If you press the (K) Button you can use the Bravery without limit!) So lets start the tutorial... Open your IntroLoading.py #Search for this: self.loadingImage=0 #Add under: self.DIDYOUKNOW=0 #Search for this: self.loadingImage=self.GetChild("BackGround") #Add under: self.DIDYOUKNOW=self.GetChild("Didyouknow_text") #Search for this: imgFileNameDict = { #After this add: YourDidYouKnowLines = { 0 : "SOMETHING1", 1 : "SOMETHING2", 2 : "SOMETHING3", 3 : "SOMETHING4", } #Search for this: self.loadingImage.LoadImage(imgFileName) #Add under: ThisIsntFunnyLOL = YourDidYouKnowLines[app.GetRandom(0, len(YourDidYouKnowLines) - 1)] self.DIDYOUKNOW.SetText(ThisIsntFunnyLOL) #Search for this: self.loadingImage=0 #Add under: self.DIDYOUKNOW=0 Alright, we are done with the introloading.py Now open your LoadingWindow.py in locale or uiscript whatever you use... #Search for: { "name":"ErrorMessage", "type":"text", "x":10, "y":10, "text": uiScriptLocale.LOAD_ERROR, }, #Add under: { "name" : "DIDYOUKNOW_BLACKIMG", "type" : "expanded_image", "x" : wndMgr.GetScreenWidth()/2 - 260, "y" : wndMgr.GetScreenHeight()/2 + 150-68-10, "image" : "shabbatutorial/blackimg.tga", "children" : ( { "name" : "DIDYOUKNOW", "type" : "text", "x" : 10, "y" : 10, "text" : "Did you know???", "fontname" : "Tahoma Bold:17", "color" : 0xFFFFBF00, }, { "name" : "Didyouknow_text", "type" : "text", "x" : 10, "y" : 30, "text" : "Salalallaalalalalalaa", "fontname" : "Tahoma Bold:13", }, ) } We are done. Due to my own client i didnt made the right position so you might have to play a little bit with it! I included a rar which contains a black image... (Future ymir update XD) Good luck with it! shabbatutorial.rar
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
You will be able to see content when you disable your adblocker and enable javascript.