JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
hmi::GamepadBindingsWidget Class Reference

Widget de remappage des boutons manette (GamepadBindings), onglet « Commande manette » de la page Options. More...

#include <GamepadBindingsWidget.h>

Inheritance diagram for hmi::GamepadBindingsWidget:

Public Member Functions

 GamepadBindingsWidget (hmi::GamepadBindings &bindings, std::filesystem::path savePath, QWidget *parent=nullptr)
void retranslateUi (const Localization &loc)
 Applique la langue active (libellés d'actions, invite de capture, aide, état manette).

Protected Member Functions

void showEvent (QShowEvent *event) override
 Démarre/arrête le sondage d'état manette avec la visibilité de l'onglet.
void hideEvent (QHideEvent *event) override

Private Member Functions

void startCapture (int index)
void onCaptureTick ()
void refresh ()
void updateStatus ()
 Sonde la manette et met à jour le libellé d'état (connectée / non connectée).

Private Attributes

hmi::GamepadBindings_bindings
std::filesystem::path _savePath
int _capturing = -1
hmi::GamepadPoller _poller
hmi::InputState _input
QTimer * _timer
QTimer * _statusTimer = nullptr
 Sondage périodique de l'état de connexion (hors capture).
std::array< QPushButton *, hmi::GAME_ACTION_COUNT_buttons {}
std::array< QLabel *, hmi::GAME_ACTION_COUNT_actionLabels {}
QLabel * _help = nullptr
QLabel * _status = nullptr
 État de connexion de la manette (informatif).
const Localization_loc = nullptr

Detailed Description

Widget de remappage des boutons manette (GamepadBindings), onglet « Commande manette » de la page Options.

Chaque action affiche son bouton courant ; cliquer une action sonde XInput (via hmi::GamepadPoller, dans un QTimer) jusqu'au prochain bouton pressé, puis l'assigne (échange auto). Persisté dans keybindings.json. La partie en cours en tient compte immédiatement. La page Options n'étant affichée que hors jeu (viewport masqué, boucle en pause), aucun sondage XInput concurrent.

Constructor & Destructor Documentation

◆ GamepadBindingsWidget()

hmi::GamepadBindingsWidget::GamepadBindingsWidget ( hmi::GamepadBindings & bindings,
std::filesystem::path savePath,
QWidget * parent = nullptr )

Member Function Documentation

◆ hideEvent()

void hmi::GamepadBindingsWidget::hideEvent ( QHideEvent * event)
overrideprotected

◆ onCaptureTick()

void hmi::GamepadBindingsWidget::onCaptureTick ( )
private

◆ refresh()

void hmi::GamepadBindingsWidget::refresh ( )
private

◆ retranslateUi()

void hmi::GamepadBindingsWidget::retranslateUi ( const Localization & loc)

Applique la langue active (libellés d'actions, invite de capture, aide, état manette).

◆ showEvent()

void hmi::GamepadBindingsWidget::showEvent ( QShowEvent * event)
overrideprotected

Démarre/arrête le sondage d'état manette avec la visibilité de l'onglet.

◆ startCapture()

void hmi::GamepadBindingsWidget::startCapture ( int index)
private

◆ updateStatus()

void hmi::GamepadBindingsWidget::updateStatus ( )
private

Sonde la manette et met à jour le libellé d'état (connectée / non connectée).

Member Data Documentation

◆ _actionLabels

std::array<QLabel*, hmi::GAME_ACTION_COUNT> hmi::GamepadBindingsWidget::_actionLabels {}
private

◆ _bindings

hmi::GamepadBindings& hmi::GamepadBindingsWidget::_bindings
private

◆ _buttons

std::array<QPushButton*, hmi::GAME_ACTION_COUNT> hmi::GamepadBindingsWidget::_buttons {}
private

◆ _capturing

int hmi::GamepadBindingsWidget::_capturing = -1
private

◆ _help

QLabel* hmi::GamepadBindingsWidget::_help = nullptr
private

◆ _input

hmi::InputState hmi::GamepadBindingsWidget::_input
private

◆ _loc

const Localization* hmi::GamepadBindingsWidget::_loc = nullptr
private

◆ _poller

hmi::GamepadPoller hmi::GamepadBindingsWidget::_poller
private

◆ _savePath

std::filesystem::path hmi::GamepadBindingsWidget::_savePath
private

◆ _status

QLabel* hmi::GamepadBindingsWidget::_status = nullptr
private

État de connexion de la manette (informatif).

◆ _statusTimer

QTimer* hmi::GamepadBindingsWidget::_statusTimer = nullptr
private

Sondage périodique de l'état de connexion (hors capture).

◆ _timer

QTimer* hmi::GamepadBindingsWidget::_timer
private

The documentation for this class was generated from the following files: