Коммит 95666018 создал по автору xottab-duty's avatar xottab-duty
Просмотр файлов

Added helper functions to determine input type (gamepad or keyboard & mouse)

Reduces code length
владелец 07fbd105
......@@ -159,7 +159,10 @@ public:
bool IsControllerAvailable() const { return !controllers.empty(); }
void EnableControllerSensors(bool enable);
auto GetCurrentInputType() { return currentInputType; }
auto GetCurrentInputType() const { return currentInputType; }
auto IsCurrentInputTypeController() const { return GetCurrentInputType() == InputType::Controller; }
auto IsCurrentInputTypeKeyboardMouse() const { return GetCurrentInputType() == InputType::KeyboardMouse; }
public:
void ExclusiveMode(const bool exclusive);
bool IsExclusiveMode() const;
......
......@@ -225,7 +225,7 @@ void CDialogHolder::OnFrame()
{
m_b_in_update = true;
if (GetUICursor().IsVisible() && pInput->GetCurrentInputType() == CInput::Controller)
if (GetUICursor().IsVisible() && pInput->IsCurrentInputTypeController())
GetUICursor().UpdateAutohideTiming();
CUIDialogWnd* wnd = TopInputReceiver();
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать