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
31 lines
1 KiB
C++
31 lines
1 KiB
C++
#include "Client/ClientOptions.h"
|
|
#include "Contents/Skills/AutomaticSkills.h"
|
|
#include "UI/Shortcuts/ShortcutActivation.h"
|
|
#include "UI/Window/UIWindow.h"
|
|
|
|
// OFFSET: 0x00930900
|
|
// FUNCTION: fn_12689
|
|
void ActivateShortcut(
|
|
UIWindow& window, ShortcutGrid& grid, int x, int y, bool itemSlotActive, unsigned char& currentRow, const NormalItemSlot* const* slots,
|
|
AutomaticSkills& automatic, ClientOptions& options
|
|
) {
|
|
const int column = grid.HitTest(x, y, itemSlotActive, currentRow);
|
|
if (column == -1) {
|
|
return;
|
|
}
|
|
|
|
const unsigned index = 9u * currentRow + static_cast<unsigned>(column);
|
|
const int limit = 9 * grid.rows;
|
|
if (limit <= static_cast<int>(index)) {
|
|
return;
|
|
}
|
|
|
|
const NormalItemSlot& slot = *slots[index];
|
|
if (slot.unknown_0000 != 0 && automatic.Contains(static_cast<std::uint16_t>(slot.itemId))) {
|
|
options.Set(AutomaticSkills::CancelOption(static_cast<std::int16_t>(slot.itemId)), 1, 0);
|
|
} else {
|
|
automatic.DisableAll();
|
|
}
|
|
|
|
window.SendMsg(nullptr, 41, column, currentRow, 0, 0);
|
|
}
|