mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-28 06:57:02 -04:00
Touch controls (#2053)
* 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
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/menu_pointer.h"
|
||||
#endif
|
||||
|
||||
typedef void (dMenu_Insect_c::*initFunc)();
|
||||
static initFunc map_init_process[] = {
|
||||
&dMenu_Insect_c::wait_init, &dMenu_Insect_c::explain_open_init,
|
||||
@@ -280,6 +284,12 @@ void dMenu_Insect_c::wait_init() {
|
||||
|
||||
void dMenu_Insect_c::wait_move() {
|
||||
if (mDoGph_gInf_c::getFader()->getStatus() == 1) {
|
||||
#if TARGET_PC
|
||||
if (pointerWait()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mDoCPd_c::getTrigB(PAD_1) || field_0xf7 == 0) {
|
||||
if (mDoCPd_c::getTrigB(PAD_1) && field_0xf6 == 1) {
|
||||
dMeter2Info_setInsectSelectType(0);
|
||||
@@ -301,6 +311,39 @@ void dMenu_Insect_c::wait_move() {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
bool dMenu_Insect_c::pointerWait() {
|
||||
dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Collection);
|
||||
for (u8 y = 0; y < 4; ++y) {
|
||||
for (u8 x = 0; x < 6; ++x) {
|
||||
const int index = x + y * 6;
|
||||
if (!isGetInsect(x, y) || !dusk::menu_pointer::hit_pane(mpINSParent[index], 8.0f)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (field_0xf4 != x || field_0xf5 != y) {
|
||||
field_0xf4 = x;
|
||||
field_0xf5 = y;
|
||||
setCursorPos();
|
||||
setAButtonString(0x368);
|
||||
Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f,
|
||||
-1.0f, 0);
|
||||
}
|
||||
if (dusk::menu_pointer::consume_click()) {
|
||||
field_0xf3 = 1;
|
||||
Z2GetAudioMgr()->seStart(Z2SE_SY_EXP_WIN_OPEN, NULL, 0, 0, 1.0f, 1.0f, -1.0f,
|
||||
-1.0f, 0);
|
||||
dMeter2Info_set2DVibration();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void dMenu_Insect_c::explain_open_init() {
|
||||
char local_78[32];
|
||||
char local_98[32];
|
||||
|
||||
Reference in New Issue
Block a user