AMFP Enhanced
C++ reference: the code this unofficial fork added
Loading...
Searching...
No Matches
LuxProfilePad.h
Go to the documentation of this file.
1/*
2 * AMFP-2026: gamepad control of the profile window (the stock window was mouse-only in
3 * practice). Pure mapping, unit tested in tests/cpp/test_profile_pad.cpp. The flag values
4 * mirror hpl::eUIButton (checked by static_asserts in LuxMainMenu_Profile.cpp).
5 */
6#ifndef LUX_PROFILE_PAD_H
7#define LUX_PROFILE_PAD_H
8
9static const int kLuxUIPrimary = 1 << 0; // A
10static const int kLuxUISecondary = 1 << 1; // B
11static const int kLuxUIPrevPage = 1 << 2; // LB / LT
12static const int kLuxUINextPage = 1 << 3; // RB / RT
13static const int kLuxUIDelete = 1 << 5; // X
14static const int kLuxUIClear = 1 << 6; // Y
15
17{
23};
24
25inline int LuxProfilePadAction(int alUIButton)
26{
27 switch(alUIButton)
28 {
33 default: return eLuxProfilePad_None;
34 }
35}
36
37/** Next selected row for an up (-1) / down (+1) press, clamped to the list. */
38inline int LuxListStep(int alCurrent, int alCount, int alDir)
39{
40 if(alCount <= 0) return -1;
41 if(alCurrent < 0) return 0;
42 int lNext = alCurrent + (alDir < 0 ? -1 : 1);
43 if(lNext < 0) lNext = 0;
44 if(lNext >= alCount) lNext = alCount - 1;
45 return lNext;
46}
47
48#endif
int LuxProfilePadAction(int alUIButton)
static const int kLuxUIPrimary
static const int kLuxUINextPage
static const int kLuxUISecondary
eLuxProfilePad
@ eLuxProfilePad_Back
@ eLuxProfilePad_Create
@ eLuxProfilePad_None
@ eLuxProfilePad_Delete
@ eLuxProfilePad_Select
static const int kLuxUIPrevPage
int LuxListStep(int alCurrent, int alCount, int alDir)
Next selected row for an up (-1) / down (+1) press, clamped to the list.
static const int kLuxUIDelete
static const int kLuxUIClear