From b5d09ddb6efa5bee4c531064000e989e5cb4e2a9 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 6 Nov 2021 16:44:40 +0100 Subject: [PATCH] Use W, A, S, D to navigate in editor --- src/game/editor/editor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 3a73060f5..8e11139e8 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -2668,6 +2668,19 @@ void CEditor::DoMapEditor(CUIRect View) UI()->SetActiveItem(0); } } + if(!Input()->KeyIsPressed(KEY_LSHIFT) && !Input()->KeyIsPressed(KEY_RSHIFT) && + !Input()->KeyIsPressed(KEY_LCTRL) && !Input()->KeyIsPressed(KEY_RCTRL)) + { + float PanSpeed = 64.0f; + if(Input()->KeyPress(KEY_A)) + m_WorldOffsetX -= PanSpeed * m_WorldZoom; + else if(Input()->KeyPress(KEY_D)) + m_WorldOffsetX += PanSpeed * m_WorldZoom; + if(Input()->KeyPress(KEY_W)) + m_WorldOffsetY -= PanSpeed * m_WorldZoom; + else if(Input()->KeyPress(KEY_S)) + m_WorldOffsetY += PanSpeed * m_WorldZoom; + } } else if(UI()->ActiveItem() == s_pEditorID) {