mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-16 22:00:05 -04:00
ad53af5c78
* WIP touch controls * Action icons * Updates * Don't mutate freeCamera config; allow switching between touch and controller cam * Wow * Fix build & add Skip button * Fix build & add settings * RCSS cleanup * Dpad and fishing, might redo * Add menu mouse controls * More pointer & fix icons * Optimizations & introduce layout system * Update aurora * Implement touch controls layout editor * Cleanup & fixes * Allow disabling mouse/touch in menus * More fixes
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <unordered_map>
|
|
|
|
#include "dusk/config_var.hpp"
|
|
|
|
namespace dusk {
|
|
|
|
enum class ActionBinds {
|
|
FIRST_PERSON_CAMERA,
|
|
CALL_MIDNA,
|
|
OPEN_MAP_SCREEN,
|
|
TOGGLE_MINIMAP,
|
|
OPEN_DUSKLIGHT_MENU,
|
|
TURBO_SPEED_BUTTON,
|
|
COUNT,
|
|
};
|
|
|
|
struct ActionBindData {
|
|
std::array<config::ActionBindConfigVar, 4>* configVars{};
|
|
std::string actionName{};
|
|
};
|
|
|
|
struct ActionBindPressData {
|
|
bool pressedCurFrame{false};
|
|
bool pressedPrevFrame{false};
|
|
};
|
|
|
|
using ActionBindsMap = std::unordered_map<ActionBinds, ActionBindData>;
|
|
|
|
ActionBindsMap& getActionBinds();
|
|
|
|
bool isActionBound(ActionBinds action, u32 port);
|
|
|
|
void updateActionBindings();
|
|
|
|
void setVirtualActionBind(ActionBinds action, u32 port, bool pressed, bool available = true);
|
|
|
|
void clearVirtualActionBind(ActionBinds action, u32 port);
|
|
|
|
void clearAllVirtualActionBinds();
|
|
|
|
bool getActionBindTrig(ActionBinds action, u32 port);
|
|
|
|
bool getActionBindHold(ActionBinds action, u32 port);
|
|
|
|
bool getActionBindHoldAnyPort(ActionBinds action);
|
|
|
|
int getActionBindButton(ActionBinds action, u32 port);
|
|
|
|
}
|