Mercurial > traipse_dev
comparison orpg/main.py @ 119:9314d63c0941 alpha
Traipse Alpha 'OpenRPG' {091029-00}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go.
Traipse also makes it easy for developers to work on code without fear of
sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the
code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the
productivity of the user.
Update Summary:
Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images!
Changes made to the map for increased portability. SnowDog has changes planned in
Core, though.
Added an initial push to the BCG. Not much to see, just shows off how it is
re-writing Main code.
Fix to remote admin commands
Minor fix to texted based server, works in /System/ folder
Some Core changes to gametree to correctly disply Pretty Print, thanks David!
Fix to Splitter Nodes not being created.
Added images to Plugin Control panel for Autostart feature
Fix to massive amounts of images loading; from Core
fix to gsclient so with_statement imports
Added 'boot' command to remote admin
Prep work in Pass tool for remote admin rankings and different passwords, ei,
Server, Admin, Moderator, etc.
Remote Admin Commands more organized, more prep work.
Added Confirmation window for sent nodes.
Minor changes to allow for portability to an OpenSUSE linux OS (hopefully without
breaking)
{091028}
00:
Made changes to gametree to start working with Element Tree, mostly from Core
Minor changes to Map to start working with Element Tree, from Core
Preliminary changes to map efficiency, from FlexiRPG
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Changes to main.py to start working with Element Tree
{091029}
00:
Changes made to server to start working with Element Tree.
Changes made to Meta Server Lib. Prepping test work for a multi meta network
page.
Minor bug fixed with mini to gametree
Zoom Mouse plugin added.
Known Issue: Disconnecting causes an server side error. XML data is not being
passed correctly.
author | sirebral |
---|---|
date | Thu, 29 Oct 2009 20:35:28 -0500 |
parents | 217fb049bd00 |
children | 8827271fbe1b |
comparison
equal
deleted
inserted
replaced
118:217fb049bd00 | 119:9314d63c0941 |
---|---|
94 "on_player_event":self.on_player_event, | 94 "on_player_event":self.on_player_event, |
95 "on_status_event":self.on_status_event, | 95 "on_status_event":self.on_status_event, |
96 "on_password_signal":self.on_password_signal, | 96 "on_password_signal":self.on_password_signal, |
97 "orpgFrame":self} | 97 "orpgFrame":self} |
98 self.settings = component.get('settings') #Arbitrary until settings updated with Core. | 98 self.settings = component.get('settings') #Arbitrary until settings updated with Core. |
99 self.session = orpg.networking.mplay_client.mplay_client(self.settings.get_setting("player"), call_backs) | 99 self.session = orpg.networking.mplay_client.mplay_client(self.settings.get("player"), call_backs) |
100 self.poll_timer = wx.Timer(self, wx.NewId()) | 100 self.poll_timer = wx.Timer(self, wx.NewId()) |
101 self.Bind(wx.EVT_TIMER, self.session.poll, self.poll_timer) | 101 self.Bind(wx.EVT_TIMER, self.session.poll, self.poll_timer) |
102 self.poll_timer.Start(100) | 102 self.poll_timer.Start(100) |
103 self.ping_timer = wx.Timer(self, wx.NewId()) | 103 self.ping_timer = wx.Timer(self, wx.NewId()) |
104 self.Bind(wx.EVT_TIMER, self.session.update, self.ping_timer) | 104 self.Bind(wx.EVT_TIMER, self.session.update, self.ping_timer) |
105 | 105 |
106 # create roller manager | 106 # create roller manager |
107 self.DiceManager = DiceManager(settings.get_setting("dieroller")) | 107 self.DiceManager = DiceManager(settings.get("dieroller")) |
108 component.add('DiceManager', self.DiceManager) | 108 component.add('DiceManager', self.DiceManager) |
109 | 109 |
110 #create password manager --SD 8/03 | 110 #create password manager --SD 8/03 |
111 self.password_manager = component.get('password_manager') | 111 self.password_manager = component.get('password_manager') |
112 component.add("session", self.session) | 112 component.add("session", self.session) |
121 component.add("chat",self.chat) | 121 component.add("chat",self.chat) |
122 component.add("map",self.map) | 122 component.add("map",self.map) |
123 component.add("alias", self.aliaslib) | 123 component.add("alias", self.aliaslib) |
124 | 124 |
125 logger.debug("openrpg components all added") | 125 logger.debug("openrpg components all added") |
126 self.tree.load_tree(settings.get_setting("gametree")) | 126 self.tree.load_tree(settings.get("gametree")) |
127 logger.debug("Tree Loaded") | 127 logger.debug("Tree Loaded") |
128 self.players.size_cols() | 128 self.players.size_cols() |
129 | 129 |
130 #Load the Plugins This has to be after the chat component has been added | 130 #Load the Plugins This has to be after the chat component has been added |
131 component.add('pluginmenu', self.pluginMenu) | 131 component.add('pluginmenu', self.pluginMenu) |
233 [' Change Log'], | 233 [' Change Log'], |
234 [' Report a Bug'] | 234 [' Report a Bug'] |
235 ]] | 235 ]] |
236 | 236 |
237 self.mainmenu = MenuBarEx(self, menu) | 237 self.mainmenu = MenuBarEx(self, menu) |
238 if settings.get_setting('Heartbeat') == '1': | 238 if settings.get('Heartbeat') == '1': |
239 self.mainmenu.SetMenuState("GameServerServerHeartbeat", True) | 239 self.mainmenu.SetMenuState("GameServerServerHeartbeat", True) |
240 | 240 |
241 tabtheme = settings.get_setting('TabTheme') #This change is stable. TaS. | 241 tabtheme = settings.get('TabTheme') #This change is stable. TaS. |
242 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful') | 242 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful') |
243 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw') | 243 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw') |
244 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua') | 244 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua') |
245 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw') | 245 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw') |
246 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua') | 246 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua') |
247 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant') | 247 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant') |
248 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat') | 248 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat') |
249 | 249 |
250 lvl = int(settings.get_setting('LoggingLevel')) | 250 lvl = int(settings.get('LoggingLevel')) |
251 if lvl & ORPG_DEBUG: self.mainmenu.SetMenuState("ToolsLoggingLevelDebug", True) | 251 if lvl & ORPG_DEBUG: self.mainmenu.SetMenuState("ToolsLoggingLevelDebug", True) |
252 if lvl & ORPG_DEBUG: self.mainmenu.SetMenuState("ToolsLoggingLevelNote", True) | 252 if lvl & ORPG_DEBUG: self.mainmenu.SetMenuState("ToolsLoggingLevelNote", True) |
253 if lvl & ORPG_INFO: self.mainmenu.SetMenuState("ToolsLoggingLevelInfo", True) | 253 if lvl & ORPG_INFO: self.mainmenu.SetMenuState("ToolsLoggingLevelInfo", True) |
254 if lvl & ORPG_GENERAL: self.mainmenu.SetMenuState("ToolsLoggingLevelGeneral", True) | 254 if lvl & ORPG_GENERAL: self.mainmenu.SetMenuState("ToolsLoggingLevelGeneral", True) |
255 | 255 |
301 ################################# | 301 ################################# |
302 #Tab Styles Menus | 302 #Tab Styles Menus |
303 @debugging | 303 @debugging |
304 def SetTabStyles(self, *args, **kwargs): | 304 def SetTabStyles(self, *args, **kwargs): |
305 | 305 |
306 tabtheme = settings.get_setting('TabTheme') #This change is stable. TaS. | 306 tabtheme = settings.get('TabTheme') #This change is stable. TaS. |
307 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful') | 307 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful') |
308 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw') | 308 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw') |
309 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua') | 309 self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua') |
310 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw') | 310 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw') |
311 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua') | 311 self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua') |
336 except: pass | 336 except: pass |
337 tabbedwindows = new | 337 tabbedwindows = new |
338 component.add("tabbedWindows", tabbedwindows) | 338 component.add("tabbedWindows", tabbedwindows) |
339 | 339 |
340 #Run though the new list and set the proper styles | 340 #Run though the new list and set the proper styles |
341 tabbg = settings.get_setting('TabBackgroundGradient') | 341 tabbg = settings.get('TabBackgroundGradient') |
342 (red, green, blue) = self.rgb.rgb_tuple(tabbg) | 342 (red, green, blue) = self.rgb.rgb_tuple(tabbg) |
343 | 343 |
344 for wnd in tabbedwindows: | 344 for wnd in tabbedwindows: |
345 style = wnd.GetWindowStyleFlag() | 345 style = wnd.GetWindowStyleFlag() |
346 # remove old tabs style | 346 # remove old tabs style |
359 pass #Not Implemented yet! | 359 pass #Not Implemented yet! |
360 | 360 |
361 @debugging | 361 @debugging |
362 def OnMB_OpenRPGTabStylesSlantedColorful(self): | 362 def OnMB_OpenRPGTabStylesSlantedColorful(self): |
363 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedColorful"): | 363 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedColorful"): |
364 settings.set_setting('TabTheme', 'slanted&colorful') | 364 settings.change('TabTheme', 'slanted&colorful') |
365 self.SetTabStyles("OpenRPGTabStylesSlantedColorful", FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS) | 365 self.SetTabStyles("OpenRPGTabStylesSlantedColorful", FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS) |
366 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", True) | 366 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", True) |
367 | 367 |
368 @debugging | 368 @debugging |
369 def OnMB_OpenRPGTabStylesSlantedBlackandWhite(self): | 369 def OnMB_OpenRPGTabStylesSlantedBlackandWhite(self): |
370 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedBlackandWhite"): | 370 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedBlackandWhite"): |
371 settings.set_setting('TabTheme', 'slanted&bw') | 371 settings.change('TabTheme', 'slanted&bw') |
372 self.SetTabStyles("OpenRPGTabStylesSlantedBlackandWhite", | 372 self.SetTabStyles("OpenRPGTabStylesSlantedBlackandWhite", |
373 FNB.FNB_VC8, graidentTo=wx.WHITE, graidentFrom=wx.WHITE, textColor=wx.BLACK) | 373 FNB.FNB_VC8, graidentTo=wx.WHITE, graidentFrom=wx.WHITE, textColor=wx.BLACK) |
374 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", True) | 374 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", True) |
375 | 375 |
376 @debugging | 376 @debugging |
377 def OnMB_OpenRPGTabStylesSlantedAqua(self): | 377 def OnMB_OpenRPGTabStylesSlantedAqua(self): |
378 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedAqua"): | 378 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedAqua"): |
379 settings.set_setting('TabTheme', 'slanted&aqua') | 379 settings.change('TabTheme', 'slanted&aqua') |
380 self.SetTabStyles("OpenRPGTabStylesSlantedAqua", FNB.FNB_VC8, | 380 self.SetTabStyles("OpenRPGTabStylesSlantedAqua", FNB.FNB_VC8, |
381 graidentTo=wx.Color(0, 128, 255), graidentFrom=wx.WHITE, textColor=wx.BLACK) | 381 graidentTo=wx.Color(0, 128, 255), graidentFrom=wx.WHITE, textColor=wx.BLACK) |
382 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", True) | 382 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", True) |
383 | 383 |
384 @debugging | 384 @debugging |
385 def OnMB_OpenRPGTabStylesSlantedCustom(self): | 385 def OnMB_OpenRPGTabStylesSlantedCustom(self): |
386 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedCustom"): | 386 if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedCustom"): |
387 settings.set_setting('TabTheme', 'customslant') | 387 settings.change('TabTheme', 'customslant') |
388 gfrom = settings.get_setting('TabGradientFrom') | 388 gfrom = settings.get('TabGradientFrom') |
389 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom) | 389 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom) |
390 gto = settings.get_setting('TabGradientTo') | 390 gto = settings.get('TabGradientTo') |
391 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto) | 391 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto) |
392 tabtext = settings.get_setting('TabTextColor') | 392 tabtext = settings.get('TabTextColor') |
393 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext) | 393 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext) |
394 tabbg = settings.get_setting('TabBackgroundGradient') | 394 tabbg = settings.get('TabBackgroundGradient') |
395 (red, green, blue) = self.rgb.rgb_tuple(tabbg) | 395 (red, green, blue) = self.rgb.rgb_tuple(tabbg) |
396 self.SetTabStyles("OpenRPGTabStylesSlantedCustom", FNB.FNB_VC8, | 396 self.SetTabStyles("OpenRPGTabStylesSlantedCustom", FNB.FNB_VC8, |
397 graidentTo=wx.Color(tored, togreen, toblue), graidentFrom=wx.Color(fred, fgreen, fblue), | 397 graidentTo=wx.Color(tored, togreen, toblue), graidentFrom=wx.Color(fred, fgreen, fblue), |
398 textColor=wx.Color(tred, tgreen, tblue)) | 398 textColor=wx.Color(tred, tgreen, tblue)) |
399 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", True) | 399 else: self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", True) |
400 | 400 |
401 @debugging | 401 @debugging |
402 def OnMB_OpenRPGTabStylesFlatBlackandWhite(self): | 402 def OnMB_OpenRPGTabStylesFlatBlackandWhite(self): |
403 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatBlackandWhite"): | 403 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatBlackandWhite"): |
404 settings.set_setting('TabTheme', 'flat&bw') | 404 settings.change('TabTheme', 'flat&bw') |
405 self.SetTabStyles("OpenRPGTabStylesFlatBlackandWhite", FNB.FNB_FANCY_TABS, | 405 self.SetTabStyles("OpenRPGTabStylesFlatBlackandWhite", FNB.FNB_FANCY_TABS, |
406 graidentTo=wx.WHITE, graidentFrom=wx.WHITE, textColor=wx.BLACK) | 406 graidentTo=wx.WHITE, graidentFrom=wx.WHITE, textColor=wx.BLACK) |
407 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", True) | 407 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", True) |
408 | 408 |
409 @debugging | 409 @debugging |
410 def OnMB_OpenRPGTabStylesFlatAqua(self): | 410 def OnMB_OpenRPGTabStylesFlatAqua(self): |
411 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatAqua"): | 411 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatAqua"): |
412 settings.set_setting('TabTheme', 'flat&aqua') | 412 settings.change('TabTheme', 'flat&aqua') |
413 self.SetTabStyles("OpenRPGTabStylesFlatAqua", FNB.FNB_FANCY_TABS, | 413 self.SetTabStyles("OpenRPGTabStylesFlatAqua", FNB.FNB_FANCY_TABS, |
414 graidentTo=wx.Color(0, 128, 255), graidentFrom=wx.WHITE, textColor=wx.BLACK) | 414 graidentTo=wx.Color(0, 128, 255), graidentFrom=wx.WHITE, textColor=wx.BLACK) |
415 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", True) | 415 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", True) |
416 | 416 |
417 @debugging | 417 @debugging |
418 def OnMB_OpenRPGTabStylesFlatCustom(self): | 418 def OnMB_OpenRPGTabStylesFlatCustom(self): |
419 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatCustom"): | 419 if self.mainmenu.GetMenuState("OpenRPGTabStylesFlatCustom"): |
420 settings.set_setting('TabTheme', 'customflat') | 420 settings.change('TabTheme', 'customflat') |
421 gfrom = settings.get_setting('TabGradientFrom') | 421 gfrom = settings.get('TabGradientFrom') |
422 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom) | 422 (fred, fgreen, fblue) = self.rgb.rgb_tuple(gfrom) |
423 gto = settings.get_setting('TabGradientTo') | 423 gto = settings.get('TabGradientTo') |
424 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto) | 424 (tored, togreen, toblue) = self.rgb.rgb_tuple(gto) |
425 tabtext = settings.get_setting('TabTextColor') | 425 tabtext = settings.get('TabTextColor') |
426 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext) | 426 (tred, tgreen, tblue) = self.rgb.rgb_tuple(tabtext) |
427 tabbg = settings.get_setting('TabBackgroundGradient') | 427 tabbg = settings.get('TabBackgroundGradient') |
428 (red, green, blue) = self.rgb.rgb_tuple(tabbg) | 428 (red, green, blue) = self.rgb.rgb_tuple(tabbg) |
429 self.SetTabStyles("OpenRPGTabStylesFlatCustom", FNB.FNB_FANCY_TABS, | 429 self.SetTabStyles("OpenRPGTabStylesFlatCustom", FNB.FNB_FANCY_TABS, |
430 graidentTo=wx.Color(tored, togreen, toblue), graidentFrom=wx.Color(fred, fgreen, fblue), | 430 graidentTo=wx.Color(tored, togreen, toblue), graidentFrom=wx.Color(fred, fgreen, fblue), |
431 textColor=wx.Color(tred, tgreen, tblue)) | 431 textColor=wx.Color(tred, tgreen, tblue)) |
432 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", True) | 432 else: self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", True) |
461 else: self._mgr.GetPane("Browse Server Window").Show() | 461 else: self._mgr.GetPane("Browse Server Window").Show() |
462 self._mgr.Update() | 462 self._mgr.Update() |
463 | 463 |
464 @debugging | 464 @debugging |
465 def OnMB_GameServerServerHeartbeat(self): | 465 def OnMB_GameServerServerHeartbeat(self): |
466 if self.mainmenu.GetMenuState("GameServerServerHeartbeat"): settings.set_setting('Heartbeat', '1') | 466 if self.mainmenu.GetMenuState("GameServerServerHeartbeat"): settings.change('Heartbeat', '1') |
467 else: settings.set_setting('Heartbeat', '0') | 467 else: settings.change('Heartbeat', '0') |
468 | 468 |
469 @debugging | 469 @debugging |
470 def OnMB_GameServerStartServer(self): | 470 def OnMB_GameServerStartServer(self): |
471 start_dialog = wx.ProgressDialog( "Server Loading", "Server Loading, Please Wait...", 1, self ) | 471 start_dialog = wx.ProgressDialog( "Server Loading", "Server Loading, Please Wait...", 1, self ) |
472 # Spawn the new process and close the stdout handle from it | 472 # Spawn the new process and close the stdout handle from it |
805 temp_wnd = orpg.mapper.map.map_wnd(parent_wnd, -1) | 805 temp_wnd = orpg.mapper.map.map_wnd(parent_wnd, -1) |
806 self.map = temp_wnd | 806 self.map = temp_wnd |
807 elif name == "tree": | 807 elif name == "tree": |
808 temp_wnd = orpg.gametree.gametree.game_tree(parent_wnd, -1) | 808 temp_wnd = orpg.gametree.gametree.game_tree(parent_wnd, -1) |
809 self.tree = temp_wnd | 809 self.tree = temp_wnd |
810 if settings.get_setting('ColorTree') == '1': | 810 if settings.get('ColorTree') == '1': |
811 self.tree.SetBackgroundColour(settings.get_setting('bgcolor')) | 811 self.tree.SetBackgroundColour(settings.get('bgcolor')) |
812 self.tree.SetForegroundColour(settings.get_setting('textcolor')) | 812 self.tree.SetForegroundColour(settings.get('textcolor')) |
813 else: | 813 else: |
814 self.tree.SetBackgroundColour('white') | 814 self.tree.SetBackgroundColour('white') |
815 self.tree.SetForegroundColour('black') | 815 self.tree.SetForegroundColour('black') |
816 | 816 |
817 elif name == "chat": | 817 elif name == "chat": |
820 self.chat = temp_wnd.MainChatPanel | 820 self.chat = temp_wnd.MainChatPanel |
821 | 821 |
822 elif name == "player": | 822 elif name == "player": |
823 temp_wnd = orpg.player_list.player_list(parent_wnd) | 823 temp_wnd = orpg.player_list.player_list(parent_wnd) |
824 self.players = temp_wnd | 824 self.players = temp_wnd |
825 if settings.get_setting('ColorTree') == '1': | 825 if settings.get('ColorTree') == '1': |
826 self.players.SetBackgroundColour(settings.get_setting('bgcolor')) | 826 self.players.SetBackgroundColour(settings.get('bgcolor')) |
827 self.players.SetForegroundColour(settings.get_setting('textcolor')) | 827 self.players.SetForegroundColour(settings.get('textcolor')) |
828 else: | 828 else: |
829 self.players.SetBackgroundColour('white') | 829 self.players.SetBackgroundColour('white') |
830 self.players.SetForegroundColour('black') | 830 self.players.SetForegroundColour('black') |
831 | 831 |
832 if parent_wnd != self: return temp_wnd | 832 if parent_wnd != self: return temp_wnd |
912 | 912 |
913 @debugging | 913 @debugging |
914 def start_timer(self): | 914 def start_timer(self): |
915 self.poll_timer.Start(100) | 915 self.poll_timer.Start(100) |
916 s = component.get('settings') | 916 s = component.get('settings') |
917 if s.get_setting("Heartbeat") == "1": | 917 if s.get("Heartbeat") == "1": |
918 self.ping_timer.Start(1000*60) | 918 self.ping_timer.Start(1000*60) |
919 logger.debug("starting heartbeat...", True) | 919 logger.debug("starting heartbeat...", True) |
920 | 920 |
921 @debugging | 921 @debugging |
922 def kill_mplay_session(self): | 922 def kill_mplay_session(self): |
1030 self.status.set_connect_status("Not Connected") | 1030 self.status.set_connect_status("Not Connected") |
1031 | 1031 |
1032 ####Begin changes for Custom Exit Message by mDuo13###### | 1032 ####Begin changes for Custom Exit Message by mDuo13###### |
1033 elif id == orpg.networking.mplay_client.MPLAY_DISCONNECTING: | 1033 elif id == orpg.networking.mplay_client.MPLAY_DISCONNECTING: |
1034 settings = component.get('settings') | 1034 settings = component.get('settings') |
1035 custom_msg = settings.get_setting("dcmsg") | 1035 custom_msg = settings.get("dcmsg") |
1036 custom_msg=custom_msg[:80] | 1036 custom_msg=custom_msg[:80] |
1037 if custom_msg[:3]=="/me": self.chat.send_chat_message(custom_msg[3:], 3) | 1037 if custom_msg[:3]=="/me": self.chat.send_chat_message(custom_msg[3:], 3) |
1038 else: self.chat.system_message(custom_msg) | 1038 else: self.chat.system_message(custom_msg) |
1039 #####End Changes for Custom Exit Message by mDuo13 | 1039 #####End Changes for Custom Exit Message by mDuo13 |
1040 | 1040 |
1041 elif id== orpg.networking.mplay_client.MPLAY_GROUP_CHANGE: | 1041 elif id == orpg.networking.mplay_client.MPLAY_GROUP_CHANGE: |
1042 group = evt.get_data() | 1042 group = evt.get_data() |
1043 print 'main ', group | |
1043 self.chat.InfoPost("Moving to room '"+group[1]+"'..") | 1044 self.chat.InfoPost("Moving to room '"+group[1]+"'..") |
1044 if self.gs : self.gs.set_cur_room_text(group[1]) | 1045 if self.gs : self.gs.set_cur_room_text(group[1]) |
1045 self.players.reset() | 1046 self.players.reset() |
1046 elif id== orpg.networking.mplay_client.MPLAY_GROUP_CHANGE_F: | 1047 elif id == orpg.networking.mplay_client.MPLAY_GROUP_CHANGE_F: |
1047 self.chat.SystemPost("Room access denied!") | 1048 self.chat.SystemPost("Room access denied!") |
1048 | 1049 |
1049 @debugging | 1050 @debugging |
1050 def OnCloseWindow(self, event): | 1051 def OnCloseWindow(self, event): |
1051 dlg = wx.MessageDialog(self, "Quit OpenRPG?", "OpenRPG", wx.YES_NO) | 1052 dlg = wx.MessageDialog(self, "Quit OpenRPG?", "OpenRPG", wx.YES_NO) |
1074 try: self.map.pre_exit_cleanup() | 1075 try: self.map.pre_exit_cleanup() |
1075 except Exception: | 1076 except Exception: |
1076 logger.general("[WARNING] Map error pre_exit_cleanup()", True) | 1077 logger.general("[WARNING] Map error pre_exit_cleanup()", True) |
1077 | 1078 |
1078 try: | 1079 try: |
1079 save_tree = string.upper(settings.get_setting("SaveGameTreeOnExit")) | 1080 save_tree = string.upper(settings.get("SaveGameTreeOnExit")) |
1080 if (save_tree != "0") and (save_tree != "False") and (save_tree != "NO"): | 1081 if (save_tree != "0") and (save_tree != "False") and (save_tree != "NO"): |
1081 self.tree.save_tree(settings.get_setting("gametree")) | 1082 self.tree.save_tree(settings.get("gametree")) |
1082 except Exception: | 1083 except Exception: |
1083 logger.general("[WARNING] Error saving gametree", True) | 1084 logger.general("[WARNING] Error saving gametree", True) |
1084 | 1085 |
1085 if self.session.get_status() == orpg.networking.mplay_client.MPLAY_CONNECTED: self.kill_mplay_session() | 1086 if self.session.get_status() == orpg.networking.mplay_client.MPLAY_CONNECTED: self.kill_mplay_session() |
1086 | 1087 |
1198 component.add('xml', xml) | 1199 component.add('xml', xml) |
1199 component.add('settings', settings) | 1200 component.add('settings', settings) |
1200 component.add('validate', validate) | 1201 component.add('validate', validate) |
1201 component.add("tabbedWindows", []) | 1202 component.add("tabbedWindows", []) |
1202 | 1203 |
1203 logger._set_log_level = int(settings.get_setting('LoggingLevel')) | 1204 logger._set_log_level = int(settings.get('LoggingLevel')) |
1204 logger._set_log_to_console(False) | 1205 logger._set_log_to_console(False) |
1205 | 1206 |
1206 #Update Manager | 1207 #Update Manager |
1207 self.manifest = manifest.ManifestChanges() | 1208 self.manifest = manifest.ManifestChanges() |
1208 | 1209 |