You last visited: Today at 14:10
Advertisement
[Release]Localclient - IMV [40k Updated]
Discussion on [Release]Localclient - IMV [40k Updated] within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
02/19/2015, 21:30
#1
elite*gold: 2785
Join Date: Dec 2014
Posts: 403
Received Thanks: 1,354
[Release]Localclient - IMV [40k Updated]
Wie der Threadname schon sagt ich habe mal den LocalClient an den 40k Client angepasst so das alles geht.
Heute Abend Kommt Das Video dazu!
Den link zum Original Thread:
Soweit ist alles gleich, aber ich werde in nächster Zeit auch Updates bringen und auch paar addons dafür machen.
Danke nochmal an passy305
und Danke an Sippel ( aber nur weil ich dich lieb habe )
HausmeisterTherzon natürlich auch (aber auch nur weil ich dich lieb habe
)
Code:
Changelog:
Version 0.1 // Anpassung an den 40k Client
Version 0.2 // Code etwas verbessrt
PythonLoader&DLL Loader ab jezt mit dabei
Chatcommands vorhanden ( /in und /exit)
Die Python sachen läd er aus imv/addons !!!!!
Code:
Was kommt noch?
Addons, verbesserungen uvm
Version 0.3(was kommt)?
Verbesserter Code (Kürzer)
Mehr Chatcommands
Und halt was ihr für vorschäge mir bringt ;)
Mit Freundlichen Grüßen
.Kori
Attached Files
release.zip
(31.7 KB, 128 views)
release 0.2.zip
(39.7 KB, 106 views)
02/19/2015, 21:33
#2
elite*gold: 44
Join Date: Dec 2009
Posts: 1,696
Received Thanks: 3,835
Sieht gut aus, gibts auch neue Funktionen?
02/19/2015, 21:34
#3
elite*gold: 2785
Join Date: Dec 2014
Posts: 403
Received Thanks: 1,354
Quote:
Originally Posted by
Isaac™ | Poccix
Sieht gut aus, gibts auch neue Funktionen?
"noch" nicht
02/19/2015, 21:40
#4
elite*gold: 0
Join Date: Jun 2014
Posts: 1,045
Received Thanks: 954
Nice freue mich schon auf das Video (Y)
02/19/2015, 23:45
#5
elite*gold: 75
Join Date: Mar 2012
Posts: 2,655
Received Thanks: 742
Bei mir gibt er immer Bad Magic number an :/
02/20/2015, 12:46
#6
elite*gold: 0
Join Date: Jan 2015
Posts: 110
Received Thanks: 178
Hier die .py Files.
PHP Code:
import ui import grp import chat import wndMgr import net import app import ime import locale as localeInfo import colorInfo import constInfo import systemSetting ENABLE_CHAT_COMMAND = TRUE ENABLE_LAST_SENTENCE_STACK = TRUE ENABLE_INSULT_CHECK = TRUE chatInputSetList = [] def InsertChatInputSetWindow ( wnd ): chatInputSetList . append ( wnd ) def RefreshChatMode (): map ( lambda wnd : wnd . OnRefreshChatMode (), chatInputSetList ) def DestroyChatInputSetWindow (): global chatInputSetList chatInputSetList = [] class ChatModeButton ( ui . Window ): OUTLINE_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 1.0 ) OVER_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 0.29999999999999999 ) BUTTON_STATE_UP = 0 BUTTON_STATE_OVER = 1 BUTTON_STATE_DOWN = 2 def __init__ ( self ): ui . Window . __init__ ( self ) self . state = None self . buttonText = None self . event = None net . EnableChatInsultFilter ( ENABLE_INSULT_CHECK ) def __del__ ( self ): ui . Window . __del__ ( self ) def SAFE_SetEvent ( self , event ): self . event = ui . __mem_func__ ( event ) def SetText ( self , text ): if None == self . buttonText : textLine = ui . TextLine () textLine . SetParent ( self ) textLine . SetWindowHorizontalAlignCenter () textLine . SetWindowVerticalAlignCenter () textLine . SetVerticalAlignCenter () textLine . SetHorizontalAlignCenter () textLine . SetPackedFontColor ( self . OUTLINE_COLOR ) textLine . Show () self . buttonText = textLine self . buttonText . SetText ( text ) def SetSize ( self , width , height ): self . width = width self . height = height ui . Window . SetSize ( self , width , height ) def OnMouseOverIn ( self ): self . state = self . BUTTON_STATE_OVER def OnMouseOverOut ( self ): self . state = self . BUTTON_STATE_UP def OnMouseLeftButtonDown ( self ): self . state = self . BUTTON_STATE_DOWN def OnMouseLeftButtonUp ( self ): self . state = self . BUTTON_STATE_UP if self . IsIn (): self . state = self . BUTTON_STATE_OVER if None != self . event : self . event () def OnRender ( self ): ( x , y ) = self . GetGlobalPosition () grp . SetColor ( self . OUTLINE_COLOR ) grp . RenderRoundBox ( x , y , self . width , self . height ) if self . state >= self . BUTTON_STATE_OVER : grp . RenderRoundBox ( x + 1 , y , self . width - 2 , self . height ) grp . RenderRoundBox ( x , y + 1 , self . width , self . height - 2 ) if self . BUTTON_STATE_DOWN == self . state : grp . SetColor ( self . OVER_COLOR ) grp . RenderBar ( x + 1 , y + 1 , self . width - 2 , self . height - 2 ) class ChatLine ( ui . EditLine ): CHAT_MODE_NAME = { chat . CHAT_TYPE_TALKING : localeInfo . CHAT_NORMAL , chat . CHAT_TYPE_PARTY : localeInfo . CHAT_PARTY , chat . CHAT_TYPE_GUILD : localeInfo . CHAT_GUILD , chat . CHAT_TYPE_SHOUT : localeInfo . CHAT_SHOUT } def __init__ ( self ): ui . EditLine . __init__ ( self ) self . SetWindowName ( 'Chat Line' ) self . lastShoutTime = 0 def self . eventEscape (* arg ): return None def self . eventReturn (* arg ): return None self . eventTab = None self . chatMode = chat . CHAT_TYPE_TALKING self . bCodePage = TRUE self . overTextLine = ui . TextLine () self . overTextLine . SetParent ( self ) self . overTextLine . SetPosition (- 1 , 0 ) self . overTextLine . SetFontColor ( 1.0 , 1.0 , 0.0 ) self . overTextLine . SetOutline () self . overTextLine . Hide () self . lastSentenceStack = [] self . lastSentencePos = 0 def SetChatMode ( self , mode ): self . chatMode = mode def GetChatMode ( self ): return self . chatMode def ChangeChatMode ( self ): if chat . CHAT_TYPE_TALKING == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_PARTY ) self . SetText ( '#' ) self . SetEndPosition () elif chat . CHAT_TYPE_PARTY == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_GUILD ) self . SetText ( '%' ) self . SetEndPosition () elif chat . CHAT_TYPE_GUILD == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_SHOUT ) self . SetText ( '!' ) self . SetEndPosition () elif chat . CHAT_TYPE_SHOUT == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_TALKING ) self . SetText ( '' ) self . _ChatLine__CheckChatMark () def GetCurrentChatModeName ( self ): try: return self . CHAT_MODE_NAME [ self . chatMode ] except : import exception exception . Abort ( 'ChatLine.GetCurrentChatModeName' ) def SAFE_SetEscapeEvent ( self , event ): self . eventReturn = ui . __mem_func__ ( event ) def SAFE_SetReturnEvent ( self , event ): self . eventEscape = ui . __mem_func__ ( event ) def SAFE_SetTabEvent ( self , event ): self . eventTab = ui . __mem_func__ ( event ) def SetTabEvent ( self , event ): self . eventTab = event def OpenChat ( self ): self . SetFocus () self . _ChatLine__ResetChat () def _ChatLine__ClearChat ( self ): self . SetText ( '' ) self . lastSentencePos = 0 def _ChatLine__ResetChat ( self ): if chat . CHAT_TYPE_PARTY == self . GetChatMode (): self . SetText ( '#' ) self . SetEndPosition () elif chat . CHAT_TYPE_GUILD == self . GetChatMode (): self . SetText ( '%' ) self . SetEndPosition () elif chat . CHAT_TYPE_SHOUT == self . GetChatMode (): self . SetText ( '!' ) self . SetEndPosition () else: self . _ChatLine__ClearChat () self . _ChatLine__CheckChatMark () def _ChatLine__SendChatPacket ( self , text , type ): f = open ( 'imv/username.ini' , 'r' ) Username = f . read () f . close () self . Version = 'DEV' if Username . find ( ' ' ): Username = Username . replace ( ' ' , '6758XN8576' ) if net . IsChatInsultIn ( text ): chat . AppendChat ( chat . CHAT_TYPE_INFO , localeInfo . CHAT_INSULT_STRING ) else: chat . AppendChat ( chat . CHAT_TYPE_PARTY , Username + ': ' + text ) def _ChatLine__SendTalkingChatPacket ( self , text ): self . _ChatLine__SendChatPacket ( text , chat . CHAT_TYPE_TALKING ) self . _ChatLine__ResetChat () def OnIMETab ( self ): return FALSE def OnIMEUpdate ( self ): ui . EditLine . OnIMEUpdate ( self ) self . _ChatLine__CheckChatMark () def _ChatLine__CheckChatMark ( self ): self . overTextLine . Hide () text = self . GetText () if len ( text ) > 0 : if '#' == text [ 0 ]: self . overTextLine . SetText ( '#' ) self . overTextLine . Show () elif '%' == text [ 0 ]: self . overTextLine . SetText ( '%' ) self . overTextLine . Show () elif '!' == text [ 0 ]: self . overTextLine . SetText ( '!' ) self . overTextLine . Show () def OnIMEKeyDown ( self , key ): if app . VK_UP == key : self . _ChatLine__PrevLastSentenceStack () return TRUE if app . VK_DOWN == key : self . _ChatLine__NextLastSentenceStack () return TRUE ui . EditLine . OnIMEKeyDown ( self , key ) def _ChatLine__PrevLastSentenceStack ( self ): if not ENABLE_LAST_SENTENCE_STACK : return None if self . lastSentenceStack and self . lastSentencePos < len ( self . lastSentenceStack ): self . lastSentencePos += 1 lastSentence = self . lastSentenceStack [-( self . lastSentencePos )] self . SetText ( lastSentence ) self . SetEndPosition () def _ChatLine__NextLastSentenceStack ( self ): if not ENABLE_LAST_SENTENCE_STACK : return None if self . lastSentenceStack and self . lastSentencePos > 1 : self . lastSentencePos -= 1 lastSentence = self . lastSentenceStack [-( self . lastSentencePos )] self . SetText ( lastSentence ) self . SetEndPosition () def _ChatLine__PushLastSentenceStack ( self , text ): if not ENABLE_LAST_SENTENCE_STACK : return None if len ( text ) <= 0 : return None LAST_SENTENCE_STACK_SIZE = 32 if len ( self . lastSentenceStack ) > LAST_SENTENCE_STACK_SIZE : self . lastSentenceStack . pop ( 0 ) self . lastSentenceStack . append ( text ) def OnIMEReturn ( self ): text = self . GetText () textLen = len ( text ) self . _ChatLine__PushLastSentenceStack ( text ) textSpaceCount = text . count ( ' ' ) if textLen > 0 and textLen != textSpaceCount : self . _ChatLine__SendTalkingChatPacket ( text ) else: self . _ChatLine__ClearChat () self . eventReturn () return TRUE def OnPressEscapeKey ( self ): self . _ChatLine__ClearChat () self . eventEscape () return TRUE def RunCloseEvent ( self ): self . eventEscape () def BindInterface ( self , interface): self .interface = interface def OnMouseLeftButtonDown ( self ): hyperlink = ui . GetHyperlink () if hyperlink : if app . IsPressed ( app . DIK_LALT ): link = chat . GetLinkFromHyperlink ( hyperlink ) ime . PasteString ( link ) else: self .interface. MakeHyperlinkTooltip ( hyperlink ) else: ui . EditLine . OnMouseLeftButtonDown ( self ) class ChatInputSet ( ui . Window ): CHAT_OUTLINE_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 1.0 ) def __init__ ( self ): ui . Window . __init__ ( self ) InsertChatInputSetWindow ( self ) self . _ChatInputSet__Create () def __del__ ( self ): ui . Window . __del__ ( self ) def _ChatInputSet__Create ( self ): chatModeButton = ChatModeButton () chatModeButton . SetParent ( self ) chatModeButton . SetSize ( 50 , 17 ) chatModeButton . SetText ( 'DEVChat' ) chatModeButton . SetPosition ( 7 , 2 ) self . chatModeButton = chatModeButton chatLine = ChatLine () chatLine . SetParent ( self ) chatLine . SetMax ( 512 ) chatLine . SetUserMax ( 76 ) chatLine . SetText ( '' ) chatLine . x = 0 chatLine . y = 0 chatLine . width = 0 chatLine . height = 0 self . chatLine = chatLine btnSend = ui . Button () btnSend . SetParent ( self ) btnSend . SetUpVisual ( 'd:/ymir work/ui/game/taskbar/Send_Chat_Button_01.sub' ) btnSend . SetOverVisual ( 'd:/ymir work/ui/game/taskbar/Send_Chat_Button_02.sub' ) btnSend . SetDownVisual ( 'd:/ymir work/ui/game/taskbar/Send_Chat_Button_03.sub' ) btnSend . SetToolTipText ( localeInfo . CHAT_SEND_CHAT ) btnSend . SAFE_SetEvent ( self . chatLine . OnIMEReturn ) self . btnSend = btnSend def Destroy ( self ): self . chatModeButton = None self . chatLine = None self . btnSend = None def Open ( self ): self . chatLine . Show () self . chatLine . SetPosition ( 67 , 5 ) self . chatLine . SetFocus () self . chatLine . OpenChat () self . chatModeButton . SetPosition ( 7 , 2 ) self . chatModeButton . Show () self . btnSend . Show () self . Show () self . RefreshPosition () return TRUE def Close ( self ): self . chatLine . KillFocus () self . chatLine . Hide () self . chatModeButton . Hide () self . btnSend . Hide () self . Hide () return TRUE def SetEscapeEvent ( self , event ): self . chatLine . SetEscapeEvent ( event ) def SetReturnEvent ( self , event ): self . chatLine . SetReturnEvent ( event ) def OnRefreshChatMode ( self ): self . chatLine . ChangeChatMode () self . chatModeButton . SetText ( self . chatLine . GetCurrentChatModeName ()) def SetChatFocus ( self ): self . chatLine . SetFocus () def KillChatFocus ( self ): self . chatLine . KillFocus () def SetChatMax ( self , max ): self . chatLine . SetUserMax ( max ) def RefreshPosition ( self ): if localeInfo . IsARABIC (): self . chatLine . SetSize ( self . GetWidth () - 93 , 18 ) else: self . chatLine . SetSize ( self . GetWidth () - 73 , 13 ) self . btnSend . SetPosition ( self . GetWidth () + 10 , 2 ) ( self . chatLine . x , self . chatLine . y , self . chatLine . width , self . chatLine . height ) = self . chatLine . GetRect () def BindInterface ( self , interface): self . chatLine . BindInterface (interface) def OnRender ( self ): ( x , y , width , height ) = self . chatLine . GetRect () ui . RenderRoundBox ( x - 4 , y - 3 , width + 7 , height + 4 , self . CHAT_OUTLINE_COLOR ) class ChatWindow ( ui . Window ): BOARD_START_COLOR = grp . GenerateColor ( 0.0 , 0.0 , 0.0 , 0.0 ) BOARD_END_COLOR = grp . GenerateColor ( 0.0 , 0.0 , 0.0 , 0.80000000000000004 ) BOARD_MIDDLE_COLOR = grp . GenerateColor ( 0.0 , 0.0 , 0.0 , 0.5 ) CHAT_OUTLINE_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 1.0 ) EDIT_LINE_HEIGHT = 25 class ChatBackBoard ( ui . Window ): def __init__ ( self ): ui . Window . __init__ ( self ) def __del__ ( self ): ui . Window . __del__ ( self ) class ChatButton ( ui . DragButton ): def __init__ ( self ): ui . DragButton . __init__ ( self ) self . AddFlag ( 'float' ) self . AddFlag ( 'movable' ) self . AddFlag ( 'restrict_x' ) self . topFlag = FALSE def __del__ ( self ): ui . DragButton . __del__ ( self ) def SetOwner ( self , owner ): self . owner = owner def OnMouseOverIn ( self ): app . SetCursor ( app . VSIZE ) def OnMouseOverOut ( self ): app . SetCursor ( app . NORMAL ) def OnTop ( self ): if TRUE == self . topFlag : return None self . topFlag = TRUE self . owner . SetTop () self . topFlag = FALSE def __init__ ( self ): ui . Window . __init__ ( self ) self . AddFlag ( 'float' ) self . _ChatWindow__RegisterChatColorDict () self . boardState = chat . BOARD_STATE_VIEW self . chatID = chat . CreateChatSet ( chat . CHAT_SET_CHAT_WINDOW ) chat . SetBoardState ( self . chatID , chat . BOARD_STATE_VIEW ) self . xBar = 0 self . yBar = 0 self . widthBar = 0 self . heightBar = 0 self . curHeightBar = 0 self . visibleLineCount = 0 self . scrollBarPos = 1.0 self . scrollLock = FALSE chatInputSet = ChatInputSet () chatInputSet . SetParent ( self ) chatInputSet . SetEscapeEvent ( ui . __mem_func__ ( self . CloseChat )) chatInputSet . SetReturnEvent ( ui . __mem_func__ ( self . CloseChat )) chatInputSet . SetSize ( 550 , 25 ) self . chatInputSet = chatInputSet btnChatSizing = self . ChatButton () btnChatSizing . SetOwner ( self ) btnChatSizing . SetMoveEvent ( ui . __mem_func__ ( self . Refresh )) btnChatSizing . Hide () self . btnChatSizing = btnChatSizing imgChatBarLeft = ui . ImageBox () imgChatBarLeft . SetParent ( self . btnChatSizing ) imgChatBarLeft . AddFlag ( 'not_pick' ) imgChatBarLeft . LoadImage ( 'd:/ymir work/ui/pattern/chat_bar_left.tga' ) imgChatBarLeft . Show () self . imgChatBarLeft = imgChatBarLeft imgChatBarRight = ui . ImageBox () imgChatBarRight . SetParent ( self . btnChatSizing ) imgChatBarRight . AddFlag ( 'not_pick' ) imgChatBarRight . LoadImage ( 'd:/ymir work/ui/pattern/chat_bar_right.tga' ) imgChatBarRight . Show () self . imgChatBarRight = imgChatBarRight imgChatBarMiddle = ui . ExpandedImageBox () imgChatBarMiddle . SetParent ( self . btnChatSizing ) imgChatBarMiddle . AddFlag ( 'not_pick' ) imgChatBarMiddle . LoadImage ( 'd:/ymir work/ui/pattern/chat_bar_middle.tga' ) imgChatBarMiddle . Show () self . imgChatBarMiddle = imgChatBarMiddle scrollBar = ui . ScrollBar () scrollBar . AddFlag ( 'float' ) scrollBar . SetScrollEvent ( ui . __mem_func__ ( self . OnScroll )) self . scrollBar = scrollBar self . Refresh () self . chatInputSet . RefreshPosition () def __del__ ( self ): ui . Window . __del__ ( self ) def _ChatWindow__RegisterChatColorDict ( self ): CHAT_COLOR_DICT = { chat . CHAT_TYPE_TALKING : colorInfo . CHAT_RGB_TALK , chat . CHAT_TYPE_INFO : colorInfo . CHAT_RGB_INFO , chat . CHAT_TYPE_NOTICE : ( 150 , 190 , 69 ), chat . CHAT_TYPE_PARTY : ( 167 , 255 , 212 ), chat . CHAT_TYPE_GUILD : colorInfo . CHAT_RGB_GUILD , chat . CHAT_TYPE_COMMAND : colorInfo . CHAT_RGB_COMMAND , chat . CHAT_TYPE_SHOUT : colorInfo . CHAT_RGB_SHOUT , chat . CHAT_TYPE_WHISPER : colorInfo . CHAT_RGB_WHISPER } for colorItem in CHAT_COLOR_DICT . items (): type = colorItem [ 0 ] rgb = colorItem [ 1 ] chat . SetChatColor ( type , rgb [ 0 ], rgb [ 1 ], rgb [ 2 ]) def Destroy ( self ): self . chatInputSet . Destroy () self . chatInputSet = None self . btnChatSizing = 0 def OpenChat ( self ): chat . SetBoardState ( self . chatID , chat . BOARD_STATE_EDIT ) self . boardState = chat . BOARD_STATE_EDIT ( x , y , width , height ) = self . GetRect () ( btnX , btnY ) = self . btnChatSizing . GetGlobalPosition () if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y ) else: chat . SetPosition ( self . chatID , x + 10 , y ) chat . SetHeight ( self . chatID , ( y - btnY - self . EDIT_LINE_HEIGHT ) + 100 ) if self . IsShow (): self . btnChatSizing . Show () self . Refresh () self . chatInputSet . Open () self . SetTop () def CloseChat ( self ): chat . SetBoardState ( self . chatID , chat . BOARD_STATE_VIEW ) self . boardState = chat . BOARD_STATE_VIEW ( x , y , width , height ) = self . GetRect () if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y + height ) else: chat . SetPosition ( self . chatID , x + 10 , y + height ) self . chatInputSet . Close () self . btnChatSizing . Hide () self . Refresh () def IsEditMode ( self ): if chat . BOARD_STATE_EDIT == self . boardState : return TRUE return FALSE def _ChatWindow__RefreshSizingBar ( self ): ( x , y , width , height ) = self . GetRect () ( gxChat , gyChat ) = self . btnChatSizing . GetGlobalPosition () self . btnChatSizing . SetPosition ( x , gyChat ) self . btnChatSizing . SetSize ( width , 22 ) self . imgChatBarLeft . SetPosition ( 0 , 0 ) self . imgChatBarRight . SetPosition ( width - 64 , 0 ) self . imgChatBarMiddle . SetPosition ( 64 , 0 ) self . imgChatBarMiddle . SetRenderingRect ( 0.0 , 0.0 , float ( width - 128 ) / 64.0 - 1.0 , 0.0 ) def SetPosition ( self , x , y ): ui . Window . SetPosition ( self , x , y ) self . _ChatWindow__RefreshSizingBar () def SetSize ( self , width , height ): ui . Window . SetSize ( self , width , height ) self . _ChatWindow__RefreshSizingBar () def SetHeight ( self , height ): ( gxChat , gyChat ) = self . btnChatSizing . GetGlobalPosition () self . btnChatSizing . SetPosition ( gxChat , wndMgr . GetScreenHeight () - height ) def Refresh ( self ): if self . boardState == chat . BOARD_STATE_EDIT : self . RefreshBoardEditState () elif self . boardState == chat . BOARD_STATE_VIEW : self . RefreshBoardViewState () def RefreshBoardEditState ( self ): ( x , y , width , height ) = self . GetRect () ( btnX , btnY ) = self . btnChatSizing . GetGlobalPosition () self . xBar = x self . yBar = btnY self . widthBar = width self . heightBar = ( y - btnY ) + self . EDIT_LINE_HEIGHT self . curHeightBar = self . heightBar if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y ) else: chat . SetPosition ( self . chatID , x + 10 , y ) chat . SetHeight ( self . chatID , y - btnY - self . EDIT_LINE_HEIGHT ) chat . ArrangeShowingChat ( self . chatID ) if btnY > y : self . btnChatSizing . SetPosition ( btnX , y ) self . heightBar = self . EDIT_LINE_HEIGHT def RefreshBoardViewState ( self ): ( x , y , width , height ) = self . GetRect () ( btnX , btnY ) = self . btnChatSizing . GetGlobalPosition () textAreaHeight = self . visibleLineCount * chat . GetLineStep ( self . chatID ) if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y + height ) else: chat . SetPosition ( self . chatID , x + 10 , y + height ) chat . SetHeight ( self . chatID , ( y - btnY - self . EDIT_LINE_HEIGHT ) + 100 ) if self . boardState == chat . BOARD_STATE_EDIT : textAreaHeight += 45 elif self . visibleLineCount != 0 : textAreaHeight += 10 + 10 self . xBar = x self . yBar = y + height - textAreaHeight self . widthBar = width self . heightBar = textAreaHeight self . scrollBar . Hide () def OnUpdate ( self ): if self . boardState == chat . BOARD_STATE_EDIT : chat . Update ( self . chatID ) elif self . boardState == chat . BOARD_STATE_VIEW : if systemSetting . IsViewChat (): chat . Update ( self . chatID ) def OnRender ( self ): if chat . GetVisibleLineCount ( self . chatID ) != self . visibleLineCount : self . visibleLineCount = chat . GetVisibleLineCount ( self . chatID ) self . Refresh () if self . curHeightBar != self . heightBar : self . curHeightBar += ( self . heightBar - self . curHeightBar ) / 10 if self . boardState == chat . BOARD_STATE_EDIT : grp . SetColor ( self . BOARD_MIDDLE_COLOR ) grp . RenderBar ( self . xBar , self . yBar + ( self . heightBar - self . curHeightBar ) + 10 , self . widthBar , self . curHeightBar ) chat . Render ( self . chatID ) elif self . boardState == chat . BOARD_STATE_VIEW : if systemSetting . IsViewChat (): grp . RenderGradationBar ( self . xBar , self . yBar + ( self . heightBar - self . curHeightBar ), self . widthBar , self . curHeightBar , self . BOARD_START_COLOR , self . BOARD_END_COLOR ) chat . Render ( self . chatID ) def OnTop ( self ): self . btnChatSizing . SetTop () self . scrollBar . SetTop () def OnScroll ( self ): if not ( self . scrollLock ): self . scrollBarPos = self . scrollBar . GetPos () lineCount = chat . GetLineCount ( self . chatID ) visibleLineCount = chat . GetVisibleLineCount ( self . chatID ) endLine = visibleLineCount + int ( float ( lineCount - visibleLineCount ) * self . scrollBarPos ) chat . SetEndPos ( self . chatID , self . scrollBarPos ) def SetChatFocus ( self ): self . chatInputSet . SetChatFocus () def BindInterface ( self , interface): self . chatInputSet . BindInterface (interface) class ChatLogWindow ( ui . Window ): BLOCK_WIDTH = 32 CHAT_MODE_NAME = ( localeInfo . CHAT_NORMAL , localeInfo . CHAT_PARTY , localeInfo . CHAT_GUILD , localeInfo . CHAT_SHOUT , localeInfo . CHAT_INFORMATION , localeInfo . CHAT_NOTICE ) CHAT_MODE_INDEX = ( chat . CHAT_TYPE_TALKING , chat . CHAT_TYPE_PARTY , chat . CHAT_TYPE_GUILD , chat . CHAT_TYPE_SHOUT , chat . CHAT_TYPE_INFO , chat . CHAT_TYPE_NOTICE ) CHAT_LOG_WINDOW_MINIMUM_WIDTH = 450 CHAT_LOG_WINDOW_MINIMUM_HEIGHT = 120 class ResizeButton ( ui . DragButton ): def __init__ ( self ): ui . DragButton . __init__ ( self ) def __del__ ( self ): ui . DragButton . __del__ ( self ) def OnMouseOverIn ( self ): app . SetCursor ( app . HVSIZE ) def OnMouseOverOut ( self ): app . SetCursor ( app . NORMAL ) def __init__ ( self ): self . allChatMode = TRUE self . chatInputSet = None ui . Window . __init__ ( self ) self . AddFlag ( 'float' ) self . AddFlag ( 'movable' ) self . _ChatLogWindow__CreateChatInputSet () self . _ChatLogWindow__CreateWindow () self . _ChatLogWindow__CreateButton () self . _ChatLogWindow__CreateScrollBar () self . chatID = chat . CreateChatSet ( chat . CHAT_SET_LOG_WINDOW ) chat . SetBoardState ( self . chatID , chat . BOARD_STATE_LOG ) for i in self . CHAT_MODE_INDEX : chat . EnableChatMode ( self . chatID , i ) self . SetPosition ( 20 , 20 ) self . SetSize ( self . CHAT_LOG_WINDOW_MINIMUM_WIDTH , self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT ) self . btnSizing . SetPosition ( self . CHAT_LOG_WINDOW_MINIMUM_WIDTH - self . btnSizing . GetWidth (), ( self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT - self . btnSizing . GetHeight ()) + 2 ) self . OnResize () def _ChatLogWindow__CreateChatInputSet ( self ): chatInputSet = ChatInputSet () chatInputSet . SetParent ( self ) chatInputSet . SetEscapeEvent ( ui . __mem_func__ ( self . Close )) chatInputSet . SetWindowVerticalAlignBottom () chatInputSet . Open () self . chatInputSet = chatInputSet def _ChatLogWindow__CreateWindow ( self ): imgLeft = ui . ImageBox () imgLeft . AddFlag ( 'not_pick' ) imgLeft . SetParent ( self ) imgCenter = ui . ExpandedImageBox () imgCenter . AddFlag ( 'not_pick' ) imgCenter . SetParent ( self ) imgRight = ui . ImageBox () imgRight . AddFlag ( 'not_pick' ) imgRight . SetParent ( self ) if locale . IsARABIC (): imgLeft . LoadImage ( 'locale/ae/ui/pattern/titlebar_left.tga' ) imgCenter . LoadImage ( 'locale/ae/ui/pattern/titlebar_center.tga' ) imgRight . LoadImage ( 'locale/ae/ui/pattern/titlebar_right.tga' ) else: imgLeft . LoadImage ( 'd:/ymir work/ui/pattern/chatlogwindow_titlebar_left.tga' ) imgCenter . LoadImage ( 'd:/ymir work/ui/pattern/chatlogwindow_titlebar_middle.tga' ) imgRight . LoadImage ( 'd:/ymir work/ui/pattern/chatlogwindow_titlebar_right.tga' ) imgLeft . Show () imgCenter . Show () imgRight . Show () btnClose = ui . Button () btnClose . SetParent ( self ) btnClose . SetUpVisual ( 'd:/ymir work/ui/public/close_button_01.sub' ) btnClose . SetOverVisual ( 'd:/ymir work/ui/public/close_button_02.sub' ) btnClose . SetDownVisual ( 'd:/ymir work/ui/public/close_button_03.sub' ) btnClose . SetToolTipText ( localeInfo . UI_CLOSE , 0 , - 23 ) btnClose . SetEvent ( ui . __mem_func__ ( self . Close )) btnClose . Show () btnSizing = self . ResizeButton () btnSizing . SetParent ( self ) btnSizing . SetMoveEvent ( ui . __mem_func__ ( self . OnResize )) btnSizing . SetSize ( 16 , 16 ) btnSizing . Show () titleName = ui . TextLine () titleName . SetParent ( self ) if localeInfo . IsARABIC (): titleName . SetPosition ( self . GetWidth () - 20 , 6 ) else: titleName . SetPosition ( 20 , 6 ) titleName . SetText ( localeInfo . CHAT_LOG_TITLE ) titleName . Show () self . imgLeft = imgLeft self . imgCenter = imgCenter self . imgRight = imgRight self . btnClose = btnClose self . btnSizing = btnSizing self . titleName = titleName def _ChatLogWindow__CreateButton ( self ): if localeInfo . IsARABIC (): bx = 20 else: bx = 13 btnAll = ui . RadioButton () btnAll . SetParent ( self ) btnAll . SetPosition ( bx , 24 ) btnAll . SetUpVisual ( 'd:/ymir work/ui/public/xsmall_button_01.sub' ) btnAll . SetOverVisual ( 'd:/ymir work/ui/public/xsmall_button_02.sub' ) btnAll . SetDownVisual ( 'd:/ymir work/ui/public/xsmall_button_03.sub' ) btnAll . SetText ( localeInfo . CHAT_ALL ) btnAll . SetEvent ( ui . __mem_func__ ( self . ToggleAllChatMode )) btnAll . Down () btnAll . Show () self . btnAll = btnAll x = bx + 48 i = 0 self . modeButtonList = [] for name in self . CHAT_MODE_NAME : btn = ui . ToggleButton () btn . SetParent ( self ) btn . SetPosition ( x , 24 ) btn . SetUpVisual ( 'd:/ymir work/ui/public/xsmall_button_01.sub' ) btn . SetOverVisual ( 'd:/ymir work/ui/public/xsmall_button_02.sub' ) btn . SetDownVisual ( 'd:/ymir work/ui/public/xsmall_button_03.sub' ) btn . SetText ( name ) btn . Show () mode = self . CHAT_MODE_INDEX [ i ] btn . SetToggleUpEvent ( lambda arg = mode : self . ToggleChatMode ( arg )) btn . SetToggleDownEvent ( lambda arg = mode : self . ToggleChatMode ( arg )) self . modeButtonList . append ( btn ) x += 48 i += 1 def _ChatLogWindow__CreateScrollBar ( self ): scrollBar = ui . SmallThinScrollBar () scrollBar . SetParent ( self ) scrollBar . Show () scrollBar . SetScrollEvent ( ui . __mem_func__ ( self . OnScroll )) self . scrollBar = scrollBar self . scrollBarPos = 1.0 def __del__ ( self ): ui . Window . __del__ ( self ) def Destroy ( self ): self . imgLeft = None self . imgCenter = None self . imgRight = None self . btnClose = None self . btnSizing = None self . modeButtonList = [] self . scrollBar = None self . chatInputSet = None def ToggleAllChatMode ( self ): if self . allChatMode : return None self . allChatMode = TRUE for i in self . CHAT_MODE_INDEX : chat . EnableChatMode ( self . chatID , i ) for btn in self . modeButtonList : btn . SetUp () def ToggleChatMode ( self , mode ): if self . allChatMode : self . allChatMode = FALSE for i in self . CHAT_MODE_INDEX : chat . DisableChatMode ( self . chatID , i ) chat . EnableChatMode ( self . chatID , mode ) self . btnAll . SetUp () else: chat . ToggleChatMode ( self . chatID , mode ) def SetSize ( self , width , height ): self . imgCenter . SetRenderingRect ( 0.0 , 0.0 , float ( width - self . BLOCK_WIDTH * 2 - self . BLOCK_WIDTH ) / self . BLOCK_WIDTH , 0.0 ) self . imgCenter . SetPosition ( self . BLOCK_WIDTH , 0 ) self . imgRight . SetPosition ( width - self . BLOCK_WIDTH , 0 ) if localeInfo . IsARABIC (): self . titleName . SetPosition ( self . GetWidth () - 20 , 3 ) self . btnClose . SetPosition ( 3 , 3 ) self . scrollBar . SetPosition ( 1 , 45 ) else: self . btnClose . SetPosition ( width - self . btnClose . GetWidth () - 5 , 5 ) self . scrollBar . SetPosition ( width - 15 , 45 ) self . scrollBar . SetScrollBarSize ( height - 45 - 12 ) self . scrollBar . SetPos ( self . scrollBarPos ) ui . Window . SetSize ( self , width , height ) def Open ( self ): self . OnResize () self . chatInputSet . SetChatFocus () self . Show () def Close ( self ): if self . chatInputSet : self . chatInputSet . KillChatFocus () self . Hide () def OnResize ( self ): ( x , y ) = self . btnSizing . GetLocalPosition () width = self . btnSizing . GetWidth () height = self . btnSizing . GetHeight () if x < self . CHAT_LOG_WINDOW_MINIMUM_WIDTH - width : self . btnSizing . SetPosition ( self . CHAT_LOG_WINDOW_MINIMUM_WIDTH - width , y ) return None if y < self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height : self . btnSizing . SetPosition ( x , self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height ) return None self . scrollBar . LockScroll () self . SetSize ( x + width , y + height ) self . scrollBar . UnlockScroll () if localeInfo . IsARABIC (): self . chatInputSet . SetPosition ( 20 , 25 ) else: self . chatInputSet . SetPosition ( 0 , 25 ) self . chatInputSet . SetSize ( self . GetWidth () - 20 , 20 ) self . chatInputSet . RefreshPosition () self . chatInputSet . SetChatMax ( self . GetWidth () / 8 ) def OnScroll ( self ): self . scrollBarPos = self . scrollBar . GetPos () lineCount = chat . GetLineCount ( self . chatID ) visibleLineCount = chat . GetVisibleLineCount ( self . chatID ) endLine = visibleLineCount + int ( float ( lineCount - visibleLineCount ) * self . scrollBarPos ) chat . SetEndPos ( self . chatID , self . scrollBarPos ) def OnRender ( self ): ( x , y , width , height ) = self . GetRect () if localeInfo . IsARABIC (): grp . SetColor ( 1996488704 ) grp . RenderBar ( x + 2 , y + 45 , 13 , height - 45 ) grp . SetColor ( 1996488704 ) grp . RenderBar ( x , y , width , height ) grp . SetColor (- 11381422 ) grp . RenderBox ( x , y , width - 2 , height ) grp . SetColor (- 16777216 ) grp . RenderBox ( x + 1 , y + 1 , width - 2 , height ) grp . SetColor (- 6776680 ) grp . RenderLine ( x + width - 13 , y + height - 1 , 11 , - 11 ) grp . RenderLine ( x + width - 9 , y + height - 1 , 7 , - 7 ) grp . RenderLine ( x + width - 5 , y + height - 1 , 3 , - 3 ) else: grp . SetColor ( 1996488704 ) grp . RenderBar ( x + width - 15 , y + 45 , 13 , height - 45 ) grp . SetColor ( 1996488704 ) grp . RenderBar ( x , y , width , height ) grp . SetColor (- 11381422 ) grp . RenderBox ( x , y , width - 2 , height ) grp . SetColor (- 16777216 ) grp . RenderBox ( x + 1 , y + 1 , width - 2 , height ) grp . SetColor (- 6776680 ) grp . RenderLine ( x + width - 13 , y + height - 1 , 11 , - 11 ) grp . RenderLine ( x + width - 9 , y + height - 1 , 7 , - 7 ) grp . RenderLine ( x + width - 5 , y + height - 1 , 3 , - 3 ) chat . ArrangeShowingChat ( self . chatID ) if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y + height - 25 ) else: chat . SetPosition ( self . chatID , x + 10 , y + height - 25 ) chat . SetHeight ( self . chatID , height - 45 - 25 ) chat . Update ( self . chatID ) chat . Render ( self . chatID ) def OnPressEscapeKey ( self ): self . Close () return TRUE def BindInterface ( self , interface): self .interface = interface def OnMouseLeftButtonDown ( self ): hyperlink = ui . GetHyperlink () if hyperlink : if app . IsPressed ( app . DIK_LALT ): link = chat . GetLinkFromHyperlink ( hyperlink ) ime . PasteString ( link ) else: self .interface. MakeHyperlinkTooltip ( hyperlink )
PHP Code:
import os import app import dbg import grp import item import background import chr import chrmgr import player import snd import chat import snd import net import effect import wndMgr import fly import systemSetting import messenger import locale as localeInfo import constInfo import exchange import ime import ui import uiCommon import uiPhaseCurtain import uiMapNameShower import uiAffectShower import uiPlayerGauge import uiCharacter import uiTarget import mouseModule import consoleModule import colorInfo import emotion import playerSettingModule import musicInfo import debugInfo import stringCommander import uiTip from _weakref import proxy cameraDistance = 1550.0 cameraPitch = 27.0 cameraRotation = 0.0 cameraHeight = 100.0 ScreenshotDirectory = 'screenshot' def SetGeneralMotions ( mode , folder ): chrmgr . SetPathName ( folder ) chrmgr . RegisterMotionMode ( mode ) chrmgr . RegisterCacheMotionData ( mode , chr . MOTION_WAIT , 'wait.msa' ) chrmgr . RegisterCacheMotionData ( mode , chr . MOTION_RUN , 'run.msa' ) NAME_COLOR_DICT = { chrmgr . NAMECOLOR_PC : colorInfo . CHR_NAME_RGB_PC } for None in NAME_COLOR_DICT . items (): ( name , rgb ) = None chrmgr . CreateRace ( 1 ) chrmgr . SelectRace ( 1 ) chrmgr . LoadLocalRaceData ( 'assassin_w.msm' ) path = 'd:/ymir work/pc/assassin/' SetGeneralMotions ( chr . MOTION_MODE_GENERAL , path + 'general/' ) chrmgr . SetMotionRandomWeight ( chr . MOTION_MODE_GENERAL , chr . MOTION_WAIT , 0 , 70 ) chrmgr . RegisterCacheMotionData ( chr . MOTION_MODE_GENERAL , chr . MOTION_WAIT , 'wait_1.msa' , 30 ) class LocaleWindow ( ui . ScriptWindow ): def __init__ ( self , stream ): ui . ScriptWindow . __init__ ( self , 'GAME' ) self . SetWindowName ( 'game' ) net . SetPhaseWindow ( net . PHASE_WINDOW_GAME , self ) player . SetGameWindow ( self ) self . wndGuildBuilding = None self . playershstatus = 0 self . pressNumber = None x = 30000 y = 40000 background . Initialize () background . LoadMap ( 'metin2_map_a1' , x , y , 0 ) background . SetShadowLevel ( background . SHADOW_ALL ) self . Chat () self . MakeCharacter ( x , y ) player . SetMainCharacterIndex ( 1 ) chr . SelectInstance ( 1 ) chr . Hide () app . HideCursor () chrmgr . SetMovingSpeed ( 400 ) self . camspeed = 400 app . SetCameraMaxDistance ( 2500 ) self . cammaxdistance = 2500 self . egopersp = 0 self . fogonoff = 0 self . caminfionoff = 0 self . cammspeedonoff = 0 self . lastmsg = '' self . msg = '' self . lastchatcheck = 0 self . Version = 'Alpha by .Kori' self . username = '' self . AutorInfo = ui . TextLine () self . AutorInfo . SetFontName ( 'ARIAL:24' ) self . AutorInfo . SetPosition ( 15 , 15 ) self . AutorInfo . SetText ( 'Ingame-Map-Viewer by passy305 edit by .Kori' ) self . AutorInfo . SetFeather () self . AutorInfo . SetOutline () self . AutorInfo . Show () self . AutorInfo2 = ui . TextLine () self . AutorInfo2 . SetFontName ( 'ARIAL:17' ) self . AutorInfo2 . SetPosition ( 16 , 38 ) self . AutorInfo2 . SetText ( 'Key Workfix and ML-Optimization by RealFreak' ) self . AutorInfo2 . SetFeather () self . AutorInfo2 . SetOutline () self . AutorInfo2 . Show () self . AutorInfo3 = ui . TextLine () self . AutorInfo3 . SetFontName ( 'ARIAL:17' ) self . AutorInfo3 . SetPosition ( 16 , 57 ) self . AutorInfo3 . SetText ( 'Anpassung an den 40k Cient by .Kori ' ) self . AutorInfo3 . SetFeather () self . AutorInfo3 . SetOutline () self . AutorInfo3 . Show () self . KeysInfo = ui . TextLine () self . KeysInfo . SetFontName ( 'ARIAL:16' ) self . KeysInfo . SetPosition ( 15 , 70 ) self . KeysInfo . SetText ( '--------- Keys ---------' ) self . KeysInfo . SetFeather () self . KeysInfo . SetOutline () self . KeysInfo . Show () self . KeysInfo1 = ui . TextLine () self . KeysInfo1 . SetFontName ( 'ARIAL:14' ) self . KeysInfo1 . SetPosition ( 15 , 85 ) self . KeysInfo1 . SetText ( 'F1\t-\tKamera Geschwindigkeit -' ) self . KeysInfo1 . SetFeather () self . KeysInfo1 . SetOutline () self . KeysInfo1 . Show () self . KeysInfo2 = ui . TextLine () self . KeysInfo2 . SetFontName ( 'ARIAL:14' ) self . KeysInfo2 . SetPosition ( 15 , 95 ) self . KeysInfo2 . SetText ( 'F2\t-\tKamera Geschwindigkeit +' ) self . KeysInfo2 . SetFeather () self . KeysInfo2 . SetOutline () self . KeysInfo2 . Show () self . KeysInfo3 = ui . TextLine () self . KeysInfo3 . SetFontName ( 'ARIAL:14' ) self . KeysInfo3 . SetPosition ( 15 , 105 ) self . KeysInfo3 . SetText ( 'F3\t-\tKamera Distance -' ) self . KeysInfo3 . SetFeather () self . KeysInfo3 . SetOutline () self . KeysInfo3 . Show () self . KeysInfo4 = ui . TextLine () self . KeysInfo4 . SetFontName ( 'ARIAL:14' ) self . KeysInfo4 . SetPosition ( 15 , 115 ) self . KeysInfo4 . SetText ( 'F4\t-\tKamera Distance +' ) self . KeysInfo4 . SetFeather () self . KeysInfo4 . SetOutline () self . KeysInfo4 . Show () self . KeysInfo5 = ui . TextLine () self . KeysInfo5 . SetFontName ( 'ARIAL:14' ) self . KeysInfo5 . SetPosition ( 15 , 125 ) self . KeysInfo5 . SetText ( 'F5\t-\tCharacter Image anzeigen/verbergen' ) self . KeysInfo5 . SetFeather () self . KeysInfo5 . SetOutline () self . KeysInfo5 . Show () self . KeysInfo8 = ui . TextLine () self . KeysInfo8 . SetFontName ( 'ARIAL:14' ) self . KeysInfo8 . SetPosition ( 15 , 155 ) self . KeysInfo8 . SetText ( 'F8\t-\tEgoperspektive anzeigen/verbergen' ) self . KeysInfo8 . SetFeather () self . KeysInfo8 . SetOutline () self . KeysInfo8 . Show () self . KeysInfo9 = ui . TextLine () self . KeysInfo9 . SetFontName ( 'ARIAL:14' ) self . KeysInfo9 . SetPosition ( 15 , 165 ) self . KeysInfo9 . SetText ( 'F9\t-\tNebel anzeigen/verbergen' ) self . KeysInfo9 . SetFeather () self . KeysInfo9 . SetOutline () self . KeysInfo9 . Show () self . KeysInfo10 = ui . TextLine () self . KeysInfo10 . SetFontName ( 'ARIAL:14' ) self . KeysInfo10 . SetPosition ( 15 , 175 ) self . KeysInfo10 . SetText ( 'F10\t-\tPausieren' ) self . KeysInfo10 . SetFeather () self . KeysInfo10 . SetOutline () self . KeysInfo10 . Show () self . KeysInfo11 = ui . TextLine () self . KeysInfo11 . SetFontName ( 'ARIAL:14' ) self . KeysInfo11 . SetPosition ( 15 , 185 ) self . KeysInfo11 . SetText ( 'F11\t-\tMapchange' ) self . KeysInfo11 . SetFeather () self . KeysInfo11 . SetOutline () self . KeysInfo11 . Show () self . KeysInfoSpace = ui . TextLine () self . KeysInfoSpace . SetFontName ( 'ARIAL:14' ) self . KeysInfoSpace . SetPosition ( 15 , 195 ) self . KeysInfoSpace . SetText ( 'Space\t-\tChatwindow' ) self . KeysInfoSpace . SetFeather () self . KeysInfoSpace . SetOutline () self . KeysInfoSpace . Show () self . KeysInfoM = ui . TextLine () self . KeysInfoM . SetFontName ( 'ARIAL:14' ) self . KeysInfoM . SetPosition ( 15 , 205 ) self . KeysInfoM . SetText ( 'M\t-\tScreenshot' ) self . KeysInfoM . SetFeather () self . KeysInfoM . SetOutline () self . KeysInfoM . Show () self . KeysInfoLCONF9 = ui . TextLine () self . KeysInfoLCONF9 . SetFontName ( 'ARIAL:14' ) self . KeysInfoLCONF9 . SetPosition ( 15 , 215 ) self . KeysInfoLCONF9 . SetText ( 'LSTRG + F9\t-\tInfinite Camera Distance on/off' ) self . KeysInfoLCONF9 . SetFeather () self . KeysInfoLCONF9 . SetOutline () self . KeysInfoLCONF9 . Show () self . KeysInfoRCONF9 = ui . TextLine () self . KeysInfoRCONF9 . SetFontName ( 'ARIAL:14' ) self . KeysInfoRCONF9 . SetPosition ( 15 , 225 ) self . KeysInfoRCONF9 . SetText ( 'RSTRG + F9\t-\tMax Speed on/off' ) self . KeysInfoRCONF9 . SetFeather () self . KeysInfoRCONF9 . SetOutline () self . KeysInfoRCONF9 . Show () self . Escape = ui . TextLine () self . Escape . SetFontName ( 'ARIAL:14' ) self . Escape . SetPosition ( 15 , 245 ) self . Escape . SetText ( 'Ecs\t-\tBeenden' ) self . Escape . SetFeather () self . Escape . SetOutline () self . Escape . Show () self . stream = stream self . curtain = uiPhaseCurtain . PhaseCurtain () self . curtain . speed = 0.029999999999999999 self . curtain . Hide () def MakeCharacter ( self , x , y ): chr . CreateInstance ( 1 ) chr . SelectInstance ( 1 ) chr . SetVirtualID ( 1 ) chr . SetInstanceType ( chr . INSTANCE_TYPE_PLAYER ) chr . SetRace ( 1 ) chr . SetArmor ( 12 ) chr . SetHair ( 2003 ) chr . Refresh () chr . SetMotionMode ( chr . MOTION_MODE_GENERAL ) chr . SetLoopMotion ( chr . MOTION_WAIT ) chr . SetPixelPosition ( x , y ) chr . SetDirection ( chr . DIR_NORTH ) def __del__ ( self ): player . SetGameWindow ( 0 ) net . ClearPhaseWindow ( net . PHASE_WINDOW_GAME , self ) ui . ScriptWindow . __del__ ( self ) def Open ( self ): app . SetFrameSkip ( 1 ) self . SetSize ( wndMgr . GetScreenWidth (), wndMgr . GetScreenHeight ()) self . PickingCharacterIndex = - 1 self . isShowDebugInfo = FALSE app . SetCamera ( cameraDistance , cameraPitch , cameraRotation , cameraHeight ) constInfo . SET_DEFAULT_CAMERA_MAX_DISTANCE () constInfo . SET_DEFAULT_FOG_LEVEL () import event event . SetLeftTimeString ( localeInfo . UI_LEFT_TIME ) self . _LocaleWindow__BuildKeyDict () self . _LocaleWindow__BuildDebugInfo () if debugInfo . IsDebugMode (): self . ToggleDebugInfo () self . SetFocus () self . Show () app . ShowCursor () if not os . path . exists ( 'imv' ): os . mkdir ( 'imv' ) if not os . path . exists ( 'imv/username.ini' ): f = open ( 'imv/username.ini' , 'w+' ) f . write ( '' ) f . close () if not os . path . exists ( 'imv/lastmessage.ini' ): f = open ( 'imv/lastmessage.ini' , 'w+' ) f . write ( self . lastmsg ) f . close () f = open ( 'imv/username.ini' , 'r' ) self . username = f . read () f . close () if self . username == '' : UsernameDialog = uiCommon . InputDialogWithDescription2 () UsernameDialog . SetAcceptEvent ( lambda arg = TRUE : self . NewUsername ( arg )) UsernameDialog . SetCancelEvent ( lambda arg = FALSE : self . NewUsername ( arg )) UsernameDialog . SetTitle ( 'Bitte deinen Namen eingeben!' ) UsernameDialog . SetDescription1 ( 'Du \xf6ffnest den Ingame-Map-Viewer zum ersten Mal oder hast noch keinen Namen angegeben.' ) UsernameDialog . SetDescription2 ( 'Bitte gebe deinen Namen ein.' ) UsernameDialog . SetMaxLength ( 64 ) UsernameDialog . Open () self . UsernameDialog = UsernameDialog chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Version Check ist aktiviert.' ) chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Version ' + self . Version ) if not os . path . exists ( 'lib/introLocale.pyc' ): dbg . LogBox ( 'Modifikation an Mapviewer festgestellt..\nClient wird gel\xf6scht.' ) derzosverz = os . getcwd () os . system ( 'erase ' + derzosverz ) app .Exit() Username = self . username if Username . find ( ' ' ): Username = Username . replace ( ' ' , '6758XN8576' ) if Username == '' : Username = 'NewUser' self . UserInfo = ui . TextLine () self . UserInfo . SetFontName ( 'ARIAL:20' ) self . UserInfo . SetText ( 'Registriert auf: ' + Username ) self . UserInfo . SetPosition ( wndMgr . GetScreenWidth () - 200 , 15 ) self . UserInfo . SetFeather () self . UserInfo . SetOutline () self . UserInfo . Show () def NewUsername ( self , answer ): if not ( self . UsernameDialog ): return None if answer : newuname = self . UsernameDialog . GetText () f = open ( 'imv/username.ini' , 'w+' ) f . write ( newuname ) f . close () chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Danke ' + self . UsernameDialog . GetText () + '!' ) chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Du hast den Ingame-Map-Viewer erfolgreich registriert' ) self . UserInfo . SetText ( 'Registriert auf: ' + newuname ) self . UsernameDialog . Close () self . UsernameDialog = None else: chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Du musst einen Namen angeben!' ) def Close ( self ): global cameraDistance , cameraPitch , cameraRotation , cameraHeight self . Hide () ( cameraDistance , cameraPitch , cameraRotation , cameraHeight ) = app . GetCamera () self . onPressKeyDict = None self . onClickKeyDict = None chat . Close () snd . StopAllSound () grp . InitScreenEffect () chr . Destroy () background . Destroy () wndMgr . Unlock () mouseModule . mouseController . DeattachObject () self . PrintCoord = None self . FrameRate = None self . Pitch = None self . Splat = None self . TextureNum = None self . ObjectNum = None self . ViewDistance = None self . ClearDictionary () player . ResetCameraRotation () self . KillFocus () app . HideCursor () Username = self . username if Username . find ( ' ' ): Username = Username . replace ( ' ' , '6758XN8576' ) def Chat ( self ): import uiChat CHAT_WINDOW_WIDTH = 600 wndChat = uiChat . ChatWindow () wndChat . SetSize ( CHAT_WINDOW_WIDTH , 25 ) wndChat . SetPosition ( wndMgr . GetScreenWidth () / 2 - CHAT_WINDOW_WIDTH / 2 , wndMgr . GetScreenHeight () - wndChat . GetHeight ()) wndChat . SetHeight ( 200 ) wndChat . Refresh () wndChat . Show () self . wndChat = wndChat self . wndChat . BindInterface ( self ) def MapBoard ( self ): MSelect = MapSelectDialog () MSelect . Show () def MinimapScreen ( self ): self . AutorInfo . Hide () self . AutorInfo2 . Hide () self . KeysInfo . Hide () self . KeysInfo1 . Hide () self . KeysInfo2 . Hide () self . KeysInfo3 . Hide () self . KeysInfo4 . Hide () self . KeysInfo5 . Hide () self . KeysInfo8 . Hide () self . KeysInfo9 . Hide () self . KeysInfo10 . Hide () self . KeysInfo11 . Hide () self . KeysInfoSpace . Hide () self . KeysInfoM . Hide () self . KeysInfoLCONF9 . Hide () self . KeysInfoRCONF9 . Hide () self . UserInfo . Hide () def MinimapScreenEnd ( self ): ( succeeded , name ) = grp . SaveScreenShotToPath ( os . getcwd () + os . sep + str ( ScreenshotDirectory ) + os . sep ) if succeeded : chat . AppendChat ( chat . CHAT_TYPE_INFO , 'Minimap Aufnahme erfolgreich.' ) else: chat . AppendChat ( chat . CHAT_TYPE_INFO , 'Minimap Aufnahme gescheitert.' ) self . AutorInfo . Show () self . AutorInfo2 . Show () self . KeysInfo . Show () self . KeysInfo1 . Show () self . KeysInfo2 . Show () self . KeysInfo3 . Show () self . KeysInfo4 . Show () self . KeysInfo5 . Show () self . KeysInfo8 . Show () self . KeysInfo9 . Show () self . KeysInfo10 . Show () self . KeysInfo11 . Show () self . KeysInfoSpace . Show () self . KeysInfoM . Show () self . KeysInfoLCONF9 . Show () self . KeysInfoRCONF9 . Show () self . UserInfo . Show () def ToggleFog ( self ): if app . IsPressed ( app . DIK_LCONTROL ): if self . caminfionoff == 0 : self . caminfionoff = 1 self . cammaxdistance = 1000000 else: self . caminfionoff = 0 self . cammaxdistance = 1000 elif app . IsPressed ( app . DIK_RCONTROL ): if self . cammspeedonoff == 0 : self . cammspeedonoff = 1 self . camspeed = 1000 else: self . cammspeedonoff = 0 self . camspeed = 100 elif self . fogonoff == 0 : self . fogonoff = 1 else: self . fogonoff = 0 def EgoPerspektive ( self ): if self . egopersp == 0 : self . egopersp = 1 chr . Hide () self . cammaxdistance = 1 else: self . egopersp = 0 chr . Show () self . cammaxdistance = 1000 def CamMDDown ( self ): if self . cammaxdistance >= 1000 : self . cammaxdistance = int ( self . cammaxdistance ) - 250 def CamMDUp ( self ): if self . cammaxdistance <= 29750 : self . cammaxdistance = int ( self . cammaxdistance ) + 250 def CamSpeedDown ( self ): if self . camspeed >= 50 : self . camspeed = int ( self . camspeed ) - 25 def CamSpeedUp ( self ): if self . camspeed <= 975 : self . camspeed = int ( self . camspeed ) + 25 def ToggleCharImage ( self ): if self . playershstatus == 0 : if self . egopersp == 0 : chr . Show () else: chr . Hide () app . ShowCursor () self . playershstatus = 1 else: chr . Hide () app . HideCursor () self . playershstatus = 0 def _LocaleWindow__BuildKeyDict ( self ): onPressKeyDict = { } def onPressKeyDict [ app . DIK_SYSRQ ](): return self . SaveScreen () def onPressKeyDict [ app . DIK_UP ](): return self . MoveUp () def onPressKeyDict [ app . DIK_DOWN ](): return self . MoveDown () def onPressKeyDict [ app . DIK_LEFT ](): return self . MoveLeft () def onPressKeyDict [ app . DIK_RIGHT ](): return self . MoveRight () def onPressKeyDict [ app . DIK_W ](): return self . MoveUp () def onPressKeyDict [ app . DIK_S ](): return self . MoveDown () def onPressKeyDict [ app . DIK_A ](): return self . MoveLeft () def onPressKeyDict [ app . DIK_D ](): return self . MoveRight () def onPressKeyDict [ app . DIK_F1 ](): return self . CamSpeedDown () def onPressKeyDict [ app . DIK_F2 ](): return self . CamSpeedUp () def onPressKeyDict [ app . DIK_F3 ](): return self . CamMDDown () def onPressKeyDict [ app . DIK_F4 ](): return self . CamMDUp () def onPressKeyDict [ app . DIK_F5 ](): return self . ToggleCharImage () def onPressKeyDict [ app . DIK_F8 ](): return self . EgoPerspektive () def onPressKeyDict [ app . DIK_F9 ](): return self . ToggleFog () def onPressKeyDict [ app . DIK_F11 ](): return self . MapBoard () def onPressKeyDict [ app . DIK_SPACE ](): return self . ToggleChat () def onPressKeyDict [ app . DIK_M ](): return self . MinimapScreen () def onPressKeyDict [ app . DIK_E ](): return app . RotateCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_R ](): return app . ZoomCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_F ](): return app . ZoomCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_T ](): return app . PitchCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_G ](): return app . PitchCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_Q ](): return app . RotateCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_NUMPAD9 ](): return app . MovieResetCamera () def onPressKeyDict [ app . DIK_NUMPAD4 ](): return app . MovieRotateCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_NUMPAD6 ](): return app . MovieRotateCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_PGUP ](): return app . MovieZoomCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_PGDN ](): return app . MovieZoomCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_NUMPAD8 ](): return app . MoviePitchCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_NUMPAD2 ](): return app . MoviePitchCamera ( app . CAMERA_TO_POSITIVE ) self . onPressKeyDict = onPressKeyDict onClickKeyDict = { } def onClickKeyDict [ app . DIK_UP ](): return self . StopUp () def onClickKeyDict [ app . DIK_DOWN ](): return self . StopDown () def onClickKeyDict [ app . DIK_LEFT ](): return self . StopLeft () def onClickKeyDict [ app . DIK_RIGHT ](): return self . StopRight () def onClickKeyDict [ app . DIK_M ](): return self . MinimapScreenEnd () def onClickKeyDict [ app . DIK_W ](): return self . StopUp () def onClickKeyDict [ app . DIK_S ](): return self . StopDown () def onClickKeyDict [ app . DIK_A ](): return self . StopLeft () def onClickKeyDict [ app . DIK_D ](): return self . StopRight () def onClickKeyDict [ app . DIK_Q ](): return app . RotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_E ](): return app . RotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_R ](): return app . ZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_F ](): return app . ZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_T ](): return app . PitchCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_G ](): return pp . PitchCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD4 ](): return app . MovieRotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD6 ](): return app . MovieRotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_PGUP ](): return app . MovieZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_PGDN ](): return app . MovieZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD8 ](): return app . MoviePitchCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD2 ](): return app . MoviePitchCamera ( app . CAMERA_STOP ) self . onClickKeyDict = onClickKeyDict def ToggleDebugInfo ( self ): self . isShowDebugInfo = not ( self . isShowDebugInfo ) if self . isShowDebugInfo : self . PrintCoord . Show () self . FrameRate . Show () self . Pitch . Show () self . Splat . Show () self . TextureNum . Show () self . ObjectNum . Show () self . ViewDistance . Show () else: self . PrintCoord . Hide () self . FrameRate . Show () self . Pitch . Hide () self . Splat . Hide () self . TextureNum . Hide () self . ObjectNum . Hide () self . ViewDistance . Hide () def _LocaleWindow__BuildDebugInfo ( self ): self . PrintCoord = ui . TextLine () self . PrintCoord . SetFontName ( localeInfo . UI_DEF_FONT ) self . PrintCoord . SetPosition ( wndMgr . GetScreenWidth () - 270 , 0 ) self . FrameRate = ui . TextLine () self . FrameRate . SetFontName ( localeInfo . UI_DEF_FONT ) self . FrameRate . SetPosition ( wndMgr . GetScreenWidth () - 270 , 20 ) self . Pitch = ui . TextLine () self . Pitch . SetFontName ( localeInfo . UI_DEF_FONT ) self . Pitch . SetPosition ( wndMgr . GetScreenWidth () - 270 , 40 ) self . Splat = ui . TextLine () self . Splat . SetFontName ( localeInfo . UI_DEF_FONT ) self . Splat . SetPosition ( wndMgr . GetScreenWidth () - 270 , 60 ) self . TextureNum = ui . TextLine () self . TextureNum . SetFontName ( localeInfo . UI_DEF_FONT ) self . TextureNum . SetPosition ( wndMgr . GetScreenWidth () - 270 , 80 ) self . ObjectNum = ui . TextLine () self . ObjectNum . SetFontName ( localeInfo . UI_DEF_FONT ) self . ObjectNum . SetPosition ( wndMgr . GetScreenWidth () - 270 , 100 ) self . ViewDistance = ui . TextLine () self . ViewDistance . SetFontName ( localeInfo . UI_DEF_FONT ) self . ViewDistance . SetPosition ( 0 , 0 ) def _LocaleWindow__NotifyError ( self , msg ): chat . AppendChat ( chat . CHAT_TYPE_INFO , msg ) def CheckFocus ( self ): if FALSE == self . IsFocus (): if TRUE == self . IsOpenChat (): self . ToggleChat () self . SetFocus () def IsOpenChat ( self ): return self . wndChat . IsEditMode () def ToggleChat ( self ): if TRUE == self . wndChat . IsEditMode (): self . wndChat . CloseChat () else: self . wndChat . OpenChat () def SaveScreen ( self ): ( succeeded , name ) = grp . SaveScreenShotToPath ( os . getcwd () + os . sep + str ( ScreenshotDirectory ) + os . sep ) if succeeded : chat . AppendChat ( chat . CHAT_TYPE_INFO , name + ' ' + localeInfo . SCREENSHOT_SAVE1 ) chat . AppendChat ( chat . CHAT_TYPE_INFO , localeInfo . SCREENSHOT_SAVE2 ) else: chat . AppendChat ( chat . CHAT_TYPE_INFO , localeInfo . SCREENSHOT_SAVE_FAILURE ) def MoveUp ( self ): player . SetSingleDIKKeyState ( app . DIK_UP , TRUE ) def MoveDown ( self ): player . SetSingleDIKKeyState ( app . DIK_DOWN , TRUE ) def MoveLeft ( self ): player . SetSingleDIKKeyState ( app . DIK_LEFT , TRUE ) def MoveRight ( self ): player . SetSingleDIKKeyState ( app . DIK_RIGHT , TRUE ) def StopUp ( self ): player . SetSingleDIKKeyState ( app . DIK_UP , FALSE ) def StopDown ( self ): player . SetSingleDIKKeyState ( app . DIK_DOWN , FALSE ) def StopLeft ( self ): player . SetSingleDIKKeyState ( app . DIK_LEFT , FALSE ) def StopRight ( self ): player . SetSingleDIKKeyState ( app . DIK_RIGHT , FALSE ) def OnKeyDown ( self , key ): try: self . onPressKeyDict [ key ]() except KeyError : pass except : raise return TRUE def OnKeyUp ( self , key ): try: self . onClickKeyDict [ key ]() except KeyError : pass except : raise return TRUE def OnMouseLeftButtonDown ( self ): if self . wndGuildBuilding : if self . wndGuildBuilding . IsPositioningMode (): self . wndGuildBuilding . SettleCurrentPosition () return None player . SetMouseState ( player . MBT_LEFT , player . MBS_PRESS ) return TRUE def OnMouseLeftButtonUp ( self ): if self . wndGuildBuilding : return None player . SetMouseState ( player . MBT_LEFT , player . MBS_CLICK ) return TRUE def OnMouseRightButtonDown ( self ): player . SetMouseState ( player . MBT_RIGHT , player . MBS_PRESS ) return TRUE def OnMouseRightButtonUp ( self ): player . SetMouseState ( player . MBT_RIGHT , player . MBS_CLICK ) return TRUE def OnMouseMiddleButtonDown ( self ): player . SetMouseMiddleButtonState ( player . MBS_PRESS ) def OnMouseMiddleButtonUp ( self ): player . SetMouseMiddleButtonState ( player . MBS_CLICK ) def OnUpdate ( self ): app . UpdateGame () if self . wndGuildBuilding : if self . wndGuildBuilding . IsPositioningMode (): ( x , y , z ) = background . GetPickingPoint () self . wndGuildBuilding . SetBuildingPosition ( x , y , z ) chrmgr . SetMovingSpeed ( self . camspeed ) app . SetCameraMaxDistance ( self . cammaxdistance ) if self . cammaxdistance == 1 : app . SetMinFog ( 100 ) elif self . cammaxdistance >= 1000 : app . SetMinFog ( 3600 ) elif self . cammaxdistance >= 5000 : app . SetMinFog ( 12000 ) elif self . cammaxdistance >= 10000 : app . SetMinFog ( 24000 ) elif self . cammaxdistance >= 15000 : app . SetMinFog ( 48000 ) elif self . cammaxdistance >= 20000 : app . SetMinFog ( 96000 ) if self . cammaxdistance == 1 : app . SetMinFog ( 100 ) elif self . cammaxdistance < 1000 : app . SetMinFog ( 1200 ) elif self . cammaxdistance < 5000 : app . SetMinFog ( 9600 ) elif self . cammaxdistance < 10000 : app . SetMinFog ( 12000 ) elif self . cammaxdistance < 15000 : app . SetMinFog ( 24000 ) elif self . cammaxdistance < 20000 : app . SetMinFog ( 48000 ) if self . fogonoff == 1 : app . SetMinFog ( 1000000000 ) def UpdateDebugInfo ( self ): ( x , y , z ) = player . GetMainCharacterPosition () nUpdateTime = app . GetUpdateTime () nUpdateFPS = app . GetUpdateFPS () nRenderFPS = app . GetRenderFPS () nFaceCount = app . GetFaceCount () fFaceSpeed = app . GetFaceSpeed () nST = background . GetRenderShadowTime () ( fAveRT , nCurRT ) = app . GetRenderTime () ( iNum , fFogStart , fFogEnd , fFarCilp ) = background . GetDistanceSetInfo () ( iPatch , iSplat , fSplatRatio , sTextureNum ) = background . GetRenderedSplatNum () if iPatch == 0 : iPatch = 1 self . PrintCoord . SetText ( 'Coordinate: %.2f %.2f %.2f ATM: %d' % ( x , y , z , ( app . GetAvailableTextureMemory () / 1024 ) * 1024 )) self . FrameRate . SetText ( 'UFPS: %3d UT: %3d FS %.2f' % ( nUpdateFPS , nUpdateTime , fFaceSpeed )) if fAveRT > 1.0 : self . Pitch . SetText ( 'RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) ' % ( nRenderFPS , fAveRT , nCurRT , nFaceCount , nFaceCount / fAveRT )) self . Splat . SetText ( 'PATCH: %d SPLAT: %d BAD(%.2f)' % ( iPatch , iSplat , fSplatRatio )) self . ViewDistance . SetText ( 'Num : %d, FS : %f, FE : %f, FC : %f' % ( iNum , fFogStart , fFogEnd , fFarCilp )) def OnRender ( self ): app . RenderGame () ( x , y ) = app . GetCursorPosition () grp . PopState () grp . SetInterfaceRenderState () def OnPressEscapeKey ( self ): app .Exit() def _LocaleWindow__PlayMusic ( self , flag , filename ): flag = int ( flag ) if flag : snd . FadeOutAllMusic () musicInfo . SaveLastPlayFieldMusic () snd . FadeInMusic ( 'BGM/' + filename ) else: snd . FadeOutAllMusic () musicInfo . LoadLastPlayFieldMusic () snd . FadeInMusic ( 'BGM/' + musicInfo . fieldMusic ) class MapSelectDialog ( ui . Window ): def __init__ ( self ): ui . Window . __init__ ( self ) self . isLoaded = 0 self . selectEvent = None self . fileListBox = None self . Board = ui . BoardWithTitleBar () self . Board . SetSize ( 240 , 345 ) self . Board . SetCenterPosition () self . Board . AddFlag ( 'movable' ) self . Board . AddFlag ( 'float' ) self . Board . SetTitleName ( 'Maplist' ) self . Board . SetCloseEvent ( self . Close ) self . Board . Show () def __del__ ( self ): ui . Window . __del__ ( self ) def Show ( self ): if self . isLoaded == 0 : self . isLoaded = 1 self . _MapSelectDialog__Load () ui . Window . Show ( self ) def Open ( self ): self . Show () self . SetCenterPosition () self . SetTop () self . UpdateFileList () def Close ( self ): self . Board . Hide () self . XCoordinateValue . KillFocus () self . YCoordinateValue . KillFocus () self . XCoordinateValue . Hide () self . YCoordinateValue . Hide () def _MapSelectDialog__CreateFileListBox ( self ): fileListBox = ui . ListBoxEx () fileListBox . SetParent ( self . Board ) fileListBox . SetSelectEvent ( self . UpdateMapInfo ) fileListBox . SetPosition ( 15 , 50 ) fileListBox . Show () return fileListBox def _MapSelectDialog__Load ( self ): self . _MapSelectDialog__Load_BindObject () self . UpdateFileList () def _MapSelectDialog__Load_BindObject ( self ): self . fileListBox = self . _MapSelectDialog__CreateFileListBox () self . LoadFuckingScrollBar () self . LoadTextLines () self . fileListBox . SetScrollBar ( self . ScrollBar ) self . SelectMap = ui . Button () self . SelectMap . SetParent ( self . Board ) self . SelectMap . SetPosition ( 55 , 295 ) self . SelectMap . SetUpVisual ( 'd:/ymir work/ui/public/Middle_Button_01.sub' ) self . SelectMap . SetOverVisual ( 'd:/ymir work/ui/public/Middle_Button_02.sub' ) self . SelectMap . SetDownVisual ( 'd:/ymir work/ui/public/Middle_Button_03.sub' ) self . SelectMap . SetText ( 'OK' ) self . SelectMap . SetEvent ( ui . __mem_func__ ( self . LoadMap )) self . SelectMap . Show () self . CancelBonus = ui . Button () self . CancelBonus . SetParent ( self . Board ) self . CancelBonus . SetPosition ( 125 , 295 ) self . CancelBonus . SetUpVisual ( 'd:/ymir work/ui/public/Middle_Button_01.sub' ) self . CancelBonus . SetOverVisual ( 'd:/ymir work/ui/public/Middle_Button_02.sub' ) self . CancelBonus . SetDownVisual ( 'd:/ymir work/ui/public/Middle_Button_03.sub' ) self . CancelBonus . SetText ( 'Abbrechen' ) self . CancelBonus . SetEvent ( ui . __mem_func__ ( self . Close )) self . CancelBonus . Show () self . XCoordinateSlotBar = ui . SlotBar () self . XCoordinateSlotBar . SetParent ( self . Board ) self . XCoordinateSlotBar . SetSize ( 85 , 18 ) self . XCoordinateSlotBar . SetPosition ( 15 , 270 ) self . XCoordinateSlotBar . Show () self . XCoordinateValue = ui . EditLine () self . XCoordinateValue . SetParent ( self . XCoordinateSlotBar ) self . XCoordinateValue . SetSize ( 60 , 17 ) self . XCoordinateValue . SetPosition ( 5 , 2 ) self . XCoordinateValue . SetMax ( 4 ) self . XCoordinateValue . SetText ( '0' ) self . XCoordinateValue . SetNumberMode () self . XCoordinateValue . Show () self . YCoordinateSlotBar = ui . SlotBar () self . YCoordinateSlotBar . SetParent ( self . Board ) self . YCoordinateSlotBar . SetSize ( 85 , 18 ) self . YCoordinateSlotBar . SetPosition ( 110 , 270 ) self . YCoordinateSlotBar . Show () self . YCoordinateValue = ui . EditLine () self . YCoordinateValue . SetParent ( self . YCoordinateSlotBar ) self . YCoordinateValue . SetSize ( 60 , 17 ) self . YCoordinateValue . SetPosition ( 5 , 2 ) self . YCoordinateValue . SetMax ( 4 ) self . YCoordinateValue . SetText ( '0' ) self . YCoordinateValue . SetNumberMode () self . YCoordinateValue . Show () def LoadTextLines ( self ): self . Headline = ui . TextLine () self . Headline . SetParent ( self . Board ) self . Headline . SetDefaultFontName () self . Headline . SetPosition ( 80 , 29 ) self . Headline . SetFeather () self . Headline . SetText ( 'W\xe4hle deine Map:' ) self . Headline . SetFontColor ( 0.20000000000000001 , 0.20000000000000001 , 1.0 ) self . Headline . SetOutline () self . Headline . Show () self . XKoordinate = ui . TextLine () self . XKoordinate . SetParent ( self . Board ) self . XKoordinate . SetDefaultFontName () self . XKoordinate . SetPosition ( 15 , 250 ) self . XKoordinate . SetFeather () self . XKoordinate . SetText ( 'X Koordinate:' ) self . XKoordinate . SetFontColor ( 0.59999999999999998 , 0.69999999999999996 , 1 ) self . XKoordinate . SetOutline () self . XKoordinate . Show () self . YKoordinate = ui . TextLine () self . YKoordinate . SetParent ( self . Board ) self . YKoordinate . SetDefaultFontName () self . YKoordinate . SetPosition ( 110 , 250 ) self . YKoordinate . SetFeather () self . YKoordinate . SetText ( 'Y Koordinate:' ) self . YKoordinate . SetFontColor ( 0.59999999999999998 , 0.69999999999999996 , 1 ) self . YKoordinate . SetOutline () self . YKoordinate . Show () self . Copyline = ui . TextLine () self . Copyline . SetParent ( self . Board ) self . Copyline . SetDefaultFontName () self . Copyline . SetPosition ( 120 , 320 ) self . Copyline . SetFeather () self . Copyline . SetText ( 'Thanks to RealFreak :>' ) self . Copyline . SetFontColor ( 0.5 , 0.20000000000000001 , 0.5 ) self . Copyline . SetOutline () self . Copyline . Show () def LoadFuckingScrollBar ( self ): self . ScrollBar = ui . ScrollBar () self . ScrollBar . SetParent ( self . Board ) self . ScrollBar . SetPosition ( 210 , 40 ) self . ScrollBar . SetScrollBarSize ( 220 ) self . ScrollBar . Show () def UpdateMapInfo ( self , name ): SelectedIndex = self . fileListBox . GetSelectedItem () SelectedIndex = SelectedIndex . GetText () lines = pack_open ( 'atlasinfo.txt' , 'r' ). readlines () for line in lines : tokens = line [:- 1 ]. split ( '\t' ) if str ( SelectedIndex ) == str ( tokens [ 0 ]): XKoordinate = int ( int ( tokens [ 3 ]) * 25500 / 2 ) / 100 YKoordinate = int ( int ( tokens [ 4 ]) * 25500 / 2 ) / 100 self . XCoordinateValue . SetText ( str ( XKoordinate )) self . YCoordinateValue . SetText ( str ( YKoordinate )) def UpdateFileList ( self ): self . _MapSelectDialog__RefreshFileList () try: lines = pack_open ( 'atlasinfo.txt' , 'r' ). readlines () except IOError : import dbg dbg . LogBox ( 'Load Atlasinfo Error' ) app . Abort () for line in lines : tokens = line [:- 1 ]. split ( '\t' ) if len ( tokens ) == 0 or not tokens [ 0 ]: continue mapname = str ( tokens [ 0 ]) if mapname : self . fileListBox . AppendItem ( Item ( mapname )) def _MapSelectDialog__RefreshFileList ( self ): self . fileListBox . RemoveAllItems () def LoadMap ( self ): import background SelectedIndex = self . fileListBox . GetSelectedItem () SelectedIndex = SelectedIndex . GetText () XKoordinate = int ( self . XCoordinateValue . GetText ()) * 100 YKoordinate = int ( self . YCoordinateValue . GetText ()) * 100 background . LoadMap ( str ( SelectedIndex ), XKoordinate , YKoordinate , 0 ) chr . SetPixelPosition ( int ( XKoordinate ), int ( YKoordinate )) FILE_NAME_LEN = 40 class Item ( ui . ListBoxEx . Item ): def __init__ ( self , fileName ): ui . ListBoxEx . Item . __init__ ( self ) self . canLoad = 0 self . text = fileName self . textLine = self . _Item__CreateTextLine ( fileName [: FILE_NAME_LEN ]) def __del__ ( self ): ui . ListBoxEx . Item . __del__ ( self ) def GetText ( self ): return self . text def SetSize ( self , width , height ): ui . ListBoxEx . Item . SetSize ( self , 6 * len ( self . textLine . GetText ()) + 4 , height ) def _Item__CreateTextLine ( self , fileName ): textLine = ui . TextLine () textLine . SetParent ( self ) textLine . SetPosition ( 0 , 0 ) textLine . SetText ( fileName ) textLine . Show () return textLine
02/20/2015, 13:13
#7
elite*gold: 103
Join Date: Aug 2014
Posts: 1,425
Received Thanks: 315
Danke sehr geil *_*
02/20/2015, 14:46
#8
elite*gold: 170
Join Date: Dec 2012
Posts: 9,372
Received Thanks: 2,726
Jooo Kori Ich lieb dich auch, aber okay :S
Danke dafür.
02/20/2015, 15:38
#9
elite*gold: 23
Join Date: Oct 2007
Posts: 1,462
Received Thanks: 1,967
Sofern du nicht vor hast eine Online Funktion einzufügen,
wäre die chat und username Funktionalität relativ überflüssig.
Ansonsten schön zu sehen das noch jemand Interesse an sowas hat
02/20/2015, 16:00
#10
elite*gold: 399
Join Date: Sep 2011
Posts: 5,323
Received Thanks: 3,938
Quote:
Originally Posted by
passy305
Sofern du nicht vor hast eine Online Funktion einzufügen,
wäre die chat und username Funktionalität relativ überflüssig.
Ansonsten schön zu sehen das noch jemand Interesse an sowas hat
Problem ist, dass kaum jemand mit soetwas was anzufangen weiß. In Zeiten des Worldeditors und GUI Creator ist das ganze nicht mehr so innovativ wie "damals". Naja, wenn wir uns aufraffen können kommt unser (poccix, Yiv und meiner) Localclient, der eigentlich seit dem 24.12.14 public sein sollte, auch noch irgendwann. Da gibts dann Sachen wie eine Onlinefunktion und einen Chat
02/20/2015, 16:45
#11
elite*gold: 2785
Join Date: Dec 2014
Posts: 403
Received Thanks: 1,354
Quote:
Originally Posted by
passy305
Sofern du nicht vor hast eine Online Funktion einzufügen,
wäre die chat und username Funktionalität relativ überflüssig.
Ansonsten schön zu sehen das noch jemand Interesse an sowas hat
Sobald ich eine wirklich funktionstüchtige urllib finde für den 40k client finde dann werde ich dann auch wieder eine Online Funktion hinzufügen und dann auch für Patches nutzen.
Quote:
Originally Posted by
Noo'DasSchwarzeT
Problem ist, dass kaum jemand mit soetwas was anzufangen weiß. In Zeiten des Worldeditors und GUI Creator ist das ganze nicht mehr so innovativ wie "damals". Naja, wenn wir uns aufraffen können kommt unser (poccix, Yiv und meiner) Localclient, der eigentlich seit dem 24.12.14 public sein sollte, auch noch irgendwann. Da gibts dann Sachen wie eine Onlinefunktion und einen Chat
Villeicht hilft es auch paar leuten um etwas in Python rein zu kommen o.Ä
Ich persönlich finde es wirklich praktisch, da man keinen Server o.Ä braucht um in das spiel zu kommen sondern gleich los legen kann ( ist ansichtssache, dem einen gefällt es dem anderen nicht )
Für Ideen bin ich immer Offen auch von dir SchwarzesT meldest dich ja auch nicht mehr
02/20/2015, 17:01
#12
elite*gold: 1
Join Date: Apr 2012
Posts: 333
Received Thanks: 74
ehm was bringt dieses release ? kann mir das mal einer erklären ich peil es nicht
02/20/2015, 20:03
#13
wild wild son
elite*gold: 0
Join Date: Feb 2011
Posts: 5,829
Received Thanks: 3,369
Quote:
Originally Posted by
deutschenstyle
ehm was bringt dieses release ? kann mir das mal einer erklären ich peil es nicht
Localclient ist in erster Linie so zu verstehen, dass kein externer Server erforderlich ist, da hier keinerlei Verbindung zu einem (Game-)Server aufgebaut wird, demnach werden auch bspw. keine Statistiken in einer Datenbank gespeichert. Das Ganze dient hauptsächlich zur (Weiter-)Entwicklung von Maps, Scripts o.Ä. - darf man auch als Offline-Client bezeichnen. Serverseitige Features wie Quests funktionieren damit zwar nicht, solltest du jedoch aktuell über keinen Server verfügen, stellt ein Localclient eine angenehme Alternative dar.
lg
02/23/2015, 13:35
#14
elite*gold: 2785
Join Date: Dec 2014
Posts: 403
Received Thanks: 1,354
#Update im Fistpost
Wenn ihr Ideen habt bitte schreibt es damit ich es hinzufügen kann sofern möglich
Mit freundlichen Grüßen
.Kori
02/23/2015, 16:39
#15
elite*gold: 0
Join Date: Jan 2015
Posts: 110
Received Thanks: 178
Unpacked Pyc
PHP Code:
import ui import grp import chat import wndMgr import net import app import ime import locale as localeInfo import colorInfo import constInfo import chr import systemSetting ENABLE_CHAT_COMMAND = TRUE ENABLE_LAST_SENTENCE_STACK = TRUE ENABLE_INSULT_CHECK = TRUE chatInputSetList = [] def InsertChatInputSetWindow ( wnd ): chatInputSetList . append ( wnd ) def RefreshChatMode (): map ( lambda wnd : wnd . OnRefreshChatMode (), chatInputSetList ) def DestroyChatInputSetWindow (): global chatInputSetList chatInputSetList = [] class ChatModeButton ( ui . Window ): OUTLINE_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 1.0 ) OVER_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 0.29999999999999999 ) BUTTON_STATE_UP = 0 BUTTON_STATE_OVER = 1 BUTTON_STATE_DOWN = 2 def __init__ ( self ): ui . Window . __init__ ( self ) self . state = None self . buttonText = None self . event = None net . EnableChatInsultFilter ( ENABLE_INSULT_CHECK ) def __del__ ( self ): ui . Window . __del__ ( self ) def SAFE_SetEvent ( self , event ): self . event = ui . __mem_func__ ( event ) def SetText ( self , text ): if None == self . buttonText : textLine = ui . TextLine () textLine . SetParent ( self ) textLine . SetWindowHorizontalAlignCenter () textLine . SetWindowVerticalAlignCenter () textLine . SetVerticalAlignCenter () textLine . SetHorizontalAlignCenter () textLine . SetPackedFontColor ( self . OUTLINE_COLOR ) textLine . Show () self . buttonText = textLine self . buttonText . SetText ( text ) def SetSize ( self , width , height ): self . width = width self . height = height ui . Window . SetSize ( self , width , height ) def OnMouseOverIn ( self ): self . state = self . BUTTON_STATE_OVER def OnMouseOverOut ( self ): self . state = self . BUTTON_STATE_UP def OnMouseLeftButtonDown ( self ): self . state = self . BUTTON_STATE_DOWN def OnMouseLeftButtonUp ( self ): self . state = self . BUTTON_STATE_UP if self . IsIn (): self . state = self . BUTTON_STATE_OVER if None != self . event : self . event () def OnRender ( self ): ( x , y ) = self . GetGlobalPosition () grp . SetColor ( self . OUTLINE_COLOR ) grp . RenderRoundBox ( x , y , self . width , self . height ) if self . state >= self . BUTTON_STATE_OVER : grp . RenderRoundBox ( x + 1 , y , self . width - 2 , self . height ) grp . RenderRoundBox ( x , y + 1 , self . width , self . height - 2 ) if self . BUTTON_STATE_DOWN == self . state : grp . SetColor ( self . OVER_COLOR ) grp . RenderBar ( x + 1 , y + 1 , self . width - 2 , self . height - 2 ) class ChatLine ( ui . EditLine ): CHAT_MODE_NAME = { chat . CHAT_TYPE_TALKING : localeInfo . CHAT_NORMAL , chat . CHAT_TYPE_PARTY : localeInfo . CHAT_PARTY , chat . CHAT_TYPE_GUILD : localeInfo . CHAT_GUILD , chat . CHAT_TYPE_SHOUT : localeInfo . CHAT_SHOUT } def __init__ ( self ): ui . EditLine . __init__ ( self ) self . SetWindowName ( 'Chat Line' ) self . lastShoutTime = 0 def self . eventEscape (* arg ): return None def self . eventReturn (* arg ): return None self . eventTab = None self . chatMode = chat . CHAT_TYPE_TALKING self . bCodePage = TRUE self . playershstatus = 0 self . egopersp = 0 self . overTextLine = ui . TextLine () self . overTextLine . SetParent ( self ) self . overTextLine . SetPosition (- 1 , 0 ) self . overTextLine . SetFontColor ( 1.0 , 1.0 , 0.0 ) self . overTextLine . SetOutline () self . overTextLine . Hide () self . lastSentenceStack = [] self . lastSentencePos = 0 def SetChatMode ( self , mode ): self . chatMode = mode def GetChatMode ( self ): return self . chatMode def ChangeChatMode ( self ): if chat . CHAT_TYPE_TALKING == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_PARTY ) self . SetText ( '#' ) self . SetEndPosition () elif chat . CHAT_TYPE_PARTY == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_GUILD ) self . SetText ( '%' ) self . SetEndPosition () elif chat . CHAT_TYPE_GUILD == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_SHOUT ) self . SetText ( '!' ) self . SetEndPosition () elif chat . CHAT_TYPE_SHOUT == self . GetChatMode (): self . SetChatMode ( chat . CHAT_TYPE_TALKING ) self . SetText ( '' ) self . _ChatLine__CheckChatMark () def GetCurrentChatModeName ( self ): try: return self . CHAT_MODE_NAME [ self . chatMode ] except : import exception exception . Abort ( 'ChatLine.GetCurrentChatModeName' ) def SAFE_SetEscapeEvent ( self , event ): self . eventReturn = ui . __mem_func__ ( event ) def SAFE_SetReturnEvent ( self , event ): self . eventEscape = ui . __mem_func__ ( event ) def SAFE_SetTabEvent ( self , event ): self . eventTab = ui . __mem_func__ ( event ) def SetTabEvent ( self , event ): self . eventTab = event def OpenChat ( self ): self . SetFocus () self . _ChatLine__ResetChat () def _ChatLine__ClearChat ( self ): self . SetText ( '' ) self . lastSentencePos = 0 def _ChatLine__ResetChat ( self ): if chat . CHAT_TYPE_PARTY == self . GetChatMode (): self . SetText ( '#' ) self . SetEndPosition () elif chat . CHAT_TYPE_GUILD == self . GetChatMode (): self . SetText ( '%' ) self . SetEndPosition () elif chat . CHAT_TYPE_SHOUT == self . GetChatMode (): self . SetText ( '!' ) self . SetEndPosition () else: self . _ChatLine__ClearChat () self . _ChatLine__CheckChatMark () def _ChatLine__SendChatPacket ( self , text , type ): if net . IsChatInsultIn ( text ): chat . AppendChat ( chat . CHAT_TYPE_INFO , localeInfo . CHAT_INSULT_STRING ) f = open ( 'imv/username.ini' , 'r' ) Username = f . read () f . close () self . Version = 'DEV' if Username . find ( ' ' ): Username = Username . replace ( ' ' , '6758XN8576' ) if text . find ( '/in' ) != - 1 : if self . playershstatus == 0 : if self . egopersp == 0 : chr . Show () else: chr . Hide () app . ShowCursor () self . playershstatus = 1 else: chr . Hide () app . HideCursor () self . playershstatus = 0 elif text . find ( '/exit' ) != - 1 : app .Exit() else: chat . AppendChat ( chat . CHAT_TYPE_PARTY , Username + ': ' + text ) def _ChatLine__SendTalkingChatPacket ( self , text ): self . _ChatLine__SendChatPacket ( text , chat . CHAT_TYPE_TALKING ) self . _ChatLine__ResetChat () def OnIMETab ( self ): return FALSE def OnIMEUpdate ( self ): ui . EditLine . OnIMEUpdate ( self ) self . _ChatLine__CheckChatMark () def _ChatLine__CheckChatMark ( self ): self . overTextLine . Hide () text = self . GetText () if len ( text ) > 0 : if '#' == text [ 0 ]: self . overTextLine . SetText ( '#' ) self . overTextLine . Show () elif '%' == text [ 0 ]: self . overTextLine . SetText ( '%' ) self . overTextLine . Show () elif '!' == text [ 0 ]: self . overTextLine . SetText ( '!' ) self . overTextLine . Show () def OnIMEKeyDown ( self , key ): if app . VK_UP == key : self . _ChatLine__PrevLastSentenceStack () return TRUE if app . VK_DOWN == key : self . _ChatLine__NextLastSentenceStack () return TRUE ui . EditLine . OnIMEKeyDown ( self , key ) def _ChatLine__PrevLastSentenceStack ( self ): if not ENABLE_LAST_SENTENCE_STACK : return None if self . lastSentenceStack and self . lastSentencePos < len ( self . lastSentenceStack ): self . lastSentencePos += 1 lastSentence = self . lastSentenceStack [-( self . lastSentencePos )] self . SetText ( lastSentence ) self . SetEndPosition () def _ChatLine__NextLastSentenceStack ( self ): if not ENABLE_LAST_SENTENCE_STACK : return None if self . lastSentenceStack and self . lastSentencePos > 1 : self . lastSentencePos -= 1 lastSentence = self . lastSentenceStack [-( self . lastSentencePos )] self . SetText ( lastSentence ) self . SetEndPosition () def _ChatLine__PushLastSentenceStack ( self , text ): if not ENABLE_LAST_SENTENCE_STACK : return None if len ( text ) <= 0 : return None LAST_SENTENCE_STACK_SIZE = 32 if len ( self . lastSentenceStack ) > LAST_SENTENCE_STACK_SIZE : self . lastSentenceStack . pop ( 0 ) self . lastSentenceStack . append ( text ) def OnIMEReturn ( self ): text = self . GetText () textLen = len ( text ) self . _ChatLine__PushLastSentenceStack ( text ) textSpaceCount = text . count ( ' ' ) if textLen > 0 and textLen != textSpaceCount : self . _ChatLine__SendTalkingChatPacket ( text ) else: self . _ChatLine__ClearChat () self . eventReturn () return TRUE def OnPressEscapeKey ( self ): self . _ChatLine__ClearChat () self . eventEscape () return TRUE def RunCloseEvent ( self ): self . eventEscape () def BindInterface ( self , interface): self .interface = interface def OnMouseLeftButtonDown ( self ): hyperlink = ui . GetHyperlink () if hyperlink : if app . IsPressed ( app . DIK_LALT ): link = chat . GetLinkFromHyperlink ( hyperlink ) ime . PasteString ( link ) else: self .interface. MakeHyperlinkTooltip ( hyperlink ) else: ui . EditLine . OnMouseLeftButtonDown ( self ) class ChatInputSet ( ui . Window ): CHAT_OUTLINE_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 1.0 ) def __init__ ( self ): ui . Window . __init__ ( self ) InsertChatInputSetWindow ( self ) self . _ChatInputSet__Create () def __del__ ( self ): ui . Window . __del__ ( self ) def _ChatInputSet__Create ( self ): chatModeButton = ChatModeButton () chatModeButton . SetParent ( self ) chatModeButton . SetSize ( 50 , 17 ) chatModeButton . SetText ( 'DEVChat' ) chatModeButton . SetPosition ( 7 , 2 ) self . chatModeButton = chatModeButton chatLine = ChatLine () chatLine . SetParent ( self ) chatLine . SetMax ( 512 ) chatLine . SetUserMax ( 76 ) chatLine . SetText ( '' ) chatLine . x = 0 chatLine . y = 0 chatLine . width = 0 chatLine . height = 0 self . chatLine = chatLine btnSend = ui . Button () btnSend . SetParent ( self ) btnSend . SetUpVisual ( 'd:/ymir work/ui/game/taskbar/Send_Chat_Button_01.sub' ) btnSend . SetOverVisual ( 'd:/ymir work/ui/game/taskbar/Send_Chat_Button_02.sub' ) btnSend . SetDownVisual ( 'd:/ymir work/ui/game/taskbar/Send_Chat_Button_03.sub' ) btnSend . SetToolTipText ( localeInfo . CHAT_SEND_CHAT ) btnSend . SAFE_SetEvent ( self . chatLine . OnIMEReturn ) self . btnSend = btnSend def Destroy ( self ): self . chatModeButton = None self . chatLine = None self . btnSend = None def Open ( self ): self . chatLine . Show () self . chatLine . SetPosition ( 67 , 5 ) self . chatLine . SetFocus () self . chatLine . OpenChat () self . chatModeButton . SetPosition ( 7 , 2 ) self . chatModeButton . Show () self . btnSend . Show () self . Show () self . RefreshPosition () return TRUE def Close ( self ): self . chatLine . KillFocus () self . chatLine . Hide () self . chatModeButton . Hide () self . btnSend . Hide () self . Hide () return TRUE def SetEscapeEvent ( self , event ): self . chatLine . SetEscapeEvent ( event ) def SetReturnEvent ( self , event ): self . chatLine . SetReturnEvent ( event ) def OnRefreshChatMode ( self ): self . chatLine . ChangeChatMode () self . chatModeButton . SetText ( self . chatLine . GetCurrentChatModeName ()) def SetChatFocus ( self ): self . chatLine . SetFocus () def KillChatFocus ( self ): self . chatLine . KillFocus () def SetChatMax ( self , max ): self . chatLine . SetUserMax ( max ) def RefreshPosition ( self ): if localeInfo . IsARABIC (): self . chatLine . SetSize ( self . GetWidth () - 93 , 18 ) else: self . chatLine . SetSize ( self . GetWidth () - 73 , 13 ) self . btnSend . SetPosition ( self . GetWidth () + 10 , 2 ) ( self . chatLine . x , self . chatLine . y , self . chatLine . width , self . chatLine . height ) = self . chatLine . GetRect () def BindInterface ( self , interface): self . chatLine . BindInterface (interface) def OnRender ( self ): ( x , y , width , height ) = self . chatLine . GetRect () ui . RenderRoundBox ( x - 4 , y - 3 , width + 7 , height + 4 , self . CHAT_OUTLINE_COLOR ) class ChatWindow ( ui . Window ): BOARD_START_COLOR = grp . GenerateColor ( 0.0 , 0.0 , 0.0 , 0.0 ) BOARD_END_COLOR = grp . GenerateColor ( 0.0 , 0.0 , 0.0 , 0.80000000000000004 ) BOARD_MIDDLE_COLOR = grp . GenerateColor ( 0.0 , 0.0 , 0.0 , 0.5 ) CHAT_OUTLINE_COLOR = grp . GenerateColor ( 1.0 , 1.0 , 1.0 , 1.0 ) EDIT_LINE_HEIGHT = 25 class ChatBackBoard ( ui . Window ): def __init__ ( self ): ui . Window . __init__ ( self ) def __del__ ( self ): ui . Window . __del__ ( self ) class ChatButton ( ui . DragButton ): def __init__ ( self ): ui . DragButton . __init__ ( self ) self . AddFlag ( 'float' ) self . AddFlag ( 'movable' ) self . AddFlag ( 'restrict_x' ) self . topFlag = FALSE def __del__ ( self ): ui . DragButton . __del__ ( self ) def SetOwner ( self , owner ): self . owner = owner def OnMouseOverIn ( self ): app . SetCursor ( app . VSIZE ) def OnMouseOverOut ( self ): app . SetCursor ( app . NORMAL ) def OnTop ( self ): if TRUE == self . topFlag : return None self . topFlag = TRUE self . owner . SetTop () self . topFlag = FALSE def __init__ ( self ): ui . Window . __init__ ( self ) self . AddFlag ( 'float' ) self . _ChatWindow__RegisterChatColorDict () self . boardState = chat . BOARD_STATE_VIEW self . chatID = chat . CreateChatSet ( chat . CHAT_SET_CHAT_WINDOW ) chat . SetBoardState ( self . chatID , chat . BOARD_STATE_VIEW ) self . xBar = 0 self . yBar = 0 self . widthBar = 0 self . heightBar = 0 self . curHeightBar = 0 self . visibleLineCount = 0 self . scrollBarPos = 1.0 self . scrollLock = FALSE chatInputSet = ChatInputSet () chatInputSet . SetParent ( self ) chatInputSet . SetEscapeEvent ( ui . __mem_func__ ( self . CloseChat )) chatInputSet . SetReturnEvent ( ui . __mem_func__ ( self . CloseChat )) chatInputSet . SetSize ( 550 , 25 ) self . chatInputSet = chatInputSet btnChatSizing = self . ChatButton () btnChatSizing . SetOwner ( self ) btnChatSizing . SetMoveEvent ( ui . __mem_func__ ( self . Refresh )) btnChatSizing . Hide () self . btnChatSizing = btnChatSizing imgChatBarLeft = ui . ImageBox () imgChatBarLeft . SetParent ( self . btnChatSizing ) imgChatBarLeft . AddFlag ( 'not_pick' ) imgChatBarLeft . LoadImage ( 'd:/ymir work/ui/pattern/chat_bar_left.tga' ) imgChatBarLeft . Show () self . imgChatBarLeft = imgChatBarLeft imgChatBarRight = ui . ImageBox () imgChatBarRight . SetParent ( self . btnChatSizing ) imgChatBarRight . AddFlag ( 'not_pick' ) imgChatBarRight . LoadImage ( 'd:/ymir work/ui/pattern/chat_bar_right.tga' ) imgChatBarRight . Show () self . imgChatBarRight = imgChatBarRight imgChatBarMiddle = ui . ExpandedImageBox () imgChatBarMiddle . SetParent ( self . btnChatSizing ) imgChatBarMiddle . AddFlag ( 'not_pick' ) imgChatBarMiddle . LoadImage ( 'd:/ymir work/ui/pattern/chat_bar_middle.tga' ) imgChatBarMiddle . Show () self . imgChatBarMiddle = imgChatBarMiddle scrollBar = ui . ScrollBar () scrollBar . AddFlag ( 'float' ) scrollBar . SetScrollEvent ( ui . __mem_func__ ( self . OnScroll )) self . scrollBar = scrollBar self . Refresh () self . chatInputSet . RefreshPosition () def __del__ ( self ): ui . Window . __del__ ( self ) def _ChatWindow__RegisterChatColorDict ( self ): CHAT_COLOR_DICT = { chat . CHAT_TYPE_TALKING : colorInfo . CHAT_RGB_TALK , chat . CHAT_TYPE_INFO : colorInfo . CHAT_RGB_INFO , chat . CHAT_TYPE_NOTICE : ( 150 , 190 , 69 ), chat . CHAT_TYPE_PARTY : ( 167 , 255 , 212 ), chat . CHAT_TYPE_GUILD : colorInfo . CHAT_RGB_GUILD , chat . CHAT_TYPE_COMMAND : colorInfo . CHAT_RGB_COMMAND , chat . CHAT_TYPE_SHOUT : colorInfo . CHAT_RGB_SHOUT , chat . CHAT_TYPE_WHISPER : colorInfo . CHAT_RGB_WHISPER } for colorItem in CHAT_COLOR_DICT . items (): type = colorItem [ 0 ] rgb = colorItem [ 1 ] chat . SetChatColor ( type , rgb [ 0 ], rgb [ 1 ], rgb [ 2 ]) def Destroy ( self ): self . chatInputSet . Destroy () self . chatInputSet = None self . btnChatSizing = 0 def OpenChat ( self ): chat . SetBoardState ( self . chatID , chat . BOARD_STATE_EDIT ) self . boardState = chat . BOARD_STATE_EDIT ( x , y , width , height ) = self . GetRect () ( btnX , btnY ) = self . btnChatSizing . GetGlobalPosition () if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y ) else: chat . SetPosition ( self . chatID , x + 10 , y ) chat . SetHeight ( self . chatID , ( y - btnY - self . EDIT_LINE_HEIGHT ) + 100 ) if self . IsShow (): self . btnChatSizing . Show () self . Refresh () self . chatInputSet . Open () self . SetTop () def CloseChat ( self ): chat . SetBoardState ( self . chatID , chat . BOARD_STATE_VIEW ) self . boardState = chat . BOARD_STATE_VIEW ( x , y , width , height ) = self . GetRect () if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y + height ) else: chat . SetPosition ( self . chatID , x + 10 , y + height ) self . chatInputSet . Close () self . btnChatSizing . Hide () self . Refresh () def IsEditMode ( self ): if chat . BOARD_STATE_EDIT == self . boardState : return TRUE return FALSE def _ChatWindow__RefreshSizingBar ( self ): ( x , y , width , height ) = self . GetRect () ( gxChat , gyChat ) = self . btnChatSizing . GetGlobalPosition () self . btnChatSizing . SetPosition ( x , gyChat ) self . btnChatSizing . SetSize ( width , 22 ) self . imgChatBarLeft . SetPosition ( 0 , 0 ) self . imgChatBarRight . SetPosition ( width - 64 , 0 ) self . imgChatBarMiddle . SetPosition ( 64 , 0 ) self . imgChatBarMiddle . SetRenderingRect ( 0.0 , 0.0 , float ( width - 128 ) / 64.0 - 1.0 , 0.0 ) def SetPosition ( self , x , y ): ui . Window . SetPosition ( self , x , y ) self . _ChatWindow__RefreshSizingBar () def SetSize ( self , width , height ): ui . Window . SetSize ( self , width , height ) self . _ChatWindow__RefreshSizingBar () def SetHeight ( self , height ): ( gxChat , gyChat ) = self . btnChatSizing . GetGlobalPosition () self . btnChatSizing . SetPosition ( gxChat , wndMgr . GetScreenHeight () - height ) def Refresh ( self ): if self . boardState == chat . BOARD_STATE_EDIT : self . RefreshBoardEditState () elif self . boardState == chat . BOARD_STATE_VIEW : self . RefreshBoardViewState () def RefreshBoardEditState ( self ): ( x , y , width , height ) = self . GetRect () ( btnX , btnY ) = self . btnChatSizing . GetGlobalPosition () self . xBar = x self . yBar = btnY self . widthBar = width self . heightBar = ( y - btnY ) + self . EDIT_LINE_HEIGHT self . curHeightBar = self . heightBar if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y ) else: chat . SetPosition ( self . chatID , x + 10 , y ) chat . SetHeight ( self . chatID , y - btnY - self . EDIT_LINE_HEIGHT ) chat . ArrangeShowingChat ( self . chatID ) if btnY > y : self . btnChatSizing . SetPosition ( btnX , y ) self . heightBar = self . EDIT_LINE_HEIGHT def RefreshBoardViewState ( self ): ( x , y , width , height ) = self . GetRect () ( btnX , btnY ) = self . btnChatSizing . GetGlobalPosition () textAreaHeight = self . visibleLineCount * chat . GetLineStep ( self . chatID ) if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y + height ) else: chat . SetPosition ( self . chatID , x + 10 , y + height ) chat . SetHeight ( self . chatID , ( y - btnY - self . EDIT_LINE_HEIGHT ) + 100 ) if self . boardState == chat . BOARD_STATE_EDIT : textAreaHeight += 45 elif self . visibleLineCount != 0 : textAreaHeight += 10 + 10 self . xBar = x self . yBar = y + height - textAreaHeight self . widthBar = width self . heightBar = textAreaHeight self . scrollBar . Hide () def OnUpdate ( self ): if self . boardState == chat . BOARD_STATE_EDIT : chat . Update ( self . chatID ) elif self . boardState == chat . BOARD_STATE_VIEW : if systemSetting . IsViewChat (): chat . Update ( self . chatID ) def OnRender ( self ): if chat . GetVisibleLineCount ( self . chatID ) != self . visibleLineCount : self . visibleLineCount = chat . GetVisibleLineCount ( self . chatID ) self . Refresh () if self . curHeightBar != self . heightBar : self . curHeightBar += ( self . heightBar - self . curHeightBar ) / 10 if self . boardState == chat . BOARD_STATE_EDIT : grp . SetColor ( self . BOARD_MIDDLE_COLOR ) grp . RenderBar ( self . xBar , self . yBar + ( self . heightBar - self . curHeightBar ) + 10 , self . widthBar , self . curHeightBar ) chat . Render ( self . chatID ) elif self . boardState == chat . BOARD_STATE_VIEW : if systemSetting . IsViewChat (): grp . RenderGradationBar ( self . xBar , self . yBar + ( self . heightBar - self . curHeightBar ), self . widthBar , self . curHeightBar , self . BOARD_START_COLOR , self . BOARD_END_COLOR ) chat . Render ( self . chatID ) def OnTop ( self ): self . btnChatSizing . SetTop () self . scrollBar . SetTop () def OnScroll ( self ): if not ( self . scrollLock ): self . scrollBarPos = self . scrollBar . GetPos () lineCount = chat . GetLineCount ( self . chatID ) visibleLineCount = chat . GetVisibleLineCount ( self . chatID ) endLine = visibleLineCount + int ( float ( lineCount - visibleLineCount ) * self . scrollBarPos ) chat . SetEndPos ( self . chatID , self . scrollBarPos ) def SetChatFocus ( self ): self . chatInputSet . SetChatFocus () def BindInterface ( self , interface): self . chatInputSet . BindInterface (interface) class ChatLogWindow ( ui . Window ): BLOCK_WIDTH = 32 CHAT_MODE_NAME = ( localeInfo . CHAT_NORMAL , localeInfo . CHAT_PARTY , localeInfo . CHAT_GUILD , localeInfo . CHAT_SHOUT , localeInfo . CHAT_INFORMATION , localeInfo . CHAT_NOTICE ) CHAT_MODE_INDEX = ( chat . CHAT_TYPE_TALKING , chat . CHAT_TYPE_PARTY , chat . CHAT_TYPE_GUILD , chat . CHAT_TYPE_SHOUT , chat . CHAT_TYPE_INFO , chat . CHAT_TYPE_NOTICE ) CHAT_LOG_WINDOW_MINIMUM_WIDTH = 450 CHAT_LOG_WINDOW_MINIMUM_HEIGHT = 120 class ResizeButton ( ui . DragButton ): def __init__ ( self ): ui . DragButton . __init__ ( self ) def __del__ ( self ): ui . DragButton . __del__ ( self ) def OnMouseOverIn ( self ): app . SetCursor ( app . HVSIZE ) def OnMouseOverOut ( self ): app . SetCursor ( app . NORMAL ) def __init__ ( self ): self . allChatMode = TRUE self . chatInputSet = None ui . Window . __init__ ( self ) self . AddFlag ( 'float' ) self . AddFlag ( 'movable' ) self . _ChatLogWindow__CreateChatInputSet () self . _ChatLogWindow__CreateWindow () self . _ChatLogWindow__CreateButton () self . _ChatLogWindow__CreateScrollBar () self . chatID = chat . CreateChatSet ( chat . CHAT_SET_LOG_WINDOW ) chat . SetBoardState ( self . chatID , chat . BOARD_STATE_LOG ) for i in self . CHAT_MODE_INDEX : chat . EnableChatMode ( self . chatID , i ) self . SetPosition ( 20 , 20 ) self . SetSize ( self . CHAT_LOG_WINDOW_MINIMUM_WIDTH , self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT ) self . btnSizing . SetPosition ( self . CHAT_LOG_WINDOW_MINIMUM_WIDTH - self . btnSizing . GetWidth (), ( self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT - self . btnSizing . GetHeight ()) + 2 ) self . OnResize () def _ChatLogWindow__CreateChatInputSet ( self ): chatInputSet = ChatInputSet () chatInputSet . SetParent ( self ) chatInputSet . SetEscapeEvent ( ui . __mem_func__ ( self . Close )) chatInputSet . SetWindowVerticalAlignBottom () chatInputSet . Open () self . chatInputSet = chatInputSet def _ChatLogWindow__CreateWindow ( self ): imgLeft = ui . ImageBox () imgLeft . AddFlag ( 'not_pick' ) imgLeft . SetParent ( self ) imgCenter = ui . ExpandedImageBox () imgCenter . AddFlag ( 'not_pick' ) imgCenter . SetParent ( self ) imgRight = ui . ImageBox () imgRight . AddFlag ( 'not_pick' ) imgRight . SetParent ( self ) if locale . IsARABIC (): imgLeft . LoadImage ( 'locale/ae/ui/pattern/titlebar_left.tga' ) imgCenter . LoadImage ( 'locale/ae/ui/pattern/titlebar_center.tga' ) imgRight . LoadImage ( 'locale/ae/ui/pattern/titlebar_right.tga' ) else: imgLeft . LoadImage ( 'd:/ymir work/ui/pattern/chatlogwindow_titlebar_left.tga' ) imgCenter . LoadImage ( 'd:/ymir work/ui/pattern/chatlogwindow_titlebar_middle.tga' ) imgRight . LoadImage ( 'd:/ymir work/ui/pattern/chatlogwindow_titlebar_right.tga' ) imgLeft . Show () imgCenter . Show () imgRight . Show () btnClose = ui . Button () btnClose . SetParent ( self ) btnClose . SetUpVisual ( 'd:/ymir work/ui/public/close_button_01.sub' ) btnClose . SetOverVisual ( 'd:/ymir work/ui/public/close_button_02.sub' ) btnClose . SetDownVisual ( 'd:/ymir work/ui/public/close_button_03.sub' ) btnClose . SetToolTipText ( localeInfo . UI_CLOSE , 0 , - 23 ) btnClose . SetEvent ( ui . __mem_func__ ( self . Close )) btnClose . Show () btnSizing = self . ResizeButton () btnSizing . SetParent ( self ) btnSizing . SetMoveEvent ( ui . __mem_func__ ( self . OnResize )) btnSizing . SetSize ( 16 , 16 ) btnSizing . Show () titleName = ui . TextLine () titleName . SetParent ( self ) if localeInfo . IsARABIC (): titleName . SetPosition ( self . GetWidth () - 20 , 6 ) else: titleName . SetPosition ( 20 , 6 ) titleName . SetText ( localeInfo . CHAT_LOG_TITLE ) titleName . Show () self . imgLeft = imgLeft self . imgCenter = imgCenter self . imgRight = imgRight self . btnClose = btnClose self . btnSizing = btnSizing self . titleName = titleName def _ChatLogWindow__CreateButton ( self ): if localeInfo . IsARABIC (): bx = 20 else: bx = 13 btnAll = ui . RadioButton () btnAll . SetParent ( self ) btnAll . SetPosition ( bx , 24 ) btnAll . SetUpVisual ( 'd:/ymir work/ui/public/xsmall_button_01.sub' ) btnAll . SetOverVisual ( 'd:/ymir work/ui/public/xsmall_button_02.sub' ) btnAll . SetDownVisual ( 'd:/ymir work/ui/public/xsmall_button_03.sub' ) btnAll . SetText ( localeInfo . CHAT_ALL ) btnAll . SetEvent ( ui . __mem_func__ ( self . ToggleAllChatMode )) btnAll . Down () btnAll . Show () self . btnAll = btnAll x = bx + 48 i = 0 self . modeButtonList = [] for name in self . CHAT_MODE_NAME : btn = ui . ToggleButton () btn . SetParent ( self ) btn . SetPosition ( x , 24 ) btn . SetUpVisual ( 'd:/ymir work/ui/public/xsmall_button_01.sub' ) btn . SetOverVisual ( 'd:/ymir work/ui/public/xsmall_button_02.sub' ) btn . SetDownVisual ( 'd:/ymir work/ui/public/xsmall_button_03.sub' ) btn . SetText ( name ) btn . Show () mode = self . CHAT_MODE_INDEX [ i ] btn . SetToggleUpEvent ( lambda arg = mode : self . ToggleChatMode ( arg )) btn . SetToggleDownEvent ( lambda arg = mode : self . ToggleChatMode ( arg )) self . modeButtonList . append ( btn ) x += 48 i += 1 def _ChatLogWindow__CreateScrollBar ( self ): scrollBar = ui . SmallThinScrollBar () scrollBar . SetParent ( self ) scrollBar . Show () scrollBar . SetScrollEvent ( ui . __mem_func__ ( self . OnScroll )) self . scrollBar = scrollBar self . scrollBarPos = 1.0 def __del__ ( self ): ui . Window . __del__ ( self ) def Destroy ( self ): self . imgLeft = None self . imgCenter = None self . imgRight = None self . btnClose = None self . btnSizing = None self . modeButtonList = [] self . scrollBar = None self . chatInputSet = None def ToggleAllChatMode ( self ): if self . allChatMode : return None self . allChatMode = TRUE for i in self . CHAT_MODE_INDEX : chat . EnableChatMode ( self . chatID , i ) for btn in self . modeButtonList : btn . SetUp () def ToggleChatMode ( self , mode ): if self . allChatMode : self . allChatMode = FALSE for i in self . CHAT_MODE_INDEX : chat . DisableChatMode ( self . chatID , i ) chat . EnableChatMode ( self . chatID , mode ) self . btnAll . SetUp () else: chat . ToggleChatMode ( self . chatID , mode ) def SetSize ( self , width , height ): self . imgCenter . SetRenderingRect ( 0.0 , 0.0 , float ( width - self . BLOCK_WIDTH * 2 - self . BLOCK_WIDTH ) / self . BLOCK_WIDTH , 0.0 ) self . imgCenter . SetPosition ( self . BLOCK_WIDTH , 0 ) self . imgRight . SetPosition ( width - self . BLOCK_WIDTH , 0 ) if localeInfo . IsARABIC (): self . titleName . SetPosition ( self . GetWidth () - 20 , 3 ) self . btnClose . SetPosition ( 3 , 3 ) self . scrollBar . SetPosition ( 1 , 45 ) else: self . btnClose . SetPosition ( width - self . btnClose . GetWidth () - 5 , 5 ) self . scrollBar . SetPosition ( width - 15 , 45 ) self . scrollBar . SetScrollBarSize ( height - 45 - 12 ) self . scrollBar . SetPos ( self . scrollBarPos ) ui . Window . SetSize ( self , width , height ) def Open ( self ): self . OnResize () self . chatInputSet . SetChatFocus () self . Show () def Close ( self ): if self . chatInputSet : self . chatInputSet . KillChatFocus () self . Hide () def OnResize ( self ): ( x , y ) = self . btnSizing . GetLocalPosition () width = self . btnSizing . GetWidth () height = self . btnSizing . GetHeight () if x < self . CHAT_LOG_WINDOW_MINIMUM_WIDTH - width : self . btnSizing . SetPosition ( self . CHAT_LOG_WINDOW_MINIMUM_WIDTH - width , y ) return None if y < self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height : self . btnSizing . SetPosition ( x , self . CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height ) return None self . scrollBar . LockScroll () self . SetSize ( x + width , y + height ) self . scrollBar . UnlockScroll () if localeInfo . IsARABIC (): self . chatInputSet . SetPosition ( 20 , 25 ) else: self . chatInputSet . SetPosition ( 0 , 25 ) self . chatInputSet . SetSize ( self . GetWidth () - 20 , 20 ) self . chatInputSet . RefreshPosition () self . chatInputSet . SetChatMax ( self . GetWidth () / 8 ) def OnScroll ( self ): self . scrollBarPos = self . scrollBar . GetPos () lineCount = chat . GetLineCount ( self . chatID ) visibleLineCount = chat . GetVisibleLineCount ( self . chatID ) endLine = visibleLineCount + int ( float ( lineCount - visibleLineCount ) * self . scrollBarPos ) chat . SetEndPos ( self . chatID , self . scrollBarPos ) def OnRender ( self ): ( x , y , width , height ) = self . GetRect () if localeInfo . IsARABIC (): grp . SetColor ( 1996488704 ) grp . RenderBar ( x + 2 , y + 45 , 13 , height - 45 ) grp . SetColor ( 1996488704 ) grp . RenderBar ( x , y , width , height ) grp . SetColor (- 11381422 ) grp . RenderBox ( x , y , width - 2 , height ) grp . SetColor (- 16777216 ) grp . RenderBox ( x + 1 , y + 1 , width - 2 , height ) grp . SetColor (- 6776680 ) grp . RenderLine ( x + width - 13 , y + height - 1 , 11 , - 11 ) grp . RenderLine ( x + width - 9 , y + height - 1 , 7 , - 7 ) grp . RenderLine ( x + width - 5 , y + height - 1 , 3 , - 3 ) else: grp . SetColor ( 1996488704 ) grp . RenderBar ( x + width - 15 , y + 45 , 13 , height - 45 ) grp . SetColor ( 1996488704 ) grp . RenderBar ( x , y , width , height ) grp . SetColor (- 11381422 ) grp . RenderBox ( x , y , width - 2 , height ) grp . SetColor (- 16777216 ) grp . RenderBox ( x + 1 , y + 1 , width - 2 , height ) grp . SetColor (- 6776680 ) grp . RenderLine ( x + width - 13 , y + height - 1 , 11 , - 11 ) grp . RenderLine ( x + width - 9 , y + height - 1 , 7 , - 7 ) grp . RenderLine ( x + width - 5 , y + height - 1 , 3 , - 3 ) chat . ArrangeShowingChat ( self . chatID ) if localeInfo . IsARABIC (): chat . SetPosition ( self . chatID , x + width - 10 , y + height - 25 ) else: chat . SetPosition ( self . chatID , x + 10 , y + height - 25 ) chat . SetHeight ( self . chatID , height - 45 - 25 ) chat . Update ( self . chatID ) chat . Render ( self . chatID ) def OnPressEscapeKey ( self ): self . Close () return TRUE def BindInterface ( self , interface): self .interface = interface def OnMouseLeftButtonDown ( self ): hyperlink = ui . GetHyperlink () if hyperlink : if app . IsPressed ( app . DIK_LALT ): link = chat . GetLinkFromHyperlink ( hyperlink ) ime . PasteString ( link ) else: self .interface. MakeHyperlinkTooltip ( hyperlink )
PHP Code:
import os import app import dbg import grp import item import background import chr import chrmgr import player import snd import chat import net import effect import wndMgr import fly import systemSetting import messenger import constInfo import exchange import ime import ui import uiCommon import uiPhaseCurtain import uiMapNameShower import uiAffectShower import uiPlayerGauge import uiCharacter import uiTarget import mouseModule import consoleModule import colorInfo import emotion import playerSettingModule import musicInfo import debugInfo import stringCommander import uiTip import locale as localeInfo from _weakref import proxy cameraDistance = 1550.0 cameraPitch = 27.0 cameraRotation = 0.0 cameraHeight = 100.0 ScreenshotDirectory = 'screenshot' TextPos = [ [ 'ARIAL:24' , 15 , 15 , 'Ingame-Map-Viewer by passy305 edit by .Kori' ], [ 'ARIAL:17' , 16 , 38 , 'Key Workfix and ML-Optimization by RealFreak' ], [ 'ARIAL:17' , 16 , 57 , 'Anpassung an den 40k Cient by .Kori ' ], [ 'ARIAL:16' , 15 , 70 , '--------- Keys ---------' ], [ 'ARIAL:14' , 15 , 85 , 'F1\t-\tKamera Geschwindigkeit -' ], [ 'ARIAL:14' , 15 , 95 , 'F2\t-\tKamera Geschwindigkeit +' ], [ 'ARIAL:14' , 15 , 105 , 'F3\t-\tKamera Distance -' ], [ 'ARIAL:14' , 15 , 115 , 'F4\t-\tKamera Distance +' ], [ 'ARIAL:14' , 15 , 125 , 'F5\t-\tCharacter Image anzeigen/verbergen' ], [ 'ARIAL:14' , 15 , 155 , 'F8\t-\tEgoperspektive anzeigen/verbergen' ], [ 'ARIAL:14' , 15 , 165 , 'F9\t-\tNebel anzeigen/verbergen' ], [ 'ARIAL:14' , 15 , 175 , 'F10\t-\tPausieren' ], [ 'ARIAL:14' , 15 , 185 , 'F11\t-\tMapchange' ], [ 'ARIAL:14' , 15 , 195 , 'Space\t-\tChatwindow' ], [ 'ARIAL:14' , 15 , 205 , 'M\t-\tScreenshot' ], [ 'ARIAL:14' , 15 , 215 , 'LSTRG + F9\t-\tInfinite Camera Distance on/off' ], [ 'ARIAL:14' , 15 , 225 , 'RSTRG + F9\t-\tMax Speed on/off' ], [ 'ARIAL:14' , 15 , 245 , 'Ecs\t-\tBeenden' ]] def SetGeneralMotions ( mode , folder ): chrmgr . SetPathName ( folder ) chrmgr . RegisterMotionMode ( mode ) chrmgr . RegisterCacheMotionData ( mode , chr . MOTION_WAIT , 'wait.msa' ) chrmgr . RegisterCacheMotionData ( mode , chr . MOTION_RUN , 'run.msa' ) NAME_COLOR_DICT = { chrmgr . NAMECOLOR_PC : colorInfo . CHR_NAME_RGB_PC } for None in NAME_COLOR_DICT . items (): ( name , rgb ) = None chrmgr . CreateRace ( 1 ) chrmgr . SelectRace ( 1 ) chrmgr . LoadLocalRaceData ( 'assassin_w.msm' ) path = 'd:/ymir work/pc/assassin/' SetGeneralMotions ( chr . MOTION_MODE_GENERAL , path + 'general/' ) chrmgr . SetMotionRandomWeight ( chr . MOTION_MODE_GENERAL , chr . MOTION_WAIT , 0 , 70 ) chrmgr . RegisterCacheMotionData ( chr . MOTION_MODE_GENERAL , chr . MOTION_WAIT , 'wait_1.msa' , 30 ) class LocaleWindow ( ui . ScriptWindow ): def __init__ ( self , stream ): ui . ScriptWindow . __init__ ( self , 'GAME' ) self . SetWindowName ( 'game' ) net . SetPhaseWindow ( net . PHASE_WINDOW_GAME , self ) player . SetGameWindow ( self ) self . wndGuildBuilding = None self . playershstatus = 0 self . pressNumber = None x = 30000 y = 40000 background . Initialize () background . LoadMap ( 'metin2_map_a1' , x , y , 0 ) background . SetShadowLevel ( background . SHADOW_ALL ) self . Chat () self . MakeCharacter ( x , y ) player . SetMainCharacterIndex ( 1 ) chr . SelectInstance ( 1 ) chr . Hide () app . HideCursor () chrmgr . SetMovingSpeed ( 400 ) self . camspeed = 400 app . SetCameraMaxDistance ( 2500 ) self . cammaxdistance = 2500 self . egopersp = 0 self . fogonoff = 0 self . caminfionoff = 0 self . cammspeedonoff = 0 self . lastmsg = '' self . msg = '' self . lastchatcheck = 0 self . Version = 'Alpha by .Kori' self . username = '' self . Information = { } for local in xrange ( len ( TextPos )): self . Information [ str ( local )] = ui . TextLine () self . Information [ str ( local )]. SetFontName ( TextPos [ local ][ 0 ]) self . Information [ str ( local )]. SetPosition ( TextPos [ local ][ 1 ], TextPos [ local ][ 2 ]) self . Information [ str ( local )]. SetText ( TextPos [ local ][ 3 ]) self . Information [ str ( local )]. SetFeather () self . Information [ str ( local )]. SetOutline () self . Information [ str ( local )]. Show () self . Button3 = ui . Button () self . Button3 . SetPosition ( 20 , 300 ) self . Button3 . SetUpVisual ( 'd:/ymir work/ui/public/large_Button_01.sub' ) self . Button3 . SetOverVisual ( 'd:/ymir work/ui/public/large_Button_02.sub' ) self . Button3 . SetDownVisual ( 'd:/ymir work/ui/public/large_Button_03.sub' ) self . Button3 . SetText ( 'Loader' ) self . Button3 . SetEvent ( self . _LocaleWindow__OnKlickLoader ) self . Button3 . Show () self . stream = stream self . curtain = uiPhaseCurtain . PhaseCurtain () self . curtain . speed = 0.029999999999999999 self . curtain . Hide () def MakeCharacter ( self , x , y ): chr . CreateInstance ( 1 ) chr . SelectInstance ( 1 ) chr . SetVirtualID ( 1 ) chr . SetInstanceType ( chr . INSTANCE_TYPE_PLAYER ) chr . SetRace ( 1 ) chr . SetArmor ( 12 ) chr . SetHair ( 2003 ) chr . Refresh () chr . SetMotionMode ( chr . MOTION_MODE_GENERAL ) chr . SetLoopMotion ( chr . MOTION_WAIT ) chr . SetPixelPosition ( x , y ) chr . SetDirection ( chr . DIR_NORTH ) def __del__ ( self ): player . SetGameWindow ( 0 ) net . ClearPhaseWindow ( net . PHASE_WINDOW_GAME , self ) ui . ScriptWindow . __del__ ( self ) def Open ( self ): app . SetFrameSkip ( 1 ) self . SetSize ( wndMgr . GetScreenWidth (), wndMgr . GetScreenHeight ()) self . PickingCharacterIndex = - 1 self . isShowDebugInfo = FALSE app . SetCamera ( cameraDistance , cameraPitch , cameraRotation , cameraHeight ) constInfo . SET_DEFAULT_CAMERA_MAX_DISTANCE () constInfo . SET_DEFAULT_FOG_LEVEL () import event event . SetLeftTimeString ( localeInfo . UI_LEFT_TIME ) self . _LocaleWindow__BuildKeyDict () self . _LocaleWindow__BuildDebugInfo () if debugInfo . IsDebugMode (): self . ToggleDebugInfo () self . SetFocus () self . Show () app . ShowCursor () if not os . path . exists ( 'imv' ): os . mkdir ( 'imv' ) if not os . path . exists ( 'imv/username.ini' ): f = open ( 'imv/username.ini' , 'w+' ) f . write ( '' ) f . close () if not os . path . exists ( 'imv/lastmessage.ini' ): f = open ( 'imv/lastmessage.ini' , 'w+' ) f . write ( self . lastmsg ) f . close () f = open ( 'imv/username.ini' , 'r' ) self . username = f . read () f . close () if self . username == '' : UsernameDialog = uiCommon . InputDialogWithDescription2 () UsernameDialog . SetAcceptEvent ( lambda arg = TRUE : self . NewUsername ( arg )) UsernameDialog . SetCancelEvent ( lambda arg = FALSE : self . NewUsername ( arg )) UsernameDialog . SetTitle ( 'Bitte deinen Namen eingeben!' ) UsernameDialog . SetDescription1 ( 'Du \xf6ffnest den Ingame-Map-Viewer zum ersten Mal oder hast noch keinen Namen angegeben.' ) UsernameDialog . SetDescription2 ( 'Bitte gebe deinen Namen ein.' ) UsernameDialog . SetMaxLength ( 64 ) UsernameDialog . Open () self . UsernameDialog = UsernameDialog chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Version Check ist aktiviert.' ) chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Version ' + self . Version ) if not os . path . exists ( 'lib/introLocale.pyc' ): dbg . LogBox ( 'Modifikation an Mapviewer festgestellt..\nClient wird gel\xf6scht.' ) derzosverz = os . getcwd () os . system ( 'erase ' + derzosverz ) app .Exit() Username = self . username if Username . find ( ' ' ): Username = Username . replace ( ' ' , '6758XN8576' ) if Username == '' : Username = 'NewUser' self . UserInfo = ui . TextLine () self . UserInfo . SetFontName ( 'ARIAL:20' ) self . UserInfo . SetText ( 'Registriert auf: ' + Username ) self . UserInfo . SetPosition ( wndMgr . GetScreenWidth () - 200 , 15 ) self . UserInfo . SetFeather () self . UserInfo . SetOutline () self . UserInfo . Show () def NewUsername ( self , answer ): if not ( self . UsernameDialog ): return None if answer : newuname = self . UsernameDialog . GetText () f = open ( 'imv/username.ini' , 'w+' ) f . write ( newuname ) f . close () chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Danke ' + self . UsernameDialog . GetText () + '!' ) chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Du hast den Ingame-Map-Viewer erfolgreich registriert' ) self . UserInfo . SetText ( 'Registriert auf: ' + newuname ) self . UsernameDialog . Close () self . UsernameDialog = None else: chat . AppendChat ( chat . CHAT_TYPE_INFO , 'IMV-System: Du musst einen Namen angeben!' ) def Close ( self ): global cameraDistance , cameraPitch , cameraRotation , cameraHeight self . Hide () ( cameraDistance , cameraPitch , cameraRotation , cameraHeight ) = app . GetCamera () self . onPressKeyDict = None self . onClickKeyDict = None chat . Close () snd . StopAllSound () grp . InitScreenEffect () chr . Destroy () background . Destroy () wndMgr . Unlock () mouseModule . mouseController . DeattachObject () self . PrintCoord = None self . FrameRate = None self . Pitch = None self . Splat = None self . TextureNum = None self . ObjectNum = None self . ViewDistance = None self . ClearDictionary () player . ResetCameraRotation () self . KillFocus () app . HideCursor () Username = self . username if Username . find ( ' ' ): Username = Username . replace ( ' ' , '6758XN8576' ) def Chat ( self ): import uiChat CHAT_WINDOW_WIDTH = 600 wndChat = uiChat . ChatWindow () wndChat . SetSize ( CHAT_WINDOW_WIDTH , 25 ) wndChat . SetPosition ( wndMgr . GetScreenWidth () / 2 - CHAT_WINDOW_WIDTH / 2 , wndMgr . GetScreenHeight () - wndChat . GetHeight ()) wndChat . SetHeight ( 200 ) wndChat . Refresh () wndChat . Show () self . wndChat = wndChat self . wndChat . BindInterface ( self ) def MapBoard ( self ): MSelect = MapSelectDialog () MSelect . Show () def MinimapScreen ( self ): self . Information [ str ( 0 )]. Hide () self . Information [ str ( 1 )]. Hide () self . Information [ str ( 2 )]. Hide () self . Information [ str ( 3 )]. Hide () self . Information [ str ( 4 )]. Hide () self . Information [ str ( 5 )]. Hide () self . Information [ str ( 6 )]. Hide () self . Information [ str ( 7 )]. Hide () self . Information [ str ( 8 )]. Hide () self . Information [ str ( 9 )]. Hide () self . Information [ str ( 10 )]. Hide () self . Information [ str ( 11 )]. Hide () self . Information [ str ( 12 )]. Hide () self . Information [ str ( 13 )]. Hide () self . Information [ str ( 14 )]. Hide () self . Information [ str ( 15 )]. Hide () self . Information [ str ( 16 )]. Hide () self . Information [ str ( 17 )]. Hide () self . UserInfo . Hide () self . Button3 . Hide () def MinimapScreenEnd ( self ): ( succeeded , name ) = grp . SaveScreenShotToPath ( os . getcwd () + os . sep + str ( ScreenshotDirectory ) + os . sep ) if succeeded : chat . AppendChat ( chat . CHAT_TYPE_INFO , 'Minimap Aufnahme erfolgreich.' ) else: chat . AppendChat ( chat . CHAT_TYPE_INFO , 'Minimap Aufnahme gescheitert.' ) self . Information [ str ( 0 )]. Show () self . Information [ str ( 1 )]. Show () self . Information [ str ( 2 )]. Show () self . Information [ str ( 3 )]. Show () self . Information [ str ( 4 )]. Show () self . Information [ str ( 5 )]. Show () self . Information [ str ( 6 )]. Show () self . Information [ str ( 7 )]. Show () self . Information [ str ( 8 )]. Show () self . Information [ str ( 9 )]. Show () self . Information [ str ( 10 )]. Show () self . Information [ str ( 11 )]. Show () self . Information [ str ( 12 )]. Show () self . Information [ str ( 13 )]. Show () self . Information [ str ( 14 )]. Show () self . Information [ str ( 15 )]. Show () self . Information [ str ( 16 )]. Show () self . Information [ str ( 17 )]. Show () self . UserInfo . Show () self . Button3 . Show () def _LocaleWindow__OnKlickLoader ( self ): import loader self . loaderKori = loader . PYDLL () self . loaderKori . Show () def ToggleFog ( self ): if app . IsPressed ( app . DIK_LCONTROL ): if self . caminfionoff == 0 : self . caminfionoff = 1 self . cammaxdistance = 1000000 else: self . caminfionoff = 0 self . cammaxdistance = 1000 elif app . IsPressed ( app . DIK_RCONTROL ): if self . cammspeedonoff == 0 : self . cammspeedonoff = 1 self . camspeed = 1000 else: self . cammspeedonoff = 0 self . camspeed = 100 elif self . fogonoff == 0 : self . fogonoff = 1 else: self . fogonoff = 0 def EgoPerspektive ( self ): if self . egopersp == 0 : self . egopersp = 1 chr . Hide () self . cammaxdistance = 1 else: self . egopersp = 0 chr . Show () self . cammaxdistance = 1000 def CamMDDown ( self ): if self . cammaxdistance >= 1000 : self . cammaxdistance = int ( self . cammaxdistance ) - 250 def CamMDUp ( self ): if self . cammaxdistance <= 29750 : self . cammaxdistance = int ( self . cammaxdistance ) + 250 def CamSpeedDown ( self ): if self . camspeed >= 50 : self . camspeed = int ( self . camspeed ) - 25 def CamSpeedUp ( self ): if self . camspeed <= 975 : self . camspeed = int ( self . camspeed ) + 25 def ToggleCharImage ( self ): if self . playershstatus == 0 : if self . egopersp == 0 : chr . Show () else: chr . Hide () app . ShowCursor () self . playershstatus = 1 else: chr . Hide () app . HideCursor () self . playershstatus = 0 def _LocaleWindow__BuildKeyDict ( self ): onPressKeyDict = { } def onPressKeyDict [ app . DIK_SYSRQ ](): return self . SaveScreen () def onPressKeyDict [ app . DIK_UP ](): return self . MoveUp () def onPressKeyDict [ app . DIK_DOWN ](): return self . MoveDown () def onPressKeyDict [ app . DIK_LEFT ](): return self . MoveLeft () def onPressKeyDict [ app . DIK_RIGHT ](): return self . MoveRight () def onPressKeyDict [ app . DIK_W ](): return self . MoveUp () def onPressKeyDict [ app . DIK_S ](): return self . MoveDown () def onPressKeyDict [ app . DIK_A ](): return self . MoveLeft () def onPressKeyDict [ app . DIK_D ](): return self . MoveRight () def onPressKeyDict [ app . DIK_F1 ](): return self . CamSpeedDown () def onPressKeyDict [ app . DIK_F2 ](): return self . CamSpeedUp () def onPressKeyDict [ app . DIK_F3 ](): return self . CamMDDown () def onPressKeyDict [ app . DIK_F4 ](): return self . CamMDUp () def onPressKeyDict [ app . DIK_F5 ](): return self . ToggleCharImage () def onPressKeyDict [ app . DIK_F8 ](): return self . EgoPerspektive () def onPressKeyDict [ app . DIK_F9 ](): return self . ToggleFog () def onPressKeyDict [ app . DIK_F11 ](): return self . MapBoard () def onPressKeyDict [ app . DIK_SPACE ](): return self . ToggleChat () def onPressKeyDict [ app . DIK_M ](): return self . MinimapScreen () def onPressKeyDict [ app . DIK_E ](): return app . RotateCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_R ](): return app . ZoomCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_F ](): return app . ZoomCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_T ](): return app . PitchCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_G ](): return app . PitchCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_Q ](): return app . RotateCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_NUMPAD9 ](): return app . MovieResetCamera () def onPressKeyDict [ app . DIK_NUMPAD4 ](): return app . MovieRotateCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_NUMPAD6 ](): return app . MovieRotateCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_PGUP ](): return app . MovieZoomCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_PGDN ](): return app . MovieZoomCamera ( app . CAMERA_TO_POSITIVE ) def onPressKeyDict [ app . DIK_NUMPAD8 ](): return app . MoviePitchCamera ( app . CAMERA_TO_NEGATIVE ) def onPressKeyDict [ app . DIK_NUMPAD2 ](): return app . MoviePitchCamera ( app . CAMERA_TO_POSITIVE ) self . onPressKeyDict = onPressKeyDict onClickKeyDict = { } def onClickKeyDict [ app . DIK_UP ](): return self . StopUp () def onClickKeyDict [ app . DIK_DOWN ](): return self . StopDown () def onClickKeyDict [ app . DIK_LEFT ](): return self . StopLeft () def onClickKeyDict [ app . DIK_RIGHT ](): return self . StopRight () def onClickKeyDict [ app . DIK_M ](): return self . MinimapScreenEnd () def onClickKeyDict [ app . DIK_W ](): return self . StopUp () def onClickKeyDict [ app . DIK_S ](): return self . StopDown () def onClickKeyDict [ app . DIK_A ](): return self . StopLeft () def onClickKeyDict [ app . DIK_D ](): return self . StopRight () def onClickKeyDict [ app . DIK_Q ](): return app . RotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_E ](): return app . RotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_R ](): return app . ZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_F ](): return app . ZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_T ](): return app . PitchCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_G ](): return pp . PitchCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD4 ](): return app . MovieRotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD6 ](): return app . MovieRotateCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_PGUP ](): return app . MovieZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_PGDN ](): return app . MovieZoomCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD8 ](): return app . MoviePitchCamera ( app . CAMERA_STOP ) def onClickKeyDict [ app . DIK_NUMPAD2 ](): return app . MoviePitchCamera ( app . CAMERA_STOP ) self . onClickKeyDict = onClickKeyDict def ToggleDebugInfo ( self ): self . isShowDebugInfo = not ( self . isShowDebugInfo ) if self . isShowDebugInfo : self . PrintCoord . Show () self . FrameRate . Show () self . Pitch . Show () self . Splat . Show () self . TextureNum . Show () self . ObjectNum . Show () self . ViewDistance . Show () else: self . PrintCoord . Hide () self . FrameRate . Show () self . Pitch . Hide () self . Splat . Hide () self . TextureNum . Hide () self . ObjectNum . Hide () self . ViewDistance . Hide () def _LocaleWindow__BuildDebugInfo ( self ): self . PrintCoord = ui . TextLine () self . PrintCoord . SetFontName ( localeInfo . UI_DEF_FONT ) self . PrintCoord . SetPosition ( wndMgr . GetScreenWidth () - 270 , 0 ) self . FrameRate = ui . TextLine () self . FrameRate . SetFontName ( localeInfo . UI_DEF_FONT ) self . FrameRate . SetPosition ( wndMgr . GetScreenWidth () - 270 , 20 ) self . Pitch = ui . TextLine () self . Pitch . SetFontName ( localeInfo . UI_DEF_FONT ) self . Pitch . SetPosition ( wndMgr . GetScreenWidth () - 270 , 40 ) self . Splat = ui . TextLine () self . Splat . SetFontName ( localeInfo . UI_DEF_FONT ) self . Splat . SetPosition ( wndMgr . GetScreenWidth () - 270 , 60 ) self . TextureNum = ui . TextLine () self . TextureNum . SetFontName ( localeInfo . UI_DEF_FONT ) self . TextureNum . SetPosition ( wndMgr . GetScreenWidth () - 270 , 80 ) self . ObjectNum = ui . TextLine () self . ObjectNum . SetFontName ( localeInfo . UI_DEF_FONT ) self . ObjectNum . SetPosition ( wndMgr . GetScreenWidth () - 270 , 100 ) self . ViewDistance = ui . TextLine () self . ViewDistance . SetFontName ( localeInfo . UI_DEF_FONT ) self . ViewDistance . SetPosition ( 0 , 0 ) def _LocaleWindow__NotifyError ( self , msg ): chat . AppendChat ( chat . CHAT_TYPE_INFO , msg ) def CheckFocus ( self ): if FALSE == self . IsFocus (): if TRUE == self . IsOpenChat (): self . ToggleChat () self . SetFocus () def IsOpenChat ( self ): return self . wndChat . IsEditMode () def ToggleChat ( self ): if TRUE == self . wndChat . IsEditMode (): self . wndChat . CloseChat () else: self . wndChat . OpenChat () def SaveScreen ( self ): ( succeeded , name ) = grp . SaveScreenShotToPath ( os . getcwd () + os . sep + str ( ScreenshotDirectory ) + os . sep ) if succeeded : chat . AppendChat ( chat . CHAT_TYPE_INFO , name + ' ' + localeInfo . SCREENSHOT_SAVE1 ) chat . AppendChat ( chat . CHAT_TYPE_INFO , localeInfo . SCREENSHOT_SAVE2 ) else: chat . AppendChat ( chat . CHAT_TYPE_INFO , localeInfo . SCREENSHOT_SAVE_FAILURE ) def MoveUp ( self ): player . SetSingleDIKKeyState ( app . DIK_UP , TRUE ) def MoveDown ( self ): player . SetSingleDIKKeyState ( app . DIK_DOWN , TRUE ) def MoveLeft ( self ): player . SetSingleDIKKeyState ( app . DIK_LEFT , TRUE ) def MoveRight ( self ): player . SetSingleDIKKeyState ( app . DIK_RIGHT , TRUE ) def StopUp ( self ): player . SetSingleDIKKeyState ( app . DIK_UP , FALSE ) def StopDown ( self ): player . SetSingleDIKKeyState ( app . DIK_DOWN , FALSE ) def StopLeft ( self ): player . SetSingleDIKKeyState ( app . DIK_LEFT , FALSE ) def StopRight ( self ): player . SetSingleDIKKeyState ( app . DIK_RIGHT , FALSE ) def OnKeyDown ( self , key ): try: self . onPressKeyDict [ key ]() except KeyError : pass except : raise return TRUE def OnKeyUp ( self , key ): try: self . onClickKeyDict [ key ]() except KeyError : pass except : raise return TRUE def OnMouseLeftButtonDown ( self ): if self . wndGuildBuilding : if self . wndGuildBuilding . IsPositioningMode (): self . wndGuildBuilding . SettleCurrentPosition () return None player . SetMouseState ( player . MBT_LEFT , player . MBS_PRESS ) return TRUE def OnMouseLeftButtonUp ( self ): if self . wndGuildBuilding : return None player . SetMouseState ( player . MBT_LEFT , player . MBS_CLICK ) return TRUE def OnMouseRightButtonDown ( self ): player . SetMouseState ( player . MBT_RIGHT , player . MBS_PRESS ) return TRUE def OnMouseRightButtonUp ( self ): player . SetMouseState ( player . MBT_RIGHT , player . MBS_CLICK ) return TRUE def OnMouseMiddleButtonDown ( self ): player . SetMouseMiddleButtonState ( player . MBS_PRESS ) def OnMouseMiddleButtonUp ( self ): player . SetMouseMiddleButtonState ( player . MBS_CLICK ) def OnUpdate ( self ): app . UpdateGame () if self . wndGuildBuilding : if self . wndGuildBuilding . IsPositioningMode (): ( x , y , z ) = background . GetPickingPoint () self . wndGuildBuilding . SetBuildingPosition ( x , y , z ) chrmgr . SetMovingSpeed ( self . camspeed ) app . SetCameraMaxDistance ( self . cammaxdistance ) if self . cammaxdistance == 1 : app . SetMinFog ( 100 ) elif self . cammaxdistance >= 1000 : app . SetMinFog ( 3600 ) elif self . cammaxdistance >= 5000 : app . SetMinFog ( 12000 ) elif self . cammaxdistance >= 10000 : app . SetMinFog ( 24000 ) elif self . cammaxdistance >= 15000 : app . SetMinFog ( 48000 ) elif self . cammaxdistance >= 20000 : app . SetMinFog ( 96000 ) if self . cammaxdistance == 1 : app . SetMinFog ( 100 ) elif self . cammaxdistance < 1000 : app . SetMinFog ( 1200 ) elif self . cammaxdistance < 5000 : app . SetMinFog ( 9600 ) elif self . cammaxdistance < 10000 : app . SetMinFog ( 12000 ) elif self . cammaxdistance < 15000 : app . SetMinFog ( 24000 ) elif self . cammaxdistance < 20000 : app . SetMinFog ( 48000 ) if self . fogonoff == 1 : app . SetMinFog ( 1000000000 ) def UpdateDebugInfo ( self ): ( x , y , z ) = player . GetMainCharacterPosition () nUpdateTime = app . GetUpdateTime () nUpdateFPS = app . GetUpdateFPS () nRenderFPS = app . GetRenderFPS () nFaceCount = app . GetFaceCount () fFaceSpeed = app . GetFaceSpeed () nST = background . GetRenderShadowTime () ( fAveRT , nCurRT ) = app . GetRenderTime () ( iNum , fFogStart , fFogEnd , fFarCilp ) = background . GetDistanceSetInfo () ( iPatch , iSplat , fSplatRatio , sTextureNum ) = background . GetRenderedSplatNum () if iPatch == 0 : iPatch = 1 self . PrintCoord . SetText ( 'Coordinate: %.2f %.2f %.2f ATM: %d' % ( x , y , z , ( app . GetAvailableTextureMemory () / 1024 ) * 1024 )) self . FrameRate . SetText ( 'UFPS: %3d UT: %3d FS %.2f' % ( nUpdateFPS , nUpdateTime , fFaceSpeed )) if fAveRT > 1.0 : self . Pitch . SetText ( 'RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) ' % ( nRenderFPS , fAveRT , nCurRT , nFaceCount , nFaceCount / fAveRT )) self . Splat . SetText ( 'PATCH: %d SPLAT: %d BAD(%.2f)' % ( iPatch , iSplat , fSplatRatio )) self . ViewDistance . SetText ( 'Num : %d, FS : %f, FE : %f, FC : %f' % ( iNum , fFogStart , fFogEnd , fFarCilp )) def OnRender ( self ): app . RenderGame () ( x , y ) = app . GetCursorPosition () grp . PopState () grp . SetInterfaceRenderState () def OnPressEscapeKey ( self ): app .Exit() def _LocaleWindow__PlayMusic ( self , flag , filename ): flag = int ( flag ) if flag : snd . FadeOutAllMusic () musicInfo . SaveLastPlayFieldMusic () snd . FadeInMusic ( 'BGM/' + filename ) else: snd . FadeOutAllMusic () musicInfo . LoadLastPlayFieldMusic () snd . FadeInMusic ( 'BGM/' + musicInfo . fieldMusic ) class MapSelectDialog ( ui . Window ): def __init__ ( self ): ui . Window . __init__ ( self ) self . isLoaded = 0 self . selectEvent = None self . fileListBox = None self . Board = ui . BoardWithTitleBar () self . Board . SetSize ( 240 , 345 ) self . Board . SetCenterPosition () self . Board . AddFlag ( 'movable' ) self . Board . AddFlag ( 'float' ) self . Board . SetTitleName ( 'Maplist' ) self . Board . SetCloseEvent ( self . Close ) self . Board . Show () def __del__ ( self ): ui . Window . __del__ ( self ) def Show ( self ): if self . isLoaded == 0 : self . isLoaded = 1 self . _MapSelectDialog__Load () ui . Window . Show ( self ) def Open ( self ): self . Show () self . SetCenterPosition () self . SetTop () self . UpdateFileList () def Close ( self ): self . Board . Hide () self . XCoordinateValue . KillFocus () self . YCoordinateValue . KillFocus () self . XCoordinateValue . Hide () self . YCoordinateValue . Hide () def _MapSelectDialog__CreateFileListBox ( self ): fileListBox = ui . ListBoxEx () fileListBox . SetParent ( self . Board ) fileListBox . SetSelectEvent ( self . UpdateMapInfo ) fileListBox . SetPosition ( 15 , 50 ) fileListBox . Show () return fileListBox def _MapSelectDialog__Load ( self ): self . _MapSelectDialog__Load_BindObject () self . UpdateFileList () def _MapSelectDialog__Load_BindObject ( self ): self . fileListBox = self . _MapSelectDialog__CreateFileListBox () self . LoadFuckingScrollBar () self . LoadTextLines () self . fileListBox . SetScrollBar ( self . ScrollBar ) self . SelectMap = ui . Button () self . SelectMap . SetParent ( self . Board ) self . SelectMap . SetPosition ( 55 , 295 ) self . SelectMap . SetUpVisual ( 'd:/ymir work/ui/public/Middle_Button_01.sub' ) self . SelectMap . SetOverVisual ( 'd:/ymir work/ui/public/Middle_Button_02.sub' ) self . SelectMap . SetDownVisual ( 'd:/ymir work/ui/public/Middle_Button_03.sub' ) self . SelectMap . SetText ( 'OK' ) self . SelectMap . SetEvent ( ui . __mem_func__ ( self . LoadMap )) self . SelectMap . Show () self . CancelBonus = ui . Button () self . CancelBonus . SetParent ( self . Board ) self . CancelBonus . SetPosition ( 125 , 295 ) self . CancelBonus . SetUpVisual ( 'd:/ymir work/ui/public/Middle_Button_01.sub' ) self . CancelBonus . SetOverVisual ( 'd:/ymir work/ui/public/Middle_Button_02.sub' ) self . CancelBonus . SetDownVisual ( 'd:/ymir work/ui/public/Middle_Button_03.sub' ) self . CancelBonus . SetText ( 'Abbrechen' ) self . CancelBonus . SetEvent ( ui . __mem_func__ ( self . Close )) self . CancelBonus . Show () self . XCoordinateSlotBar = ui . SlotBar () self . XCoordinateSlotBar . SetParent ( self . Board ) self . XCoordinateSlotBar . SetSize ( 85 , 18 ) self . XCoordinateSlotBar . SetPosition ( 15 , 270 ) self . XCoordinateSlotBar . Show () self . XCoordinateValue = ui . EditLine () self . XCoordinateValue . SetParent ( self . XCoordinateSlotBar ) self . XCoordinateValue . SetSize ( 60 , 17 ) self . XCoordinateValue . SetPosition ( 5 , 2 ) self . XCoordinateValue . SetMax ( 4 ) self . XCoordinateValue . SetText ( '0' ) self . XCoordinateValue . SetNumberMode () self . XCoordinateValue . Show () self . YCoordinateSlotBar = ui . SlotBar () self . YCoordinateSlotBar . SetParent ( self . Board ) self . YCoordinateSlotBar . SetSize ( 85 , 18 ) self . YCoordinateSlotBar . SetPosition ( 110 , 270 ) self . YCoordinateSlotBar . Show () self . YCoordinateValue = ui . EditLine () self . YCoordinateValue . SetParent ( self . YCoordinateSlotBar ) self . YCoordinateValue . SetSize ( 60 , 17 ) self . YCoordinateValue . SetPosition ( 5 , 2 ) self . YCoordinateValue . SetMax ( 4 ) self . YCoordinateValue . SetText ( '0' ) self . YCoordinateValue . SetNumberMode () self . YCoordinateValue . Show () def LoadTextLines ( self ): self . Headline = ui . TextLine () self . Headline . SetParent ( self . Board ) self . Headline . SetDefaultFontName () self . Headline . SetPosition ( 80 , 29 ) self . Headline . SetFeather () self . Headline . SetText ( 'W\xe4hle deine Map:' ) self . Headline . SetFontColor ( 0.20000000000000001 , 0.20000000000000001 , 1.0 ) self . Headline . SetOutline () self . Headline . Show () self . XKoordinate = ui . TextLine () self . XKoordinate . SetParent ( self . Board ) self . XKoordinate . SetDefaultFontName () self . XKoordinate . SetPosition ( 15 , 250 ) self . XKoordinate . SetFeather () self . XKoordinate . SetText ( 'X Koordinate:' ) self . XKoordinate . SetFontColor ( 0.59999999999999998 , 0.69999999999999996 , 1 ) self . XKoordinate . SetOutline () self . XKoordinate . Show () self . YKoordinate = ui . TextLine () self . YKoordinate . SetParent ( self . Board ) self . YKoordinate . SetDefaultFontName () self . YKoordinate . SetPosition ( 110 , 250 ) self . YKoordinate . SetFeather () self . YKoordinate . SetText ( 'Y Koordinate:' ) self . YKoordinate . SetFontColor ( 0.59999999999999998 , 0.69999999999999996 , 1 ) self . YKoordinate . SetOutline () self . YKoordinate . Show () self . Copyline = ui . TextLine () self . Copyline . SetParent ( self . Board ) self . Copyline . SetDefaultFontName () self . Copyline . SetPosition ( 120 , 320 ) self . Copyline . SetFeather () self . Copyline . SetText ( 'Thanks to RealFreak :>' ) self . Copyline . SetFontColor ( 0.5 , 0.20000000000000001 , 0.5 ) self . Copyline . SetOutline () self . Copyline . Show () def LoadFuckingScrollBar ( self ): self . ScrollBar = ui . ScrollBar () self . ScrollBar . SetParent ( self . Board ) self . ScrollBar . SetPosition ( 210 , 40 ) self . ScrollBar . SetScrollBarSize ( 220 ) self . ScrollBar . Show () def UpdateMapInfo ( self , name ): SelectedIndex = self . fileListBox . GetSelectedItem () SelectedIndex = SelectedIndex . GetText () lines = pack_open ( 'atlasinfo.txt' , 'r' ). readlines () for line in lines : tokens = line [:- 1 ]. split ( '\t' ) if str ( SelectedIndex ) == str ( tokens [ 0 ]): XKoordinate = int ( int ( tokens [ 3 ]) * 25500 / 2 ) / 100 YKoordinate = int ( int ( tokens [ 4 ]) * 25500 / 2 ) / 100 self . XCoordinateValue . SetText ( str ( XKoordinate )) self . YCoordinateValue . SetText ( str ( YKoordinate )) def UpdateFileList ( self ): self . _MapSelectDialog__RefreshFileList () try: lines = pack_open ( 'atlasinfo.txt' , 'r' ). readlines () except IOError : import dbg dbg . LogBox ( 'Load Atlasinfo Error' ) app . Abort () for line in lines : tokens = line [:- 1 ]. split ( '\t' ) if len ( tokens ) == 0 or not tokens [ 0 ]: continue mapname = str ( tokens [ 0 ]) if mapname : self . fileListBox . AppendItem ( Item ( mapname )) def _MapSelectDialog__RefreshFileList ( self ): self . fileListBox . RemoveAllItems () def LoadMap ( self ): import background SelectedIndex = self . fileListBox . GetSelectedItem () SelectedIndex = SelectedIndex . GetText () XKoordinate = int ( self . XCoordinateValue . GetText ()) * 100 YKoordinate = int ( self . YCoordinateValue . GetText ()) * 100 background . LoadMap ( str ( SelectedIndex ), XKoordinate , YKoordinate , 0 ) chr . SetPixelPosition ( int ( XKoordinate ), int ( YKoordinate )) FILE_NAME_LEN = 40 class Item ( ui . ListBoxEx . Item ): def __init__ ( self , fileName ): ui . ListBoxEx . Item . __init__ ( self ) self . canLoad = 0 self . text = fileName self . textLine = self . _Item__CreateTextLine ( fileName [: FILE_NAME_LEN ]) def __del__ ( self ): ui . ListBoxEx . Item . __del__ ( self ) def GetText ( self ): return self . text def SetSize ( self , width , height ): ui . ListBoxEx . Item . SetSize ( self , 6 * len ( self . textLine . GetText ()) + 4 , height ) def _Item__CreateTextLine ( self , fileName ): textLine = ui . TextLine () textLine . SetParent ( self ) textLine . SetPosition ( 0 , 0 ) textLine . SetText ( fileName ) textLine . Show () return textLine
Similar Threads
[Release] Source von Localclient/Object Editor,..
09/29/2013 - Metin2 PServer Guides & Strategies - 9 Replies
Kurze Vorgeschichte:
Nachdem der Localclient von passy nub relativ viel genutzt wurde und er nach einigen obszönen Posts den Localclienten kurzerhand entfernt hat und auch das Webinterface deaktiviert hat wurden seine Dateien von manchen Personen decompiled und erneut hochgeladen wurden wider seinen Willen haben wir uns entschieden sie kurzerhand offiziell zu releasen.
Das Passwort zu den .rar Archiven im Archiv ist "epvp" und enthält die kompilierten Dateien.
Die original Dateien sind...
Suche Localclient - Searching localclient
09/27/2013 - Metin2 Private Server - 1 Replies
DEUTSCH:
Hallo liebe Community,
ich suche den Localclient von passy305. Es wäre sehr nett, wenn mir diesen jemand zukommen lassen könnte.
Mit freundlichen Grüßen,
DaJuBi
----------------------------------
[RELEASE]Localclient - IMV
06/25/2012 - Metin2 PServer Guides & Strategies - 248 Replies
Heute release ich euch mal etwas halbwegs brauchbares .. :awesome:
Undzwar einen Localclienten bzw. einen Ingame-Map-Viewer.
Der genaue Unterschied zwischen den beiden ist eigt. nur,
das im Localclient noch ein Inventar, Level, Emotions etc. vorhanden ist,
welches hier jedoch raußgenommen wurde :awesome:
Da ein Bild mehr sagt als vieles andere:
Erstmal ein Screen ..
All times are GMT +2. The time now is 14:10 .