mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #4315
4315: Use W, A, S, D to navigate in editor r=def- a=ChillerDragon Sorah requested it on discord ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
This commit is contained in:
commit
8c49d20cb6
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue