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:
bors[bot] 2021-11-16 07:56:22 +00:00 committed by GitHub
commit 8c49d20cb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
{