Restored the position of the ammo bar when ALTERNATE_AMMO_METRE=0

This commit is contained in:
NovaRain
2025-02-03 12:07:43 +08:00
parent 38d00f2e5f
commit 0b9140b3ef
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -389,7 +389,7 @@ static void GetAmmoMetreColors(long yPercent, BYTE &outClr1, BYTE &outClr2) {
static void __fastcall DrawAlternateAmmoMetre(long x, long y) {
fo::Window* win = fo::func::GNW_find(fo::var::interfaceWindow);
x += xOffset + 1;
x += xOffset - 1;
long startOffset = x + (25 * win->width);
BYTE* surface = win->surface + startOffset;
@@ -445,7 +445,7 @@ static void __fastcall DrawAlternateAmmoMetre(long x, long y) {
fo::BoundRect rect;
rect.x = x;
rect.y = 26;
rect.offx = x + 4;
rect.offx = x + 3;
rect.offy = 26 + 70;
fo::func::win_draw_rect(fo::var::interfaceWindow, (RECT*)&rect);
+4 -4
View File
@@ -1043,7 +1043,7 @@ static __declspec(naked) void gmouse_bk_process_hook() {
}
}
static long ammoBarXPos = 461; // move ammo bar away from rivets (was 463)
static long ammoBarXPos = 463; // default position
static __declspec(naked) void intface_update_ammo_lights_hack() {
__asm {
@@ -1407,9 +1407,9 @@ void Interface::init() {
MakeCall(0x45F94F, intface_update_ammo_lights_hack);
// Tweak for ammo bar position with HRP by Mash
if (HRP::Setting::ExternalEnabled()) {
ammoBarXPos = 465;
if (IniReader::GetInt("IFACE", "ALTERNATE_AMMO_METRE", 0, ".\\f2_res.ini")) {
ammoBarXPos -= 2;
//ammoBarXPos = 467;
if (!IniReader::GetInt("IFACE", "ALTERNATE_AMMO_METRE", 0, ".\\f2_res.ini")) {
ammoBarXPos += 4;
}
}
LoadGameHook::OnGameInit() += []() {