annotate plugins/xxgsc.py @ 33:6f460a73989e ornery-orc

Traipse 'OpenRPG' {100503-02} 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 (Patch-2) New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New Namespace 2.0 documentation in the User Manual New Namespace plugin, Allows Traipse users to use the Standard syntax !@ :: @! New Mini Library with minis from Devin Knight New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start New to Mini Lib node, change title in design mode New to Game Tree, never lose a node, appends a number to the end of corrupted trees New to Server GUI, Traipse Suite's Debug Console New Warhammer PC Sheet Updates: Update to White Board layer, uses a pencil image for color button Update to Grid Layer, uses a grid image for color button Update to Chat Window, size of drop down menus Update to default lobby message Update to template Text node Update to 4e PC Sheet node Update to how display names are acquired Update to Server, added some 'Pious' technology Update to features node Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up Fix to Mini Lib node that was preventing use Fix to plugins that parce dice but did not call InterParse Fix to nodes for name changing by double click Fix to Game Tree, node ordering on drag and drop corrected Fix to Game Tree, corrupted error message was not showing Fix to Update Manager, checks for internet connection Fix to Update Manager, Auto Update corrections Fix to Server GUI's broadcast, room, player messaging Daily-01: Figured out, this time, why the version file is copied. because of the linux .py~ files. Daily-02: Incomplete feature node updates, sorry. Should be a complete transition after this. Files in the update: Currently selected branch: ornery-orc Author: sirebral Files Modified (in update): data/tips.txt images/draw.png images/grid.png orpg/chat/chatwnd.py orpg/chat/commands.py orpg/dieroller/base.py orpg/dieroller/rollers/std.py orpg/gametree/gametree.py orpg/gametree/nodehandlers/chatmacro.py orpg/gametree/nodehandlers/containers.py orpg/gametree/nodehandlers/core.py~ orpg/gametree/nodehandlers/forms.py orpg/gametree/nodehandlers/minilib.py orpg/gametree/nodehandlers/minilib.py~ orpg/gametree/nodehandlers/rpg_grid.py orpg/main.py orpg/mapper/background.py orpg/mapper/grid_handler.py orpg/mapper/map.py orpg/mapper/whiteboard_handler.py orpg/networking/mplay_server.py orpg/networking/mplay_server_gui.py orpg/orpg_version.py orpg/pluginhandler.py orpg/templates/default_LobbyMessage.html orpg/templates/feature.xml orpg/templates/nodes/4e_char_sheet.xml orpg/templates/nodes/Warhammerv2CS2-Traipse.xml orpg/templates/nodes/split.xml orpg/templates/nodes/textctrl.xml orpg/tools/InterParse.py orpg/tools/aliaslib.py orpg/tools/orpg_log.py orpg/tools/orpg_settings.py plugins/xxhiddendice.py plugins/xxsimpleinit.py plugins/xxstdnamespace.py plugins/xxurl2link.py readme.txt rollback.py start_developer.py start_noupdate.py upmana/updatemana.py
author sirebral
date Mon, 03 May 2010 03:47:00 -0500
parents ff154cf3350c
children
rev   line source
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
1 import os, wx
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2 import random
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3 import orpg.pluginhandler
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
5 ID_ROLL = wx.NewId()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
6
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
7 class Plugin(orpg.pluginhandler.PluginHandler):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
8 # Initialization subroutine.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
9 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
10 # !self : instance of self
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
11 # !chat : instance of the chat window to write to
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
12 def __init__(self, plugindb, parent):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
13 orpg.pluginhandler.PluginHandler.__init__(self, plugindb, parent)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
14
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
15 self.name = 'Game Status Controller'
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
16 self.author = 'Woody, updated by mDuo13 and Calchexas'
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
17 self.help = 'This plugin lets you quickly and easily manage a status that includes \n'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
18 self.help += 'your HP and AC for AD&D 2nd Edition. Type /gsc to open up the manager\n'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
19 self.help += 'window, and from there just change the values as necessary and the changes\n'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
20 self.help += 'will be reflected in your status. To revert to your regular status, close\n'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
21 self.help += 'the GSC window.'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
22
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
23 self.frame = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
24
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
25 def plugin_enabled(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
26 self.plugin_addcommand('/gsc', self.on_gsc, '- The GSC command')
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
27 self.frame = RollerFrame(None, -1, "Game Status Controller (GSC)", self)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
28 self.frame.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
29
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
30 def plugin_menu(self):
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
31 self.menu = wx.Menu()
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
32 self.toggle = self.menu.AppendCheckItem(wx.ID_ANY, 'GSC Window')
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
33 self.topframe.Bind(wx.EVT_MENU, self._toggleWindow, self.toggle)
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
34 self.toggle.Check(False)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
35
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
36 def plugin_disabled(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
37 self.plugin_removecmd('/gsc')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
38 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
39 self.frame.TimeToQuit(1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
40 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
41 pass
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
42
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
43 def on_gsc(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
44 item = self.menu.FindItemById(self.menu.FindItem("GSC Window"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
45 item.Check(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
46 self.frame.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
47 self.frame.Raise()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
48
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
49 #Events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
50 def _toggleWindow(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
51 if self.frame.IsShown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
52 self.frame.Hide()
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
53 self.toggle.Check(False)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
54 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
55 self.frame.Show()
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
56 self.toggle.Check(True)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
57
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
58
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
59 class RollerFrame(wx.Frame):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
60 def __init__(self, parent, ID, title, plugin):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
61 wx.Frame.__init__(self, parent, ID, title,
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
62 wx.DefaultPosition, wx.Size(250, 110))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
63
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
64 self.settings = plugin.settings
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
65 self.session = plugin.session
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
66 self.plugin = plugin
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
67
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
68 self.panel = wx.Panel(self,-1)
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
69 sizer = wx.GridBagSizer(1, 2)
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
70 self.panel.SetSizer(sizer)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
71 menu = wx.Menu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
72 menu.AppendSeparator()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
73 menu.Append(wx.ID_EXIT, "&Close", "Close this window")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
74 menuBar = wx.MenuBar()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
75 menuBar.Append(menu, "&File");
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
76 self.SetMenuBar(menuBar)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
77
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
78 self.old_idle = self.settings.get_setting('IdleStatusAlias')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
79
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
80 ac_text = wx.StaticText(self.panel, -1, "AC:", wx.Point(0, 5))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
81 self.ac = wx.SpinCtrl(self.panel, ID_ROLL, "",
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
82 wx.Point(18, 0), wx.Size(45, -1), min = -100, max = 100, initial = 10)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
83 self.ac.SetValue(10)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
84
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
85 touch_text = wx.StaticText(self.panel, -1, "Touch:", wx.Point(0, 25))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
86 self.touch = wx.SpinCtrl(self.panel, ID_ROLL, "",
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
87 wx.Point(60, 25), wx.Size(45, -1), min = -100, max = 100, initial = 10)
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
88 self.touch.SetValue(10)
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
89
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
90 ff_text = wx.StaticText(self.panel, -1, "FF:", wx.Point(115, 25))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
91 self.ff = wx.SpinCtrl(self.panel, ID_ROLL, "",
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
92 wx.Point(165, 25), wx.Size(45, -1), min = -100, max = 100, initial = 10)
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
93 self.ff.SetValue(10)
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
94
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
95 max_hp_text = wx.StaticText(self.panel, -1, "/", wx.Point(150, 5))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
96 self.max_hp = wx.SpinCtrl(self.panel, ID_ROLL, "",
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
97 wx.Point(158, 0), wx.Size(48, -1), min = -999, max = 999, initial = 10)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
98 self.max_hp.SetValue(10)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
99
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
100 hp_text = wx.StaticText(self.panel, -1, "HP:", wx.Point(80, 5))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
101 self.hp = wx.SpinCtrl(self.panel, ID_ROLL, "",
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
102 wx.Point(98, 0), wx.Size(48, -1), min = -999, max = 999, initial = 10)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
103 self.hp.SetValue(10)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
104
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
105 sizer.Add(ac_text, (1,0), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
106 sizer.Add(self.ac, (1,1), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
107 sizer.Add(touch_text, (1,2), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
108 sizer.Add(self.touch, (1,3), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
109 sizer.Add(ff_text, (1,4), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
110 sizer.Add(self.ff, (1,5), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
111 sizer.Add(hp_text, (0,0), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
112 sizer.Add(self.hp, (0,1), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
113 sizer.Add(max_hp_text, (0,2), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
114 sizer.Add(self.max_hp, (0,3), span=(1,1))
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
115 self.SetMinSize((350,100))
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
116 self.Bind(wx.EVT_SPINCTRL, self.SetStatus, id=ID_ROLL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
117 self.Bind(wx.EVT_TEXT, self.SetStatus, id=ID_ROLL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
118 self.Bind(wx.EVT_MENU, self.TimeToQuit, id=wx.ID_EXIT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
119 self.Bind(wx.EVT_CLOSE, self._close)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
120 self.SetStatus(None)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
121
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
122 def SetStatus(self, evt):
28
ff154cf3350c Traipse 'OpenRPG' {100203-00}
sirebral
parents: 0
diff changeset
123 new_status = "AC: " + str(self.ac.GetValue()) + " (Touch: " + str(self.touch.GetValue()) + " FF: " + str(self.ff.GetValue()) + ")" + " HP: " + str(self.hp.GetValue()) + "/" + str(self.max_hp.GetValue())
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
124 self.settings.set_setting('IdleStatusAlias',new_status)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
125 self.session.set_text_status(new_status)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
126
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
127 def TimeToQuit(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
128 self.settings.set_setting('IdleStatusAlias',self.old_idle)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
129 self.session.set_text_status(self.old_idle)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
130 self.frame = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
131 self.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
132
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
133 def _close(self, evt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
134 self.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
135 item = self.plugin.menu.FindItemById(self.plugin.menu.FindItem("GSC Window"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
136 item.Check(False)