Skip to content

Commit

Permalink
port to 1.13c + change config to "Always Show Item Range"
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmTrial committed Mar 31, 2018
1 parent dcf367b commit a3ba37e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions BH/D2Ptrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ ASMPTR(D2CLIENT, LoadAct_2, 0x62760, 0x2B420)
ASMPTR(D2CLIENT, GetUnitFromId_I, 0xA4E20, 0x61480)
VARPTR(D2CLIENT, pUnitTable, POINT, 0x10A608, 0x1047B8)

ASMPTR(D2CLIENT, ParseStats_J, 0/*TODO*/, 0x2CE40)
ASMPTR(D2CLIENT, ParseStats_J, 0x54E10, 0x2CE40)

////////////////////////////////////////////////////////////////////////////////////////////////
// D2Common Ordinals
Expand All @@ -329,7 +329,7 @@ FUNCPTR(D2COMMON, GetLevel, Level * __fastcall, (ActMisc *pMisc, DWORD dwLevelNo

FUNCPTR(D2COMMON, GetStatList, StatList* __stdcall, (UnitAny* pUnit, DWORD dwUnk, DWORD dwMaxEntries ), -10930, -10449)
FUNCPTR(D2COMMON, CopyStatList, DWORD __stdcall, (StatList* pStatList, Stat* pStatArray, DWORD dwMaxEntries), -10658, -10195)
FUNCPTR(D2COMMON, GetBaseStatSigned, int __stdcall, (UnitAny *pUnit, int nStat, int nLayer), 0 /*TODO*/, -10216)
FUNCPTR(D2COMMON, GetBaseStatSigned, int __stdcall, (UnitAny *pUnit, int nStat, int nLayer), -10587, -10216)
FUNCPTR(D2COMMON, GetUnitStat, DWORD __stdcall, (UnitAny* pUnit, DWORD dwStat, DWORD dwStat2), -10973, -10550)
FUNCPTR(D2COMMON, GetUnitState, int __stdcall, (UnitAny *pUnit, DWORD dwStateNo), -10494, -10706)

Expand All @@ -345,11 +345,11 @@ FUNCPTR(D2COMMON, GetRepairCost, DWORD __stdcall, (DWORD _1, UnitAny* pUnit, DWO
FUNCPTR(D2COMMON, GetItemMagicalMods, AutoMagicTxt* __stdcall, (int wPrefixNum), -10248, -10174)
FUNCPTR(D2COMMON, GetItemFromInventory, UnitAny *__stdcall, (Inventory* inv), -10460, -11132)
FUNCPTR(D2COMMON, GetNextItemFromInventory, UnitAny *__stdcall, (UnitAny *pItem), -10464, -10879)
FUNCPTR(D2COMMON, GetItemType, int __stdcall, (UnitAny *pItem), 0 /*TODO*/, -10121)
FUNCPTR(D2COMMON, IsMatchingType, BOOL __stdcall, (UnitAny *pItem, int iType), 0 /*TODO*/, -10601)
FUNCPTR(D2COMMON, GetItemType, int __stdcall, (UnitAny *pItem), -11088, -10121)
FUNCPTR(D2COMMON, IsMatchingType, BOOL __stdcall, (UnitAny *pItem, int iType), -10744, -10601)

FUNCPTR(D2COMMON, GetRunesTxt, RunesTxt* __stdcall, (int RecordNo), 0 /*TODO*/, -10405)
FUNCPTR(D2COMMON, GetRunesTxtRecords, int* __stdcall, (void), 0 /*TODO*/, -10981)
FUNCPTR(D2COMMON, GetRunesTxt, RunesTxt* __stdcall, (int RecordNo), -10006, -10405)
FUNCPTR(D2COMMON, GetRunesTxtRecords, int* __stdcall, (void), -11032, -10981)

FUNCPTR(D2COMMON, GenerateOverheadMsg, OverheadMsg* __stdcall, (DWORD dwUnk, char* szMsg, DWORD dwTrigger), -10454, -10538)
FUNCPTR(D2COMMON, FixOverheadMsg, void __stdcall, (OverheadMsg* pMsg, DWORD dwUnk), -10097, -10417)
Expand All @@ -373,7 +373,7 @@ FUNCPTR(D2COMMON, IsTownByRoom, BOOL __stdcall, (Room1* pRoom1), -10057, -10691)
////////////////////////////////////////////////////////////////////////////////////////////////

VARPTR(D2COMMON, sgptDataTable, sgptDataTable*, 0x99E1C, 0xA33F0)
VARPTR(D2COMMON, AutoMagicTxt, AutoMagicTxt*, 0 /*TODO*/, 0xA4CE4)
VARPTR(D2COMMON, AutoMagicTxt, AutoMagicTxt*, 0x9FBC8, 0xA4CE4)


////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions BH/Modules/Item/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ UnitAny* Item::viewingUnit;

Patch* itemNamePatch = new Patch(Call, D2CLIENT, { 0x92366, 0x96736 }, (int)ItemName_Interception, 6);
Patch* itemPropertyStringDamagePatch = new Patch(Call, D2CLIENT, { 0x55D7B, 0x2E04B }, (int)GetItemPropertyStringDamage_Interception, 5);
Patch* itemPropertyStringPatch = new Patch(Call, D2CLIENT, { 0 /* TODO */, 0x2E06D }, (int)GetItemPropertyString_Interception, 5);
Patch* itemPropertyStringPatch = new Patch(Call, D2CLIENT, { 0x55D9D, 0x2E06D }, (int) GetItemPropertyString_Interception, 5);
Patch* viewInvPatch1 = new Patch(Call, D2CLIENT, { 0x953E2, 0x997B2 }, (int)ViewInventoryPatch1_ASM, 6);
Patch* viewInvPatch2 = new Patch(Call, D2CLIENT, { 0x94AB4, 0x98E84 }, (int)ViewInventoryPatch2_ASM, 6);
Patch* viewInvPatch3 = new Patch(Call, D2CLIENT, { 0x93A6F, 0x97E3F }, (int)ViewInventoryPatch3_ASM, 5);
Expand All @@ -78,7 +78,7 @@ void Item::OnLoad() {
Toggles["Show Rune Numbers"].state || Toggles["Alt Item Style"].state || Toggles["Shorten Item Names"].state || Toggles["Advanced Item Display"].state)
itemNamePatch->Install();

if (Toggles["Show Item Stat Ranges"].state) {
if (Toggles["Always Show Item Stat Ranges"].state) {
itemPropertyStringDamagePatch->Install();
itemPropertyStringPatch->Install();
}
Expand All @@ -91,7 +91,7 @@ void Item::LoadConfig() {
Toggles["Show Sockets"] = BH::config->ReadToggle("Show Sockets", "None", true);
Toggles["Show iLvl"] = BH::config->ReadToggle("Show iLvl", "None", true);
Toggles["Show Rune Numbers"] = BH::config->ReadToggle("Show Rune Numbers", "None", true);
Toggles["Show Item Stat Ranges"] = BH::config->ReadToggle("Show Item Stat Ranges", "None", true);
Toggles["Always Show Item Stat Ranges"] = BH::config->ReadToggle("Always Show Item Stat Ranges", "None", true);
Toggles["Alt Item Style"] = BH::config->ReadToggle("Alt Item Style", "None", true);
Toggles["Color Mod"] = BH::config->ReadToggle("Color Mod", "None", false);
Toggles["Shorten Item Names"] = BH::config->ReadToggle("Shorten Item Names", "None", false);
Expand Down Expand Up @@ -122,8 +122,8 @@ void Item::DrawSettings() {
new Checkhook(settingsTab, 4, 60, &Toggles["Show Rune Numbers"].state, "Show Rune #");
new Keyhook(settingsTab, 200, 62, &Toggles["Show Rune Numbers"].toggle, "");

new Checkhook(settingsTab, 4, 75, &Toggles["Show Item Stat Ranges"].state, "Show Item Stat Ranges");
new Keyhook(settingsTab, 200, 77, &Toggles["Show Item Stat Ranges"].toggle, "");
new Checkhook(settingsTab, 4, 75, &Toggles["Always Show Item Stat Ranges"].state, "Always Show Item Stat Ranges");
new Keyhook(settingsTab, 200, 77, &Toggles["Always Show Item Stat Ranges"].toggle, "");

new Checkhook(settingsTab, 4, 90, &Toggles["Alt Item Style"].state, "Alt Style");
new Keyhook(settingsTab, 200, 92, &Toggles["Alt Item Style"].toggle, "");
Expand Down Expand Up @@ -673,7 +673,7 @@ BOOL __stdcall Item::OnDamagePropertyBuild(UnitAny* pItem, DamageStats* pDmgStat
}

void __stdcall Item::OnPropertyBuild(wchar_t* wOut, int nStat, UnitAny* pItem, int nStatParam) {
if (!(GetKeyState(VK_CONTROL) & 0x8000) || pItem == nullptr || pItem->dwType != UNIT_ITEM) {
if (!(Toggles["Always Show Item Stat Ranges"].state || GetKeyState(VK_CONTROL) & 0x8000) || pItem == nullptr || pItem->dwType != UNIT_ITEM) {
return;
}

Expand Down

0 comments on commit a3ba37e

Please sign in to comment.