comparison orpg/tools/aliaslib.py @ 66:c54768cffbd4 ornery-dev

Traipse Dev 'OpenRPG' {090818-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: *Unstable* This is the first wave of Code Refinement updates. Includes new material from Core Beta; new debugger material (partially implemented), beginnings of switch to etree, TerminalWriter, and a little more. open_rpg has been renamed to component; functioning now as component.get(), component.add(), component.delete(). This version has known bugs, specifically with the gametree and nodes. I think the XML files where not removed during testing of Core and switching back.
author sirebral
date Tue, 18 Aug 2009 06:33:37 -0500
parents c160f26ecf65
children 7b752c9d0c28
comparison
equal deleted inserted replaced
65:4840657c23c5 66:c54768cffbd4
31 from orpg.orpg_wx import * 31 from orpg.orpg_wx import *
32 from orpg.orpgCore import * 32 from orpg.orpgCore import *
33 from orpg.orpg_windows import createMaskedButton, orpgMultiCheckBoxDlg 33 from orpg.orpg_windows import createMaskedButton, orpgMultiCheckBoxDlg
34 from orpg.tools.rgbhex import RGBHex 34 from orpg.tools.rgbhex import RGBHex
35 import orpg.tools.orpg_log 35 import orpg.tools.orpg_log
36 import orpg.dirpath 36 from orpg.dirpath import dir_struct
37 import orpg.orpg_xml 37 import orpg.orpg_xml
38 import orpg.tools.validate 38 import orpg.tools.validate
39 import orpg.tools.orpg_settings 39 #import orpg.tools.orpg_settings
40 40
41 class AliasLib(wx.Frame): 41 class AliasLib(wx.Frame):
42 def __init__(self): 42 def __init__(self):
43 self.orpgframe = open_rpg.get_component('frame') 43 self.orpgframe = component.get('frame')
44 self.log = open_rpg.get_component('log') 44 self.log = component.get('log')
45 self.log.log("Enter AliasLib", ORPG_DEBUG) 45 self.log.log("Enter AliasLib", ORPG_DEBUG)
46 wx.Frame.__init__(self, None, wx.ID_ANY, title="Alias Lib") 46 wx.Frame.__init__(self, None, wx.ID_ANY, title="Alias Lib")
47 self.orpgframe.Freeze() 47 self.orpgframe.Freeze()
48 self.Freeze() 48 self.Freeze()
49 self.SetOwnBackgroundColour('#EFEFEF') 49 self.SetOwnBackgroundColour('#EFEFEF')
50 self.dir_struct = open_rpg.get_component('dir_struct') 50 self.dir_struct = dir_struct
51 self.settings = open_rpg.get_component('settings') 51 self.settings = component.get('settings')
52 self.xml = open_rpg.get_component('xml') 52 self.xml = component.get('xml')
53 self.validate = open_rpg.get_component('validate') 53 self.validate = component.get('validate')
54 self.filename = self.settings.get_setting('aliasfile') + '.alias' 54 self.filename = self.settings.get_setting('aliasfile') + '.alias'
55 self.validate.config_file(self.filename, "default_alias.alias") 55 self.validate.config_file(self.filename, "default_alias.alias")
56 self.buildMenu() 56 self.buildMenu()
57 self.buildButtons() 57 self.buildButtons()
58 self.buildGUI() 58 self.buildGUI()
62 self.orpgframe.Thaw() 62 self.orpgframe.Thaw()
63 self.Bind(wx.EVT_CLOSE, self.OnMB_FileExit) 63 self.Bind(wx.EVT_CLOSE, self.OnMB_FileExit)
64 self.log.log("Exit AliasLib", ORPG_DEBUG) 64 self.log.log("Exit AliasLib", ORPG_DEBUG)
65 65
66 def InitSetup(self): 66 def InitSetup(self):
67 self.chat = open_rpg.get_component('chat') 67 self.chat = component.get('chat')
68 self.gametree = open_rpg.get_component('tree') 68 self.gametree = component.get('tree')
69 self.map = open_rpg.get_component('map') 69 self.map = component.get('map')
70 self.session = open_rpg.get_component('session') 70 self.session = component.get('session')
71 71
72 def buildMenu(self): 72 def buildMenu(self):
73 self.log.log("Enter AliasLib->buildMenu(self)", ORPG_DEBUG) 73 self.log.log("Enter AliasLib->buildMenu(self)", ORPG_DEBUG)
74 filemenu = wx.Menu() 74 filemenu = wx.Menu()
75 item = wx.MenuItem(filemenu, wx.ID_ANY, "&New\tCtrl+N", "New ALias Lib") 75 item = wx.MenuItem(filemenu, wx.ID_ANY, "&New\tCtrl+N", "New ALias Lib")
187 f.close() 187 f.close()
188 self.log.log("Exit AliasLib->OnMB_FileSave(self, event)", ORPG_DEBUG) 188 self.log.log("Exit AliasLib->OnMB_FileSave(self, event)", ORPG_DEBUG)
189 189
190 def OnMB_FileExportToTree(self, event): 190 def OnMB_FileExportToTree(self, event):
191 self.log.log("Enter AliasLib->OnMB_FileExportToTree(self, event)", ORPG_DEBUG) 191 self.log.log("Enter AliasLib->OnMB_FileExportToTree(self, event)", ORPG_DEBUG)
192 #tree = open_rpg.get_component("tree") 192 #tree = component.get("tree")
193 xml = '<nodehandler class="voxchat_handler" icon="player" module="voxchat" name="' + self.filename[:-6] + '" use.filter="0" version="1.0">' + "\n" 193 xml = '<nodehandler class="voxchat_handler" icon="player" module="voxchat" name="' + self.filename[:-6] + '" use.filter="0" version="1.0">' + "\n"
194 idx = self.aliasIdx 194 idx = self.aliasIdx
195 for n in xrange(self.selectAliasWnd.GetItemCount()): 195 for n in xrange(self.selectAliasWnd.GetItemCount()):
196 self.alias = n 196 self.alias = n
197 xml += "\t<voxchat.alias " 197 xml += "\t<voxchat.alias "
214 214
215 def OnMB_FileExit(self, event): 215 def OnMB_FileExit(self, event):
216 self.log.log("Enter AliasLib->OnMB_FileExit(self, event)", ORPG_DEBUG) 216 self.log.log("Enter AliasLib->OnMB_FileExit(self, event)", ORPG_DEBUG)
217 self.OnMB_FileSave(0) 217 self.OnMB_FileSave(0)
218 self.Hide() 218 self.Hide()
219 top_frame = open_rpg.get_component('frame') 219 top_frame = component.get('frame')
220 top_frame.mainmenu.Check(top_frame.mainmenu.FindMenuItem("Windows", "Alias Lib"), False) 220 top_frame.mainmenu.Check(top_frame.mainmenu.FindMenuItem("Windows", "Alias Lib"), False)
221 self.log.log("Exit AliasLib->OnMB_FileExit(self, event)", ORPG_DEBUG) 221 self.log.log("Exit AliasLib->OnMB_FileExit(self, event)", ORPG_DEBUG)
222 222
223 def OnMB_AliasNew(self, event): 223 def OnMB_AliasNew(self, event):
224 self.log.log("Enter AliasLib->OnMB_AliasNew(self, event)", ORPG_DEBUG) 224 self.log.log("Enter AliasLib->OnMB_AliasNew(self, event)", ORPG_DEBUG)