AMFP Enhanced
C++ reference: the code this unofficial fork added
Toggle main menu visibility
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
9
static
const
int
kLuxUIPrimary
= 1 << 0;
// A
10
static
const
int
kLuxUISecondary
= 1 << 1;
// B
11
static
const
int
kLuxUIPrevPage
= 1 << 2;
// LB / LT
12
static
const
int
kLuxUINextPage
= 1 << 3;
// RB / RT
13
static
const
int
kLuxUIDelete
= 1 << 5;
// X
14
static
const
int
kLuxUIClear
= 1 << 6;
// Y
15
16
enum
eLuxProfilePad
17
{
18
eLuxProfilePad_None
,
19
eLuxProfilePad_Select
,
20
eLuxProfilePad_Create
,
21
eLuxProfilePad_Delete
,
22
eLuxProfilePad_Back
,
23
};
24
25
inline
int
LuxProfilePadAction
(
int
alUIButton)
26
{
27
switch
(alUIButton)
28
{
29
case
kLuxUIPrimary
:
return
eLuxProfilePad_Select
;
30
case
kLuxUIClear
:
return
eLuxProfilePad_Create
;
31
case
kLuxUIDelete
:
return
eLuxProfilePad_Delete
;
32
case
kLuxUISecondary
:
return
eLuxProfilePad_Back
;
33
default
:
return
eLuxProfilePad_None
;
34
}
35
}
36
37
/** Next selected row for an up (-1) / down (+1) press, clamped to the list. */
38
inline
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
LuxProfilePadAction
int LuxProfilePadAction(int alUIButton)
Definition
LuxProfilePad.h:25
kLuxUIPrimary
static const int kLuxUIPrimary
Definition
LuxProfilePad.h:9
kLuxUINextPage
static const int kLuxUINextPage
Definition
LuxProfilePad.h:12
kLuxUISecondary
static const int kLuxUISecondary
Definition
LuxProfilePad.h:10
eLuxProfilePad
eLuxProfilePad
Definition
LuxProfilePad.h:17
eLuxProfilePad_Back
@ eLuxProfilePad_Back
Definition
LuxProfilePad.h:22
eLuxProfilePad_Create
@ eLuxProfilePad_Create
Definition
LuxProfilePad.h:20
eLuxProfilePad_None
@ eLuxProfilePad_None
Definition
LuxProfilePad.h:18
eLuxProfilePad_Delete
@ eLuxProfilePad_Delete
Definition
LuxProfilePad.h:21
eLuxProfilePad_Select
@ eLuxProfilePad_Select
Definition
LuxProfilePad.h:19
kLuxUIPrevPage
static const int kLuxUIPrevPage
Definition
LuxProfilePad.h:11
LuxListStep
int LuxListStep(int alCurrent, int alCount, int alDir)
Next selected row for an up (-1) / down (+1) press, clamped to the list.
Definition
LuxProfilePad.h:38
kLuxUIDelete
static const int kLuxUIDelete
Definition
LuxProfilePad.h:13
kLuxUIClear
static const int kLuxUIClear
Definition
LuxProfilePad.h:14
Game
src
game
LuxProfilePad.h
Generated by
1.18.0