Skip to content

Commit

Permalink
Add empty container module
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubb13 committed Mar 13, 2024
1 parent a9d4498 commit c57f978
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 18 deletions.
30 changes: 19 additions & 11 deletions EEex/EEex.tp2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BACKUP ~EEex/backup~
AUTHOR ~Bubb~
VERSION ~v0.10.1.1-alpha~
VERSION ~devel~
README ~EEex/readme-EEex.html~

BEGIN ~EEex~ LABEL ~B3-EEex-Main~
Expand Down Expand Up @@ -50,7 +50,7 @@ REQUIRE_PREDICATE (GAME_IS ~bgee bg2ee eet iwdee~ AND FILE_EXISTS ~data/PATCH26.


BEGIN ~Experimental - Use LuaJIT (can help stuttering)~ LABEL ~B3-EEex-LuaJIT~
REQUIRE_COMPONENT ~EEex.tp2~ ~0~ ~This component requires the main component to be installed.~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Main~) ~This component requires the main component to be installed.~

COPY ~InfinityLoader.ini~ ~.~
REPLACE_TEXTUALLY ~^\(LuaLibrary=\).*~ ~\1lua51.dll~
Expand All @@ -61,55 +61,63 @@ REQUIRE_COMPONENT ~EEex.tp2~ ~0~ ~This component requires the main component to


BEGIN ~Enable effect menu module - LShift-on-hover to view spells affecting creature~ LABEL ~B3-EEex-Module-Effect-Menu~
REQUIRE_COMPONENT ~EEex.tp2~ ~0~ ~This component requires the main component to be installed.~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Main~) ~This component requires the main component to be installed.~

COPY ~override/EEex_Modules.lua~ ~override~
REPLACE_TEXTUALLY ~^\([ %TAB%]+\["B3EffMen"\][ %TAB%]+=[ %TAB%]+\)false~ ~\1true~
BUT_ONLY


BEGIN ~Enable empty container module - Highlight empty containers in gray instead of cyan~ LABEL ~B3-EEex-Module-Empty-Containers~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Main~) ~This component requires the main component to be installed.~

COPY ~override/EEex_Modules.lua~ ~override~
REPLACE_TEXTUALLY ~^\([ %TAB%]+\["B3EmptyContainer"\][ %TAB%]+=[ %TAB%]+\)false~ ~\1true~
BUT_ONLY


BEGIN ~Enable timer module - Visual indicators for modal actions, contingencies, and spell/item cooldowns~ LABEL ~B3-EEex-Module-Timer-Main~
REQUIRE_COMPONENT ~EEex.tp2~ ~0~ ~This component requires the main component to be installed.~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Main~) ~This component requires the main component to be installed.~

COPY ~override/EEex_Modules.lua~ ~override~
REPLACE_TEXTUALLY ~^\([ %TAB%]+\["B3Timer"\][ %TAB%]+=[ %TAB%]+\)false~ ~\1true~
BUT_ONLY


BEGIN ~Timer module - Show modal actions (red bar)~ LABEL ~B3-EEex-Module-Timer-Modal~
REQUIRE_COMPONENT ~EEex.tp2~ ~2~ ~This component requires the "Enable timer module" component to be installed.~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Module-Timer-Main~) ~This component requires the "Enable timer module" component to be installed.~

COPY ~override/B3Timer.lua~ ~override~
REPLACE_TEXTUALLY ~^\(B3Timer_ShowModalTimer = \)[^ %TAB%%WNL%]+~ ~\1true~
BUT_ONLY


BEGIN ~Timer module - Show contingencies (green bar)~ LABEL ~B3-EEex-Module-Timer-Contingency~
REQUIRE_COMPONENT ~EEex.tp2~ ~2~ ~This component requires the "Enable timer module" component to be installed.~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Module-Timer-Main~) ~This component requires the "Enable timer module" component to be installed.~

COPY ~override/B3Timer.lua~ ~override~
REPLACE_TEXTUALLY ~^\(B3Timer_ShowContingencyTimer = \)[^ %TAB%%WNL%]+~ ~\1true~
BUT_ONLY


BEGIN ~Timer module - Show spell/item cooldowns (cyan bar)~ LABEL ~B3-EEex-Module-Timer-Aura~
REQUIRE_COMPONENT ~EEex.tp2~ ~2~ ~This component requires the "Enable timer module" component to be installed.~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Module-Timer-Main~) ~This component requires the "Enable timer module" component to be installed.~

COPY ~override/B3Timer.lua~ ~override~
REPLACE_TEXTUALLY ~^\(B3Timer_ShowCastTimer = \)[^ %TAB%%WNL%]+~ ~\1true~
BUT_ONLY


BEGIN ~Time step module - Advance 1 game tick on keypress~ LABEL ~B3-EEex-Module-Time-Step~
REQUIRE_COMPONENT ~EEex.tp2~ ~0~ ~This component requires the main component to be installed.~
BEGIN ~Enable time step module - Advance 1 game tick on keypress~ LABEL ~B3-EEex-Module-Time-Step~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Main~) ~This component requires the main component to be installed.~

COPY ~override/EEex_Modules.lua~ ~override~
REPLACE_TEXTUALLY ~^\([ %TAB%]+\["B3TimeStep"\][ %TAB%]+=[ %TAB%]+\)false~ ~\1true~
BUT_ONLY


BEGIN ~Hotkey module - Edit override/B3Hotkey.lua to create advanced spell hotkeys~ LABEL ~B3-EEex-Module-Hotkey~
REQUIRE_COMPONENT ~EEex.tp2~ ~0~ ~This component requires the main component to be installed.~
BEGIN ~Enable hotkey module - Edit override/B3Hotkey.lua to create advanced spell hotkeys~ LABEL ~B3-EEex-Module-Hotkey~
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ (ID_OF_LABEL ~EEex.tp2~ ~B3-EEex-Main~) ~This component requires the main component to be installed.~

COPY ~override/EEex_Modules.lua~ ~override~
REPLACE_TEXTUALLY ~^\([ %TAB%]+\["B3Hotkey"\][ %TAB%]+=[ %TAB%]+\)false~ ~\1true~
Expand Down
45 changes: 45 additions & 0 deletions EEex/copy/B3EmptyContainer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

function B3EmptyContainer_OnBeforeContainerOutlineRender(container, color)
if color.value ~= 0xFF00 and container.m_lstItems.m_nCount == 0 then
color.value = 0x808080
end
end

(function()

EEex_DisableCodeProtection()

EEex_HookBeforeCallWithLabels(EEex_Label("Hook-CGameContainer::Render()-B3EmptyContainer"), {
{"hook_integrity_watchdog_ignore_registers", {
EEex_HookIntegrityWatchdogRegister.R10, EEex_HookIntegrityWatchdogRegister.R11
}}},
EEex_FlattenTable({
{[[
#MAKE_SHADOW_SPACE(80)
mov qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-8)], rcx
mov qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-16)], rdx
mov qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-24)], r8
mov qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-32)], r9
]]},
EEex_GenLuaCall("B3EmptyContainer_OnBeforeContainerOutlineRender", {
["args"] = {
function(rspOffset) return {"mov qword ptr ss:[rsp+#$(1)], r14", {rspOffset}, "#ENDL"}, "CGameContainer" end,
function(rspOffset) return {[[
lea rax, qword ptr ds:[rsp+#LAST_FRAME_TOP(32)]
mov qword ptr ss:[rsp+#$(1)], rax ]], {rspOffset}, [[ #ENDL
]]}, "Primitive<uint>" end,
},
}),
{[[
call_error:
mov rcx, qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-8)]
mov rdx, qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-16)]
mov r8, qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-24)]
mov r9, qword ptr ss:[rsp+#SHADOW_SPACE_BOTTOM(-32)]
#DESTROY_SHADOW_SPACE
]]},
})
)

EEex_EnableCodeProtection()
end)()
13 changes: 7 additions & 6 deletions EEex/copy/EEex_Modules.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

EEex_Modules = {
["B3EffMen"] = false,
["B3Hotkey"] = false,
["B3Invis"] = false,
["B3Scale"] = false,
["B3Timer"] = false,
["B3TimeStep"] = false,
["B3EffMen"] = false,
["B3EmptyContainer"] = false,
["B3Hotkey"] = false,
["B3Invis"] = false,
["B3Scale"] = false,
["B3Timer"] = false,
["B3TimeStep"] = false,
}
Binary file modified EEex/loader/EEex.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions EEex/loader/InfinityLoader.db
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,10 @@ Operations=ADD 31
Pattern=6689B3BA040000
Operations=ADD -5

[Hook-CGameContainer::Render()-B3EmptyContainer]
Pattern=85C00F8893000000
Operations=ADD 150

[Hook-CGameEffect::CheckAdd()-FixShouldTransformSpellImmunityStrref]
Pattern=448D7E01BBFFFFFFFF
Operations=ADD 4
Expand Down
Binary file modified EEex/loader/LuaBindings-v2.6.6.0.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion package_mod.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ call "%~dp0..\ModPackaging\utilities\ie_games.bat"

REM /* MODIFY: set the values of the 3 variables below to reflect the current mod version */
set "mod_name=EEex"
set "mod_version=v0.10.1.1-alpha"
set "mod_version=devel"
set mod_folder=EEex

REM /* MODIFY: list here which IE games the mod is compatible with, from this list of possibilities: */
Expand Down
Binary file modified pdb/EEex.pdb
Binary file not shown.
Binary file modified pdb/LuaBindings-v2.6.6.0.pdb
Binary file not shown.

0 comments on commit c57f978

Please sign in to comment.