From f246ea9264adbe09b4f4e45a74073edc11ee6335 Mon Sep 17 00:00:00 2001 From: Argent77 Date: Sun, 21 May 2017 01:35:31 +0200 Subject: [PATCH] Version 0.2-beta --- .../languages/english/mod.tra | 92 ++++ .../languages/english/setup.tra | 29 ++ HiddenGameplayOptions/lib/functions.tph | 122 +++++ HiddenGameplayOptions/lib/presets.tph | 386 +++++++++++++++ HiddenGameplayOptions/lib/ui_checkbox.tph | 450 ++++++++++++++++++ HiddenGameplayOptions/readme/readme.txt | 181 +++++++ .../setup-HiddenGameplayOptions.tp2 | 177 +++++++ HiddenGameplayOptions/tables/sneakatt.2da | 8 + MoreGameplayOptions/languages/english/mod.tra | 37 -- .../languages/english/setup.tra | 17 - MoreGameplayOptions/lib/functions.tph | 316 ------------ MoreGameplayOptions/readme/readme.txt | 92 ---- .../setup-MoreGameplayOptions.tp2 | 179 ------- 13 files changed, 1445 insertions(+), 641 deletions(-) create mode 100644 HiddenGameplayOptions/languages/english/mod.tra create mode 100644 HiddenGameplayOptions/languages/english/setup.tra create mode 100644 HiddenGameplayOptions/lib/functions.tph create mode 100644 HiddenGameplayOptions/lib/presets.tph create mode 100644 HiddenGameplayOptions/lib/ui_checkbox.tph create mode 100644 HiddenGameplayOptions/readme/readme.txt create mode 100644 HiddenGameplayOptions/setup-HiddenGameplayOptions.tp2 create mode 100644 HiddenGameplayOptions/tables/sneakatt.2da delete mode 100644 MoreGameplayOptions/languages/english/mod.tra delete mode 100644 MoreGameplayOptions/languages/english/setup.tra delete mode 100644 MoreGameplayOptions/lib/functions.tph delete mode 100644 MoreGameplayOptions/readme/readme.txt delete mode 100644 MoreGameplayOptions/setup-MoreGameplayOptions.tp2 diff --git a/HiddenGameplayOptions/languages/english/mod.tra b/HiddenGameplayOptions/languages/english/mod.tra new file mode 100644 index 0000000..a83217a --- /dev/null +++ b/HiddenGameplayOptions/languages/english/mod.tra @@ -0,0 +1,92 @@ +// -*- coding: utf-8 -*- + +@1000 = ~Enable Debug Console~ +@1001 = ~Enabling this setting allows you to activate cheat keys and the debug console. + +Use keyboard shortcut CTRL+SPACE to activate the console in the game. + +Cheat keys include CTRL+Y to insta-kill creatures under the mouse cursor, CTRL+R to heal and dispel effects from characters under the mouse cursor, CTRL+J to teleport selected party members to the current cursor location, CTRL+T to advance game time by one hour, CTRL+4 to toggle visibility of interactive regions, and many more. + +Console commands include ^PC:AddGold(number)^-, ^PC:CreateItem("name")^-, ^PC:SetCurrentXP(number)^-, and many more. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1100 = ~Enable UI Edit Mode~ +@1101 = ~Enabling this setting allows you to use UI edit functionality in the game. + +Press F11 to activate or deactivate UI edit mode. While this mode is active it is possible to drag UI elements around the screen. Press F5 to preview UI changes without restarting the game. Press TAB while hovering over an UI element shows which line number in UI.MENU defines that element. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1200 = ~Show Strrefs~ +@1201 = ~Enabling this setting places string reference numbers in front of game strings. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1300 = ~Show Trigger Icons on Tab~ +@1301 = ~Enable this setting to reveal additional information about interactive regions when pressing the TAB key. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1400 = ~Allow Spacebar in Dialogs~ +@1401 = ~Enabling this setting allows you to continue conversations by using the spacebar. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1500 = ~Limit druidic spells for Cleric/Ranger~ +@1501 = ~This setting controls the availability of druidic spells for multi- or dualclassed Cleric/Rangers. + +Enable this option to limit druidic spells to level 3 - the maximum allowed spell level available to rangers. Cleric spells are not affected by this option. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1600 = ~3E Sneak Attack~ +@1601 = ~Enabling this setting activates Sneak Attack and Crippling Strike, which are special abilities similar to those from Wizards of the Coast's 3rd Edition Dungeons & DragonsĀ® rules. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1700 = ~Screen Shake on Critical Hit~ +@1701 = ~Enabling this setting triggers a screen shake whenever a party member rolls a critical hit in combat. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1800 = ~Hotkeys On Tooltips~ +@1801 = ~When this setting is enabled tooltips will display hotkeys when available. + +^NNote: You must restart the game for changes to take effect.^-~ + +@1900 = ~Show Extra Combat Info~ +@1901 = ~Enabling this setting allows you to see all factors that influence an attack roll. + +^NNote: You must restart the game for changes to take effect.^-~ + +@2000 = ~Show Game Date and Time on Pause~ +@2001 = ~Shows game date and time when activating pause. + +^NNote: You must restart the game for changes to take effect.^-~ + +@2100 = ~Disable Area Map Zoom~ +@2101 = ~Disables the zoom in/zoom out effect when opening or closing the area map screen. + +^NNote: You must restart the game for changes to take effect.^-~ + +@2200 = ~Reverse Mouse Wheel Zoom~ +@2201 = ~Reverses the zoom direction when using the mouse wheel. + +^NNote: You must restart the game for changes to take effect.^-~ + +@2300 = ~Pause Game on Map Screen~ +@2301 = ~Automatically pauses the game while looking at the map screen. + +^NNote: You must restart the game for changes to take effect.^-~ + +@2400 = ~Enable Fog~ +@2401 = ~Enables fog effects on maps. + +^NNote: You must restart the game for changes to take effect.^-~ + +@2500 = ~Disable Movies~ +@2501 = ~Enabling this setting disables movie playback. + +^NNote: You must restart the game for changes to take effect.^-~ + diff --git a/HiddenGameplayOptions/languages/english/setup.tra b/HiddenGameplayOptions/languages/english/setup.tra new file mode 100644 index 0000000..e8e5d2c --- /dev/null +++ b/HiddenGameplayOptions/languages/english/setup.tra @@ -0,0 +1,29 @@ +// -*- coding: us-ascii -*- + +@1 = ~Install Hidden Gameplay Options~ +@2 = ~All available options~ +@3 = ~Selected options~ + +@10 = ~Add in-game option "Enable Debug Console"~ +@11 = ~Add in-game option "Enable UI Edit Mode"~ +@12 = ~Add in-game option "Show Strrefs"~ +@13 = ~Add in-game option "Show trigger icons on tab"~ +@14 = ~Add in-game option "Allow Spacebar in Dialogs"~ +@15 = ~Add in-game option "Limit druidic spells for Cleric/Ranger"~ +@16 = ~Add in-game option "3E Sneak Attack"~ +@17 = ~Add in-game option "Critical Hit Screen Shake"~ +@18 = ~Add in-game option "Hotkeys On Tooltips"~ +@19 = ~Add in-game option "Show extra combat info"~ +@20 = ~Add in-game option "Show Game Date and Time on Pause"~ +@21 = ~Add in-game option "Disable Area Map Zoom"~ +@22 = ~Add in-game option "Reverse Mouse Wheel Zoom"~ +@23 = ~Add in-game option "Pause Game on Map Screen"~ +@24 = ~Add in-game option "Enable Fog"~ +@25 = ~Add in-game option "Disable Movies"~ + +@100 = ~Enhanced Edition game patched to v2.0 or higher required.~ +@101 = ~Cannot patch LUA file~ +@102 = ~Cannot patch UI.MENU~ +@103 = ~Component "Selected options" not selected.~ +@104 = ~Option not available for this game.~ +@105 = ~Option already present in this game.~ diff --git a/HiddenGameplayOptions/lib/functions.tph b/HiddenGameplayOptions/lib/functions.tph new file mode 100644 index 0000000..1a0415c --- /dev/null +++ b/HiddenGameplayOptions/lib/functions.tph @@ -0,0 +1,122 @@ +// *** Generic UI-related functions *** + +/** + * Adds a new string variable definition into available L_xx_YY.LUA resources. + * INT_VAR traRef TRA reference number of the string to add. + * STR_VAR varName Name of the variable to add. + * RET success Returns 1 if definition has been added successfully to all available LUA files, 0 otherwise. + */ +DEFINE_ACTION_FUNCTION ADD_LUA_DEFINITION +INT_VAR + traRef = "-1" +STR_VAR + varName = ~~ +RET + success +BEGIN + OUTER_SET success = 0 + + ACTION_IF (traRef >= 0 AND NOT ~%varName%~ STR_EQ ~~) BEGIN + COPY_EXISTING_REGEXP ~L_[a-zA-Z][a-zA-Z]_[a-zA-Z][a-zA-Z]\.LUA~ ~override~ + SET startOfs = INDEX_BUFFER(~uiStrings[ %TAB%%WNL%]*=[ %TAB%%WNL%]*{~) + SET ofs1 = INDEX_BUFFER(~[ %TAB%]*[a-zA-Z_][a-zA-Z0-9_]*[ %TAB%]*=.+,~ startOfs) + SET failed = 0 + PATCH_IF (ofs1 < 0) BEGIN + SET failed = 1 + END + PATCH_IF (NOT failed) BEGIN + SET ofs2 = INDEX_BUFFER(~[%WNL%]~ ofs1) + PATCH_IF (ofs2 < ofs1) BEGIN + SET failed = 1 + END + END + + PATCH_IF (NOT failed) BEGIN + // determining variable definition type + READ_ASCII ofs1 curLine (ofs2 - ofs1) + INNER_PATCH ~%curLine%~ BEGIN + SET v = INDEX_BUFFER(~[ %TAB%]*=[ %TAB%]*"[^"]+"~) + SET isStrref = (v < 0) ? 1 : 0 + END + + PATCH_IF (isStrref) BEGIN + SET number = RESOLVE_STR_REF((AT traRef)) + TEXT_SPRINT line ~%TAB%%varName% = %number%,%LNL%~ + END ELSE BEGIN + SPRINT text (AT traRef) + INNER_PATCH_SAVE text ~%text%~ BEGIN + REPLACE_TEXTUALLY ~%MNL%?%LNL%~ ~\n~ // line break -> symbolic line break + REPLACE_TEXTUALLY ~\([^\\]\)"~ ~\1\"~ // double-quotes must be escaped + REPLACE_TEXTUALLY ~\^[0-9A-Z$]\([^^]+\)\^-~ ~\1~ // just a precaution: older games don't appear to support colored text in options menu yet + END + TEXT_SPRINT line ~%TAB%%varName% = "%text%",%LNL%~ + END + + // inserting text definition + SET strlen = STRING_LENGTH ~%line%~ + INSERT_BYTES ofs1 strlen + WRITE_ASCIIE ofs1 ~%line%~ + + SET success = 1 + END + END +END + + +/** + * Returns the value associated to the specified variable name found in L_xx_YY.LUA (where xx_YY is a language code). + * STR_VAR varName The variable name + * RET value The numeric value assigned to the variable. Returns -1 if not available. + */ +DEFINE_ACTION_FUNCTION GET_LUA_VALUE +STR_VAR + varName = "" +RET + value +BEGIN + OUTER_SET value = "-1" + + OUTER_TEXT_SPRINT luaFile ~L_%EE_LANGUAGE%.LUA~ + ACTION_IF (NOT FILE_EXISTS_IN_GAME ~%luaFile%~) BEGIN + OUTER_TEXT_SPRINT luaFile ~L_EN_US.LUA~ + ACTION_IF (NOT FILE_EXISTS_IN_GAME ~%luaFile%~) BEGIN + OUTER_TEXT_SPRINT luaFile ~~ + COPY_EXISTING_REGEXP - ~L_[a-zA-Z][a-zA-Z]_[a-zA-Z][a-zA-Z]\.LUA~ ~override~ + PATCH_IF (~%luaFile%~ STR_EQ ~~) BEGIN + TEXT_SPRINT luaFile ~%SOURCE_FILE%~ + END + END + END + + ACTION_IF (FILE_EXISTS_IN_GAME ~%luaFile%~) BEGIN + COPY_EXISTING - ~%luaFile%~ ~override~ + SET ofs1 = INDEX_BUFFER(~.*%varName%[ %TAB%]*=~) + PATCH_IF (ofs1 >= 0) BEGIN + SET ofs2 = INDEX_BUFFER(~[%WNL%]~ ofs1) + PATCH_IF (ofs2 > ofs1) BEGIN + READ_ASCII ofs1 line (ofs2 - ofs1) + INNER_PATCH_SAVE val ~%line%~ BEGIN REPLACE_TEXTUALLY ~.*=[ %TAB%]*\(-?[0-9]*\).*~ ~\1~ END + PATCH_IF (~%val%~ STR_EQ ~~) BEGIN + // value may be a literal string + INNER_PATCH_SAVE string ~%line%~ BEGIN REPLACE_TEXTUALLY ~.*=[ %TAB%]*"\([^"]*\)".*~ ~\1~ END + INNER_PATCH_SAVE string ~%string%~ BEGIN REPLACE_TEXTUALLY ~\\n~ ~%LNL%~ END + SET value = RESOLVE_STR_REF(~%string%~) + END ELSE PATCH_IF (IS_AN_INT "val") BEGIN + // value is a valid number + SET value = val + END + END + END + END +END + +DEFINE_PATCH_FUNCTION GET_LUA_VALUE +STR_VAR + varName = "" +RET + value +BEGIN + INNER_ACTION BEGIN + LAF GET_LUA_VALUE STR_VAR varName = EVAL ~%varName%~ RET value END + END +END diff --git a/HiddenGameplayOptions/lib/presets.tph b/HiddenGameplayOptions/lib/presets.tph new file mode 100644 index 0000000..cb23034 --- /dev/null +++ b/HiddenGameplayOptions/lib/presets.tph @@ -0,0 +1,386 @@ +// *** Predefined functions for adding specific options to the game *** + +INCLUDE ~%MOD_FOLDER%/lib/ui_checkbox.tph~ + +/** + * Available options sections (defined by "arrayName" parameter): + * toggleTitles: Gameplay options + * feedbackToggles: Gameplay > Feedback > Visual Feedback + * messagesToggles: Gameplay > Feedback > Feedback Messages + * graphicsToggles: Graphics > Display Options + */ + +/** Add in-game option "Enable Debug Console" */ +DEFINE_ACTION_FUNCTION OPTION_DEBUG_CONSOLE +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1000 + optDescTra = 1001 + controlID = "-167" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_DEBUG_CONSOLE_LABEL" + optDescName = "A7_SHOW_DEBUG_CONSOLE_DESCRIPTION" + iniSection = "Program Options" + iniName = "Debug Mode" + RET + success + END +END + +/** Add in-game option "Enable UI Edit Mode" */ +DEFINE_ACTION_FUNCTION OPTION_UI_EDIT_MODE +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1100 + optDescTra = 1101 + controlID = "-168" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_UI_EDIT_MODE_LABEL" + optDescName = "A7_UI_EDIT_MODE_DESCRIPTION" + iniSection = "Program Options" + iniName = "UI Edit Mode" + RET + success + END +END + +/** Add in-game option "Show Strrefs" */ +DEFINE_ACTION_FUNCTION OPTION_SHOW_STRREFS +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1200 + optDescTra = 1201 + controlID = "-169" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_STRREFS_LABEL" + optDescName = "A7_SHOW_STRREFS_DESCRIPTION" + iniSection = "Program Options" + iniName = "Strref On" + RET + success + END +END + +/** Add in-game option "Show trigger icons on tab" */ +DEFINE_ACTION_FUNCTION OPTION_TRIGGER_ICONS +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1300 + optDescTra = 1301 + controlID = "-170" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_TRIGGER_ICONS_LABEL" + optDescName = "A7_SHOW_TRIGGER_ICONS_DESCRIPTION" + iniSection = "Game Options" + iniName = "Show Triggers On Tab" + RET + success + END +END + +/** Add in-game option "Allow Spacebar in Dialogs" */ +DEFINE_ACTION_FUNCTION OPTION_ALLOW_SPACE_IN_DIALOG +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1400 + optDescTra = 1401 + controlID = "-171" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_ALLOW_SPACE_IN_DIALOG_LABEL" + optDescName = "A7_ALLOW_SPACE_IN_DIALOG_DESCRIPTION" + iniSection = "Game Options" + iniName = "Allow Spacebar In Dialog" + RET + success + END +END + +/** Add in-game option "Limit druidic spells for Cleric/Ranger" */ +DEFINE_ACTION_FUNCTION OPTION_CLERIC_RANGER_SPELLS +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1500 + optDescTra = 1501 + controlID = "-172" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_CLERIC_RANGER_SPELLS_LABEL" + optDescName = "A7_SHOW_CLERIC_RANGER_SPELLS_DESCRIPTION" + iniSection = "Game Options" + iniName = "Cleric Ranger Spells" + RET + success + END +END + +/** Add in-game option "3E Sneak Attack" */ +DEFINE_ACTION_FUNCTION OPTION_SNEAK_ATTACK +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + ACTION_IF (GAME_IS ~pstee~ AND NOT FILE_EXISTS_IN_GAME ~sneakatt.2da~) BEGIN + COPY ~%MOD_FOLDER%/tables/sneakatt.2da~ ~override~ + END + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1600 + optDescTra = 1601 + controlID = "-173" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SNEAK_ATTACK_LABEL" + optDescName = "A7_SNEAK_ATTACK_DESCRIPTION" + iniSection = "Game Options" + iniName = "3E Thief Sneak Attack" + RET + success + END +END + +/** Add in-game option "Critical Hit Screen Shake" */ +DEFINE_ACTION_FUNCTION OPTION_CRITICAL_HIT_SCREEN_SHAKE +BEGIN + ACTION_IF (GAME_IS ~pstee~ OR + MOD_IS_INSTALLED ~leui.tp2~ 0) BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + END ELSE BEGIN + OUTER_TEXT_SPRINT arrayName "feedbackToggles" + END + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1700 + optDescTra = 1701 + controlID = "-174" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_CRITICAL_HIT_SCREEN_SHAKE_LABEL" + optDescName = "A7_CRITICAL_HIT_SCREEN_SHAKE_DESCRIPTION" + iniSection = "Game Options" + iniName = "Critical Hit Screen Shake" + RET + success + END +END + +/** Add in-game option "Hotkeys On Tooltips" */ +DEFINE_ACTION_FUNCTION OPTION_TOOLTIP_HOTKEYS +BEGIN + ACTION_IF (GAME_IS ~pstee~ OR + MOD_IS_INSTALLED ~leui.tp2~ 0) BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + END ELSE BEGIN + OUTER_TEXT_SPRINT arrayName "feedbackToggles" + END + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1800 + optDescTra = 1801 + controlID = "-175" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_TOOLTIP_HOTKEYS_LABEL" + optDescName = "A7_TOOLTIP_HOTKEYS_DESCRIPTION" + iniSection = "Game Options" + iniName = "Hotkeys On Tooltips" + RET + success + END +END + +/** Add in-game option "Show extra combat info" */ +DEFINE_ACTION_FUNCTION OPTION_EXTRA_COMBAT_INFO +BEGIN + ACTION_IF (MOD_IS_INSTALLED ~leui.tp2~ 0) BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + END ELSE BEGIN + OUTER_TEXT_SPRINT arrayName "messagesToggles" + END + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 1900 + optDescTra = 1901 + controlID = "-176" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_EXTRA_COMBAT_INFO_LABEL" + optDescName = "A7_SHOW_EXTRA_COMBAT_INFO_DESCRIPTION" + iniSection = "Game Options" + iniName = "Extra Combat Info" + RET + success + END +END + +/** Add in-game option "Show Game Date and Time on Pause" */ +DEFINE_ACTION_FUNCTION OPTION_DATE_ON_PAUSE +BEGIN + ACTION_IF (MOD_IS_INSTALLED ~leui.tp2~ 0) BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + END ELSE BEGIN + OUTER_TEXT_SPRINT arrayName "messagesToggles" + END + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 2000 + optDescTra = 2001 + controlID = "-177" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_DATE_ON_PAUSE_LABEL" + optDescName = "A7_SHOW_DATE_ON_PAUSE_DESCRIPTION" + iniSection = "Game Options" + iniName = "Show Date On Pause" + RET + success + END +END + +/** Add in-game option "Disable Area Map Zoom" */ +DEFINE_ACTION_FUNCTION OPTION_DISABLE_MAP_ZOOM +BEGIN + OUTER_TEXT_SPRINT arrayName "graphicsToggles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 2100 + optDescTra = 2101 + controlID = "-178" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_DISABLE_MAP_ZOOM_LABEL" + optDescName = "A7_DISABLE_MAP_ZOOM_DESCRIPTION" + iniSection = "Graphics" + iniName = "Disable Area Map Zoom" + RET + success + END +END + +/** Add in-game option "Reverse Mouse Wheel Zoom" */ +DEFINE_ACTION_FUNCTION OPTION_REVERSE_WHEEL_ZOOM +BEGIN + OUTER_TEXT_SPRINT arrayName "graphicsToggles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 2200 + optDescTra = 2201 + controlID = "-179" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_REVERSE_WHEEL_ZOOM_LABEL" + optDescName = "A7_REVERSE_WHEEL_ZOOM_DESCRIPTION" + iniSection = "Game Options" + iniName = "Reverse Mouse Wheel Zoom" + RET + success + END +END + +/** Add in-game option "Pause Game on Map Screen" */ +DEFINE_ACTION_FUNCTION OPTION_PAUSING_MAP +BEGIN + OUTER_TEXT_SPRINT arrayName "toggleTitles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 2300 + optDescTra = 2301 + controlID = "-180" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_PAUSING_MAP_LABEL" + optDescName = "A7_PAUSING_MAP_DESCRIPTION" + iniSection = "Game Options" + iniName = "Pausing Map" + RET + success + END +END + +/** Add in-game option "Enable Fog" */ +DEFINE_ACTION_FUNCTION OPTION_ENABLE_FOG +BEGIN + OUTER_TEXT_SPRINT arrayName "graphicsToggles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 2400 + optDescTra = 2401 + controlID = "-181" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_SHOW_ENABLE_FOG_LABEL" + optDescName = "A7_SHOW_ENABLE_FOG_DESCRIPTION" + iniSection = "Game Options" + iniName = "Enable Fog" + RET + success + END +END + +/** Add in-game option "Disable Movies" */ +DEFINE_ACTION_FUNCTION OPTION_DISABLE_MOVIES +BEGIN + OUTER_TEXT_SPRINT arrayName "graphicsToggles" + + LAF INSTALL_CHECK_OPTION + INT_VAR + optLabelTra = 2500 + optDescTra = 2501 + controlID = "-182" + autoFail = 1 + STR_VAR + arrayName = EVAL "%arrayName%" + optLabelName = "A7_DISABLE_MOVIES_LABEL" + optDescName = "A7_DISABLE_MOVIES_DESCRIPTION" + iniSection = "Program Options" + iniName = "Disable Movies" + RET + success + END +END + diff --git a/HiddenGameplayOptions/lib/ui_checkbox.tph b/HiddenGameplayOptions/lib/ui_checkbox.tph new file mode 100644 index 0000000..905dfa4 --- /dev/null +++ b/HiddenGameplayOptions/lib/ui_checkbox.tph @@ -0,0 +1,450 @@ +// *** UI functions for adding checkbox controls to option screens *** + +INCLUDE ~%MOD_FOLDER%/lib/functions.tph~ + +/** + * Installs a new checkbox option to the game. + * INT_VAR optLabelTra The TRA reference number of the option label string. + * INT_VAR optDescTra The TRA reference number of the option description text. + * INT_VAR controlID A unique number that identifies this option. + * Recommended: Use negative number to minimize interference with existing IDs. + * INT_VAR autoFail Set to nonzero to force termination of component installation on error. + * STR_VAR arrayName Name of the LUA array containing option definitions. + * toggleTitles: used by Gameplay options + * feedbackToggles: used by Gameplay > Feedback > Visual Feedback + * messagesToggles: used by Gameplay > Feedback > Feedback Messages + * graphicsToggles: used by Graphics > Display Options + * STR_VAR optLabelName Name of the option label variable. + * STR_VAR optDescName Name of the option description variable. + * STR_VAR iniSection Section name of the option that will be added to baldur.lua (e.g. "Program Options"). + * STR_VAR iniName Option name that will be added to baldur.lua (e.g. "Debug Mode"). + * RET success Returns 1 on success, 0 otherwise. + */ +DEFINE_ACTION_FUNCTION INSTALL_CHECK_OPTION +INT_VAR + optLabelTra = "-1" + optDescTra = "-1" + controlID = 0 + autoFail = 1 +STR_VAR + arrayName = "toggleTitles" + optLabelName = "" + optDescName = "" + iniSection = "" + iniName = "" +RET + success +BEGIN + OUTER_SET success = 0 + + ACTION_IF (optLabelTra >= 0 AND + optDescTra >= 0 AND + controlID != 0 AND + NOT ~%arrayName%~ STR_EQ ~~ AND + NOT ~%optLabelName%~ STR_EQ ~~ AND + NOT ~%optDescName%~ STR_EQ ~~ AND + NOT ~%iniSection%~ STR_EQ ~~ AND + NOT ~%iniName%~ STR_EQ ~~) BEGIN + OUTER_SET failed = 0 + + LAF ADD_LUA_DEFINITION + INT_VAR traRef = optDescTra + STR_VAR varName = EVAL ~%optDescName%~ + RET success + END + ACTION_IF (NOT success) BEGIN + ACTION_IF (autoFail) BEGIN + FAIL @101 // Cannot patch LUA file + END ELSE BEGIN + OUTER_SET failed = 1 + END + END + + ACTION_IF (NOT failed) BEGIN + LAF ADD_LUA_DEFINITION + INT_VAR traRef = optLabelTra + STR_VAR varName = EVAL ~%optLabelName%~ + RET success + END + ACTION_IF (NOT success) BEGIN + ACTION_IF (autoFail) BEGIN + FAIL @101 // Cannot patch LUA file + END ELSE BEGIN + OUTER_SET failed = 1 + END + END + END + + ACTION_IF (NOT failed) BEGIN + COPY_EXISTING ~ui.menu~ ~override~ + LPF ADD_GAMEPLAY_OPTION + INT_VAR + controlID = controlID + STR_VAR + arrayName = EVAL "%arrayName%" + optLabel = EVAL ~%optLabelName%~ + optDesc = EVAL ~%optDescName%~ + iniSection = EVAL ~%iniSection%~ + iniName = EVAL ~%iniName%~ + RET + success + END + PATCH_IF (NOT success) BEGIN + PATCH_IF (autoFail) BEGIN + PATCH_FAIL @102 // Cannot patch UI.MENU + END ELSE BEGIN + SET failed = 1 + END + END + END + + OUTER_SET success = failed ? 0 : 1 + END +END + + +/** + * Adds a new option to the 'Gameplay' section of the Options menu. + * INT_VAR controlID A unique number that identifies the option. + * Recommended: Use negative number to minimize interference with existing IDs. + * STR_VAR arrayName Name of the LUA array containing option definitions. + * STR_VAR optLabel Variable name referring to option label text (e.g. "SHOW_DEBUG_CONSOLE_LABEL"). + * STR_VAR optDesc Variable name referring to option description text (e.g. "SHOW_DEBUG_CONSOLE_DESC"). + * STR_VAR iniSection Section name of option that will be added to baldur.lua (e.g. "Program Options"). + * STR_VAR iniName Option name that will be added to baldur.lua (e.g. "Debug Mode"). + * RET success Returns 1 if changes have been applied successfully, 0 otherwise. + */ +DEFINE_PATCH_FUNCTION ADD_GAMEPLAY_OPTION +INT_VAR + controlID = 0 +STR_VAR + arrayName = "" + optLabel = "" + optDesc = "" + iniSection = "" + iniName = "" +RET + success +BEGIN + SET success = 0 + PATCH_IF (controlID != 0 AND + NOT ~%arrayName%~ STR_EQ ~~ AND + NOT ~%optLabel%~ STR_EQ ~~ AND + NOT ~%optDesc%~ STR_EQ ~~ AND + NOT ~%iniSection%~ STR_EQ ~~ AND + NOT ~%iniName%~ STR_EQ ~~) BEGIN + LPF __A7_ADD_OPTION + INT_VAR controlID = controlID + STR_VAR + arrayName = EVAL "%arrayName%" + optLabel = EVAL ~%optLabel%~ + optDesc = EVAL ~%optDesc%~ + iniSection = EVAL ~%iniSection%~ + iniName = EVAL ~%iniName%~ + RET success + END + END +END + + +// Used internally: implement new entry in UI.MENU +DEFINE_PATCH_FUNCTION __A7_ADD_OPTION +INT_VAR + controlID = 0 +STR_VAR + arrayName = "" + optLabel = "" + optDesc = "" + iniSection = "" + iniName = "" +RET + success +BEGIN + SET success = 0 + SET matches = 0 // keeps track of modifications + + // 1. adding entry to options array + LPF __A7_APPEND_OPTION_ARRAY + INT_VAR + startOfs = 0 + controlID = controlID + STR_VAR + arrayName = EVAL "%arrayName%" + optLabel = EVAL "%optLabel%" + optDesc = EVAL "%optDesc%" + RET + success + endOfs // points to or behind the end of the array construct + END + + PATCH_IF (success) BEGIN + SET matches += 1 + + // 2. adding code for reading initial state of option + LPF __A7_EXPAND_READ_OPTION + INT_VAR + startOfs = endOfs + controlID = controlID + STR_VAR + arrayName = EVAL "%arrayName%" + iniSection = EVAL "%iniSection%" + iniName = EVAL "%iniName%" + RET + success + endOfs // points to or behind the end of the array construct + END + + PATCH_IF (success) BEGIN + SET matches += 1 + + // 3. adding code for writing current state of option + LPF __A7_EXPAND_WRITE_OPTION + INT_VAR + startOfs = endOfs + controlID = controlID + STR_VAR + arrayName = EVAL "%arrayName%" + iniSection = EVAL "%iniSection%" + iniName = EVAL "%iniName%" + RET + success + endOfs // points to or behind the end of the array construct + END + + PATCH_IF (success) BEGIN + SET matches += 1 + END + END + END + + SET success = (matches = 3) ? 1 : 0 +END + + +// Used internally: adds a new entry to array structure +DEFINE_PATCH_FUNCTION __A7_APPEND_OPTION_ARRAY +INT_VAR + startOfs = 0 + controlID = 0 +STR_VAR + arrayName = "" + optLabel = "" + optDesc = "" +RET + success + endOfs // points to or behind the end of the array construct +BEGIN + SET success = 0 + SET endOfs = startOfs + + SET ofs = INDEX_BUFFER(~%arrayName%[ %TAB%]*=[ %TAB%]*{~ startOfs) + PATCH_IF (ofs >= startOfs) BEGIN + SET ofs = INDEX_BUFFER(~[%WNL%]~ ofs) + SET ofs1 = INDEX_BUFFER(~{~ ofs) + PATCH_IF (ofs1 >= ofs) BEGIN + SET ofs2 = INDEX_BUFFER(~},~ ofs1) + PATCH_IF (ofs2 >= ofs1) BEGIN + READ_ASCII ofs1 line (ofs2 - ofs1) + + SET itemCount = 1 + INNER_PATCH ~%line%~ BEGIN + // counting array items + REPLACE_EVALUATE ~,~ BEGIN SET itemCount += 1 END ~,~ + + // determining quotation type for string arguments + SET ofsQuote = INDEX_BUFFER(~["']~) + PATCH_IF (ofsQuote >= 0) BEGIN + READ_ASCII ofsQuote quote (1) + END ELSE BEGIN + TEXT_SPRINT quote ~"~ + END + + // getting format for option description + TEXT_SPRINT argLabel ~%quote%%optLabel%%quote%~ + TEXT_SPRINT argDesc ~%quote%%optDesc%%quote%~ + INNER_PATCH_SAVE arg2 ~%line%~ BEGIN REPLACE_TEXTUALLY ~[^,]+,[ %TAB%]*\([^,]+\).*~ ~\1~ END + PATCH_IF (~%arg2%~ STRING_MATCHES_REGEXP ~[ %TAB%]*-?[0-9]+[ %TAB%]*~ = 0) BEGIN + LPF GET_LUA_VALUE STR_VAR varName = EVAL ~%optDesc%~ RET value END + TEXT_SPRINT argDesc ~%value%~ + END + END + + // generating array item string + PATCH_IF (itemCount > 3) BEGIN + TEXT_SPRINT entry ~{%argLabel%, %argDesc%, %controlID%~ + FOR (idx = 3; idx < itemCount; idx += 1) BEGIN + TEXT_SPRINT entry ~%entry%, 0~ + END + TEXT_SPRINT entry ~%entry%},%WNL%~ + SET entryLen = STRING_LENGTH ~%entry%~ + + // adding new entry + SET ofs = INDEX_BUFFER(~%LNL%[ %TAB%]*}[ %TAB%%WNL%]~ ofs2) + 1 + + // making sure last array entry contains a terminating comma + SET ofs2 = RINDEX_BUFFER(~}~ (ofs - 1)) + PATCH_IF (ofs2 >= 0 && ofs2 < ofs) BEGIN + READ_ASCII ofs2 buf (ofs - ofs2 - 1) + PATCH_IF (~%buf%~ STRING_CONTAINS_REGEXP ~,~ != 0) BEGIN + SET ofs2 += 1 + INSERT_BYTES ofs2 1 + WRITE_ASCII ofs2 ~,~ + SET ofs += 1 + END + END + + INSERT_BYTES ofs entryLen + WRITE_ASCIIE ofs ~%entry%~ + SET endOfs = ofs + entryLen + 1 + SET success = 1 + END + END + END + END +END + + +// Used internally: specified option reads initial state from baldur.lua +DEFINE_PATCH_FUNCTION __A7_EXPAND_READ_OPTION +INT_VAR + startOfs = 0 + controlID = 0 +STR_VAR + arrayName = "" + iniSection = "" + iniName = "" +RET + success + endOfs +BEGIN + SET success = 0 + SET endOfs = startOfs + + SET ofs = INDEX_BUFFER(~for[ %TAB%]+index,[ %TAB%]+var[ %TAB%]+in[ %TAB%]+pairs(%arrayName%)[ %TAB%]+do~ startOfs) + PATCH_IF (ofs >= startOfs) BEGIN + SET ofs1 = INDEX_BUFFER(~[ %TAB%]if[ %TAB%]+(var\[3\][ %TAB%]*==[ %TAB%]*-?[0-9]+)[ %TAB%]+then~ ofs) + SET ofs2 = INDEX_BUFFER(~.*Infinity_GetOption~ ofs) + PATCH_IF (ofs1 >= ofs && ofs1 < ofs2) BEGIN + SET mode = 2 // custom option already exists + SET ofs1 += 1 // skip to start of "if" statement + SET ofs = ofs1 + SET ofs3 = RINDEX_BUFFER(~[^ %TAB%]~ (ofs1 - 1)) + 1 + PATCH_IF (ofs3 > 0) BEGIN + READ_ASCII ofs3 indent (ofs1 - ofs3) + END + END ELSE PATCH_IF (ofs2 >= ofs) BEGIN + SET mode = 1 // first custom option to add + SET ofs = ofs2 + SET ofs3 = INDEX_BUFFER(~[^ %TAB%]~ ofs2) + PATCH_IF (ofs3 > ofs2) BEGIN + READ_ASCII ofs2 indent (ofs3 - ofs2) + END + END ELSE BEGIN + SET mode = 0 // no matching option found + END + + PATCH_IF (NOT VARIABLE_IS_SET "indent") BEGIN + TEXT_SPRINT indent ~%TAB%%TAB%%TAB%~ + END + + PATCH_IF (mode > 0) BEGIN + TEXT_SPRINT code ~~ + PATCH_IF (mode = 1) BEGIN + TEXT_SPRINT code ~%code%%indent%~ + END + TEXT_SPRINT code ~%code%if (var[3] == %controlID%) then%WNL%%indent%%TAB%var[5] = Infinity_GetINIValue('%iniSection%', '%iniName%')%WNL%%indent%else~ + PATCH_IF (mode = 1) BEGIN + TEXT_SPRINT code ~%code%%WNL%%TAB%~ + END + SET codeLen = STRING_LENGTH ~%code%~ + INSERT_BYTES ofs codeLen + WRITE_ASCIIE ofs ~%code%~ + SET ofs += codeLen + + PATCH_IF (mode = 1) BEGIN + SET ofs = INDEX_BUFFER(~[%WNL%]~ ofs) + TEXT_SPRINT code ~%WNL%%indent%end~ + SET codeLen = STRING_LENGTH ~%code%~ + INSERT_BYTES ofs codeLen + WRITE_ASCIIE ofs ~%code%~ + SET ofs += codeLen + END + + SET endOfs = ofs + SET success = 1 + END + END +END + + +// Used internally: specified option writes current state of option to baldur.lua +DEFINE_PATCH_FUNCTION __A7_EXPAND_WRITE_OPTION +INT_VAR + startOfs = 0 + controlID = 0 +STR_VAR + arrayName = "" + iniSection = "" + iniName = "" +RET + success + endOfs +BEGIN + SET success = 0 + SET endOfs = startOfs + + SET ofs = INDEX_BUFFER(~for[ %TAB%]+index,[ %TAB%]+var[ %TAB%]+in[ %TAB%]+pairs(%arrayName%)[ %TAB%]+do~ startOfs) + PATCH_IF (ofs >= startOfs) BEGIN + SET ofs1 = INDEX_BUFFER(~[ %TAB%]if[ %TAB%]+(var\[3\][ %TAB%]*==[ %TAB%]*-?[0-9]+)[ %TAB%]+then~ ofs) + SET ofs2 = INDEX_BUFFER(~.*Infinity_ChangeOption~ ofs) + PATCH_IF (ofs1 >= ofs && ofs1 < ofs2) BEGIN + SET mode = 2 // custom option already exists + SET ofs1 += 1 // skip to start of "if" statement + SET ofs = ofs1 + SET ofs3 = RINDEX_BUFFER(~[^ %TAB%]~ (ofs1 - 1)) + 1 + PATCH_IF (ofs3 > 0) BEGIN + READ_ASCII ofs3 indent (ofs1 - ofs3) + END + END ELSE PATCH_IF (ofs2 >= ofs) BEGIN + SET mode = 1 // first custom option to add + SET ofs = ofs2 + SET ofs3 = INDEX_BUFFER(~[^ %TAB%]~ ofs2) + PATCH_IF (ofs3 > ofs2) BEGIN + READ_ASCII ofs2 indent (ofs3 - ofs2) + END + END ELSE BEGIN + SET mode = 0 // no matching option found + END + + PATCH_IF (NOT VARIABLE_IS_SET "indent") BEGIN + TEXT_SPRINT indent ~%TAB%%TAB%%TAB%%TAB%~ + END + + PATCH_IF (mode > 0) BEGIN + TEXT_SPRINT code ~~ + PATCH_IF (mode = 1) BEGIN + TEXT_SPRINT code ~%code%%indent%~ + END + TEXT_SPRINT code ~%code%if (var[3] == %controlID%) then%WNL%%indent%%TAB%Infinity_SetINIValue('%iniSection%', '%iniName%', var[5])%WNL%%indent%else~ + PATCH_IF (mode = 1) BEGIN + TEXT_SPRINT code ~%code%%WNL%%TAB%~ + END + SET codeLen = STRING_LENGTH ~%code%~ + INSERT_BYTES ofs codeLen + WRITE_ASCIIE ofs ~%code%~ + SET ofs += codeLen + + PATCH_IF (mode = 1) BEGIN + SET ofs = INDEX_BUFFER(~[%WNL%]~ ofs) + TEXT_SPRINT code ~%WNL%%indent%end~ + SET codeLen = STRING_LENGTH ~%code%~ + INSERT_BYTES ofs codeLen + WRITE_ASCIIE ofs ~%code%~ + SET ofs += codeLen + END + + SET endOfs = ofs + SET success = 1 + END + END +END diff --git a/HiddenGameplayOptions/readme/readme.txt b/HiddenGameplayOptions/readme/readme.txt new file mode 100644 index 0000000..296e58b --- /dev/null +++ b/HiddenGameplayOptions/readme/readme.txt @@ -0,0 +1,181 @@ +Reveal Hidden Gameplay Options +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Version: 0.2-beta +Author: Argent77 + +Download: https:// +Discussion: https://forums.beamdog.com/discussion/64524/mod-reveal-hidden-gameplay-options-for-all-ee-games-patched-to-v2-0-or-higher + + +Overview +~~~~~~~~ + +The Enhanced Editions provide a great number of settings that are not directly accessible in the +in-game options menu, but instead have to be manually enabled or disabled in the game's +configuration file which might discourage less computer-savvy players from using them at all. + +This mods adds a number of useful options directly to the game, which includes the (in)famous +debug console, various graphics and feedback settings, and more. + +All Enhanced Edition games patched to v2.0 or higher are supported. + + +Installation +~~~~~~~~~~~~ + +This is a WeiDU mod, that means it is very easy to install. Simply unpack the downloaded archive +into your game directory and run "setup-HiddenGameplayOptions.exe". + + +Compatibility +~~~~~~~~~~~~~ + +The mod supports all Enhanced Edition games patched to v2.0 or higher. It is also compatible with +Pecca's "Dragonspear UI++" and Lefreut's Enhanced UI (LeUI). Some options may be moved into other +sections when these mods have been detected. + +Patching UI definition files can be tricky. To ensure that a failed patch attempt does not corrupt +the game it will fail with a forced error and restore the original state of the patched files. + + +Components +~~~~~~~~~~ + +1. Install Hidden Gameplay Options (main component) + +This component allows you to choose whether to install selected options individually or all at once. +See more detailed information about individual options below. + + +The following components are available when you chose to select options individually: + +2. Add in-game option "Enable Debug Console" + +Allows you to enable cheat keys and the debug console in the game. + +Option can be found in Gameplay section. + + +3. Add in-game option "Enable UI Edit Mode" + +Enabling this setting allows you to use UI edit functionality in the game. + +Option can be found in Gameplay section. + + +4. Add in-game option "Show Strrefs" + +Setting this option places string reference numbers in front of game strings. + +Option can be found in Gameplay section. + + +5. Add in-game option "Show trigger icons on tab" + +Setting this option reveals more information about interactive regions when pressing the TAB key. + +Option can be found in Gameplay section. + + +6. Add in-game option "Allow Spacebar in Dialogs" (only available in PST:EE) + +Setting this option allows you to use the spacebar to continue in dialogs. + +Option can be found in Gameplay section. + + +7. Add in-game option "Limits druidic spells for Cleric/Ranger" (not available in PST:EE) + +Setting this option limits druidic spell levels to level 3 for Cleric/Rangers (as per D&D rules). + +Option can be found in Gameplay section. + + +8. Add in-game option "3E Sneak Attack" + +Setting this option activates Sneak Attack and Crippling Strike, which are special abilities +similar to those from 3rd Edition Dungeons & Dragons rules. + +Option can be found in Gameplay section. + + +9. Add in-game option "Critical Hit Screen Shake" + +Setting this option triggers a screen shake whenever a party member rolls a critical hit in combat. + +Option can be found in Gameplay > Feedback > Visual Feedback (or Gameplay section in PST:EE). + + +10. Add in-game option "Hotkeys On Tooltips" + +When this option is enabled tooltips will display hotkeys when available. + +Option can be found in Gameplay > Feedback > Visual Feedback (or Gameplay section in PST:EE). + + +11. Add in-game option "Show extra combat info" + +Setting this option displays all factors that influence an attack roll. + +Option can be found in Gameplay > Feedback > Feedback Messages. + + +12. Add in-game option "Show Game Date and Time on Pause" + +Setting this option shows game date and time when activating pause. + +Option can be found in Gameplay > Feedback > Feedback Messages. + + +13. Add in-game option "Disable Area Map Zoom" (only available in PST:EE) + +Setting this option disables animation when zooming in or out of the area map screen. + +Option can be found in Graphics > Display Options. + + +14. Add in-game option "Reverse Mouse Wheel Zoom" + +Setting this option reverses zoom direction when using the mouse wheel. + +Option can be found in Graphics > Display Options. + + +15. Add in-game option "Pause Game on Map Screen" + +Setting this option causes the game to pause whenever the map screen is active. + +Option can be found in Graphics > Display Options. + + +16. Add in-game option "Enable Fog" (not available in PST:EE) + +Setting this option enables fog effects on maps. + +Option can be found in Graphics > Display Options. + + +17. Add in-game option "Disable Movies" + +Enabling this option disables movie playback. + +Option can be found in Graphics > Display Options. + + +Credits +~~~~~~~ + +Coding and testing: Argent77 + + +Copyright Notice +~~~~~~~~~~~~~~~~ + +The mod "Reveal Hidden Gameplay Options" is licensed under the "Creative Commons +Attribution-ShareAlike 4.0 International License" (http://creativecommons.org/licenses/by-sa/4.0/). + + +History +~~~~~~~ + diff --git a/HiddenGameplayOptions/setup-HiddenGameplayOptions.tp2 b/HiddenGameplayOptions/setup-HiddenGameplayOptions.tp2 new file mode 100644 index 0000000..02b4f4b --- /dev/null +++ b/HiddenGameplayOptions/setup-HiddenGameplayOptions.tp2 @@ -0,0 +1,177 @@ +BACKUP ~HiddenGameplayOptions/backup~ +AUTHOR ~Argent77 at Beamdog Forums~ +VERSION ~0.2-beta~ + +ASK_EVERY_COMPONENT + +ALWAYS + INCLUDE ~%MOD_FOLDER%/lib/presets.tph~ +END + +README ~%MOD_FOLDER%/readme/readme-%LANGUAGE%.txt~ + ~%MOD_FOLDER%/readme/readme.txt~ + +LANGUAGE ~English~ + ~english~ + ~%MOD_FOLDER%/languages/english/setup.tra~ + ~%MOD_FOLDER%/languages/english/mod.tra~ + +BEGIN @2 // All available options + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~ui.menu~ @100 // Enhanced Edition game patched to v2.0 or higher required. + SUBCOMPONENT @1 // Install more Gameplay options + DESIGNATED 0 + + LAF OPTION_DEBUG_CONSOLE END + + LAF OPTION_UI_EDIT_MODE END + + LAF OPTION_SHOW_STRREFS END + + LAF OPTION_TRIGGER_ICONS END + + ACTION_IF (GAME_IS ~pstee~) BEGIN LAF OPTION_ALLOW_SPACE_IN_DIALOG END END + + ACTION_IF (NOT GAME_IS ~pstee~) BEGIN LAF OPTION_CLERIC_RANGER_SPELLS END END + + LAF OPTION_SNEAK_ATTACK END + + LAF OPTION_CRITICAL_HIT_SCREEN_SHAKE END + + LAF OPTION_TOOLTIP_HOTKEYS END + + LAF OPTION_EXTRA_COMBAT_INFO END + + LAF OPTION_DATE_ON_PAUSE END + + ACTION_IF (GAME_IS ~pstee~) BEGIN LAF OPTION_DISABLE_MAP_ZOOM END END + + LAF OPTION_REVERSE_WHEEL_ZOOM END + + LAF OPTION_PAUSING_MAP END + + ACTION_IF (NOT GAME_IS ~pstee~) BEGIN LAF OPTION_ENABLE_FOG END END + + LAF OPTION_DISABLE_MOVIES END + + +BEGIN @3 // Selected options + REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~ui.menu~ @100 // Enhanced Edition game patched to v2.0 or higher required. + SUBCOMPONENT @1 // Install more Gameplay options + DESIGNATED 1 + + +BEGIN @10 // Add in-game option "Enable Debug Console" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 10 + + LAF OPTION_DEBUG_CONSOLE END + + +BEGIN @11 // Add in-game option "Enable UI Edit Mode" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 11 + + LAF OPTION_UI_EDIT_MODE END + + +BEGIN @12 // Add in-game option "Show Strrefs" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 12 + + LAF OPTION_SHOW_STRREFS END + + +BEGIN @13 // Add in-game option "Show trigger icons on tab" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 13 + + LAF OPTION_TRIGGER_ICONS END + + +BEGIN @14 // Add in-game option "Allow Spacebar in Dialogs" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + REQUIRE_PREDICATE (GAME_IS ~pstee~) @104 // Option not available for this game. + DESIGNATED 14 + + LAF OPTION_ALLOW_SPACE_IN_DIALOG END + + +BEGIN @15 // Add in-game option "Limit druidic spells for Cleric/Ranger" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + REQUIRE_PREDICATE (NOT GAME_IS ~pstee~) @104 // Option not available for this game. + DESIGNATED 15 + + LAF OPTION_CLERIC_RANGER_SPELLS END + + +BEGIN @16 // Add in-game option "3E Sneak Attack" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + REQUIRE_PREDICATE (NOT GAME_IS ~iwdee~) @105 // Option already present in this game. + DESIGNATED 16 + + LAF OPTION_SNEAK_ATTACK END + + +BEGIN @17 // Add in-game option "Critical Hit Screen Shake" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 17 + + LAF OPTION_CRITICAL_HIT_SCREEN_SHAKE END + + +BEGIN @18 // Add in-game option "Hotkeys On Tooltips" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 18 + + LAF OPTION_TOOLTIP_HOTKEYS END + + +BEGIN @19 // Add in-game option "Show extra combat info" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 19 + + LAF OPTION_EXTRA_COMBAT_INFO END + + +BEGIN @20 // Add in-game option "Show Game Date and Time on Pause" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 20 + + LAF OPTION_DATE_ON_PAUSE END + + +BEGIN @21 // Add in-game option "Disable Area Map Zoom" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + REQUIRE_PREDICATE (GAME_IS ~pstee~) @104 // Option not available for this game. + DESIGNATED 21 + + LAF OPTION_DISABLE_MAP_ZOOM END + + +BEGIN @22 // Add in-game option "Reverse Mouse Wheel Zoom" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 22 + + LAF OPTION_REVERSE_WHEEL_ZOOM END + + +BEGIN @23 // Add in-game option "Pause Game on Map Screen" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 23 + + LAF OPTION_PAUSING_MAP END + + +BEGIN @24 // Add in-game option "Enable Fog" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + REQUIRE_PREDICATE (NOT GAME_IS ~pstee~) @104 // Option not available for this game. + DESIGNATED 24 + + LAF OPTION_ENABLE_FOG END + + +BEGIN @25 // Add in-game option "Disable Movies" + REQUIRE_COMPONENT ~setup-HiddenGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. + DESIGNATED 25 + + LAF OPTION_DISABLE_MOVIES END diff --git a/HiddenGameplayOptions/tables/sneakatt.2da b/HiddenGameplayOptions/tables/sneakatt.2da new file mode 100644 index 0000000..bd3aca5 --- /dev/null +++ b/HiddenGameplayOptions/tables/sneakatt.2da @@ -0,0 +1,8 @@ +2DA V1.0 +0 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 +THIEF 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 +SHADOWDANCER 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 +ASSASIN 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 +BOUNTY_HUNTER 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 +STALKER 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 diff --git a/MoreGameplayOptions/languages/english/mod.tra b/MoreGameplayOptions/languages/english/mod.tra deleted file mode 100644 index 70f5f9d..0000000 --- a/MoreGameplayOptions/languages/english/mod.tra +++ /dev/null @@ -1,37 +0,0 @@ -// -*- coding: utf-8 -*- - -@1000 = ~Enable Debug Console~ -@1001 = ~Enabling this setting allows you to activate cheat keys and the debug console. - -Use keyboard shortcut CTRL-SPACE to activate the console in the game. - -Cheat keys include CTRL-Y to insta-kill creatures, CTRL-R to heal and dispel effects from characters, CTRL-J to teleport selected party members across the map, CTRL-T to advance game time by one hour, or CTRL-4 to toggle visibility of interactive regions. - -^NNote: You must restart the game for changes to take effect.^-~ - -@1100 = ~Show trigger icons on tab~ -@1101 = ~Enable this setting to reveal additional information about interactive regions when pressing the TAB key. - -^NNote: You must restart the game for changes to take effect.^-~ - -@1200 = ~Show extra combat info~ -@1201 = ~Enabling this setting allows you to see all factors that influence an attack roll. - -^NNote: You must restart the game for changes to take effect.^-~ - -@1300 = ~Show Game Date and Time on Pause~ -@1301 = ~Show game date and time when activating pause. - -^NNote: You must restart the game for changes to take effect.^-~ - -@1400 = ~Disable Fog~ -@1401 = ~Disables fog effects on maps. - -^NNote: You must restart the game for changes to take effect.^-~ - -@1500 = ~Limits druidic spells for Cleric/Ranger~ -@1501 = ~This setting controls the availability of druidic spells for multi- or dualclassed Cleric/Rangers. - -Enable this option to limit druidic spells to level 3 - the maximum allowed spell level available to rangers. Cleric spells are not affected by this option. - -^NNote: You must restart the game for changes to take effect.^-~ diff --git a/MoreGameplayOptions/languages/english/setup.tra b/MoreGameplayOptions/languages/english/setup.tra deleted file mode 100644 index d1322f1..0000000 --- a/MoreGameplayOptions/languages/english/setup.tra +++ /dev/null @@ -1,17 +0,0 @@ -// -*- coding: us-ascii -*- - -@1 = ~Install more Gameplay options~ -@2 = ~All available options~ -@3 = ~Selected options~ - -@10 = ~Add in-game option "Enable Debug Console"~ -@11 = ~Add in-game option "Show trigger icons on tab"~ -@12 = ~Add in-game option "Show extra combat info"~ -@13 = ~Add in-game option "Show Game Date and Time on Pause"~ -@14 = ~Add in-game option "Disable Fog"~ -@15 = ~Add in-game option "Limits druidic spells for Cleric/Ranger"~ - -@100 = ~Enhanced Edition game patched to v2.0 or higher required.~ -@101 = ~Cannot patch LUA file~ -@102 = ~Cannot patch UI.MENU~ -@103 = ~Component "Selected options" not selected.~ diff --git a/MoreGameplayOptions/lib/functions.tph b/MoreGameplayOptions/lib/functions.tph deleted file mode 100644 index ba65cce..0000000 --- a/MoreGameplayOptions/lib/functions.tph +++ /dev/null @@ -1,316 +0,0 @@ -/** - * Installs a new 'Gameplay' option to the game. - * INT_VAR optLabelTra The TRA reference number of the option label string. - * INT_VAR optDescTra The TRA reference number of the option description text. - * INT_VAR controlID A unique number that identifies this option. - * Recommended: Use negative number to minimize interference with existing IDs. - * INT_VAR autoFail Set to nonzero to force termination of component installation on error. - * STR_VAR optLabelName Name of the option label variable. - * STR_VAR optDescName Name of the option description variable. - * STR_VAR iniSection Section name of the option that will be added to baldur.lua (e.g. "Program Options"). - * STR_VAR iniName Option name that will be added to baldur.lua (e.g. "Debug Mode"). - * RET success Returns 1 on success, 0 otherwise. - */ -DEFINE_ACTION_FUNCTION INSTALL_GAMEPLAY_OPTION -INT_VAR - optLabelTra = "-1" - optDescTra = "-1" - controlID = 0 - autoFail = 1 -STR_VAR - optLabelName = "" - optDescName = "" - iniSection = "" - iniName = "" -RET - success -BEGIN - OUTER_SET success = 0 - - ACTION_IF (optLabelTra >= 0 AND - optDescTra >= 0 AND - controlID != 0 AND - NOT ~%optLabelName%~ STR_EQ ~~ AND - NOT ~%optDescName%~ STR_EQ ~~ AND - NOT ~%iniSection%~ STR_EQ ~~ AND - NOT ~%iniName%~ STR_EQ ~~) BEGIN - OUTER_SET failed = 0 - - LAF ADD_LUA_DEFINITION - INT_VAR traRef = optDescTra - STR_VAR varName = EVAL ~%optDescName%~ - RET success - END - ACTION_IF (NOT success) BEGIN - ACTION_IF (autoFail) BEGIN - FAIL @101 // Cannot patch LUA file - END ELSE BEGIN - OUTER_SET failed = 1 - END - END - - ACTION_IF (NOT failed) BEGIN - LAF ADD_LUA_DEFINITION - INT_VAR traRef = optLabelTra - STR_VAR varName = EVAL ~%optLabelName%~ - RET success - END - ACTION_IF (NOT success) BEGIN - ACTION_IF (autoFail) BEGIN - FAIL @101 // Cannot patch LUA file - END ELSE BEGIN - OUTER_SET failed = 1 - END - END - END - - ACTION_IF (NOT failed) BEGIN - COPY_EXISTING ~ui.menu~ ~override~ - LPF ADD_GAMEPLAY_OPTION - INT_VAR - controlID = controlID - STR_VAR - optLabel = EVAL ~%optLabelName%~ - optDesc = EVAL ~%optDescName%~ - iniSection = EVAL ~%iniSection%~ - iniName = EVAL ~%iniName%~ - RET - success - END - PATCH_IF (NOT success) BEGIN - PATCH_IF (autoFail) BEGIN - PATCH_FAIL @102 // Cannot patch UI.MENU - END ELSE BEGIN - SET failed = 1 - END - END - END - - ACTION_IF (NOT failed) BEGIN - OUTER_SET success = 1 - END - END -END - - -/** - * Adds a new string variable definition into available L_xx_YY.LUA resources. - * INT_VAR traRef TRA reference number of the string to add. - * STR_VAR varName Name of the variable to add. - * RET success Returns 1 if definition has been added successfully to all available LUA files, 0 otherwise. - */ -DEFINE_ACTION_FUNCTION ADD_LUA_DEFINITION -INT_VAR - traRef = "-1" -STR_VAR - varName = ~~ -RET - success -BEGIN - OUTER_SET success = 0 - - ACTION_IF (traRef >= 0 AND NOT ~%varName%~ STR_EQ ~~) BEGIN - COPY_EXISTING_REGEXP ~L_[a-zA-Z][a-zA-Z]_[a-zA-Z][a-zA-Z]\.LUA~ ~override~ - SET ofs1 = INDEX_BUFFER(~[ %TAB%]*[a-zA-Z_][a-zA-Z0-9_]*[ %TAB%]*=.+,~) - SET failed = 0 - PATCH_IF (ofs1 < 0) BEGIN - SET failed = 1 - END - PATCH_IF (NOT failed) BEGIN - SET ofs2 = INDEX_BUFFER(~[%WNL%]~ ofs1) - PATCH_IF (ofs2 < ofs1) BEGIN - SET failed = 1 - END - END - - PATCH_IF (NOT failed) BEGIN - // determining variable definition type - READ_ASCII ofs1 curLine (ofs2 - ofs1) - INNER_PATCH ~%curLine%~ BEGIN - SET v = INDEX_BUFFER(~[ %TAB%]*=[ %TAB%]*"[^"]+"~) - SET isStrref = (v < 0) ? 1 : 0 - END - - PATCH_IF (isStrref) BEGIN - SET number = RESOLVE_STR_REF((AT traRef)) - TEXT_SPRINT line ~%TAB%%varName% = %number%,%LNL%~ - END ELSE BEGIN - SPRINT text (AT traRef) - INNER_PATCH_SAVE text ~%text%~ BEGIN - REPLACE_TEXTUALLY ~%MNL%?%LNL%~ ~\n~ - REPLACE_TEXTUALLY ~\^N\(.+\)\^-~ ~\1~ // just a precaution: older games don't appear to support colored text in options menu yet - END - TEXT_SPRINT line ~%TAB%%varName% = "%text%",%LNL%~ - END - - // inserting text definition - SET strlen = STRING_LENGTH ~%line%~ - INSERT_BYTES ofs1 strlen - WRITE_ASCIIE ofs1 ~%line%~ - - SET success = 1 - END ELSE BEGIN - SET success = 0 - END - END -END - - -/** - * Adds a new option to the 'Gameplay' section of the Options menu. - * INT_VAR controlID A unique number that identifies the option. - * Recommended: Use negative number to minimize interference with existing IDs. - * STR_VAR optLabel Variable name referring to option label text (e.g. "SHOW_DEBUG_CONSOLE_LABEL"). - * STR_VAR optDesc Variable name referring to option description text (e.g. "SHOW_DEBUG_CONSOLE_DESC"). - * STR_VAR iniSection Section name of option that will be added to baldur.lua (e.g. "Program Options"). - * STR_VAR iniName Option name that will be added to baldur.lua (e.g. "Debug Mode"). - * RET success Returns 1 if changes have been applied successfully, 0 otherwise. - */ -DEFINE_PATCH_FUNCTION ADD_GAMEPLAY_OPTION -INT_VAR - controlID = 0 -STR_VAR - optLabel = "" - optDesc = "" - iniSection = "" - iniName = "" -RET - success -BEGIN - SET success = 0 - PATCH_IF (controlID != 0 AND - NOT ~%optLabel%~ STR_EQ ~~ AND - NOT ~%optDesc%~ STR_EQ ~~ AND - NOT ~%iniSection%~ STR_EQ ~~ AND - NOT ~%iniName%~ STR_EQ ~~) BEGIN - LPF __A7_ADD_OPTION - INT_VAR controlID = controlID - STR_VAR - optLabel = EVAL ~%optLabel%~ - optDesc = EVAL ~%optDesc%~ - iniSection = EVAL ~%iniSection%~ - iniName = EVAL ~%iniName%~ - RET success - END - END -END - - -// Used internally: implement new entry in UI.MENU -DEFINE_PATCH_FUNCTION __A7_ADD_OPTION -INT_VAR - controlID = 0 -STR_VAR - optLabel = "" - optDesc = "" - iniSection = "" - iniName = "" -RET - success -BEGIN - SET success = 0 - SET matches = 0 // keeps track of modifications - - // 1. adding entry to options array - SET ofs = INDEX_BUFFER(~toggleTitles[ %TAB%]*=[ %TAB%]*{~) - PATCH_IF (ofs >= 0) BEGIN - SET ofs = INDEX_BUFFER(~[%WNL%]~ ofs) - SET ofs = INDEX_BUFFER(~[ %TAB%]*}[ %TAB%%WNL%]~ ofs) - PATCH_IF (ofs > 0) BEGIN - TEXT_SPRINT entry ~{"%optLabel%", "%optDesc%", %controlID%, 0, 0},%WNL%~ - SET entryLen = STRING_LENGTH ~%entry%~ - INSERT_BYTES ofs entryLen - WRITE_ASCIIE ofs ~%entry%~ - PATCH_LOG ~DEBUG: added entry to options array~ - SET matches += 1 - - // 2. adding code for reading initial state of option - SET ofs = INDEX_BUFFER(~for index, var in pairs(toggleTitles) do~ ofs) - PATCH_IF (ofs > 0) BEGIN - SET ofs1 = INDEX_BUFFER(~[ %TAB%]if[ %TAB%]+(var\[3\][ %TAB%]*==[ %TAB%]*-?[0-9]+)[ %TAB%]+then~ ofs) - SET ofs2 = INDEX_BUFFER(~.*Infinity_GetOption~ ofs) - PATCH_IF (ofs1 > 0 && ofs1 < ofs2) BEGIN - // custom option already exists - SET ofs1 += 1 // skip to start of "if" statement - TEXT_SPRINT code ~if (var[3] == %controlID%) then - var[5] = Infinity_GetINIValue('%iniSection%', '%iniName%') - else~ - SET codeLen = STRING_LENGTH ~%code%~ - INSERT_BYTES ofs1 codeLen - WRITE_ASCIIE ofs1 ~%code%~ - SET ofs1 += codeLen - - PATCH_LOG ~DEBUG: added read option code (custom)~ - SET matches += 1 - SET ofs = ofs1 - END ELSE PATCH_IF (ofs2 > 0) BEGIN - // first custom option to add - TEXT_SPRINT code ~ if (var[3] == %controlID%) then - var[5] = Infinity_GetINIValue('%iniSection%', '%iniName%') - else - ~ - SET codeLen = STRING_LENGTH ~%code%~ - INSERT_BYTES ofs2 codeLen - WRITE_ASCIIE ofs2 ~%code%~ - SET ofs2 += codeLen - - SET ofs2 = INDEX_BUFFER(~[%WNL%]~ ofs2) - TEXT_SPRINT code ~%WNL% end~ - SET codeLen = STRING_LENGTH ~%code%~ - INSERT_BYTES ofs2 codeLen - WRITE_ASCIIE ofs2 ~%code%~ - SET ofs2 += codeLen - - PATCH_LOG ~DEBUG: added read option code (new)~ - SET matches += 1 - SET ofs = ofs2 - END - - PATCH_IF (matches = 2) BEGIN - // 3. adding code for writing current state of option - SET ofs = INDEX_BUFFER(~for index, var in pairs(toggleTitles) do~ ofs) - PATCH_IF (ofs > 0) BEGIN - SET ofs1 = INDEX_BUFFER(~[ %TAB%]if[ %TAB%]+(var\[3\][ %TAB%]*==[ %TAB%]*-?[0-9]+)[ %TAB%]+then~ ofs) - SET ofs2 = INDEX_BUFFER(~.*Infinity_ChangeOption~ ofs) - PATCH_IF (ofs1 > 0 && ofs1 < ofs2) BEGIN - // custom option already exists - SET ofs1 += 1 // skip to start of "if" statement - TEXT_SPRINT code ~if (var[3] == %controlID%) then - Infinity_SetINIValue('%iniSection%', '%iniName%', var[5]) - else~ - SET codeLen = STRING_LENGTH ~%code%~ - INSERT_BYTES ofs1 codeLen - WRITE_ASCIIE ofs1 ~%code%~ - - PATCH_LOG ~DEBUG: added write option code (custom)~ - SET matches += 1 - END ELSE PATCH_IF (ofs2 > 0) BEGIN - // first custom option to add - TEXT_SPRINT code ~ if (var[3] == %controlID%) then - Infinity_SetINIValue('%iniSection%', '%iniName%', var[5]) - else - ~ - SET codeLen = STRING_LENGTH ~%code%~ - INSERT_BYTES ofs2 codeLen - WRITE_ASCIIE ofs2 ~%code%~ - SET ofs2 += codeLen - - SET ofs2 = INDEX_BUFFER(~[%WNL%]~ ofs2) - TEXT_SPRINT code ~%WNL% end~ - SET codeLen = STRING_LENGTH ~%code%~ - INSERT_BYTES ofs2 codeLen - WRITE_ASCIIE ofs2 ~%code%~ - - PATCH_LOG ~DEBUG: added write option code (new)~ - SET matches += 1 - END - END - END - END - END - END - - PATCH_IF (matches = 3) BEGIN - SET success = 1 - END -END diff --git a/MoreGameplayOptions/readme/readme.txt b/MoreGameplayOptions/readme/readme.txt deleted file mode 100644 index 5f41fc2..0000000 --- a/MoreGameplayOptions/readme/readme.txt +++ /dev/null @@ -1,92 +0,0 @@ -Add More Gameplay Options -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Version: 0.1-beta -Author: Argent77 - -Download: https:// -Discussion: https:// - - -Overview -~~~~~~~~ - -The Enhanced Editions provide a great number of settings that are not directly accessible in the -in-game options. Instead they have to be manually enabled or disabled directly in the game's -configuration file which might discourage less computer-savvy players to use them at all. - -This mods adds a number of useful options directly to the game, which includes the debug console, -various options to display additional gameplay information and more. You can find them in the -'Gameplay' section of the Options menu. - -All Enhanced Edition games patched to v2.0 or higher are supported. - - -Installation -~~~~~~~~~~~~ - -This is a WeiDU mod, that means it is very easy to install. Simply unpack the downloaded archive -into your game directory and run "setup-MoreGameplayOptions.exe". - - -Components -~~~~~~~~~~ - -1. Install more Gameplay options (main component) - -This component allows you to choose whether to install selected options individually or all at once. - - -The following options are only available when you choose to select options individually: - -2. Add in-game option "Enable Debug Console" - -Allows you to enable cheat keys and the debug console in the game. - - -3. Add in-game option "Show trigger icons on tab" - -Setting this option reveals more information about interactive regions when pressing the TAB key. - - -4. Add in-game option "Show extra combat info" - -Setting this option displays all factors that influence an attack roll. - - -5. Add in-game option "Show Game Date and Time on Pause" - -Setting this option shows game date and time when activating pause. - - -6. Add in-game option "Disable Fog" - -Setting this option disables fog effects on maps. - - -7. Add in-game option "Limits druidic spells for Cleric/Ranger" - -Setting this option limits druidic spell levels to level 3 for Cleric/Rangers (as per D&D rules). - - -Note: Patching UI definition files can be tricky. To ensure that a failed patch attempt does not - corrupt the game the mod will fail with a forced error and restore the original state of - the patched files. - - -Credits -~~~~~~~ - -Coding and testing: Argent77 - - -Copyright Notice -~~~~~~~~~~~~~~~~ - -The mod "More Gameplay Options" is licensed under the "Creative Commons -Attribution-ShareAlike 4.0 International License" (http://creativecommons.org/licenses/by-sa/4.0/). - - -History -~~~~~~~ - diff --git a/MoreGameplayOptions/setup-MoreGameplayOptions.tp2 b/MoreGameplayOptions/setup-MoreGameplayOptions.tp2 deleted file mode 100644 index 85f10d5..0000000 --- a/MoreGameplayOptions/setup-MoreGameplayOptions.tp2 +++ /dev/null @@ -1,179 +0,0 @@ -BACKUP ~MoreGameplayOptions/backup~ -AUTHOR ~Argent77 at Beamdog Forums~ -VERSION ~0.1-beta~ - -ASK_EVERY_COMPONENT - -ALWAYS - INCLUDE ~%MOD_FOLDER%/lib/functions.tph~ - - DEFINE_ACTION_FUNCTION OPTION_DEBUG_CONSOLE - BEGIN - LAF INSTALL_GAMEPLAY_OPTION - INT_VAR - optLabelTra = 1000 - optDescTra = 1001 - controlID = "-167" - autoFail = 1 - STR_VAR - optLabelName = "SHOW_DEBUG_CONSOLE_LABEL" - optDescName = "SHOW_DEBUG_CONSOLE_DESCRIPTION" - iniSection = "Program Options" - iniName = "Debug Mode" - RET - success - END - END - - DEFINE_ACTION_FUNCTION OPTION_TRIGGER_ICONS - BEGIN - LAF INSTALL_GAMEPLAY_OPTION - INT_VAR - optLabelTra = 1100 - optDescTra = 1101 - controlID = "-168" - autoFail = 1 - STR_VAR - optLabelName = "SHOW_TRIGGER_ICONS_LABEL" - optDescName = "SHOW_TRIGGER_ICONS_DESCRIPTION" - iniSection = "Game Options" - iniName = "Show Triggers On Tab" - RET - success - END - END - - DEFINE_ACTION_FUNCTION OPTION_EXTRA_COMBAT_INFO - BEGIN - LAF INSTALL_GAMEPLAY_OPTION - INT_VAR - optLabelTra = 1200 - optDescTra = 1201 - controlID = "-169" - autoFail = 1 - STR_VAR - optLabelName = "SHOW_EXTRA_COMBAT_INFO_LABEL" - optDescName = "SHOW_EXTRA_COMBAT_INFO_DESCRIPTION" - iniSection = "Game Options" - iniName = "Extra Combat Info" - RET - success - END - END - - DEFINE_ACTION_FUNCTION OPTION_DATE_ON_PAUSE - BEGIN - LAF INSTALL_GAMEPLAY_OPTION - INT_VAR - optLabelTra = 1300 - optDescTra = 1301 - controlID = "-170" - autoFail = 1 - STR_VAR - optLabelName = "SHOW_DATE_ON_PAUSE_LABEL" - optDescName = "SHOW_DATE_ON_PAUSE_DESCRIPTION" - iniSection = "Game Options" - iniName = "Show Date On Pause" - RET - success - END - END - - DEFINE_ACTION_FUNCTION OPTION_ENABLE_FOG - BEGIN - LAF INSTALL_GAMEPLAY_OPTION - INT_VAR - optLabelTra = 1400 - optDescTra = 1401 - controlID = "-171" - autoFail = 1 - STR_VAR - optLabelName = "SHOW_ENABLE_FOG_LABEL" - optDescName = "SHOW_ENABLE_FOG_DESCRIPTION" - iniSection = "Game Options" - iniName = "Enable Fog" - RET - success - END - END - - DEFINE_ACTION_FUNCTION OPTION_CLERIC_RANGER_SPELLS - BEGIN - LAF INSTALL_GAMEPLAY_OPTION - INT_VAR - optLabelTra = 1500 - optDescTra = 1501 - controlID = "-172" - autoFail = 1 - STR_VAR - optLabelName = "SHOW_CLERIC_RANGER_SPELLS_LABEL" - optDescName = "SHOW_CLERIC_RANGER_SPELLS_DESCRIPTION" - iniSection = "Game Options" - iniName = "Cleric Ranger Spells" - RET - success - END - END -END - -README ~MoreGameplayOptions/readme/readme-%LANGUAGE%.txt~ ~MoreGameplayOptions/readme/readme.txt~ - -LANGUAGE ~English~ - ~english~ - ~MoreGameplayOptions/languages/english/setup.tra~ - ~MoreGameplayOptions/languages/english/mod.tra~ - -BEGIN @2 // All available options - REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~ui.menu~ @100 // Enhanced Edition game patched to v2.0 or higher required. - SUBCOMPONENT @1 // Install more Gameplay options - DESIGNATED 0 - - LAF OPTION_DEBUG_CONSOLE END - LAF OPTION_TRIGGER_ICONS END - LAF OPTION_EXTRA_COMBAT_INFO END - LAF OPTION_DATE_ON_PAUSE END - LAF OPTION_ENABLE_FOG END - LAF OPTION_CLERIC_RANGER_SPELLS END - - -BEGIN @3 // Selected options - REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~ui.menu~ @100 // Enhanced Edition game patched to v2.0 or higher required. - SUBCOMPONENT @1 // Install more Gameplay options - DESIGNATED 1 - - -BEGIN @10 // Add in-game option "Enable Debug Console" - REQUIRE_COMPONENT ~setup-MoreGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. - DESIGNATED 10 - - LAF OPTION_DEBUG_CONSOLE END - -BEGIN @11 // Add in-game option "Show trigger icons on tab" - REQUIRE_COMPONENT ~setup-MoreGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. - DESIGNATED 11 - - LAF OPTION_TRIGGER_ICONS END - -BEGIN @12 // Add in-game option "Show extra combat info" - REQUIRE_COMPONENT ~setup-MoreGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. - DESIGNATED 12 - - LAF OPTION_EXTRA_COMBAT_INFO END - -BEGIN @13 // Add in-game option "Show Game Date and Time on Pause" - REQUIRE_COMPONENT ~setup-MoreGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. - DESIGNATED 13 - - LAF OPTION_DATE_ON_PAUSE END - -BEGIN @14 // Add in-game option "Disable Fog" - REQUIRE_COMPONENT ~setup-MoreGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. - DESIGNATED 14 - - LAF OPTION_ENABLE_FOG END - -BEGIN @15 // Add in-game option "Limits druidic spells for Cleric/Ranger" - REQUIRE_COMPONENT ~setup-MoreGameplayOptions.tp2~ 1 @103 // Component "Selected options" not selected. - DESIGNATED 15 - - LAF OPTION_CLERIC_RANGER_SPELLS END