rodecomp/Source/UI/Shortcuts/ShortcutControlEvents.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

75 lines
1.8 KiB
C++

#include "Client/ClientOptions.h"
#include "UI/Shortcuts/ShortcutControlEvents.h"
#include "UI/Shortcuts/ShortcutCooldowns.h"
#include "UI/Shortcuts/ShortcutVisibility.h"
#include "UI/Buttons/UIBitmapButton.h"
#include "UI/Buttons/UICheckBox.h"
#include "UI/Window/UIWindow.h"
// OFFSET: 0x0093B450
// FUNCTION: fn_12760
void ShortcutControlEvents::Click(int id) {
switch (id) {
case 201:
this->visibility.Show(0);
return;
case 216:
if (this->window.geometry.visible == 0) {
this->visibility.Show(1);
return;
}
this->grid.rows = this->grid.rows + 1;
if (this->grid.rows > 4) {
this->grid.rows = 1;
this->visibility.Show(0);
}
this->window.SendMsg(nullptr, 14, 0, 0, 0, 0);
return;
case 217:
if (this->grid.rows > 1) {
--this->grid.rows;
}
this->window.SendMsg(nullptr, 14, 0, 0, 0, 0);
return;
case 549: {
const bool checked = this->options.Get(10) == 0;
this->options.Set(10, checked ? 1 : 0, 0);
this->controls.bank->geometry.unknown_0030 = checked ? 1 : 0;
this->controls.bank->Invalidate();
for (ShortcutCooldownRecord& record : this->cooldowns.records) {
record.main.clear();
}
this->window.SendMsg(nullptr, 23, 0, 0, 0, 0);
return;
}
case 588:
case 589: {
this->itemSlotActive = id == 588;
const bool active = this->itemSlotActive;
this->controls.showItems->Enable(active ? 0 : 1);
this->controls.showItems->SetDisabled(active ? 1 : 0);
this->controls.showItems->Invalidate();
this->controls.hideItems->Enable(active ? 1 : 0);
this->controls.hideItems->SetDisabled(active ? 0 : 1);
this->controls.hideItems->Invalidate();
this->window.SendMsg(nullptr, 14, 0, 0, 0, 0);
return;
}
default:
return;
}
}