mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Extract CEditor::HandleCursorMovement
function
This commit is contained in:
parent
4372932480
commit
e04eee9d44
|
@ -6812,17 +6812,7 @@ void CEditor::PlaceBorderTiles()
|
|||
pT->m_pTiles[i].m_Index = 1;
|
||||
}
|
||||
|
||||
void CEditor::OnUpdate()
|
||||
{
|
||||
CUIElementBase::Init(UI()); // update static pointer because game and editor use separate UI
|
||||
|
||||
if(!m_EditorWasUsedBefore)
|
||||
{
|
||||
m_EditorWasUsedBefore = true;
|
||||
Reset();
|
||||
}
|
||||
|
||||
// handle cursor movement
|
||||
void CEditor::HandleCursorMovement()
|
||||
{
|
||||
static float s_MouseX = 0.0f;
|
||||
static float s_MouseY = 0.0f;
|
||||
|
@ -6883,6 +6873,18 @@ void CEditor::OnUpdate()
|
|||
m_MouseWorldNoParaY = aPoints[1] + WorldHeight * (s_MouseY / Graphics()->WindowHeight());
|
||||
}
|
||||
}
|
||||
|
||||
void CEditor::OnUpdate()
|
||||
{
|
||||
CUIElementBase::Init(UI()); // update static pointer because game and editor use separate UI
|
||||
|
||||
if(!m_EditorWasUsedBefore)
|
||||
{
|
||||
m_EditorWasUsedBefore = true;
|
||||
Reset();
|
||||
}
|
||||
|
||||
HandleCursorMovement();
|
||||
}
|
||||
|
||||
void CEditor::OnRender()
|
||||
|
|
|
@ -848,6 +848,8 @@ public:
|
|||
void UpdateMentions() override { m_Mentions++; }
|
||||
void ResetMentions() override { m_Mentions = 0; }
|
||||
|
||||
void HandleCursorMovement();
|
||||
|
||||
CLayerGroup *m_apSavedBrushes[10];
|
||||
|
||||
void RefreshFilteredFileList();
|
||||
|
|
Loading…
Reference in a new issue