2020-12-01 10:42:05 +01:00
|
|
|
/* Copyright (C) 2020 Wildfire Games.
|
2023-12-03 01:30:12 +01:00
|
|
|
* This file is part of 0 A.D.
|
2019-11-24 11:26:48 +01:00
|
|
|
*
|
2023-12-03 01:30:12 +01:00
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
2019-11-24 11:26:48 +01:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2023-12-03 01:30:12 +01:00
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
2019-11-24 11:26:48 +01:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2023-12-03 01:30:12 +01:00
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
2019-11-24 11:26:48 +01:00
|
|
|
*/
|
2020-11-21 18:49:06 +01:00
|
|
|
|
|
|
|
#include "precompiled.h"
|
2019-11-24 11:26:48 +01:00
|
|
|
|
|
|
|
#include "gui/ObjectTypes/CButton.h"
|
|
|
|
#include "gui/ObjectTypes/CChart.h"
|
|
|
|
#include "gui/ObjectTypes/CCheckBox.h"
|
|
|
|
#include "gui/ObjectTypes/CDropDown.h"
|
2020-12-09 15:39:14 +01:00
|
|
|
#include "gui/ObjectTypes/CGUIDummyObject.h"
|
Let players remap hotkeys in-game, fix default hotkeys being qwerty-specific.
- Provide a "Hotkey" screen to let players remap hotkeys in-game using a
convenient setup.
- Make all .cfg hotkeys refer to scancodes (i.e. position on the
keyboard), so that default hotkeys now translate correctly for AZERTY,
QWERTZ and other layouts.
- 'BackSpace' is now an alias for 'Delete', and works for killing units.
This fixes #1917, as macs don't have a proper delete key and would need
to use Fn+Del otherwise. This shifts "timewarp" to Shift+BackSpace.
Functionally, this switches hotkeys to scancodes, as that makes more
sense (they are combinations of key positions, not actual text output).
SDL includes are cleaned and key names are reused.
Fixes #2850, Fixes #2604, Refs #1810, Fixes #1917.
Follows work in 3d7784d2af.
Various diffs tested by: Angen, Stan, Freagarach
Comments by: Nescio
Differential Revision: https://code.wildfiregames.com/D2814
This was SVN commit r24215.
2020-11-19 10:27:26 +01:00
|
|
|
#include "gui/ObjectTypes/CHotkeyPicker.h"
|
2019-11-24 11:26:48 +01:00
|
|
|
#include "gui/ObjectTypes/CImage.h"
|
|
|
|
#include "gui/ObjectTypes/CInput.h"
|
|
|
|
#include "gui/ObjectTypes/CList.h"
|
|
|
|
#include "gui/ObjectTypes/CMiniMap.h"
|
|
|
|
#include "gui/ObjectTypes/COList.h"
|
|
|
|
#include "gui/ObjectTypes/CProgressBar.h"
|
|
|
|
#include "gui/ObjectTypes/CRadioButton.h"
|
|
|
|
#include "gui/ObjectTypes/CSlider.h"
|
|
|
|
#include "gui/ObjectTypes/CText.h"
|
|
|
|
#include "gui/ObjectTypes/CTooltip.h"
|
2020-11-21 18:49:06 +01:00
|
|
|
#include "gui/Scripting/JSInterface_GUIProxy.h"
|
2019-11-24 11:26:48 +01:00
|
|
|
|
|
|
|
void CGUI::AddObjectTypes()
|
|
|
|
{
|
2020-11-21 18:49:06 +01:00
|
|
|
m_ProxyData.insert(JSI_GUIProxy<IGUIObject>::CreateData(*m_ScriptInterface));
|
|
|
|
m_ProxyData.insert(JSI_GUIProxy<CText>::CreateData(*m_ScriptInterface));
|
2020-12-01 10:42:05 +01:00
|
|
|
m_ProxyData.insert(JSI_GUIProxy<CList>::CreateData(*m_ScriptInterface));
|
2021-06-05 19:37:18 +02:00
|
|
|
m_ProxyData.insert(JSI_GUIProxy<CMiniMap>::CreateData(*m_ScriptInterface));
|
2020-12-11 17:12:46 +01:00
|
|
|
m_ProxyData.insert(JSI_GUIProxy<CButton>::CreateData(*m_ScriptInterface));
|
2020-11-21 18:49:06 +01:00
|
|
|
|
2019-11-24 11:26:48 +01:00
|
|
|
AddObjectType("button", &CButton::ConstructObject);
|
|
|
|
AddObjectType("chart", &CChart::ConstructObject);
|
|
|
|
AddObjectType("checkbox", &CCheckBox::ConstructObject);
|
|
|
|
AddObjectType("dropdown", &CDropDown::ConstructObject);
|
|
|
|
AddObjectType("empty", &CGUIDummyObject::ConstructObject);
|
Let players remap hotkeys in-game, fix default hotkeys being qwerty-specific.
- Provide a "Hotkey" screen to let players remap hotkeys in-game using a
convenient setup.
- Make all .cfg hotkeys refer to scancodes (i.e. position on the
keyboard), so that default hotkeys now translate correctly for AZERTY,
QWERTZ and other layouts.
- 'BackSpace' is now an alias for 'Delete', and works for killing units.
This fixes #1917, as macs don't have a proper delete key and would need
to use Fn+Del otherwise. This shifts "timewarp" to Shift+BackSpace.
Functionally, this switches hotkeys to scancodes, as that makes more
sense (they are combinations of key positions, not actual text output).
SDL includes are cleaned and key names are reused.
Fixes #2850, Fixes #2604, Refs #1810, Fixes #1917.
Follows work in 3d7784d2af.
Various diffs tested by: Angen, Stan, Freagarach
Comments by: Nescio
Differential Revision: https://code.wildfiregames.com/D2814
This was SVN commit r24215.
2020-11-19 10:27:26 +01:00
|
|
|
AddObjectType("hotkeypicker", &CHotkeyPicker::ConstructObject);
|
2019-11-24 11:26:48 +01:00
|
|
|
AddObjectType("image", &CImage::ConstructObject);
|
|
|
|
AddObjectType("input", &CInput::ConstructObject);
|
|
|
|
AddObjectType("list", &CList::ConstructObject);
|
|
|
|
AddObjectType("minimap", &CMiniMap::ConstructObject);
|
|
|
|
AddObjectType("olist", &COList::ConstructObject);
|
|
|
|
AddObjectType("progressbar", &CProgressBar::ConstructObject);
|
|
|
|
AddObjectType("radiobutton", &CRadioButton::ConstructObject);
|
|
|
|
AddObjectType("slider", &CSlider::ConstructObject);
|
|
|
|
AddObjectType("text", &CText::ConstructObject);
|
|
|
|
AddObjectType("tooltip", &CTooltip::ConstructObject);
|
|
|
|
}
|