From d411e853f349bad115d2b90230a446379b814a9b Mon Sep 17 00:00:00 2001 From: bctix <51544115+bctix@users.noreply.github.com> Date: Tue, 4 Jul 2023 14:01:17 -0700 Subject: [PATCH] Revamp character editor help menu (#170) --- .../funkin/editors/character/HelpControls.hx | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/source/funkin/editors/character/HelpControls.hx b/source/funkin/editors/character/HelpControls.hx index 41d6a991..66fe3e78 100644 --- a/source/funkin/editors/character/HelpControls.hx +++ b/source/funkin/editors/character/HelpControls.hx @@ -2,6 +2,19 @@ package funkin.editors.character; class HelpControls extends UISubstateWindow { + + var helpTextTitles:Array = [ + "Camera:", + "Offset:", + "Animation:" + ]; + var helpTexts:Array = [ + "\n\n- WASD: Move camera\n\n- I & O: Zoom In & Out.", + "\n\n- Arrows keys: Move the offset of the current\nanimation.\n\n- Left Click: Move the offset of the character", + "\n\n- K & L: Switch to previous & next animation\n\n- SPACE: Play current animation.\n\n" + ]; + + var curPage:Int = 0; public function new() { super(); @@ -14,19 +27,45 @@ class HelpControls extends UISubstateWindow super.create(); - var helpText = new UIText(windowSpr.x + 25, windowSpr.y + 45, -1, "Left/Right/Up/Down Arrow: To change the offset of the current\nplaying animation.\n -W/A/S/D: To move the camera.\n -Left mouse button on the character: Change character's position.\nK to change to prev anim, L to change to new anim -Space to play animation + var helpTextTitle = new UIText(windowSpr.x + 25, windowSpr.y + 45, -1, helpTextTitles[0], 36); + add(helpTextTitle); -I to zoom in -O to zoom out", 24); + var helpText = new UIText(windowSpr.x + 25, windowSpr.y + 50, -1, helpTexts[0], 24); add(helpText); + var pageText = new UIText(855, windowSpr.y + 460, -1, '${curPage+1}/${helpTexts.length}', 24); + add(pageText); + + var rightButton = new UIButton(885, windowSpr.y + 500, ">", function() + { + if(curPage == helpTexts.length-1) + curPage = 0; + else + curPage++; + + pageText.text = '${curPage+1}/${helpTexts.length}'; + helpText.text = helpTexts[curPage]; + helpTextTitle.text = helpTextTitles[curPage]; + }, 32); + + var leftButton = new UIButton(845, windowSpr.y + 500, "<", function() + { + if(curPage == 0) + curPage = helpTexts.length-1; + else + curPage--; + + pageText.text = '${curPage+1}/${helpTexts.length}'; + helpText.text = helpTexts[curPage]; + helpTextTitle.text = helpTextTitles[curPage]; + }, 32); + var closeButton = new UIButton(helpText.x, windowSpr.y + 500, "Close", function() { close(); }); add(closeButton); + add(leftButton); + add(rightButton); } }