comparison orpg/pluginhandler.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 4385a7d0efd1
children 4dc11df853bf
comparison
equal deleted inserted replaced
65:4840657c23c5 66:c54768cffbd4
1 from orpg.orpg_wx import * 1 from orpg.orpg_wx import *
2 from orpg.orpgCore import open_rpg 2 from orpg.orpgCore import component
3 3
4 class PluginHandler: 4 class PluginHandler:
5 # Initialization subroutine. 5 # Initialization subroutine.
6 # 6 #
7 # !self : instance of self 7 # !self : instance of self
8 # !chat : instance of the chat window to write to 8 # !chat : instance of the chat window to write to
9 def __init__(self, plugindb, parent): 9 def __init__(self, plugindb, parent):
10 self.session = open_rpg.get_component("session") 10 self.session = component.get("session")
11 self.chat = open_rpg.get_component("chat") 11 self.chat = component.get("chat")
12 self.settings = open_rpg.get_component("settings") 12 self.settings = component.get("settings")
13 self.gametree = open_rpg.get_component("tree") 13 self.gametree = component.get("tree")
14 self.startplugs = open_rpg.get_component("startplugs") 14 self.startplugs = component.get("startplugs")
15 self.xml = open_rpg.get_component("xml") 15 self.xml = component.get("xml")
16 self.validate = open_rpg.get_component("validate") 16 self.validate = component.get("validate")
17 self.topframe = open_rpg.get_component("frame") 17 self.topframe = component.get("frame")
18 self.plugindb = plugindb 18 self.plugindb = plugindb
19 self.parent = parent 19 self.parent = parent
20 self.shortcmdlist = self.chat.chat_cmds.shortcmdlist 20 self.shortcmdlist = self.chat.chat_cmds.shortcmdlist
21 self.cmdlist = self.chat.chat_cmds.cmdlist 21 self.cmdlist = self.chat.chat_cmds.cmdlist
22 22
25 25
26 def plugin_disabled(self): 26 def plugin_disabled(self):
27 pass 27 pass
28 28
29 def menu_start(self): 29 def menu_start(self):
30 rootMenu = open_rpg.get_component("pluginmenu") 30 rootMenu = component.get("pluginmenu")
31 try: 31 try:
32 self.plugin_menu() 32 self.plugin_menu()
33 rootMenu.AppendMenu(wx.ID_ANY, self.name, self.menu) 33 rootMenu.AppendMenu(wx.ID_ANY, self.name, self.menu)
34 except: 34 except:
35 self.menu = wx.Menu() 35 self.menu = wx.Menu()
37 self.menu.AppendItem(empty) 37 self.menu.AppendItem(empty)
38 rootMenu.AppendMenu(wx.ID_ANY, self.name, self.menu) 38 rootMenu.AppendMenu(wx.ID_ANY, self.name, self.menu)
39 39
40 def menu_cleanup(self): 40 def menu_cleanup(self):
41 self.settings.save() 41 self.settings.save()
42 rootMenu = open_rpg.get_component("pluginmenu") 42 rootMenu = component.get("pluginmenu")
43 menus = rootMenu.MenuItems 43 menus = rootMenu.MenuItems
44 for mi in menus: 44 for mi in menus:
45 if mi.GetText() == self.name: 45 if mi.GetText() == self.name:
46 rootMenu.RemoveItem(mi) 46 rootMenu.RemoveItem(mi)
47 del self.menu 47 del self.menu