AMFP Enhanced
C++ reference: the code this unofficial fork added
Toggle main menu visibility
Loading...
Searching...
No Matches
LuxPadGlyphs.h
Go to the documentation of this file.
1
/*
2
* AMFP-2026: a gamepad glyph shown on a button only while the pad is in use (last input,
3
* cLuxInputHandler::IsGamepadMode). The texture is created once and toggled, never leaked.
4
*/
5
#ifndef LUX_PAD_GLYPHS_H
6
#define LUX_PAD_GLYPHS_H
7
8
#include "LuxBase.h"
9
10
class
cLuxPadGlyph
11
{
12
public
:
13
cLuxPadGlyph
() : mpButton(NULL), mpGfx(NULL) {}
14
15
void
Init
(cGuiSet* apSet, cWidgetButton* apButton,
const
tString& asIcon)
16
{
17
mpButton = apButton;
18
mpGfx = apSet->GetGui()->CreateGfxTexture(asIcon, eGuiMaterial_Alpha, eTextureType_2D, cColor(1,1),
false
);
19
}
20
21
void
Update
(
bool
abGamepad)
22
{
23
if
(mpButton == NULL || mpGfx == NULL)
return
;
24
if
(abGamepad)
25
{
26
if
(mpButton->GetImage() != mpGfx) { mpButton->SetImage(mpGfx,
false
); mpButton->SetImageAtLeft(
true
); }
27
}
28
else
if
(mpButton->GetImage() == mpGfx) mpButton->SetImage(NULL,
false
);
29
}
30
31
private
:
32
cWidgetButton* mpButton;
33
cGuiGfxElement* mpGfx;
34
};
35
36
#endif
cLuxPadGlyph::Init
void Init(cGuiSet *apSet, cWidgetButton *apButton, const tString &asIcon)
Definition
LuxPadGlyphs.h:15
cLuxPadGlyph::Update
void Update(bool abGamepad)
Definition
LuxPadGlyphs.h:21
cLuxPadGlyph::cLuxPadGlyph
cLuxPadGlyph()
Definition
LuxPadGlyphs.h:13
Game
src
game
LuxPadGlyphs.h
Generated by
1.18.0