Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/CHotkeyPicker.cpp
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 30 Lines | |||||
template<> bool ScriptInterface::FromJSVal(const ScriptRequest&, const JS::HandleValue, CHotkeyPicker::Key&) | template<> bool ScriptInterface::FromJSVal(const ScriptRequest&, const JS::HandleValue, CHotkeyPicker::Key&) | ||||
{ | { | ||||
LOGWARNING("FromJSVal<CHotkeyPicker>: Not implemented"); | LOGWARNING("FromJSVal<CHotkeyPicker>: Not implemented"); | ||||
return false; | return false; | ||||
} | } | ||||
JSVAL_VECTOR(CHotkeyPicker::Key); | JSVAL_VECTOR(CHotkeyPicker::Key); | ||||
CHotkeyPicker::CHotkeyPicker(CGUI& pGUI) : IGUIObject(pGUI), m_TimeToCombination(1.f) | CHotkeyPicker::CHotkeyPicker(CGUI& pGUI) : IGUIObject(pGUI), m_TimeToCombination(this, "time_to_combination", 1.f) | ||||
{ | { | ||||
RegisterSetting("time_to_combination", m_TimeToCombination); | |||||
// 8 keys at the same time is probably more than we'll ever need. | // 8 keys at the same time is probably more than we'll ever need. | ||||
m_KeysPressed.reserve(8); | m_KeysPressed.reserve(8); | ||||
} | } | ||||
CHotkeyPicker::~CHotkeyPicker() | CHotkeyPicker::~CHotkeyPicker() | ||||
{ | { | ||||
} | } | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator