factored out the EFFv2 saving into EFFImporter
[gemrb.git] / gemrb / GUIScripts / iwd2 / Feedback.py
blob0985fe75ab6edeaff35d2404a259ab94b6860170
1 # GemRB - Infinity Engine Emulator
2 # Copyright (C) 2003 The GemRB Project
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #feedback
20 import GemRB
21 from GUIDefines import *
23 FeedbackWindow = 0
24 TextAreaControl = 0
26 def OnLoad():
27 global FeedbackWindow, TextAreaControl
29 GemRB.LoadWindowPack("GUIOPT", 800, 600)
30 FeedbackWindow = GemRB.LoadWindow(9)
31 FeedbackWindow.SetFrame( )
33 MarkerSlider = FeedbackWindow.GetControl(30)
34 MarkerSliderS = FeedbackWindow.GetControl(8)
36 LocatorSlider = FeedbackWindow.GetControl(31)
37 LocatorSliderS = FeedbackWindow.GetControl(9)
39 THac0Rolls = FeedbackWindow.GetControl(32)
40 THac0RollsB = FeedbackWindow.GetControl(10)
41 THac0RollsB.SetSprites("GBTNOPT4", 0, 0, 1, 2, 3)
43 CombatInfo = FeedbackWindow.GetControl(33)
44 CombatInfoB = FeedbackWindow.GetControl(11)
45 CombatInfoB.SetSprites("GBTNOPT4", 0, 0, 1, 2, 3)
47 Actions = FeedbackWindow.GetControl(34)
48 ActionsB = FeedbackWindow.GetControl(12)
49 ActionsB.SetSprites("GBTNOPT4", 0, 0, 1, 2, 3)
51 StateChanges = FeedbackWindow.GetControl(35)
52 StateChangesB = FeedbackWindow.GetControl(13)
53 StateChangesB.SetSprites("GBTNOPT4", 0, 0, 1, 2, 3)
55 SelectionText = FeedbackWindow.GetControl(36)
56 SelectionTextB = FeedbackWindow.GetControl(14)
57 SelectionTextB.SetSprites("GBTNOPT4", 0, 0, 1, 2, 3)
59 Miscellaneous = FeedbackWindow.GetControl(37)
60 MiscellaneousB = FeedbackWindow.GetControl(15)
61 MiscellaneousB.SetSprites("GBTNOPT4", 0, 0, 1, 2, 3)
63 OkButton = FeedbackWindow.GetControl(26)
64 CancelButton = FeedbackWindow.GetControl(27)
65 TextAreaControl = FeedbackWindow.GetControl(28)
67 TextAreaControl.SetText(18043)
68 OkButton.SetText(11973)
69 OkButton.SetFlags (IE_GUI_BUTTON_DEFAULT, OP_OR)
71 CancelButton.SetText(13727)
72 CancelButton.SetFlags (IE_GUI_BUTTON_CANCEL, OP_OR)
74 MarkerSlider.SetEvent(IE_GUI_BUTTON_ON_PRESS, MarkerSliderPress)
75 MarkerSliderS.SetEvent(IE_GUI_SLIDER_ON_CHANGE, MarkerSliderPress)
76 MarkerSliderS.SetVarAssoc("GUI Feedback Level",1)
78 LocatorSlider.SetEvent(IE_GUI_BUTTON_ON_PRESS, LocatorSliderPress)
79 LocatorSliderS.SetEvent(IE_GUI_SLIDER_ON_CHANGE, LocatorSliderPress)
80 LocatorSliderS.SetVarAssoc("Locator Feedback Level",1)
82 THac0Rolls.SetEvent(IE_GUI_BUTTON_ON_PRESS, THac0RollsPress)
83 THac0RollsB.SetEvent(IE_GUI_BUTTON_ON_PRESS, THac0RollsBPress)
84 THac0RollsB.SetFlags(IE_GUI_BUTTON_CHECKBOX, OP_OR)
85 THac0RollsB.SetVarAssoc("Rolls",1)
87 CombatInfo.SetEvent(IE_GUI_BUTTON_ON_PRESS, CombatInfoPress)
88 CombatInfoB.SetEvent(IE_GUI_BUTTON_ON_PRESS, CombatInfoBPress)
89 CombatInfoB.SetFlags(IE_GUI_BUTTON_CHECKBOX, OP_OR)
90 CombatInfoB.SetVarAssoc("Combat Info",1)
92 Actions.SetEvent(IE_GUI_BUTTON_ON_PRESS, ActionsPress)
93 ActionsB.SetEvent(IE_GUI_BUTTON_ON_PRESS, ActionsBPress)
94 ActionsB.SetFlags(IE_GUI_BUTTON_CHECKBOX, OP_OR)
95 ActionsB.SetVarAssoc("Actions",1)
97 StateChanges.SetEvent(IE_GUI_BUTTON_ON_PRESS, StateChangesPress)
98 StateChangesB.SetEvent(IE_GUI_BUTTON_ON_PRESS, StateChangesBPress)
99 StateChangesB.SetFlags(IE_GUI_BUTTON_CHECKBOX, OP_OR)
100 StateChangesB.SetVarAssoc("State Changes",1)
102 SelectionText.SetEvent(IE_GUI_BUTTON_ON_PRESS, SelectionTextPress)
103 SelectionTextB.SetEvent(IE_GUI_BUTTON_ON_PRESS, SelectionTextBPress)
104 SelectionTextB.SetFlags(IE_GUI_BUTTON_CHECKBOX, OP_OR)
105 SelectionTextB.SetVarAssoc("Selection Text",1)
107 Miscellaneous.SetEvent(IE_GUI_BUTTON_ON_PRESS, MiscellaneousPress)
108 MiscellaneousB.SetEvent(IE_GUI_BUTTON_ON_PRESS, MiscellaneousBPress)
109 MiscellaneousB.SetFlags(IE_GUI_BUTTON_CHECKBOX, OP_OR)
110 MiscellaneousB.SetVarAssoc("Miscellaneous Text",1)
112 OkButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, OkPress)
113 CancelButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, CancelPress)
114 FeedbackWindow.SetVisible(WINDOW_VISIBLE)
115 return
117 def MarkerSliderPress():
118 TextAreaControl.SetText(18024)
119 return
121 def LocatorSliderPress():
122 TextAreaControl.SetText(18025)
123 return
125 def THac0RollsPress():
126 TextAreaControl.SetText(18026)
127 return
129 def THac0RollsBPress():
130 TextAreaControl.SetText(18026)
131 return
133 def CombatInfoPress():
134 TextAreaControl.SetText(18027)
135 return
137 def CombatInfoBPress():
138 TextAreaControl.SetText(18027)
139 return
141 def ActionsPress():
142 TextAreaControl.SetText(18028)
143 return
145 def ActionsBPress():
146 TextAreaControl.SetText(18028)
147 return
149 def StateChangesPress():
150 TextAreaControl.SetText(18029)
151 return
153 def StateChangesBPress():
154 TextAreaControl.SetText(18029)
155 return
157 def SelectionTextPress():
158 TextAreaControl.SetText(18030)
159 return
161 def SelectionTextBPress():
162 TextAreaControl.SetText(18030)
163 return
165 def MiscellaneousPress():
166 TextAreaControl.SetText(18031)
167 return
169 def MiscellaneousBPress():
170 TextAreaControl.SetText(18031)
171 return
173 def OkPress():
174 if FeedbackWindow:
175 FeedbackWindow.Unload()
176 GemRB.SetNextScript("GamePlay")
177 return
179 def CancelPress():
180 if FeedbackWindow:
181 FeedbackWindow.Unload()
182 GemRB.SetNextScript("GamePlay")
183 return