forked from Mirrors/openclonk
Editor: More shortcuts; show helper shortcuts in tools menu
parent
d3d7256fec
commit
61b1ab08ad
|
@ -520,7 +520,11 @@ IDS_MNU_DELETE=Löschen
|
|||
IDS_MNU_DUPLICATE=Duplizieren
|
||||
IDS_MNU_EXPLOREUSERPATH=Benutzerpfad anzeigen
|
||||
IDS_MNU_FILE=Datei
|
||||
IDS_MNU_FOCUSGLOBALSCRIPTBOX=Eingabefokus auf Scripteingabe (global)
|
||||
IDS_MNU_FOCUSOBJECTSCRIPTBOX=Eingabefokus auf Scripteingabe (Objekt)
|
||||
IDS_MNU_FPS=FPS-Anzeige
|
||||
IDS_MNU_GRADEDOWN=Pinsel kleiner
|
||||
IDS_MNU_GRADEUP=Pinsel größer
|
||||
IDS_MNU_JOIN=Beitritt
|
||||
IDS_MNU_MAP_DYNAMIC=Landschaft: Dynamisch
|
||||
IDS_MNU_MAP_EXACT=Landschaft: Exakt
|
||||
|
@ -533,7 +537,9 @@ IDS_MNU_NETCLIENT_ACTIVATE=Client %s (%i) aktivieren
|
|||
IDS_MNU_NETHOST=Host %s
|
||||
IDS_MNU_NEW=Neu...
|
||||
IDS_MNU_NEWVIEWPORT=Neues Sichtfenster
|
||||
IDS_MNU_NEXTVIEWPORT=Nächstes Sichtfenster auswählen
|
||||
IDS_MNU_OPEN=Öffnen...
|
||||
IDS_MNU_OPENMATERIALSELECTION=Materialauswahl öffnen
|
||||
IDS_MNU_OPENWPLRS=Öffnen mit Spielern...
|
||||
IDS_MNU_OPTIONS=Optionen
|
||||
IDS_MNU_OPTIONSINFO=Einstellungen ändern.
|
||||
|
@ -549,6 +555,7 @@ IDS_MNU_SAVEGAME=Spiel speichern
|
|||
IDS_MNU_SAVEGAMEAS=Spiel speichern unter...
|
||||
IDS_MNU_SAVESCENARIO=Szenario speichern
|
||||
IDS_MNU_SAVESCENARIOAS=Szenario speichern unter...
|
||||
IDS_MNU_SHORTCUTS=Hotkeys
|
||||
IDS_MNU_START=Start
|
||||
IDS_MNU_SWITCHRESOLUTION=Bildschirmauflösung ändern
|
||||
IDS_MNU_SWITCHRESOLUTION_LIKEIT=Neue Auflösung gewählt. Zufrieden?
|
||||
|
|
|
@ -520,7 +520,11 @@ IDS_MNU_DELETE=Delete
|
|||
IDS_MNU_DUPLICATE=Duplicate
|
||||
IDS_MNU_EXPLOREUSERPATH=Open user path
|
||||
IDS_MNU_FILE=File
|
||||
IDS_MNU_FOCUSGLOBALSCRIPTBOX=Focus script box (global)
|
||||
IDS_MNU_FOCUSOBJECTSCRIPTBOX=Focus script box (object)
|
||||
IDS_MNU_FPS=FPS Display
|
||||
IDS_MNU_GRADEDOWN=Pen size larger
|
||||
IDS_MNU_GRADEUP=Pen size smaller
|
||||
IDS_MNU_JOIN=Join
|
||||
IDS_MNU_MAP_DYNAMIC=Landscape: Dynamic
|
||||
IDS_MNU_MAP_EXACT=Landscape: Exact
|
||||
|
@ -531,9 +535,11 @@ IDS_MNU_NET=Host
|
|||
IDS_MNU_NETCLIENT_DEACTIVATE=Deactivate client %s (%i)
|
||||
IDS_MNU_NETCLIENT_ACTIVATE=Activate client %s (%i)
|
||||
IDS_MNU_NETHOST=Host %s
|
||||
IDS_MNU_NEXTVIEWPORT=Select next viewport
|
||||
IDS_MNU_NEW=New...
|
||||
IDS_MNU_NEWVIEWPORT=New viewport
|
||||
IDS_MNU_OPEN=Open...
|
||||
IDS_MNU_OPENMATERIALSELECTION=Popup material selection
|
||||
IDS_MNU_OPENWPLRS=Open with players...
|
||||
IDS_MNU_OPTIONS=Options
|
||||
IDS_MNU_OPTIONSINFO=Change program options.
|
||||
|
@ -549,6 +555,7 @@ IDS_MNU_SAVEGAME=Save game
|
|||
IDS_MNU_SAVEGAMEAS=Save game as...
|
||||
IDS_MNU_SAVESCENARIO=Save scenario
|
||||
IDS_MNU_SAVESCENARIOAS=Save scenario as...
|
||||
IDS_MNU_SHORTCUTS=Shortcuts
|
||||
IDS_MNU_START=Start
|
||||
IDS_MNU_SWITCHRESOLUTION=Switch resolution
|
||||
IDS_MNU_SWITCHRESOLUTION_LIKEIT=This is your new resolution. Do you like it?
|
||||
|
|
|
@ -396,6 +396,7 @@
|
|||
<string comment="res">IDS_MNU_WINDOWS</string>
|
||||
</property>
|
||||
<addaction name="actionViewportNew"/>
|
||||
<addaction name="actionNextViewport"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuNet">
|
||||
<property name="title">
|
||||
|
@ -406,6 +407,16 @@
|
|||
<property name="title">
|
||||
<string comment="res">IDS_MNU_TOOLS</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuIDS_MNU_SHORTCUTS">
|
||||
<property name="title">
|
||||
<string comment="res">IDS_MNU_SHORTCUTS</string>
|
||||
</property>
|
||||
<addaction name="actionFocusGlobalScriptBox"/>
|
||||
<addaction name="actionFocusObjectScriptBox"/>
|
||||
<addaction name="actionOpenMaterialSelection"/>
|
||||
<addaction name="actionGradeUp"/>
|
||||
<addaction name="actionGradeDown"/>
|
||||
</widget>
|
||||
<addaction name="actionPlay"/>
|
||||
<addaction name="actionPause"/>
|
||||
<addaction name="separator"/>
|
||||
|
@ -422,6 +433,8 @@
|
|||
<addaction name="actionStaticLandscape"/>
|
||||
<addaction name="actionStaticFlatLandscape"/>
|
||||
<addaction name="actionExactLandscape"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuIDS_MNU_SHORTCUTS"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuTools"/>
|
||||
|
@ -987,6 +1000,9 @@
|
|||
<property name="text">
|
||||
<string comment="res">IDS_MNU_NEWVIEWPORT</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Alt+0</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileOpen">
|
||||
<property name="text">
|
||||
|
@ -1053,6 +1069,9 @@
|
|||
<property name="text">
|
||||
<string comment="res">IDS_MNU_JOIN</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+J</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionHelpAbout">
|
||||
<property name="text">
|
||||
|
@ -1171,7 +1190,13 @@
|
|||
</action>
|
||||
<action name="actionFocusGlobalScriptBox">
|
||||
<property name="text">
|
||||
<string>FocusGlobalScriptBox</string>
|
||||
<string comment="res">IDS_MNU_FOCUSGLOBALSCRIPTBOX</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string comment="res">IDS_MNU_FOCUSGLOBALSCRIPTBOX</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="res">IDS_MNU_FOCUSGLOBALSCRIPTBOX</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F4</string>
|
||||
|
@ -1179,7 +1204,13 @@
|
|||
</action>
|
||||
<action name="actionFocusObjectScriptBox">
|
||||
<property name="text">
|
||||
<string>FocusObjectScriptBox</string>
|
||||
<string comment="res">IDS_MNU_FOCUSOBJECTSCRIPTBOX</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string comment="res">IDS_MNU_FOCUSOBJECTSCRIPTBOX</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="res">IDS_MNU_FOCUSOBJECTSCRIPTBOX</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Shift+F4</string>
|
||||
|
@ -1187,12 +1218,60 @@
|
|||
</action>
|
||||
<action name="actionOpenMaterialSelection">
|
||||
<property name="text">
|
||||
<string>OpenMaterialSelection</string>
|
||||
<string comment="res">IDS_MNU_OPENMATERIALSELECTION</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string comment="res">IDS_MNU_OPENMATERIALSELECTION</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="res">IDS_MNU_OPENMATERIALSELECTION</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F9</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNextViewport">
|
||||
<property name="text">
|
||||
<string comment="res">IDS_MNU_NEXTVIEWPORT</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string comment="res">IDS_MNU_NEXTVIEWPORT</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="res">IDS_MNU_NEXTVIEWPORT</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F10</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGradeUp">
|
||||
<property name="text">
|
||||
<string comment="res">IDS_MNU_GRADEUP</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string comment="res">IDS_MNU_GRADEUP</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="res">IDS_MNU_GRADEUP</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGradeDown">
|
||||
<property name="text">
|
||||
<string comment="res">IDS_MNU_GRADEDOWN</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string comment="res">IDS_MNU_GRADEDOWN</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string comment="res">IDS_MNU_GRADEDOWN</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resource.qrc"/>
|
||||
|
@ -1886,6 +1965,54 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionNextViewport</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>FocusNextViewport()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>477</x>
|
||||
<y>312</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionGradeDown</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>GradeDown()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>477</x>
|
||||
<y>312</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionGradeUp</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>GradeUp()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>477</x>
|
||||
<y>312</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>PlayPressed(bool)</slot>
|
||||
|
@ -1930,5 +2057,8 @@
|
|||
<slot>FocusGlobalScriptBox()</slot>
|
||||
<slot>FocusObjectScriptBox()</slot>
|
||||
<slot>OpenMaterialSelection()</slot>
|
||||
<slot>FocusNextViewport()</slot>
|
||||
<slot>GradeUp()</slot>
|
||||
<slot>GradeDown()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
|
|
|
@ -536,6 +536,45 @@ void C4ConsoleQtMainWindow::OpenMaterialSelection()
|
|||
}
|
||||
}
|
||||
|
||||
void C4ConsoleQtMainWindow::FocusNextViewport()
|
||||
{
|
||||
// Focus viewport after the one that has focus
|
||||
bool has_focus_vp = false;
|
||||
for (C4ConsoleQtViewportDockWidget *vp : state->viewports)
|
||||
{
|
||||
if (has_focus_vp)
|
||||
{
|
||||
vp->SetFocus();
|
||||
return;
|
||||
}
|
||||
else if (vp->HasFocus())
|
||||
{
|
||||
has_focus_vp = true;
|
||||
}
|
||||
}
|
||||
// No focus or last viewport was focused? Focus first.
|
||||
if (state->viewports.size())
|
||||
{
|
||||
state->viewports.front()->SetFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void C4ConsoleQtMainWindow::GradeUp()
|
||||
{
|
||||
if (state->ui.drawSizeSlider->isEnabled())
|
||||
{
|
||||
state->ui.drawSizeSlider->setValue(state->ui.drawSizeSlider->value() + state->ui.drawSizeSlider->singleStep());
|
||||
}
|
||||
}
|
||||
|
||||
void C4ConsoleQtMainWindow::GradeDown()
|
||||
{
|
||||
if (state->ui.drawSizeSlider->isEnabled())
|
||||
{
|
||||
state->ui.drawSizeSlider->setValue(state->ui.drawSizeSlider->value() - state->ui.drawSizeSlider->singleStep());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Common C4ConsoleGUI interface */
|
||||
|
||||
|
@ -605,6 +644,7 @@ bool C4ConsoleGUIState::CreateConsoleWindow(C4AbstractApp *app)
|
|||
ui.drawSizeSlider->setMaximum(C4TLS_GradeMax);
|
||||
ui.drawSizeSlider->setMinimum(C4TLS_GradeMin);
|
||||
ui.drawSizeSlider->setValue(C4TLS_GradeDefault);
|
||||
ui.drawSizeSlider->setSingleStep(1);
|
||||
// Console input box signal
|
||||
QLineEdit *main_console_edit = ui.consoleInputBox->lineEdit();
|
||||
main_console_edit->completer()->setCaseSensitivity(Qt::CaseSensitivity::CaseSensitive);
|
||||
|
@ -614,10 +654,18 @@ bool C4ConsoleGUIState::CreateConsoleWindow(C4AbstractApp *app)
|
|||
property_console_edit->completer()->setCaseSensitivity(Qt::CaseSensitivity::CaseSensitive);
|
||||
// Add window menu actions
|
||||
window_menu_separator = ui.menuWindows->addSeparator();
|
||||
ui.menuWindows->addAction(ui.creatorDockWidget->toggleViewAction());
|
||||
ui.menuWindows->addAction(ui.objectListDockWidget->toggleViewAction());
|
||||
ui.menuWindows->addAction(ui.propertyDockWidget->toggleViewAction());
|
||||
ui.menuWindows->addAction(ui.logDockWidget->toggleViewAction());
|
||||
QAction *dock_action = ui.creatorDockWidget->toggleViewAction();
|
||||
dock_action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_1));
|
||||
ui.menuWindows->addAction(dock_action);
|
||||
dock_action = ui.objectListDockWidget->toggleViewAction();
|
||||
dock_action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_2));
|
||||
ui.menuWindows->addAction(dock_action);
|
||||
dock_action = ui.propertyDockWidget->toggleViewAction();
|
||||
dock_action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_3));
|
||||
ui.menuWindows->addAction(dock_action);
|
||||
dock_action = ui.logDockWidget->toggleViewAction();
|
||||
dock_action->setShortcut(QKeySequence(Qt::ALT | Qt::Key_4));
|
||||
ui.menuWindows->addAction(dock_action);
|
||||
// Viewport area setup
|
||||
viewport_area = new QMainWindow();
|
||||
viewport_area->setWindowFlags(Qt::Widget);
|
||||
|
@ -672,15 +720,10 @@ bool C4ConsoleGUIState::CreateConsoleWindow(C4AbstractApp *app)
|
|||
window->tabifyDockWidget(ui.objectListDockWidget, ui.creatorDockWidget);
|
||||
ui.propertyDockWidget->raise();
|
||||
|
||||
// Some keyboard shortcut actions
|
||||
window->addAction(ui.actionFocusGlobalScriptBox);
|
||||
window->addAction(ui.actionFocusObjectScriptBox);
|
||||
window->addAction(ui.actionOpenMaterialSelection);
|
||||
|
||||
// Welcome page
|
||||
InitWelcomeScreen();
|
||||
ShowWelcomeScreen();
|
||||
|
||||
|
||||
// Initial empty property page
|
||||
auto sel = C4EditCursorSelection();
|
||||
PropertyDlgUpdate(sel, true);
|
||||
|
|
|
@ -170,6 +170,9 @@ public slots:
|
|||
void FocusGlobalScriptBox();
|
||||
void FocusObjectScriptBox();
|
||||
void OpenMaterialSelection();
|
||||
void FocusNextViewport();
|
||||
void GradeUp();
|
||||
void GradeDown();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ public:
|
|||
virtual void closeEvent(QCloseEvent * event);
|
||||
class C4ViewportWindow *GetViewportWindow() const { return cvp; }
|
||||
void SetFocus() { view->setFocus(); } // forward focus to view
|
||||
bool HasFocus() { return view->hasFocus(); } // forward focus to view
|
||||
bool event(QEvent *e) override;
|
||||
|
||||
private slots :
|
||||
|
|
Loading…
Reference in New Issue