Decompile fn_17269 (WindowVisibility::Show)

Batch #1959 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_17269 WindowVisibility::Show: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy
Reviewed-by: ragnarok-clanker
Adds to the build: Source/UI/Shortcuts/ShortcutVisibility.cpp
This commit is contained in:
ragnarok-clanker 2026-10-29 08:57:29 +00:00
commit a2fe41a860
3 changed files with 115 additions and 0 deletions

View file

@ -0,0 +1,97 @@
#include "UI/Shortcuts/ShortcutVisibility.h"
// OFFSET: 0x00AAA310
// FUNCTION: fn_17269
bool WindowVisibility::Show(int id, int visible) {
switch (id) {
case 1: {
if (this->restricted && !this->replayAllowsBasicInfo) {
return false;
}
this->basicInfoVisible = visible;
if (!this->basicInfo) {
this->windows.EnsureWindow(1);
}
this->basicInfo->Show(visible);
UIWindow* window = this->basicInfo;
if (visible == 0) {
window->Slot11();
return true;
}
this->ordering.Promote(window);
return true;
}
case 15:
this->windows.EnsureWindow(15);
if (this->window15->geometry.visible != visible) {
this->window15->Show(visible);
}
if (visible != 0) {
this->ordering.Promote(this->window15);
}
return false;
case 36:
return this->shortcut.Show(visible);
case 46: {
this->window46Visible = visible;
if (!this->window46) {
if (visible == 0) {
return true;
}
this->windows.EnsureWindow(46);
if (!this->window46) {
return true;
}
}
this->window46->Show(visible);
UIWindow* window = this->window46;
if (visible == 0) {
window->Slot11();
return true;
}
this->ordering.Promote(window);
return true;
}
case 273:
this->windows.LookupWindow(273)->Show(visible);
return true;
case 276:
this->window276Visible = visible;
if (!this->window276) {
if (visible == 0) {
return true;
}
this->windows.EnsureWindow(276);
if (!this->window276) {
return true;
}
}
this->window276->Show(visible);
return true;
}
return false;
}

View file

@ -48,4 +48,21 @@ inline bool ShortcutVisibility::Show(int value) {
return true;
}
struct WindowVisibility {
WindowManagerWindows& windows;
WindowOrdering& ordering;
ShortcutVisibility& shortcut;
int& basicInfoVisible;
UIWindow*& basicInfo;
UIWindow*& window15;
int& window46Visible;
UIWindow*& window46;
int& window276Visible;
UIWindow*& window276;
const bool& restricted;
const bool& replayAllowsBasicInfo;
bool Show(int id, int visible);
};
#endif

View file

@ -661,6 +661,7 @@
"Source/UI/Shortcuts/ShortcutPainting.cpp": 2,
"Source/UI/Shortcuts/ShortcutPress.cpp": 2,
"Source/UI/Shortcuts/ShortcutTooltip.cpp": 2,
"Source/UI/Shortcuts/ShortcutVisibility.cpp": 2,
"Source/UI/Shortcuts/UIShortCutWnd.cpp": 2,
"Source/UI/Text/ColoredText.cpp": 2,
"Source/UI/Text/ItemLinkDisplay.cpp": 2,