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

Widget de remappage des touches de jeu (GameKeyBindings), destiné à l'onglet « Commande clavier » de la page Options. More...

#include <KeybindingsWidget.h>

Inheritance diagram for hmi::KeybindingsWidget:

Public Member Functions

 KeybindingsWidget (hmi::GameKeyBindings &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).

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override

Private Member Functions

void refresh ()

Private Attributes

hmi::GameKeyBindings_bindings
std::filesystem::path _savePath
int _capturing = -1
 Indice de l'action en cours de capture, ou -1.
std::array< QPushButton *, hmi::GAME_ACTION_COUNT_buttons {}
std::array< QLabel *, hmi::GAME_ACTION_COUNT_actionLabels {}
QLabel * _help = nullptr
const Localization_loc = nullptr

Detailed Description

Widget de remappage des touches de jeu (GameKeyBindings), destiné à l'onglet « Commande clavier » de la page Options.

Chaque action affiche sa touche courante ; cliquer une action capture la prochaine touche pressée et l'assigne (échange auto si déjà prise). Toute modification est persistée dans le fichier partagé (keybindings.json) ; la partie en cours en tient compte immédiatement (mêmes bindings lus par la session de jeu). Échap annule une capture en cours.

Constructor & Destructor Documentation

◆ KeybindingsWidget()

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

Member Function Documentation

◆ keyPressEvent()

void hmi::KeybindingsWidget::keyPressEvent ( QKeyEvent * event)
overrideprotected

◆ refresh()

void hmi::KeybindingsWidget::refresh ( )
private

◆ retranslateUi()

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

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

Member Data Documentation

◆ _actionLabels

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

◆ _bindings

hmi::GameKeyBindings& hmi::KeybindingsWidget::_bindings
private

◆ _buttons

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

◆ _capturing

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

Indice de l'action en cours de capture, ou -1.

◆ _help

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

◆ _loc

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

◆ _savePath

std::filesystem::path hmi::KeybindingsWidget::_savePath
private

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