Using 'Reveal Details' button to perform CLUAConsole functions
BGEE/SOD 2.x added a 'Reveal Details' button to the right sidebar panel that behaves something like a 'sticky TAB key'. While I'm sure it's very handy when running in tablet mode; I don't find it particularly useful when running desktop - I use the TAB key without even thinking.
So, I decided to re-define the button to perform my favorite 'cheat' command: C:ExploreArea(). Don't be put off, however, if you don't share my 'map complete' fetish - C:CreateCreature('SIRINE'), for example can be used instead as a handy 'grind' mechanism. And the possibilities provided by C:Eval and/or C:Exec are endless. If you come up with a neat alternative to ExploreArea, please share it!
One further note before the how-to. For the sake of occasional tablet users, I decided that when in tablet mode, this mod should enable the default behavior. The re-definition is only enabled when not in tablet mode.
First, if necessary, put a copy of UI.menu in the game override directory; and open it with your favorite text editor. Search for the string "Infinity_FetchString(32729)". On an unmodified 2.1 UI.menu it is line 4963 and is in the middle of a button definition that looks like this:
button { area 6 49 71 48 enabled "worldScreen == e:GetActiveEngine()" toggle highlightButtonToggle tooltip lua "Infinity_FetchString(32729)" bam GUILS10 sequence 11 clickable lua "sidebarsGreyed ~= 1" action " worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) " }
Modify the 'enabled' line, and add a new button definition so that the code looks like this:
button { area 6 49 71 48 enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine()" toggle highlightButtonToggle tooltip lua "Infinity_FetchString(32729)" bam GUILS10 sequence 11 clickable lua "sidebarsGreyed ~= 1" action " worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) " } button { area 6 49 71 48 enabled "not e:IsTouchUI() and worldScreen == e:GetActiveEngine()" tooltip lua "'Explore Area'" bam GUILS10 sequence 11 clickable lua "sidebarsGreyed ~= 1" action " C:ExploreArea() " }
The only tricky bits are to be sure to modify the 'enabled' line in the original button definition; and to be sure to use either a quote-apostrophe text apostrophe-quote or an apostrophe-quote text quote-apostrophe sequence for the tool tip in the second button definition. Or, just leave out the tool tip line altogether
Enjoy - and if you come up with an alternative to C:ExploreArea, please share it! Off to Candlekeep
Comments
button { area 6 49 71 48 enabled "worldScreen == e:GetActiveEngine()" toggle highlightButtonToggle tooltip lua "''Explore Area'" bam GUILS10 sequence 11 clickable lua "sidebarsGreyed ~= 1" action " if e:IsTouchUI() then worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) else C:ExploreArea() end " }
button { area 6 49 71 48 enabled "worldScreen == e:GetActiveEngine()" toggle highlightButtonToggle tooltip lua "Infinity_FetchString(32729)" bam GUILS10 sequence 11 clickable lua "sidebarsGreyed ~= 1" action "worldScreen:SetHighlightEnabled(highlightButtonToggle == 1)" actionhold "C:ExploreArea()" }
I've verified that this continues to work correctly in BGEE/SOD 2.2. Have fun!