Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Update more mods broken on 8/10/23 (#308)
Browse files Browse the repository at this point in the history
* Update some comments in cooking mod

Update comments in cooking mod to correct mistakes.

* Update interface while dead

Update patch and pattern for interface while dead.

* Update color Alt Text

Update pattern and offsets for color alt text

* Update don't close title window

Update pattern for don't close title window mod
  • Loading branch information
kohupallintrax authored Aug 21, 2023
1 parent b872337 commit 85d1011
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Kanan/ColorAltText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ namespace kanan {
m_patchSelf{},
m_patchOthers {}
{
auto address = scan("client.exe", "C7 46 60 ? ? ? ? C7 46 64 ? ? ? ? 68 ? ? ? ?");
auto address = scan("client.exe", "B8 ? ? ? ? B9 ? ? ? ? 0F 45 ? 41 89");

if (address) {
log("Got ColorAltText %p", *address);

m_patchOthers.address = *address + 3;
m_patchOthers.address = *address + 1;
m_patchOthers.bytes = { 0xFF, 0xFF, 0xFF, 0xFF }; //in the order b g r a

m_patchSelf.address = *address - 13;
m_patchSelf.address = *address + 6;
m_patchSelf.bytes = { 0xFF, 0xFF, 0xFF, 0xFF }; //in the order b g r a
}
else {
Expand Down
8 changes: 4 additions & 4 deletions Kanan/CookingMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ namespace kanan {
static CookingMod* g_cooking;

//variable names may not accurately reflect the true names of the class. The original hooked function (see kanan pull request # 278)
//had args for this, ingredientIdx and Amount. Ingredient Idx is now part of the CookingViewClass (0x2FC). This is a pointer to CCookingView2
//had args for _this, ingredientIdx and Amount. Ingredient Idx is now part of the CookingViewClass (0x2FC). _this is a pointer to CCookingView2
void CookingMod::HookForCooking(int* _this, int amount) {
if (!g_cooking->m_is_enabled) {
g_cooking->m_hook->callOriginal(_this, amount);
return;
}
auto ingredientIdx = _this[193]; //Interface button we are currently clicking
if (ingredientIdx > -1 && ingredientIdx < 3) { //-1 is a state of not clicking any button. 0 through 2 are each Add button starting left
if (ingredientIdx > -1 && ingredientIdx < 3) { //-1 is a state of not clicking any button. 0 through 2 are each Add button starting from the left
//Manually set each food percent of the object from our kanan UI
_this[188] = cookingOne;//+2F0
_this[189] = cookingTwo;
_this[190] = cookingThree;

//subtract 1 from the button we are pressing to allow the the original function to set the cooking bar full flag correctly
//If we don't do this the code thast handles activating the start button does not get executed
//If we don't do this the code that handles activating the start button does not get executed
_this[188 + ingredientIdx] = _this[188 + ingredientIdx] - 1;
//we call the original function - effecdtively adding the 1 value we just subtracted
//we call the original function - effectively adding the 1 value we just subtracted and allowing the start button to appear.
g_cooking->m_hook->callOriginal(_this, amount);
return;
} else {
Expand Down
6 changes: 3 additions & 3 deletions Kanan/Patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@
"category": "Interface",
"patches": [
{
"pattern": "FF 81 18 ? ? ? EB 12",
"patch": "90 90 90 90 90 90"
"pattern": "FF C0 EB ? 85 C0 74 ? FF C8 89 81 ? ? ? ? 48 89",
"patch": "90 90"
}
]
},
Expand Down Expand Up @@ -1243,7 +1243,7 @@
"category": "Quality of Life",
"patches": [
{
"pattern": "FF 50 ? B0 ? 48 8B ? ? ? 48 83 C4 ? 5F C3 CC CC CC CC 40 ? 48 83 EC",
"pattern": "FF 50 ? B0 ? 48 8B ? ? ? 48 83 C4 ? 5F C3 E8",
"patch": "90 90 90"
}
]
Expand Down

0 comments on commit 85d1011

Please sign in to comment.