/[skyui_scripts]/branch/skyui_510/Source/ski_configmenu.psc
ViewVC logotype

Annotation of /branch/skyui_510/Source/ski_configmenu.psc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (hide annotations) (download)
Sat Aug 12 15:05:05 2017 UTC (2 years, 6 months ago) by william
File size: 59599 byte(s)
commit scripts for skyui 5.1
1 william 3 scriptname SKI_ConfigMenu extends SKI_ConfigBase
2    
3     ; SCRIPT VERSION ----------------------------------------------------------------------------------
4     ;
5     ; History
6     ;
7     ; 1: - Initial version
8     ;
9     ; 2: - Added category icon theme option
10     ; - Added noIconColor option
11     ; - Added controls section for gamepad
12     ;
13     ; 3: - Added disable 3D item positioning option
14     ;
15     ; 4: - Converted script to use state options
16     ; - Added map menu version check
17     ; - Added active effects widget configuration
18     ;
19     ; 5: - Fixed 3DItemDisablePositioning
20     ;
21     ; 6: - Added favorites menu options
22     ;
23     ; 7: - Changed page layout
24     ;
25     ; 8: - Removed unsupported icon themes
26    
27     int function GetVersion()
28     return 8
29     endFunction
30    
31    
32     ; PRIVATE VARIABLES -------------------------------------------------------------------------------
33    
34     ; -- Version 1 --
35    
36     ; Lists
37     string[] _alignments
38     string[] _alignmentValues
39     string[] _sizes
40    
41     ; State
42     int _itemlistFontSizeIdx = 1
43     int _itemlistQuantityMinCount = 6
44    
45     int _itemcardAlignIdx = 2
46     float _itemcardXOffset = 0.0
47     float _itemcardYOffset = 0.0
48    
49     float _3DItemXOffset = 0.0
50     float _3DItemYOffset = 0.0
51     float _3DItemScale = 1.5
52    
53     int _searchKey = 57
54     int _switchTabKey = 56
55     int _equipModeKey = 42
56    
57     ; Internal
58     float _itemXBase
59     float _itemXBaseW
60    
61    
62     ; -- Version 2 --
63    
64     ; Lists
65     string[] _categoryIconThemeShortNames
66     string[] _categoryIconThemeLongNames
67     string[] _categoryIconThemeValues
68    
69     ; State
70     int _categoryIconThemeIdx = 0
71     bool _itemlistNoIconColors = false
72    
73     int _switchTabButton = 271 ; BACK
74     int _prevColumnButton = 274 ; LEFT_SHOULDER
75     int _nextColumnButton = 275 ; RIGHT_SHOULDER
76     int _sortOrderButton = 272 ; LEFT_THUMB
77    
78     ; -- Version 3 --
79    
80     ; State
81     bool _3DItemDisablePositioning = false
82    
83     ; Internal
84     float _fInventory3DItemPosXWide
85     float _fInventory3DItemPosX
86     float _fMagic3DItemPosXWide
87     float _fMagic3DItemPosX
88    
89     ; Flags
90     int _3DItemFlags
91    
92     ; -- Version 4 --
93    
94     ; Lists
95     string[] _orientations
96     string[] _orientationValues
97    
98     string[] _vertAlignments
99     string[] _vertAlignmentValues
100    
101     float[] _effectWidgetIconSizeValues
102    
103     float[] _alignmentBaseOffsets
104     float[] _vertAlignmentBaseOffsets
105    
106     ; State
107     int _effectWidgetIconSizeIdx = 1 ; medium
108     int _effectWidgetVAnchorIdx = 0 ; top
109     int _effectWidgetHAnchorIdx = 1 ; right
110     int _effectWidgetGroupCount = 8
111     int _effectWidgetOrientationIdx = 1 ; vertical
112     float _effectWidgetXOffset = 0.0
113     float _effectWidgetYOffset = 0.0
114    
115     ; Flags
116     int _effectWidgetFlags
117    
118     ; -- Version 5 --
119    
120     ; Internal
121     float _fInventory3DItemPosZWide
122     float _fInventory3DItemPosZ
123     float _fMagic3DItemPosZWide
124     float _fMagic3DItemPosZ
125    
126     float _fInventory3DItemPosScaleWide
127     float _fMagic3DItemPosScaleWide
128     float _fInventory3DItemPosScale
129     float _fMagic3DItemPosScale
130    
131     ; -- Version 6 --
132    
133     ; Lists
134     string[] _favGroupNames
135    
136     ; State
137     int _favCurGroupIdx = 0
138    
139    
140     ; PROPERTIES --------------------------------------------------------------------------------------
141    
142     ; -- Version 1 --
143    
144     SKI_SettingsManager property SKI_SettingsManagerInstance auto
145     SKI_Main property SKI_MainInstance auto
146    
147     ; -- Version 4 --
148    
149     SKI_ActiveEffectsWidget property SKI_ActiveEffectsWidgetInstance auto
150    
151     ; -- Version 6 --
152    
153     SKI_FavoritesManager property SKI_FavoritesManagerInstance auto
154    
155    
156     ; INITIALIZATION ----------------------------------------------------------------------------------
157    
158     ; @overrides SKI_ConfigBase
159     event OnConfigInit()
160     ; Translate strings to display in UI
161     _alignments = new string[3]
162     _alignments[0] = "$Left"
163     _alignments[1] = "$Right"
164     _alignments[2] = "$Center"
165    
166     _sizes = new string[3]
167     _sizes[0] = "$Small"
168     _sizes[1] = "$Medium"
169     _sizes[2] = "$Large"
170    
171     ; Strings used as variable values
172     _alignmentValues = new string[3]
173     _alignmentValues[0] = "left"
174     _alignmentValues[1] = "right"
175     _alignmentValues[2] = "center"
176    
177     ApplySettings()
178     endEvent
179    
180     ; @implements SKI_QuestBase
181     event OnGameReload()
182     parent.OnGameReload()
183     ApplySettings()
184     endEvent
185    
186     ; @implements SKI_QuestBase
187     event OnVersionUpdate(int a_version)
188    
189     ; Version 2
190     if (a_version >= 2 && CurrentVersion < 2)
191     Debug.Trace(self + ": Updating to script version 2")
192    
193     _categoryIconThemeShortNames = new string[4]
194     _categoryIconThemeShortNames[0] = "SKYUI V3"
195     _categoryIconThemeShortNames[1] = "CELTIC"
196     _categoryIconThemeShortNames[2] = "CURVED"
197     _categoryIconThemeShortNames[3] = "STRAIGHT"
198    
199     _categoryIconThemeLongNames = new string[4]
200     _categoryIconThemeLongNames[0] = "SkyUI V3, by PsychoSteve"
201     _categoryIconThemeLongNames[1] = "Celtic, by GreatClone"
202     _categoryIconThemeLongNames[2] = "Curved, by T3T"
203     _categoryIconThemeLongNames[3] = "Straight, by T3T"
204    
205     _categoryIconThemeValues = new string[4]
206     _categoryIconThemeValues[0] = "skyui\\icons_category_psychosteve.swf"
207     _categoryIconThemeValues[1] = "skyui\\icons_category_celtic.swf"
208     _categoryIconThemeValues[2] = "skyui\\icons_category_curved.swf"
209     _categoryIconThemeValues[3] = "skyui\\icons_category_straight.swf"
210    
211     ; Have been renamed, so clear old overrides and set new ones
212     SKI_SettingsManagerInstance.ClearOverride("Input$controls$search")
213     SKI_SettingsManagerInstance.ClearOverride("Input$controls$switchTab")
214     SKI_SettingsManagerInstance.ClearOverride("Input$controls$equipMode")
215     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$search", _searchKey)
216     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$switchTab", _switchTabKey)
217     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$equipMode", _equipModeKey)
218     endIf
219    
220     if (a_version >= 3 && CurrentVersion < 3)
221     Debug.Trace(self + ": Updating to script version 3")
222    
223     _3DItemFlags = OPTION_FLAG_NONE
224    
225     ;The below all reset to true with version 3.2
226     ;SKI_MainInstance.InventoryMenuCheckEnabled
227     ;SKI_MainInstance.MagicMenuCheckEnabled
228     ;SKI_MainInstance.BarterMenuCheckEnabled
229     ;SKI_MainInstance.ContainerMenuCheckEnabled
230     ;SKI_MainInstance.GiftMenuCheckEnabled
231     endIf
232    
233     if (a_version >= 4 && CurrentVersion < 4)
234     Debug.Trace(self + ": Updating to script version 4")
235    
236     _orientations = new string[2]
237     _orientations[0] = "$Horizontal"
238     _orientations[1] = "$Vertical"
239    
240     _orientationValues = new string[2]
241     _orientationValues[0] = "horizontal"
242     _orientationValues[1] = "vertical"
243    
244     _vertAlignments = new string[3]
245     _vertAlignments[0] = "$Top"
246     _vertAlignments[1] = "$Bottom"
247     _vertAlignments[2] = "$Center"
248    
249     _vertAlignmentValues = new string[3]
250     _vertAlignmentValues[0] = "top"
251     _vertAlignmentValues[1] = "bottom"
252     _vertAlignmentValues[2] = "center"
253    
254     _effectWidgetIconSizeValues = new float[3]
255     _effectWidgetIconSizeValues[0] = 32.0
256     _effectWidgetIconSizeValues[1] = 48.0
257     _effectWidgetIconSizeValues[2] = 64.0
258    
259     _alignmentBaseOffsets = new float[3]
260     _alignmentBaseOffsets[0] = 0.0
261     _alignmentBaseOffsets[1] = 1280.0
262     _alignmentBaseOffsets[2] = 640.0
263    
264     _vertAlignmentBaseOffsets = new float[3]
265     _vertAlignmentBaseOffsets[0] = 0.0
266     _vertAlignmentBaseOffsets[1] = 720.0
267     _vertAlignmentBaseOffsets[2] = 360.0
268    
269     _effectWidgetFlags = OPTION_FLAG_NONE
270    
271     ; Sync widget default values
272     SKI_ActiveEffectsWidgetInstance.Enabled = true
273     SKI_ActiveEffectsWidgetInstance.EffectSize = _effectWidgetIconSizeValues[_effectWidgetIconSizeIdx]
274     SKI_ActiveEffectsWidgetInstance.HAnchor = _alignmentValues[_effectWidgetHAnchorIdx]
275     SKI_ActiveEffectsWidgetInstance.VAnchor = _vertAlignmentValues[_effectWidgetVAnchorIdx]
276     SKI_ActiveEffectsWidgetInstance.GroupEffectCount = _effectWidgetGroupCount
277     SKI_ActiveEffectsWidgetInstance.Orientation = _orientationValues[_effectWidgetOrientationIdx]
278     SKI_ActiveEffectsWidgetInstance.X = _alignmentBaseOffsets[_effectWidgetHAnchorIdx] + _effectWidgetXOffset
279     SKI_ActiveEffectsWidgetInstance.Y = _vertAlignmentBaseOffsets[_effectWidgetVAnchorIdx] + _effectWidgetYOffset
280     endIf
281    
282     if (a_version >= 5 && CurrentVersion < 5)
283     Debug.Trace(self + ": Updating to script version 5")
284     endIf
285    
286     if (a_version >= 6 && CurrentVersion < 6)
287     Debug.Trace(self + ": Updating to script version 6")
288    
289     Pages = new string[3]
290     Pages[0] = "$General"
291     Pages[1] = "$Favorite Groups"
292     Pages[2] = "$Advanced"
293    
294     _favGroupNames = new string[8]
295     _favGroupNames[0] = "$Group {1}"
296     _favGroupNames[1] = "$Group {2}"
297     _favGroupNames[2] = "$Group {3}"
298     _favGroupNames[3] = "$Group {4}"
299     _favGroupNames[4] = "$Group {5}"
300     _favGroupNames[5] = "$Group {6}"
301     _favGroupNames[6] = "$Group {7}"
302     _favGroupNames[7] = "$Group {8}"
303     endIf
304    
305     if (a_version >= 7 && CurrentVersion < 7)
306     Debug.Trace(self + ": Updating to script version 7")
307    
308     Pages = new string[3]
309     Pages[0] = "$General"
310     Pages[1] = "$Controls"
311     Pages[2] = "$Advanced"
312     endIf
313    
314     if (a_version >= 8 && CurrentVersion < 8)
315     Debug.Trace(self + ": Updating to script version 8")
316    
317     _categoryIconThemeShortNames = new string[1]
318     _categoryIconThemeShortNames[0] = "SKYUI V5"
319    
320     _categoryIconThemeLongNames = new string[1]
321     _categoryIconThemeLongNames[0] = "SkyUI V5, by PsychoSteve"
322    
323     _categoryIconThemeValues = new string[1]
324     _categoryIconThemeValues[0] = "skyui\\icons_category_psychosteve.swf"
325    
326     _categoryIconThemeIdx = 0
327    
328     SKI_SettingsManagerInstance.ClearOverride("Appearance$icons$category$source")
329     SKI_SettingsManagerInstance.SetOverride("Appearance$icons$category$source", _categoryIconThemeValues[_categoryIconThemeIdx])
330     endIf
331    
332    
333     endEvent
334    
335    
336     ; EVENTS ------------------------------------------------------------------------------------------
337    
338     ; @implements SKI_ConfigBase
339     event OnPageReset(string a_page)
340    
341     ; Load custom .swf for animated logo
342     if (a_page == "")
343     LoadCustomContent("skyui/skyui_splash.swf")
344     return
345     else
346     UnloadCustomContent()
347     endIf
348    
349     ; -------------------------------------------------------
350     if (a_page == "$General")
351     SetCursorFillMode(TOP_TO_BOTTOM)
352    
353     AddHeaderOption("$Item List")
354     AddTextOptionST("ITEMLIST_FONT_SIZE", "$Font Size", _sizes[_itemlistFontSizeIdx])
355     AddSliderOptionST("ITEMLIST_QUANTITY_MIN_COUNT", "$Quantity Menu Min. Count", _itemlistQuantityMinCount)
356     ;AddMenuOptionST("ITEMLIST_CATEGORY_ICON_THEME", "$Category Icon Theme", _categoryIconThemeShortNames[_categoryIconThemeIdx])
357     AddToggleOptionST("ITEMLIST_NO_ICON_COLORS", "$Disable Icon Colors", _itemlistNoIconColors)
358    
359     AddEmptyOption()
360    
361     AddHeaderOption("$Active Effects HUD")
362     AddToggleOptionST("EFFECT_WIDGET_ENABLED", "$Enabled", SKI_ActiveEffectsWidgetInstance.Enabled)
363     AddTextOptionST("EFFECT_WIDGET_ICON_SIZE","$Icon Size", _sizes[_effectWidgetIconSizeIdx], _effectWidgetFlags)
364     AddSliderOptionST("EFFECT_WIDGET_MIN_TIME_LEFT", "$Minimum Time Left", SKI_ActiveEffectsWidgetInstance.MinimumTimeLeft, "{0} s", _effectWidgetFlags)
365    
366     SetCursorPosition(1)
367    
368     AddHeaderOption("$Favorites Menu")
369     AddToggleOptionST("FAV_MENU_HELP_ENABLED", "$Show Button Help", SKI_FavoritesManagerInstance.ButtonHelpEnabled)
370    
371     AddEmptyOption()
372    
373     int ARMOR_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_ARMOR
374     int HANDS_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_HANDS
375    
376     AddHeaderOption("$Favorite Groups")
377     AddMenuOptionST("FAV_GROUP_SELECT", "", "$Group {" + (_favCurGroupIdx+1) + "}")
378     AddToggleOptionST("FAV_GROUP_UNEQUIP_ARMOR", "$Unequip Armor", SKI_FavoritesManagerInstance.GetGroupFlag(_favCurGroupIdx, ARMOR_FLAG))
379     AddToggleOptionST("FAV_GROUP_UNEQUIP_HANDS", "$Unequip Hands", SKI_FavoritesManagerInstance.GetGroupFlag(_favCurGroupIdx, HANDS_FLAG))
380    
381     ; -------------------------------------------------------
382     elseIf (a_page == "$Controls")
383    
384     bool isGamepad = Game.UsingGamepad()
385    
386     SetCursorFillMode(TOP_TO_BOTTOM)
387    
388     AddHeaderOption("$Item List")
389     if (! isGamepad)
390     AddKeyMapOptionST("SEARCH_KEY", "$Search", _searchKey)
391     AddKeyMapOptionST("SWITCH_TAB_KEY", "$Switch Tab", _switchTabKey)
392     AddKeyMapOptionST("EQUIP_MODE_KEY", "$Equip Mode", _equipModeKey)
393     else
394     AddKeyMapOptionST("SEARCH_KEY", "$Search", _searchKey, OPTION_FLAG_DISABLED)
395     AddKeyMapOptionST("SWITCH_TAB_BUTTON", "$Switch Tab", _switchTabButton)
396     AddKeyMapOptionST("PREV_COLUMN_BUTTON", "$Previous Column", _prevColumnButton)
397     AddKeyMapOptionST("NEXT_COLUMN_BUTTON", "$Next Column", _nextColumnButton)
398     AddKeyMapOptionST("SORT_ORDER_BUTTON", "$Order", _sortOrderButton)
399     endIf
400    
401     if (! isGamepad)
402     AddEmptyOption()
403    
404     AddHeaderOption("$Favorites Menu")
405     AddKeyMapOptionST("FAV_GROUP_ADD_KEY", "{$Group}/{$Ungroup}", SKI_FavoritesManagerInstance.GroupAddKey)
406     AddKeyMapOptionST("FAV_GROUP_USE_KEY", "$Group Use", SKI_FavoritesManagerInstance.GroupUseKey)
407     AddKeyMapOptionST("FAV_SET_ICON_KEY", "$Set Group Icon", SKI_FavoritesManagerInstance.SetIconKey)
408     AddKeyMapOptionST("FAV_EQUIP_STATE_KEY", "$Save Equip State", SKI_FavoritesManagerInstance.SaveEquipStateKey)
409     AddKeyMapOptionST("FAV_TOGGLE_FOCUS", "$Toggle Focus", SKI_FavoritesManagerInstance.ToggleFocusKey)
410     endIf
411    
412     SetCursorPosition(1)
413    
414     int[] groupHotkeys = SKI_FavoritesManagerInstance.GetGroupHotkeys()
415    
416     AddHeaderOption("$Favorite Groups")
417     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY1", "$Group {1}", groupHotkeys[0], OPTION_FLAG_WITH_UNMAP)
418     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY2", "$Group {2}", groupHotkeys[1], OPTION_FLAG_WITH_UNMAP)
419     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY3", "$Group {3}", groupHotkeys[2], OPTION_FLAG_WITH_UNMAP)
420     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY4", "$Group {4}", groupHotkeys[3], OPTION_FLAG_WITH_UNMAP)
421     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY5", "$Group {5}", groupHotkeys[4], OPTION_FLAG_WITH_UNMAP)
422     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY6", "$Group {6}", groupHotkeys[5], OPTION_FLAG_WITH_UNMAP)
423     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY7", "$Group {7}", groupHotkeys[6], OPTION_FLAG_WITH_UNMAP)
424     AddKeyMapOptionST("FAV_GROUP_USE_HOTKEY8", "$Group {8}", groupHotkeys[7], OPTION_FLAG_WITH_UNMAP)
425    
426     ; -------------------------------------------------------
427     elseIf (a_page == "$Advanced")
428     SetCursorFillMode(TOP_TO_BOTTOM)
429    
430     AddHeaderOption("$3D Item")
431     AddSliderOptionST("XD_ITEM_XOFFSET", "$Horizontal Offset", _3DItemXOffset, "{0}", _3DItemFlags)
432     AddSliderOptionST("XD_ITEM_YOFFSET", "$Vertical Offset", _3DItemYOffset, "{0}", _3DItemFlags)
433     AddSliderOptionST("XD_ITEM_SCALE", "$Scale", _3DItemScale, "{1}", _3DItemFlags)
434     AddToggleOptionST("XD_ITEM_POSITIONING", "$Disable Positioning", _3DItemDisablePositioning)
435    
436     AddEmptyOption()
437    
438     AddHeaderOption("$Active Effects HUD")
439     AddTextOptionST("EFFECT_WIDGET_ORIENTATION", "$Orientation", _orientations[_effectWidgetOrientationIdx], _effectWidgetFlags)
440     AddTextOptionST("EFFECT_WIDGET_HORIZONTAL_ANCHOR", "$Horizontal Anchor", _alignments[_effectWidgetHAnchorIdx], _effectWidgetFlags)
441     AddTextOptionST("EFFECT_WIDGET_VERTICAL_ANCHOR", "$Vertical Anchor", _vertAlignments[_effectWidgetVAnchorIdx], _effectWidgetFlags)
442     AddSliderOptionST("EFFECT_WIDGET_GROUP_COUNT", "$Icon Group Count", SKI_ActiveEffectsWidgetInstance.GroupEffectCount, "{0}", _effectWidgetFlags)
443     AddSliderOptionST("EFFECT_WIDGET_XOFFSET", "$Horizontal Offset", _effectWidgetXOffset, "{0}", _effectWidgetFlags)
444     AddSliderOptionST("EFFECT_WIDGET_YOFFSET", "$Vertical Offset", _effectWidgetYOffset, "{0}", _effectWidgetFlags)
445    
446     SetCursorPosition(1)
447    
448     AddHeaderOption("$Item Card")
449     AddTextOptionST("ITEMCARD_ALIGN", "$Align", _alignments[_itemcardAlignIdx])
450     AddSliderOptionST("ITEMCARD_XOFFSET", "$Horizontal Offset", _itemcardXOffset)
451     AddSliderOptionST("ITEMCARD_YOFFSET", "$Vertical Offset", _itemcardYOffset)
452    
453     AddEmptyOption()
454    
455     AddHeaderOption("$SWF Version Checking")
456     AddToggleOptionST("CHECK_MAP_MENU", "Map Menu", SKI_MainInstance.MapMenuCheckEnabled)
457     AddToggleOptionST("CHECK_FAVORITES_MENU", "Favorites Menu", SKI_MainInstance.FavoritesMenuCheckEnabled)
458     AddToggleOptionST("CHECK_INVENTORY_MENU", "Inventory Menu", SKI_MainInstance.InventoryMenuCheckEnabled)
459     AddToggleOptionST("CHECK_MAGIC_MENU", "Magic Menu", SKI_MainInstance.MagicMenuCheckEnabled)
460     AddToggleOptionST("CHECK_BARTER_MENU", "Barter Menu", SKI_MainInstance.BarterMenuCheckEnabled)
461     AddToggleOptionST("CHECK_CONTAINER_MENU", "Container Menu", SKI_MainInstance.ContainerMenuCheckEnabled)
462     AddToggleOptionST("CHECK_CRAFTING_MENU", "Crafting Menu", SKI_MainInstance.CraftingMenuCheckEnabled)
463     AddToggleOptionST("CHECK_GIFT_MENU", "Gift Menu", SKI_MainInstance.GiftMenuCheckEnabled)
464    
465     endIf
466     endEvent
467    
468    
469     ; STATE OPTIONS -----------------------------------------------------------------------------------
470    
471     state FAV_GROUP_ADD_KEY ; KEYMAP
472    
473     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
474     if (! ValidateKey(a_keyCode, false))
475     return
476     endIf
477    
478     SKI_FavoritesManagerInstance.GroupAddKey = a_keyCode
479     RefreshFavoriteHotkeys()
480     endEvent
481    
482     event OnDefaultST()
483     SKI_FavoritesManagerInstance.GroupAddKey = 33
484     RefreshFavoriteHotkeys()
485     endEvent
486    
487     event OnHighlightST()
488     SetInfoText("$SKI_INFO1{F}")
489     endEvent
490    
491     endState
492    
493     state FAV_GROUP_USE_KEY ; KEYMAP
494    
495     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
496     if (! ValidateKey(a_keyCode, false))
497     return
498     endIf
499    
500     SKI_FavoritesManagerInstance.GroupUseKey = a_keyCode
501     RefreshFavoriteHotkeys()
502     endEvent
503    
504     event OnDefaultST()
505     SKI_FavoritesManagerInstance.GroupUseKey = 19
506     RefreshFavoriteHotkeys()
507     endEvent
508    
509     event OnHighlightST()
510     SetInfoText("$SKI_INFO1{R}")
511     endEvent
512    
513     endState
514    
515     state FAV_SET_ICON_KEY ; KEYMAP
516    
517     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
518     if (! ValidateKey(a_keyCode, false))
519     return
520     endIf
521    
522     SKI_FavoritesManagerInstance.SetIconKey = a_keyCode
523     RefreshFavoriteHotkeys()
524     endEvent
525    
526     event OnDefaultST()
527     SKI_FavoritesManagerInstance.SetIconKey = 56
528     RefreshFavoriteHotkeys()
529     endEvent
530    
531     event OnHighlightST()
532     SetInfoText("$SKI_INFO1{LAlt}")
533     endEvent
534    
535     endState
536    
537     state FAV_EQUIP_STATE_KEY ; KEYMAP
538    
539     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
540     if (! ValidateKey(a_keyCode, false))
541     return
542     endIf
543    
544     SKI_FavoritesManagerInstance.SaveEquipStateKey = a_keyCode
545     RefreshFavoriteHotkeys()
546     endEvent
547    
548     event OnDefaultST()
549     SKI_FavoritesManagerInstance.SaveEquipStateKey = 20
550     RefreshFavoriteHotkeys()
551     endEvent
552    
553     event OnHighlightST()
554     SetInfoText("$SKI_INFO1{T}")
555     endEvent
556    
557     endState
558    
559     state FAV_TOGGLE_FOCUS ; KEYMAP
560    
561     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
562     if (! ValidateKey(a_keyCode, false))
563     return
564     endIf
565    
566     SKI_FavoritesManagerInstance.ToggleFocusKey = a_keyCode
567     RefreshFavoriteHotkeys()
568     endEvent
569    
570     event OnDefaultST()
571     SKI_FavoritesManagerInstance.ToggleFocusKey = 57
572     RefreshFavoriteHotkeys()
573     endEvent
574    
575     event OnHighlightST()
576     SetInfoText("$SKI_INFO1{Space}")
577     endEvent
578    
579     endState
580    
581     state FAV_GROUP_USE_HOTKEY1 ; KEYMAP
582    
583     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
584     SetFavoritesGroupHotkey(0, a_keyCode, a_conflictControl, a_conflictName)
585     endEvent
586    
587     event OnDefaultST()
588     SetFavoritesGroupHotkey(0, 59)
589     endEvent
590    
591     event OnHighlightST()
592     SetInfoText("$SKI_INFO1{F1}")
593     endEvent
594    
595     endState
596    
597     state FAV_GROUP_USE_HOTKEY2 ; KEYMAP
598    
599     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
600     SetFavoritesGroupHotkey(1, a_keyCode, a_conflictControl, a_conflictName)
601     endEvent
602    
603     event OnDefaultST()
604     SetFavoritesGroupHotkey(1, 60)
605     endEvent
606    
607     event OnHighlightST()
608     SetInfoText("$SKI_INFO1{F2}")
609     endEvent
610    
611     endState
612    
613     state FAV_GROUP_USE_HOTKEY3 ; KEYMAP
614    
615     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
616     SetFavoritesGroupHotkey(2, a_keyCode, a_conflictControl, a_conflictName)
617     endEvent
618    
619     event OnDefaultST()
620     SetFavoritesGroupHotkey(2, 61)
621     endEvent
622    
623     event OnHighlightST()
624     SetInfoText("$SKI_INFO1{F3}")
625     endEvent
626    
627     endState
628    
629     state FAV_GROUP_USE_HOTKEY4 ; KEYMAP
630    
631     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
632     SetFavoritesGroupHotkey(3, a_keyCode, a_conflictControl, a_conflictName)
633     endEvent
634    
635     event OnDefaultST()
636     SetFavoritesGroupHotkey(3, 62)
637     endEvent
638    
639     event OnHighlightST()
640     SetInfoText("$SKI_INFO1{F4}")
641     endEvent
642    
643     endState
644    
645     state FAV_GROUP_USE_HOTKEY5 ; KEYMAP
646    
647     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
648     SetFavoritesGroupHotkey(4, a_keyCode, a_conflictControl, a_conflictName)
649     endEvent
650    
651     event OnDefaultST()
652     SetFavoritesGroupHotkey(4, -1)
653     endEvent
654    
655     event OnHighlightST()
656     SetInfoText("$SKI_INFO1{$Off}")
657     endEvent
658    
659     endState
660    
661     state FAV_GROUP_USE_HOTKEY6 ; KEYMAP
662    
663     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
664     SetFavoritesGroupHotkey(5, a_keyCode, a_conflictControl, a_conflictName)
665     endEvent
666    
667     event OnDefaultST()
668     SetFavoritesGroupHotkey(5, -1)
669     endEvent
670    
671     event OnHighlightST()
672     SetInfoText("$SKI_INFO1{$Off}")
673     endEvent
674    
675     endState
676    
677     state FAV_GROUP_USE_HOTKEY7 ; KEYMAP
678    
679     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
680     SetFavoritesGroupHotkey(6, a_keyCode, a_conflictControl, a_conflictName)
681     endEvent
682    
683     event OnDefaultST()
684     SetFavoritesGroupHotkey(6, -1)
685     endEvent
686    
687     event OnHighlightST()
688     SetInfoText("$SKI_INFO1{$Off}")
689     endEvent
690    
691     endState
692    
693     state FAV_GROUP_USE_HOTKEY8 ; KEYMAP
694    
695     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
696     SetFavoritesGroupHotkey(7, a_keyCode, a_conflictControl, a_conflictName)
697     endEvent
698    
699     event OnDefaultST()
700     SetFavoritesGroupHotkey(7, -1)
701     endEvent
702    
703     event OnHighlightST()
704     SetInfoText("$SKI_INFO1{$Off}")
705     endEvent
706    
707     endState
708    
709     state FAV_MENU_HELP_ENABLED ; TOGGLE
710    
711     event OnSelectST()
712     bool newVal = !SKI_FavoritesManagerInstance.ButtonHelpEnabled
713     SKI_FavoritesManagerInstance.ButtonHelpEnabled = newVal
714    
715     SetToggleOptionValueST(newVal)
716     endEvent
717    
718     event OnDefaultST()
719     SKI_FavoritesManagerInstance.ButtonHelpEnabled = true
720    
721     SetToggleOptionValueST(true)
722     endEvent
723    
724     event OnHighlightST()
725     SetInfoText("$SKI_INFO1{$On}")
726     endEvent
727    
728     endState
729    
730     state FAV_GROUP_SELECT ; MENU
731    
732     event OnMenuOpenST()
733     SetMenuDialogStartIndex(_favCurGroupIdx)
734     SetMenuDialogDefaultIndex(0)
735     SetMenuDialogOptions(_favGroupNames)
736     endEvent
737    
738     event OnMenuAcceptST(int a_index)
739     _favCurGroupIdx = a_index
740    
741     SetCurrentFavoriteGroup(_favCurGroupIdx)
742    
743     SetMenuOptionValueST(_favGroupNames[_favCurGroupIdx])
744     endEvent
745    
746     event OnDefaultST()
747     _favCurGroupIdx = 0
748    
749     SetCurrentFavoriteGroup(_favCurGroupIdx)
750    
751     SetTextOptionValueST(_favCurGroupIdx+1)
752     endEvent
753    
754     event OnHighlightST()
755     SetInfoText("$SKI_INFO6")
756     endEvent
757    
758     endState
759    
760     state FAV_GROUP_UNEQUIP_ARMOR ; TOGGLE
761    
762     event OnSelectST()
763     int ARMOR_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_ARMOR
764    
765     bool newVal = !SKI_FavoritesManagerInstance.GetGroupFlag(_favCurGroupIdx, ARMOR_FLAG)
766     SKI_FavoritesManagerInstance.SetGroupFlag(_favCurGroupIdx, ARMOR_FLAG, newVal)
767    
768     SetToggleOptionValueST(newVal)
769     endEvent
770    
771     event OnDefaultST()
772     int ARMOR_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_ARMOR
773    
774     SKI_FavoritesManagerInstance.SetGroupFlag(_favCurGroupIdx, ARMOR_FLAG, false)
775    
776     SetToggleOptionValueST(false)
777     endEvent
778    
779     event OnHighlightST()
780     SetInfoText("$SKI_INFO7{$Off}")
781     endEvent
782    
783     endState
784    
785     state FAV_GROUP_UNEQUIP_HANDS ; TOGGLE
786    
787     event OnSelectST()
788     int HANDS_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_HANDS
789    
790     bool newVal = !SKI_FavoritesManagerInstance.GetGroupFlag(_favCurGroupIdx, HANDS_FLAG)
791     SKI_FavoritesManagerInstance.SetGroupFlag(_favCurGroupIdx, HANDS_FLAG, newVal)
792    
793     SetToggleOptionValueST(newVal)
794     endEvent
795    
796     event OnDefaultST()
797     int HANDS_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_ARMOR
798    
799     SKI_FavoritesManagerInstance.SetGroupFlag(_favCurGroupIdx, HANDS_FLAG, false)
800    
801     SetToggleOptionValueST(false)
802     endEvent
803    
804     event OnHighlightST()
805     SetInfoText("$SKI_INFO8{$Off}")
806     endEvent
807    
808     endState
809    
810     ; -------------------------------------------------------
811    
812     state ITEMLIST_FONT_SIZE ; TEXT
813    
814     event OnSelectST()
815     if (_itemlistFontSizeIdx < _sizes.length - 1)
816     _itemlistFontSizeIdx += 1
817     else
818     _itemlistFontSizeIdx = 0
819     endif
820     SetTextOptionValueST(_sizes[_itemlistFontSizeIdx])
821     ApplyItemListFontSize()
822     endEvent
823    
824     event OnDefaultST()
825     _itemlistFontSizeIdx = 1
826     SetTextOptionValueST(_sizes[_itemlistFontSizeIdx])
827     ApplyItemListFontSize()
828     endEvent
829    
830     event OnHighlightST()
831     SetInfoText("$SKI_INFO1{" + _sizes[1] + "}")
832     endEvent
833    
834     endState
835    
836     state ITEMLIST_QUANTITY_MIN_COUNT ; SLIDER
837    
838     event OnSliderOpenST()
839     SetSliderDialogStartValue(_itemlistQuantityMinCount)
840     SetSliderDialogDefaultValue(6)
841     SetSliderDialogRange(0, 100)
842     SetSliderDialogInterval(1)
843     endEvent
844    
845     event OnSliderAcceptST(float a_value)
846     _itemlistQuantityMinCount = a_value as int
847     SetSliderOptionValueST(_itemlistQuantityMinCount)
848     SKI_SettingsManagerInstance.SetOverride("ItemList$quantityMenu$minCount", _itemlistQuantityMinCount)
849     endEvent
850    
851     event OnDefaultST()
852     _itemlistQuantityMinCount = 6
853     SetSliderOptionValueST(_itemlistQuantityMinCount)
854     SKI_SettingsManagerInstance.SetOverride("ItemList$quantityMenu$minCount", _itemlistQuantityMinCount)
855     endEvent
856    
857     event OnHighlightST()
858     SetInfoText("$SKI_INFO2{6}")
859     endEvent
860    
861     endState
862    
863     state ITEMLIST_CATEGORY_ICON_THEME ; MENU
864    
865     event OnMenuOpenST()
866     SetMenuDialogStartIndex(_categoryIconThemeIdx)
867     SetMenuDialogDefaultIndex(0)
868     SetMenuDialogOptions(_categoryIconThemeLongNames)
869     endEvent
870    
871     event OnMenuAcceptST(int a_index)
872     _categoryIconThemeIdx = a_index
873     SetMenuOptionValueST(_categoryIconThemeShortNames[_categoryIconThemeIdx])
874     SKI_SettingsManagerInstance.SetOverride("Appearance$icons$category$source", _categoryIconThemeValues[_categoryIconThemeIdx])
875     endEvent
876    
877     event OnDefaultST()
878     _categoryIconThemeIdx = 0
879     SetTextOptionValueST(_categoryIconThemeShortNames[_categoryIconThemeIdx])
880     SKI_SettingsManagerInstance.SetOverride("Appearance$icons$category$source", _categoryIconThemeValues[_categoryIconThemeIdx])
881     endEvent
882    
883     event OnHighlightST()
884     SetInfoText("$SKI_INFO1{" + _categoryIconThemeShortNames[0] + "}")
885     endEvent
886    
887     endState
888    
889     state ITEMLIST_NO_ICON_COLORS ; TOGGLE
890    
891     event OnSelectST()
892     _itemListNoIconColors = !_itemlistNoIconColors
893     SetToggleOptionValueST(_itemlistNoIconColors)
894     SKI_SettingsManagerInstance.SetOverride("Appearance$icons$item$noColor", _itemlistNoIconColors)
895     endEvent
896    
897     event OnDefaultST()
898     _itemlistNoIconColors = false
899     SetToggleOptionValueST(_itemlistNoIconColors)
900     SKI_SettingsManagerInstance.SetOverride("Appearance$icons$item$noColor", _itemlistNoIconColors)
901     endEvent
902    
903     event OnHighlightST()
904     SetInfoText("$SKI_INFO1{$Off}")
905     endEvent
906    
907     endState
908    
909     ; -------------------------------------------------------
910    
911     state EFFECT_WIDGET_ENABLED ; TOGGLE
912    
913     event OnSelectST()
914     bool newVal = !SKI_ActiveEffectsWidgetInstance.Enabled
915     SKI_ActiveEffectsWidgetInstance.Enabled = newVal
916    
917     if (newVal)
918     _effectWidgetFlags = OPTION_FLAG_NONE
919     else
920     _effectWidgetFlags = OPTION_FLAG_DISABLED
921     endIf
922    
923     SetOptionFlagsST(_effectWidgetFlags, true, "EFFECT_WIDGET_ICON_SIZE")
924     SetOptionFlagsST(_effectWidgetFlags, true, "EFFECT_WIDGET_MIN_TIME_LEFT")
925    
926     SetToggleOptionValueST(newVal)
927     endEvent
928    
929     event OnDefaultST()
930     SKI_ActiveEffectsWidgetInstance.Enabled = true
931    
932     _effectWidgetFlags = OPTION_FLAG_NONE
933    
934     SetOptionFlagsST(_effectWidgetFlags, true, "EFFECT_WIDGET_ICON_SIZE")
935     SetOptionFlagsST(_effectWidgetFlags, true, "EFFECT_WIDGET_MIN_TIME_LEFT")
936    
937     SetToggleOptionValueST(true)
938     endEvent
939    
940     event OnHighlightST()
941     SetInfoText("$SKI_INFO1{$On}")
942     endEvent
943    
944     endState
945    
946     state EFFECT_WIDGET_ICON_SIZE ; TEXT
947    
948     event OnSelectST()
949     if (_effectWidgetIconSizeIdx < _sizes.length - 1)
950     _effectWidgetIconSizeIdx += 1
951     else
952     _effectWidgetIconSizeIdx = 0
953     endIf
954    
955     SKI_ActiveEffectsWidgetInstance.EffectSize = _effectWidgetIconSizeValues[_effectWidgetIconSizeIdx]
956     SetTextOptionValueST(_sizes[_effectWidgetIconSizeIdx])
957     endEvent
958    
959     event OnDefaultST()
960     _effectWidgetIconSizeIdx = 1
961     SKI_ActiveEffectsWidgetInstance.EffectSize = _effectWidgetIconSizeValues[_effectWidgetIconSizeIdx]
962     SetTextOptionValueST(_sizes[_effectWidgetIconSizeIdx])
963     endEvent
964    
965     event OnHighlightST()
966     SetInfoText("$SKI_INFO1{" + _sizes[1] + "}")
967     endEvent
968    
969     endState
970    
971     state EFFECT_WIDGET_ORIENTATION ; TEXT
972    
973     event OnSelectST()
974     if (_effectWidgetOrientationIdx < _orientations.length - 1)
975     _effectWidgetOrientationIdx += 1
976     else
977     _effectWidgetOrientationIdx = 0
978     endIf
979    
980     SKI_ActiveEffectsWidgetInstance.Orientation = _orientationValues[_effectWidgetOrientationIdx]
981     SetTextOptionValueST(_orientations[_effectWidgetOrientationIdx])
982     endEvent
983    
984     event OnDefaultST()
985     _effectWidgetOrientationIdx = 1
986     SKI_ActiveEffectsWidgetInstance.Orientation = _orientationValues[_effectWidgetOrientationIdx]
987     SetTextOptionValueST(_orientations[_effectWidgetOrientationIdx])
988     endEvent
989    
990     event OnHighlightST()
991     SetInfoText("$SKI_INFO1{" + _orientations[1] + "}")
992     endEvent
993    
994     endState
995    
996     state EFFECT_WIDGET_HORIZONTAL_ANCHOR ; TEXT
997    
998     event OnSelectST()
999     if (_effectWidgetHAnchorIdx < _alignments.length - 1)
1000     _effectWidgetHAnchorIdx += 1
1001     else
1002     _effectWidgetHAnchorIdx = 0
1003     endIf
1004    
1005     SKI_ActiveEffectsWidgetInstance.HAnchor = _alignmentValues[_effectWidgetHAnchorIdx]
1006     SKI_ActiveEffectsWidgetInstance.X = _alignmentBaseOffsets[_effectWidgetHAnchorIdx] + _effectWidgetXOffset
1007     SetTextOptionValueST(_alignments[_effectWidgetHAnchorIdx])
1008     endEvent
1009    
1010     event OnDefaultST()
1011     _effectWidgetVAnchorIdx = 1
1012     SKI_ActiveEffectsWidgetInstance.X = _alignmentBaseOffsets[_effectWidgetHAnchorIdx] + _effectWidgetXOffset
1013     SetTextOptionValueST(_alignments[_effectWidgetHAnchorIdx])
1014     endEvent
1015    
1016     event OnHighlightST()
1017     SetInfoText("$SKI_INFO1{" + _alignments[1] + "}")
1018     endEvent
1019    
1020     endState
1021    
1022     state EFFECT_WIDGET_VERTICAL_ANCHOR ; TEXT
1023    
1024     event OnSelectST()
1025     if (_effectWidgetVAnchorIdx < _vertAlignments.length - 1)
1026     _effectWidgetVAnchorIdx += 1
1027     else
1028     _effectWidgetVAnchorIdx = 0
1029     endIf
1030    
1031     SKI_ActiveEffectsWidgetInstance.VAnchor = _vertAlignmentValues[_effectWidgetVAnchorIdx]
1032     SKI_ActiveEffectsWidgetInstance.Y = _vertAlignmentBaseOffsets[_effectWidgetVAnchorIdx] + _effectWidgetYOffset
1033     SetTextOptionValueST(_vertAlignments[_effectWidgetVAnchorIdx])
1034     endEvent
1035    
1036     event OnDefaultST()
1037     _effectWidgetVAnchorIdx = 0
1038     SKI_ActiveEffectsWidgetInstance.Y = _vertAlignmentBaseOffsets[_effectWidgetVAnchorIdx] + _effectWidgetYOffset
1039     SetTextOptionValueST(_vertAlignments[_effectWidgetVAnchorIdx])
1040     endEvent
1041    
1042     event OnHighlightST()
1043     SetInfoText("$SKI_INFO1{" + _vertAlignments[0] + "}")
1044     endEvent
1045    
1046     endState
1047    
1048     state EFFECT_WIDGET_MIN_TIME_LEFT ; SLIDER
1049    
1050     event OnSliderOpenST()
1051     SetSliderDialogStartValue(SKI_ActiveEffectsWidgetInstance.MinimumTimeLeft)
1052     SetSliderDialogDefaultValue(180)
1053     SetSliderDialogRange(0, 600)
1054     SetSliderDialogInterval(10)
1055     endEvent
1056    
1057     event OnSliderAcceptST(float a_value)
1058     SKI_ActiveEffectsWidgetInstance.MinimumTimeLeft = a_value as int
1059     SetSliderOptionValueST(a_value as int, "{0} s")
1060     endEvent
1061    
1062     event OnDefaultST()
1063     SKI_ActiveEffectsWidgetInstance.MinimumTimeLeft = 180
1064     SetSliderOptionValueST(180)
1065     endEvent
1066    
1067     event OnHighlightST()
1068     SetInfoText("$SKI_INFO5{180}")
1069     endEvent
1070    
1071     endState
1072    
1073     state EFFECT_WIDGET_GROUP_COUNT ; SLIDER
1074    
1075     event OnSliderOpenST()
1076     SetSliderDialogStartValue(SKI_ActiveEffectsWidgetInstance.GroupEffectCount)
1077     SetSliderDialogDefaultValue(8)
1078     SetSliderDialogRange(1, 16)
1079     SetSliderDialogInterval(1)
1080     endEvent
1081    
1082     event OnSliderAcceptST(float a_value)
1083     SKI_ActiveEffectsWidgetInstance.GroupEffectCount = a_value as int
1084     SetSliderOptionValueST(a_value as int)
1085     endEvent
1086    
1087     event OnDefaultST()
1088     SKI_ActiveEffectsWidgetInstance.GroupEffectCount = 8
1089     SetSliderOptionValueST(8)
1090     endEvent
1091    
1092     event OnHighlightST()
1093     SetInfoText("$SKI_INFO1{8}")
1094     endEvent
1095    
1096     endState
1097    
1098     state EFFECT_WIDGET_XOFFSET ; SLIDER
1099    
1100     event OnSliderOpenST()
1101     SetSliderDialogStartValue(_effectWidgetXOffset)
1102     SetSliderDialogDefaultValue(0)
1103     SetSliderDialogRange(-1280, 1280)
1104     SetSliderDialogInterval(1)
1105     endEvent
1106    
1107     event OnSliderAcceptST(float a_value)
1108     _effectWidgetXOffset = a_value
1109     SKI_ActiveEffectsWidgetInstance.X = _alignmentBaseOffsets[_effectWidgetHAnchorIdx] + _effectWidgetXOffset
1110     SetSliderOptionValueST(_effectWidgetXOffset)
1111     endEvent
1112    
1113     event OnDefaultST()
1114     _effectWidgetXOffset = 0.0
1115     SKI_ActiveEffectsWidgetInstance.X = _alignmentBaseOffsets[_effectWidgetHAnchorIdx] + _effectWidgetXOffset
1116     SetSliderOptionValueST(_effectWidgetXOffset)
1117     endEvent
1118    
1119     event OnHighlightST()
1120     SetInfoText("$SKI_INFO1{0}")
1121     endEvent
1122    
1123     endState
1124    
1125     state EFFECT_WIDGET_YOFFSET ; SLIDER
1126    
1127     event OnSliderOpenST()
1128     SetSliderDialogStartValue(_effectWidgetYOffset)
1129     SetSliderDialogDefaultValue(0)
1130     SetSliderDialogRange(-720, 720)
1131     SetSliderDialogInterval(1)
1132     endEvent
1133    
1134     event OnSliderAcceptST(float a_value)
1135     _effectWidgetYOffset = a_value
1136     SKI_ActiveEffectsWidgetInstance.Y = _vertAlignmentBaseOffsets[_effectWidgetVAnchorIdx] + _effectWidgetYOffset
1137     SetSliderOptionValueST(_effectWidgetYOffset)
1138     endEvent
1139    
1140     event OnDefaultST()
1141     _effectWidgetYOffset = 0.0
1142     SKI_ActiveEffectsWidgetInstance.Y = _vertAlignmentBaseOffsets[_effectWidgetVAnchorIdx] + _effectWidgetYOffset
1143     SetSliderOptionValueST(_effectWidgetYOffset)
1144     endEvent
1145    
1146     event OnHighlightST()
1147     SetInfoText("$SKI_INFO1{0}")
1148     endEvent
1149    
1150     endState
1151    
1152     ; -------------------------------------------------------
1153    
1154     state SEARCH_KEY ; KEYMAP
1155    
1156     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1157     if (! ValidateKey(a_keyCode, false))
1158     return
1159     endIf
1160    
1161     SwapItemListKey(a_keyCode, _searchKey)
1162    
1163     _searchKey = a_keyCode
1164     SetKeyMapOptionValueST(_searchKey)
1165     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$search", _searchKey)
1166     endEvent
1167    
1168     event OnDefaultST()
1169     _searchKey = 57
1170     SetKeyMapOptionValueST(_searchKey)
1171     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$search", _searchKey)
1172     endEvent
1173    
1174     event OnHighlightST()
1175     SetInfoText("$SKI_INFO1{Space}")
1176     endEvent
1177    
1178     endState
1179    
1180     state SWITCH_TAB_KEY ; KEYMAP
1181    
1182     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1183     if (! ValidateKey(a_keyCode, false))
1184     return
1185     endIf
1186    
1187     SwapItemListKey(a_keyCode, _switchTabKey)
1188    
1189     _switchTabKey = a_keyCode
1190     SetKeyMapOptionValueST(_switchTabKey)
1191     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$switchTab", _switchTabKey)
1192     endEvent
1193    
1194     event OnDefaultST()
1195     _switchTabKey = 56
1196     SetKeyMapOptionValueST(_switchTabKey)
1197     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$switchTab", _switchTabKey)
1198     endEvent
1199    
1200     event OnHighlightST()
1201     SetInfoText("$SKI_INFO1{LAlt}")
1202     endEvent
1203    
1204     endState
1205    
1206     state EQUIP_MODE_KEY ; KEYMAP
1207    
1208     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1209     if (! ValidateKey(a_keyCode, false))
1210     return
1211     endIf
1212    
1213     SwapItemListKey(a_keyCode, _equipModeKey)
1214    
1215     _equipModeKey = a_keyCode
1216     SetKeyMapOptionValueST(_equipModeKey)
1217     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$equipMode", _equipModeKey)
1218     endEvent
1219    
1220     event OnDefaultST()
1221     _equipModeKey = 42
1222     SetKeyMapOptionValueST(_equipModeKey)
1223     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$equipMode", _equipModeKey)
1224     endEvent
1225    
1226     event OnHighlightST()
1227     SetInfoText("$SKI_INFO1{Shift}")
1228     endEvent
1229    
1230     endState
1231    
1232     state SWITCH_TAB_BUTTON ; KEYMAP
1233    
1234     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1235     if (! ValidateKey(a_keyCode, true))
1236     return
1237     endIf
1238    
1239     SwapItemListKey(a_keyCode, _switchTabButton)
1240    
1241     _switchTabButton = a_keyCode
1242     SetKeyMapOptionValueST(_switchTabButton)
1243     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$switchTab", _switchTabButton)
1244     endEvent
1245    
1246     event OnDefaultST()
1247     _switchTabButton = 271
1248     SetKeyMapOptionValueST(_switchTabButton)
1249     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$switchTab", _switchTabButton)
1250     endEvent
1251    
1252     event OnHighlightST()
1253     SetInfoText("$SKI_INFO1{Back}")
1254     endEvent
1255    
1256     endState
1257    
1258     state PREV_COLUMN_BUTTON ; KEYMAP
1259    
1260     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1261     if (! ValidateKey(a_keyCode, true))
1262     return
1263     endIf
1264    
1265     SwapItemListKey(a_keyCode, _prevColumnButton)
1266    
1267     _prevColumnButton = a_keyCode
1268     SetKeyMapOptionValueST(_prevColumnButton)
1269     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$prevColumn", _prevColumnButton)
1270     endEvent
1271    
1272     event OnDefaultST()
1273     _prevColumnButton = 274
1274     SetKeyMapOptionValueST(_prevColumnButton)
1275     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$prevColumn", _prevColumnButton)
1276     endEvent
1277    
1278     event OnHighlightST()
1279     SetInfoText("$SKI_INFO1{LB}")
1280     endEvent
1281    
1282     endState
1283    
1284     state NEXT_COLUMN_BUTTON ; KEYMAP
1285    
1286     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1287     if (! ValidateKey(a_keyCode, true))
1288     return
1289     endIf
1290    
1291     SwapItemListKey(a_keyCode, _nextColumnButton)
1292    
1293     _nextColumnButton = a_keyCode
1294     SetKeyMapOptionValueST(_nextColumnButton)
1295     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$nextColumn", _nextColumnButton)
1296     endEvent
1297    
1298     event OnDefaultST()
1299     _nextColumnButton = 275
1300     SetKeyMapOptionValueST(_nextColumnButton)
1301     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$nextColumn", _nextColumnButton)
1302     endEvent
1303    
1304     event OnHighlightST()
1305     SetInfoText("$SKI_INFO1{RB}")
1306     endEvent
1307    
1308     endState
1309    
1310     state SORT_ORDER_BUTTON ; KEYMAP
1311    
1312     event OnKeyMapChangeST(int a_keyCode, string a_conflictControl, string a_conflictName)
1313     if (! ValidateKey(a_keyCode, true))
1314     return
1315     endIf
1316    
1317     SwapItemListKey(a_keyCode, _sortOrderButton)
1318    
1319     _sortOrderButton = a_keyCode
1320     SetKeyMapOptionValueST(_sortOrderButton)
1321     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$sortOrder", _sortOrderButton)
1322     endEvent
1323    
1324     event OnDefaultST()
1325     _sortOrderButton = 272
1326     SetKeyMapOptionValueST(_sortOrderButton)
1327     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$sortOrder", _sortOrderButton)
1328     endEvent
1329    
1330     event OnHighlightST()
1331     SetInfoText("$SKI_INFO1{LS}")
1332     endEvent
1333    
1334     endState
1335    
1336     ; -------------------------------------------------------
1337    
1338     state ITEMCARD_ALIGN ; KEYMAP
1339    
1340     event OnSelectST()
1341     if (_itemcardAlignIdx < _alignments.length - 1)
1342     _itemcardAlignIdx += 1
1343     else
1344     _itemcardAlignIdx = 0
1345     endif
1346     SKI_SettingsManagerInstance.SetOverride("ItemInfo$itemcard$align", _alignmentValues[_itemcardAlignIdx])
1347     SetTextOptionValueST(_alignments[_itemcardAlignIdx])
1348     endEvent
1349    
1350     event OnDefaultST()
1351     _itemcardAlignIdx = 2
1352     SKI_SettingsManagerInstance.SetOverride("ItemInfo$itemcard$align", _alignmentValues[_itemcardAlignIdx])
1353     SetTextOptionValueST(_alignments[_itemcardAlignIdx])
1354     endEvent
1355    
1356     event OnHighlightST()
1357     SetInfoText("$SKI_INFO1{" + _alignments[2] + "}")
1358     endEvent
1359    
1360     endState
1361    
1362     state ITEMCARD_XOFFSET ; SLIDER
1363    
1364     event OnSliderOpenST()
1365     SetSliderDialogStartValue(_itemcardXOffset)
1366     SetSliderDialogDefaultValue(0)
1367     SetSliderDialogRange(-1000, 1000)
1368     SetSliderDialogInterval(1)
1369     endEvent
1370    
1371     event OnSliderAcceptST(float a_value)
1372     _itemcardXOffset = a_value
1373     SetSliderOptionValueST(_itemcardXOffset)
1374     SKI_SettingsManagerInstance.SetOverride("ItemInfo$itemcard$xOffset", _itemcardXOffset)
1375     endEvent
1376    
1377     event OnDefaultST()
1378     _itemcardXOffset = 0.0
1379     SetSliderOptionValueST(_itemcardXOffset)
1380     SKI_SettingsManagerInstance.SetOverride("ItemInfo$itemcard$xOffset", _itemcardXOffset)
1381     endEvent
1382    
1383     event OnHighlightST()
1384     SetInfoText("$SKI_INFO1{0}")
1385     endEvent
1386    
1387     endState
1388    
1389     state ITEMCARD_YOFFSET ; SLIDER
1390    
1391     event OnSliderOpenST()
1392     SetSliderDialogStartValue(_itemcardYOffset)
1393     SetSliderDialogDefaultValue(0)
1394     SetSliderDialogRange(-1000, 1000)
1395     SetSliderDialogInterval(1)
1396     endEvent
1397    
1398     event OnSliderAcceptST(float a_value)
1399     _itemcardYOffset = a_value
1400     SetSliderOptionValueST(_itemcardYOffset)
1401     SKI_SettingsManagerInstance.SetOverride("ItemInfo$itemcard$yOffset", _itemcardYOffset)
1402     endEvent
1403    
1404     event OnDefaultST()
1405     _itemcardYOffset = 0.0
1406     SetSliderOptionValueST(_itemcardYOffset)
1407     SKI_SettingsManagerInstance.SetOverride("ItemInfo$itemcard$yOffset", _itemcardYOffset)
1408     endEvent
1409    
1410     event OnHighlightST()
1411     SetInfoText("$SKI_INFO1{0}")
1412     endEvent
1413    
1414     endState
1415    
1416     ; -------------------------------------------------------
1417    
1418     state XD_ITEM_XOFFSET ; SLIDER
1419    
1420     event OnSliderOpenST()
1421     SetSliderDialogStartValue(_3DItemXOffset)
1422     SetSliderDialogDefaultValue(0)
1423     SetSliderDialogRange(-128, 128)
1424     SetSliderDialogInterval(1)
1425     endEvent
1426    
1427     event OnSliderAcceptST(float a_value)
1428     _3DItemXOffset = a_value
1429     SetSliderOptionValueST(_3DItemXOffset)
1430     Apply3DItemXOffset()
1431     endEvent
1432    
1433     event OnDefaultST()
1434     _3DItemXOffset = 0.0
1435     SetSliderOptionValueST(_3DItemXOffset)
1436     Apply3DItemXOffset()
1437     endEvent
1438    
1439     event OnHighlightST()
1440     SetInfoText("$SKI_INFO1{0}")
1441     endEvent
1442    
1443     endState
1444    
1445     state XD_ITEM_YOFFSET ; SLIDER
1446    
1447     event OnSliderOpenST()
1448     SetSliderDialogStartValue(_3DItemYOffset)
1449     SetSliderDialogDefaultValue(0)
1450     SetSliderDialogRange(-128, 128)
1451     SetSliderDialogInterval(1)
1452     endEvent
1453    
1454     event OnSliderAcceptST(float a_value)
1455     _3DItemYOffset = a_value
1456     SetSliderOptionValueST(_3DItemYOffset)
1457     Apply3DItemYOffset()
1458     endEvent
1459    
1460     event OnDefaultST()
1461     _3DItemYOffset = 0.0
1462     SetSliderOptionValueST(_3DItemYOffset)
1463     Apply3DItemYOffset()
1464     endEvent
1465    
1466     event OnHighlightST()
1467     SetInfoText("$SKI_INFO1{0}")
1468     endEvent
1469    
1470     endState
1471    
1472     state XD_ITEM_SCALE ; SLIDER
1473    
1474     event OnSliderOpenST()
1475     SetSliderDialogStartValue(_3DItemScale)
1476     SetSliderDialogDefaultValue(1.5)
1477     SetSliderDialogRange(0.5, 5)
1478     SetSliderDialogInterval(0.1)
1479     endEvent
1480    
1481     event OnSliderAcceptST(float a_value)
1482     _3DItemScale = a_value
1483     SetSliderOptionValueST(_3DItemScale, "{1}")
1484     Apply3DItemScale()
1485     endEvent
1486    
1487     event OnDefaultST()
1488     _3DItemScale = 1.5
1489     SetSliderOptionValueST(_3DItemScale, "{1}")
1490     Apply3DItemScale()
1491     endEvent
1492    
1493     event OnHighlightST()
1494     SetInfoText("$SKI_INFO1{1.5}")
1495     endEvent
1496    
1497     endState
1498    
1499     state XD_ITEM_POSITIONING ; SLIDER
1500    
1501     event OnSelectST()
1502     bool newVal = !_3DItemDisablePositioning
1503     _3DItemDisablePositioning = newVal
1504    
1505     if (newVal)
1506     _3DItemFlags = OPTION_FLAG_DISABLED
1507     else
1508     _3DItemFlags = OPTION_FLAG_NONE
1509     endIf
1510    
1511     SetOptionFlagsST(_3DItemFlags, true, "XD_ITEM_XOFFSET")
1512     SetOptionFlagsST(_3DItemFlags, true, "XD_ITEM_YOFFSET")
1513     SetOptionFlagsST(_3DItemFlags, true, "XD_ITEM_SCALE")
1514     SetToggleOptionValueST(newVal)
1515     Apply3DItemXOffset()
1516     Apply3DItemYOffset()
1517     Apply3DItemScale()
1518     endEvent
1519    
1520     event OnDefaultST()
1521     _3DItemDisablePositioning = false
1522     _3DItemFlags = OPTION_FLAG_NONE
1523     SetOptionFlagsST(_3DItemFlags, true, "XD_ITEM_XOFFSET")
1524     SetOptionFlagsST(_3DItemFlags, true, "XD_ITEM_YOFFSET")
1525     SetOptionFlagsST(_3DItemFlags, true, "XD_ITEM_SCALE")
1526     SetToggleOptionValueST(false)
1527     Apply3DItemXOffset()
1528     Apply3DItemYOffset()
1529     Apply3DItemScale()
1530     endEvent
1531    
1532     event OnHighlightST()
1533     SetInfoText("$SKI_INFO4{$Off}")
1534     endEvent
1535    
1536     endState
1537    
1538     ; -------------------------------------------------------
1539    
1540     state CHECK_INVENTORY_MENU ; SLIDER
1541    
1542     event OnSelectST()
1543     bool newVal = !SKI_MainInstance.InventoryMenuCheckEnabled
1544     SKI_MainInstance.InventoryMenuCheckEnabled = newVal
1545     SetToggleOptionValueST(newVal)
1546     endEvent
1547    
1548     event OnDefaultST()
1549     SKI_MainInstance.InventoryMenuCheckEnabled = true
1550     SetToggleOptionValueST(true)
1551     endEvent
1552    
1553     event OnHighlightST()
1554     SetInfoText("$SKI_INFO3{$On}")
1555     endEvent
1556    
1557     endState
1558    
1559     state CHECK_MAGIC_MENU ; SLIDER
1560    
1561     event OnSelectST()
1562     bool newVal = !SKI_MainInstance.MagicMenuCheckEnabled
1563     SKI_MainInstance.MagicMenuCheckEnabled = newVal
1564     SetToggleOptionValueST(newVal)
1565     endEvent
1566    
1567     event OnDefaultST()
1568     SKI_MainInstance.MagicMenuCheckEnabled = true
1569     SetToggleOptionValueST(true)
1570     endEvent
1571    
1572     event OnHighlightST()
1573     SetInfoText("$SKI_INFO3{$On}")
1574     endEvent
1575    
1576     endState
1577    
1578     state CHECK_BARTER_MENU ; SLIDER
1579    
1580     event OnSelectST()
1581     bool newVal = !SKI_MainInstance.BarterMenuCheckEnabled
1582     SKI_MainInstance.BarterMenuCheckEnabled = newVal
1583     SetToggleOptionValueST(newVal)
1584     endEvent
1585    
1586     event OnDefaultST()
1587     SKI_MainInstance.BarterMenuCheckEnabled = true
1588     SetToggleOptionValueST(true)
1589     endEvent
1590    
1591     event OnHighlightST()
1592     SetInfoText("$SKI_INFO3{$On}")
1593     endEvent
1594    
1595     endState
1596    
1597     state CHECK_CONTAINER_MENU ; SLIDER
1598    
1599     event OnSelectST()
1600     bool newVal = !SKI_MainInstance.ContainerMenuCheckEnabled
1601     SKI_MainInstance.ContainerMenuCheckEnabled = newVal
1602     SetToggleOptionValueST(newVal)
1603     endEvent
1604    
1605     event OnDefaultST()
1606     SKI_MainInstance.ContainerMenuCheckEnabled = true
1607     SetToggleOptionValueST(true)
1608     endEvent
1609    
1610     event OnHighlightST()
1611     SetInfoText("$SKI_INFO3{$On}")
1612     endEvent
1613    
1614     endState
1615    
1616     state CHECK_GIFT_MENU ; SLIDER
1617    
1618     event OnSelectST()
1619     bool newVal = !SKI_MainInstance.GiftMenuCheckEnabled
1620     SKI_MainInstance.GiftMenuCheckEnabled = newVal
1621     SetToggleOptionValueST(newVal)
1622     endEvent
1623    
1624     event OnDefaultST()
1625     SKI_MainInstance.GiftMenuCheckEnabled = true
1626     SetToggleOptionValueST(true)
1627     endEvent
1628    
1629     event OnHighlightST()
1630     SetInfoText("$SKI_INFO3{$On}")
1631     endEvent
1632    
1633     endState
1634    
1635     state CHECK_MAP_MENU ; SLIDER
1636    
1637     event OnSelectST()
1638     bool newVal = !SKI_MainInstance.MapMenuCheckEnabled
1639     SKI_MainInstance.MapMenuCheckEnabled = newVal
1640     SetToggleOptionValueST(newVal)
1641     endEvent
1642    
1643     event OnDefaultST()
1644     SKI_MainInstance.MapMenuCheckEnabled = true
1645     SetToggleOptionValueST(true)
1646     endEvent
1647    
1648     event OnHighlightST()
1649     SetInfoText("$SKI_INFO3{$On}")
1650     endEvent
1651    
1652     endState
1653    
1654     state CHECK_FAVORITES_MENU ; SLIDER
1655    
1656     event OnSelectST()
1657     bool newVal = !SKI_MainInstance.FavoritesMenuCheckEnabled
1658     SKI_MainInstance.FavoritesMenuCheckEnabled = newVal
1659     SetToggleOptionValueST(newVal)
1660     endEvent
1661    
1662     event OnDefaultST()
1663     SKI_MainInstance.FavoritesMenuCheckEnabled = true
1664     SetToggleOptionValueST(true)
1665     endEvent
1666    
1667     event OnHighlightST()
1668     SetInfoText("$SKI_INFO3{$On}")
1669     endEvent
1670    
1671     endState
1672    
1673     state CHECK_CRAFTING_MENU ; SLIDER
1674    
1675     event OnSelectST()
1676     bool newVal = !SKI_MainInstance.CraftingMenuCheckEnabled
1677     SKI_MainInstance.CraftingMenuCheckEnabled = newVal
1678     SetToggleOptionValueST(newVal)
1679     endEvent
1680    
1681     event OnDefaultST()
1682     SKI_MainInstance.CraftingMenuCheckEnabled = true
1683     SetToggleOptionValueST(true)
1684     endEvent
1685    
1686     event OnHighlightST()
1687     SetInfoText("$SKI_INFO3{$On}")
1688     endEvent
1689    
1690     endState
1691    
1692    
1693     ; FUNCTIONS ---------------------------------------------------------------------------------------
1694    
1695     ; @interface
1696     string function GetCustomControl(int a_keyCode)
1697     int[] groupHotkeys = SKI_FavoritesManagerInstance.GetGroupHotkeys()
1698    
1699     int index = groupHotkeys.Find(a_keyCode)
1700     if (index != -1)
1701     return ("Group " + (index+1))
1702     endIf
1703    
1704     return ""
1705     endFunction
1706    
1707     function ApplySettings()
1708     ; Apply settings that aren't handled by SKI_SettingsManagerInstance
1709    
1710     _fInventory3DItemPosXWide = Utility.GetINIFloat("fInventory3DItemPosXWide:Interface")
1711     _fInventory3DItemPosX = Utility.GetINIFloat("fInventory3DItemPosX:Interface")
1712     _fMagic3DItemPosXWide = Utility.GetINIFloat("fMagic3DItemPosXWide:Interface")
1713     _fMagic3DItemPosX = Utility.GetINIFloat("fMagic3DItemPosX:Interface")
1714    
1715     _fInventory3DItemPosZWide = Utility.GetINIFloat("fInventory3DItemPosZWide:Interface")
1716     _fInventory3DItemPosZ = Utility.GetINIFloat("fInventory3DItemPosZ:Interface")
1717     _fMagic3DItemPosZWide = Utility.GetINIFloat("fMagic3DItemPosZWide:Interface")
1718     _fMagic3DItemPosZ = Utility.GetINIFloat("fMagic3DItemPosZ:Interface")
1719    
1720     _fInventory3DItemPosScaleWide = Utility.GetINIFloat("fInventory3DItemPosScaleWide:Interface")
1721     _fMagic3DItemPosScaleWide = Utility.GetINIFloat("fMagic3DItemPosScaleWide:Interface")
1722     _fInventory3DItemPosScale = Utility.GetINIFloat("fInventory3DItemPosScale:Interface")
1723     _fMagic3DItemPosScale = Utility.GetINIFloat("fMagic3DItemPosScale:Interface")
1724    
1725     float h = Utility.GetINIInt("iSize H:Display")
1726     float w = Utility.GetINIInt("iSize W:Display")
1727     float ar = w / h
1728    
1729     ; Widescreen
1730     if (ar == 1.6) ; 16:10, 1920×1200
1731     _itemXBaseW = -32.458335876465
1732     else
1733     _itemXBaseW = -29.122497558594
1734     endIf
1735    
1736     ; Non-widescreen
1737     if (ar == 1.25) ; 5:4, 1280x1024
1738     _itemXBase = -41.622497558594
1739     else
1740     _itemXBase = -39.122497558594
1741     endIf
1742    
1743     Apply3DItemXOffset()
1744     Apply3DItemYOffset()
1745     Apply3DItemScale()
1746     endFunction
1747    
1748     function ApplyItemListFontSize()
1749     ; Small
1750     if (_itemlistFontSizeIdx == 0)
1751     SKI_SettingsManagerInstance.SetOverride("ListLayout$defaults$label$textFormat$size", "12")
1752     SKI_SettingsManagerInstance.SetOverride("ListLayout$defaults$entry$textFormat$size", "13")
1753     SKI_SettingsManagerInstance.SetOverride("ListLayout$vars$n_iconSize$value", "16")
1754     SKI_SettingsManagerInstance.SetOverride("ListLayout$vars$a_textBorder$value", "<0, 0, 0.3, 0>")
1755     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$equipColumn$indent", "-25")
1756     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$equipColumn$border", "<0, 10, 2, 2>")
1757     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$iconColumn$border", "<0, 3, 2, 2>")
1758     ; Medium
1759     elseIf (_itemlistFontSizeIdx == 1)
1760     SKI_SettingsManagerInstance.SetOverride("ListLayout$defaults$label$textFormat$size", "12")
1761     SKI_SettingsManagerInstance.SetOverride("ListLayout$defaults$entry$textFormat$size", "14")
1762     SKI_SettingsManagerInstance.SetOverride("ListLayout$vars$n_iconSize$value", "18")
1763     SKI_SettingsManagerInstance.SetOverride("ListLayout$vars$a_textBorder$value", "<0, 0, 1.1, 0>")
1764     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$equipColumn$indent", "-28")
1765     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$equipColumn$border", "<0, 10, 3, 3>")
1766     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$iconColumn$border", "<0, 3, 3, 3>")
1767     ; Large
1768     else
1769     SKI_SettingsManagerInstance.SetOverride("ListLayout$defaults$label$textFormat$size", "14")
1770     SKI_SettingsManagerInstance.SetOverride("ListLayout$defaults$entry$textFormat$size", "18")
1771     SKI_SettingsManagerInstance.SetOverride("ListLayout$vars$n_iconSize$value", "20")
1772     SKI_SettingsManagerInstance.SetOverride("ListLayout$vars$a_textBorder$value", "<0, 0, 0.4, 0>")
1773     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$equipColumn$indent", "-30")
1774     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$equipColumn$border", "<0, 10, 3.2, 3.2>")
1775     SKI_SettingsManagerInstance.SetOverride("ListLayout$columns$iconColumn$border", "<0, 4, 3.2, 3.2>")
1776     endIf
1777     endFunction
1778    
1779     function Apply3DItemXOffset()
1780     ; Negative values shift the 3D item to the right
1781     if (_3DItemDisablePositioning)
1782     Utility.SetINIFloat("fInventory3DItemPosXWide:Interface", _fInventory3DItemPosXWide)
1783     Utility.SetINIFloat("fInventory3DItemPosX:Interface", _fInventory3DItemPosX)
1784     Utility.SetINIFloat("fMagic3DItemPosXWide:Interface", _fMagic3DItemPosXWide)
1785     Utility.SetINIFloat("fMagic3DItemPosX:Interface", _fMagic3DItemPosX)
1786     else
1787     Utility.SetINIFloat("fInventory3DItemPosXWide:Interface", (_itemXBaseW + _3DItemXOffset))
1788     Utility.SetINIFloat("fInventory3DItemPosX:Interface", (_itemXBase + _3DItemXOffset))
1789     Utility.SetINIFloat("fMagic3DItemPosXWide:Interface", (_itemXBaseW + _3DItemXOffset))
1790     Utility.SetINIFloat("fMagic3DItemPosX:Interface", (_itemXBase + _3DItemXOffset))
1791     endIf
1792     endFunction
1793    
1794     function Apply3DItemYOffset()
1795     ; Negative values shift the 3D item to the bottom
1796     if (_3DItemDisablePositioning)
1797     Utility.SetINIFloat("fInventory3DItemPosZWide:Interface", _fInventory3DItemPosZWide)
1798     Utility.SetINIFloat("fInventory3DItemPosZ:Interface", _fInventory3DItemPosZ)
1799     Utility.SetINIFloat("fMagic3DItemPosZWide:Interface", _fMagic3DItemPosZWide)
1800     Utility.SetINIFloat("fMagic3DItemPosZ:Interface", _fMagic3DItemPosZ)
1801     else
1802     Utility.SetINIFloat("fInventory3DItemPosZWide:Interface", (12 + _3DItemYOffset))
1803     Utility.SetINIFloat("fInventory3DItemPosZ:Interface", (16 + _3DItemYOffset))
1804     Utility.SetINIFloat("fMagic3DItemPosZWide:Interface", (12 + _3DItemYOffset))
1805     Utility.SetINIFloat("fMagic3DItemPosZ:Interface", (16 + _3DItemYOffset))
1806     endIf
1807     endFunction
1808    
1809     function Apply3DItemScale()
1810     if (_3DItemDisablePositioning)
1811     Utility.SetINIFloat("fInventory3DItemPosScaleWide:Interface", _fInventory3DItemPosScaleWide)
1812     Utility.SetINIFloat("fMagic3DItemPosScaleWide:Interface", _fMagic3DItemPosScaleWide)
1813     Utility.SetINIFloat("fInventory3DItemPosScale:Interface", _fInventory3DItemPosScale)
1814     Utility.SetINIFloat("fMagic3DItemPosScale:Interface", _fMagic3DItemPosScale)
1815     else
1816     Utility.SetINIFloat("fInventory3DItemPosScaleWide:Interface", _3DItemScale)
1817     Utility.SetINIFloat("fMagic3DItemPosScaleWide:Interface", _3DItemScale)
1818     Utility.SetINIFloat("fInventory3DItemPosScale:Interface", _3DItemScale)
1819     Utility.SetINIFloat("fMagic3DItemPosScale:Interface", _3DItemScale)
1820     endIf
1821     endFunction
1822    
1823     bool function ValidateKey(int a_keyCode, bool a_gamepad)
1824     ; Do nothing for ESC
1825     if (a_keyCode == 1)
1826     return false
1827     endIf
1828    
1829     bool isGamepad = Game.UsingGamepad()
1830    
1831     if (isGamepad != a_gamepad)
1832     return false
1833     endIf
1834    
1835     if (!isGamepad)
1836     ; Can't detect for mouse, don't need for gamepad
1837     if (a_keyCode > 255)
1838     ShowMessage("$SKI_MSG1", false, "$OK")
1839     return false
1840     endIf
1841     else
1842     ; If you removed the gamepad while in this menu, ignore other keys
1843     if (a_keyCode < 266)
1844     return false
1845     endIf
1846     endIf
1847    
1848     return true
1849     endFunction
1850    
1851     function SwapItemListKey(int a_newKey, int a_curKey)
1852     if (a_newKey == _searchKey)
1853     _searchKey = a_curKey
1854     SetKeyMapOptionValueST(_searchKey, true, "SEARCH_KEY")
1855     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$search", _searchKey)
1856     elseIf (a_newKey == _switchTabKey)
1857     _switchTabKey = a_curKey
1858     SetKeyMapOptionValueST(_switchTabKey, true, "SWITCH_TAB_KEY")
1859     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$switchTab", _switchTabKey)
1860     elseIf (a_newKey == _equipModeKey)
1861     _equipModeKey = a_curKey
1862     SetKeyMapOptionValueST(_equipModeKey, true, "EQUIP_MODE_KEY")
1863     SKI_SettingsManagerInstance.SetOverride("Input$controls$pc$equipMode", _equipModeKey)
1864    
1865     elseIf (a_newKey == _switchTabButton)
1866     _switchTabButton = a_curKey
1867     SetKeyMapOptionValueST(_switchTabButton, true, "SWITCH_TAB_BUTTON")
1868     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$switchTab", _switchTabButton)
1869     elseIf (a_newKey == _prevColumnButton)
1870     _prevColumnButton = a_curKey
1871     SetKeyMapOptionValueST(_prevColumnButton, true, "PREV_COLUMN_BUTTON")
1872     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$prevColumn", _prevColumnButton)
1873     elseIf (a_newKey == _nextColumnButton)
1874     _nextColumnButton = a_curKey
1875     SetKeyMapOptionValueST(_nextColumnButton, true, "NEXT_COLUMN_BUTTON")
1876     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$nextColumn", _nextColumnButton)
1877     elseIf (a_newKey == _sortOrderButton)
1878     _sortOrderButton = a_curKey
1879     SetKeyMapOptionValueST(_sortOrderButton, true, "SORT_ORDER_BUTTON")
1880     SKI_SettingsManagerInstance.SetOverride("Input$controls$gamepad$sortOrder", _sortOrderButton)
1881     endIf
1882     endFunction
1883    
1884     function SetCurrentFavoriteGroup(int a_index)
1885     int ARMOR_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_ARMOR
1886     int HANDS_FLAG = SKI_FavoritesManagerInstance.GROUP_FLAG_UNEQUIP_HANDS
1887    
1888     SetToggleOptionValueST(SKI_FavoritesManagerInstance.GetGroupFlag(_favCurGroupIdx, ARMOR_FLAG), true, "FAV_GROUP_UNEQUIP_ARMOR")
1889     SetToggleOptionValueST(SKI_FavoritesManagerInstance.GetGroupFlag(_favCurGroupIdx, HANDS_FLAG), true, "FAV_GROUP_UNEQUIP_HANDS")
1890     endFunction
1891    
1892     function SetFavoritesGroupHotkey(int a_groupIndex, int a_keyCode, string a_conflictControl = "", string a_conflictName = "")
1893    
1894     bool continue = true
1895    
1896     if (a_conflictControl != "" && a_conflictName != ModName)
1897     string msg
1898    
1899     if (a_conflictName != "")
1900     msg = "$SKI_MSG2{" + a_conflictControl + " (" + a_conflictName + ")}"
1901     else
1902     msg = "$SKI_MSG2{" + a_conflictControl + "}"
1903     endIf
1904    
1905     continue = ShowMessage(msg, true, "$Yes", "$No")
1906     endIf
1907    
1908     if (!continue)
1909     return
1910     endIf
1911    
1912     if (!SKI_FavoritesManagerInstance.SetGroupHotkey(a_groupIndex, a_keyCode))
1913     return
1914     endIf
1915    
1916     ; Update
1917     int[] groupHotkeys = SKI_FavoritesManagerInstance.GetGroupHotkeys()
1918     SetKeyMapOptionValueST(groupHotkeys[0], true, "FAV_GROUP_USE_HOTKEY1")
1919     SetKeyMapOptionValueST(groupHotkeys[1], true, "FAV_GROUP_USE_HOTKEY2")
1920     SetKeyMapOptionValueST(groupHotkeys[2], true, "FAV_GROUP_USE_HOTKEY3")
1921     SetKeyMapOptionValueST(groupHotkeys[3], true, "FAV_GROUP_USE_HOTKEY4")
1922     SetKeyMapOptionValueST(groupHotkeys[4], true, "FAV_GROUP_USE_HOTKEY5")
1923     SetKeyMapOptionValueST(groupHotkeys[5], true, "FAV_GROUP_USE_HOTKEY6")
1924     SetKeyMapOptionValueST(groupHotkeys[6], true, "FAV_GROUP_USE_HOTKEY7")
1925     SetKeyMapOptionValueST(groupHotkeys[7], false, "FAV_GROUP_USE_HOTKEY8")
1926     endFunction
1927    
1928     function RefreshFavoriteHotkeys()
1929     SetKeyMapOptionValueST(SKI_FavoritesManagerInstance.GroupAddKey, true, "FAV_GROUP_ADD_KEY")
1930     SetKeyMapOptionValueST(SKI_FavoritesManagerInstance.GroupUseKey, true, "FAV_GROUP_USE_KEY")
1931     SetKeyMapOptionValueST(SKI_FavoritesManagerInstance.SetIconKey, true, "FAV_SET_ICON_KEY")
1932     SetKeyMapOptionValueST(SKI_FavoritesManagerInstance.ToggleFocusKey, true, "FAV_TOGGLE_FOCUS")
1933     SetKeyMapOptionValueST(SKI_FavoritesManagerInstance.SaveEquipStateKey, false, "FAV_EQUIP_STATE_KEY")
1934     endFunction
1935    
1936    
1937     ; REMOVED DATA -----------------------------------------------------------------------------------
1938    
1939     ; -- Version 1 -- ; (remove version)
1940    
1941     ; int _itemlistFontSizeOID_T ; (4)
1942     ; int _itemlistQuantityMinCountOID_S ; (4)
1943     ; int _itemcardAlignOID_T ; (4)
1944     ; int _itemcardXOffsetOID_S ; (4)
1945     ; int _itemcardYOffsetOID_S ; (4)
1946     ; int _3DItemXOffsetOID_S ; (4)
1947     ; int _3DItemYOffsetOID_S ; (4)
1948     ; int _3DItemScaleOID_S ; (4)
1949     ; int _checkInventoryMenuOID_B ; (4)
1950     ; int _checkMagicMenuOID_B ; (4)
1951     ; int _checkBarterMenuOID_B ; (4)
1952     ; int _checkContainerMenuOID_B ; (4)
1953     ; int _checkGiftMenuOID_B ; (4)
1954     ; int _searchKeyOID_K ; (4)
1955     ; int _switchTabKeyOID_K ; (4)
1956     ; int _equipModeKeyOID_K ; (4)
1957    
1958     ; -- Version 2 --
1959    
1960     ; int _itemlistCategoryIconThemeOID_M ; (4)
1961     ; int _itemlistNoIconColorsOID_B ; (4)
1962     ; int _switchTabButtonOID_K ; (4)
1963     ; int _prevColumnButtonOID_K ; (4)
1964     ; int _nextColumnButtonOID_K ; (4)
1965     ; int _sortOrderButtonOID_K ; (4)
1966    
1967     ; -- Version 3 --
1968    
1969     ; int _3DItemDisablePositioningOID_B ; (4)

  ViewVC Help
Powered by ViewVC 1.1.22