Skip to content

Commit

Permalink
Added 'DontMoveTop' flag to the interface bar
Browse files Browse the repository at this point in the history
* originally only for built-in HRP, now it's a generic patch to prevent
the interface bar from obscuring the barter/trade interface.
  • Loading branch information
NovaRain committed May 27, 2024
1 parent 5803dc6 commit 0631f97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions sfall/HRP/InterfaceBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ static long __fastcall IntfaceWinCreate(long height, long yPos, long xPos, long
xPosition = xPos;
yPosition = yPos;

flags |= fo::WinFlags::DontMoveTop;

if (IFaceBar::IFACE_BAR_MODE == 0 && IFaceBar::IFACE_BAR_SIDE_ART && Setting::ScreenWidth() > IFaceBar::IFACE_BAR_WIDTH) {
long leftID = fo::func::win_add(0, yPos, xPos, height, 0, flags);
long rightID = fo::func::win_add(xPos + width, yPos, Setting::ScreenWidth() - (xPos + width), height, 0, flags);
Expand Down
5 changes: 4 additions & 1 deletion sfall/Modules/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static void WorldmapViewportPatch() {
MakeCall(0x4C5325, wmRefreshTabs_hook);

HookCall(0x4C4BFF, wmTownMapRefresh_hook);
if (worldmapInterface == 1) {
if (worldmapInterface != 2) {
HookCall(0x4C4CD5, wmTownMapRefresh_hook_textpos);
HookCall(0x4C4B8F, wmTownMapInit_hook);
}
Expand Down Expand Up @@ -1087,6 +1087,9 @@ static void InterfaceWindowPatch() {
// Remove OwnerFlag and Transparent flags
SafeWrite8(0x42F869, (*(BYTE*)0x42F869) ^ (fo::WinFlags::Transparent | fo::WinFlags::OwnerFlag)); // addWindow_

// Set DontMoveTop flag
SafeWrite8(0x45D89C, (*(BYTE*)0x45D89C) | fo::WinFlags::DontMoveTop); // intface_init_ (for HRP)

// Cosmetic fix for the background image of the character portrait on the player's inventory screen
HookCall(0x47093C, display_body_hook);
BYTE code[11] = {
Expand Down

0 comments on commit 0631f97

Please sign in to comment.