From 587d0e6839b2bbd97f6593f5de520f055832e14f Mon Sep 17 00:00:00 2001 From: regulad <52430642+regulad@users.noreply.github.com> Date: Sat, 23 Jan 2021 15:39:04 -0500 Subject: [PATCH 1/3] Basic PR/Issue templates Closes #243 --- .github/ISSUE_TEMPLATE/bug.md | 30 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/enhancement.md | 10 +++++++ .github/ISSUE_TEMPLATE/question.md | 10 +++++++ .github/PULL_REQUEST_TEMPLATE/bug.md | 12 ++++++++ .github/PULL_REQUEST_TEMPLATE/enhancement.md | 12 ++++++++ 5 files changed, 74 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/enhancement.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/bug.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/enhancement.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 000000000..c09cee277 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,30 @@ +--- +name: Bug Report +about: Report a bug or critical performance issue +title: 'Bug Report: ' +labels: bug +--- + +# Please check for duplicates or similar issues, as well performing simple troubleshooting steps (such as clearing cookies, clearing AppData, trying another browser) before submitting an issue. + +## Where are you playing the game? + +### Web +- [ ] [Newgrounds](https://www.newgrounds.com/portal/view/770371) +- [ ] [Itch.io](https://ninja-muffin24.itch.io/funkin) + +#### If you are using a web build, what browser are you using? +- [ ] Chrome, or a Chromium based broswer (Edge, Opera, etc.) +- [ ] Firefox, or a Gecko based broswer +- [ ] Safari +- [ ] Other, please specify: + +### Local +- [ ] Windows x86 +- [ ] Windows x86_64 +- [ ] Linux +- [ ] macOS + +## Have you identified any steps to reproduce the bug? If so, please describe them below. Use images if possible. + +## Please describe your issue. Provide extensive detail and images if possibe. diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md new file mode 100644 index 000000000..c86b1a39a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -0,0 +1,10 @@ +--- +name: Enhancement +about: Suggest a new feature +title: 'Enhancement: ' +labels: enhancement +--- + +# Please check for duplicates or similar issues before creating this issue. + +## What is your suggestion, and why should it be implemented? diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 000000000..15f86824b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,10 @@ +--- +name: Question +about: Ask a general question +title: 'Question: ' +labels: question +--- + +# Please check for duplicates or similar issues before asking your question. + +## What is your question? diff --git a/.github/PULL_REQUEST_TEMPLATE/bug.md b/.github/PULL_REQUEST_TEMPLATE/bug.md new file mode 100644 index 000000000..70d795633 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/bug.md @@ -0,0 +1,12 @@ +--- +name: Bug Fix +about: Fix a bug or critical performance issue +title: 'Bug Fix: ' +labels: bug +--- + +# Please check for duplicates or similar PRs before creating this issue. + +## Does this PR close any issue(s)? If so, link them below. + +## Breifly describe the issue(s) fixed. diff --git a/.github/PULL_REQUEST_TEMPLATE/enhancement.md b/.github/PULL_REQUEST_TEMPLATE/enhancement.md new file mode 100644 index 000000000..6af15f1b6 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/enhancement.md @@ -0,0 +1,12 @@ +--- +name: Enhancement +about: Add a new feature +title: 'Enhancement: ' +labels: enhancement +--- + +# Please check for duplicates or similar PRs before creating this issue. + +## Does this PR close any issue(s)? If so, link them below. + +## What do your change(s) add, and why should they be implemented? From fe7c9987424e6bb67a4e2f72a12d5fd23aafa44a Mon Sep 17 00:00:00 2001 From: regulad Date: Sat, 23 Jan 2021 15:42:24 -0500 Subject: [PATCH 2/3] Forgot this! --- .github/ISSUE_TEMPLATE/bug.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index c09cee277..9eb93945f 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -25,6 +25,8 @@ labels: bug - [ ] Linux - [ ] macOS +## What version of the game are you using? Look in the bottom left corner of the main menu. + ## Have you identified any steps to reproduce the bug? If so, please describe them below. Use images if possible. ## Please describe your issue. Provide extensive detail and images if possibe. From 3b393aed3054c805c2f8fa776e341e0d38a42599 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Wed, 27 Jan 2021 00:58:58 -0800 Subject: [PATCH 3/3] controls.txt and options UI very scuffed, OptionsMenu.hx is now mostly copied from FreeplayState.hx with no actual functionality currently it reads lines off of controls.txt and displays them on Options menu which is now accessible from main menu controls.txt has control functions prefixed with "set", IE "setUP", then the corresponding key on the following line IE "W" --- assets/data/controls.txt | 32 +++++++++++++++++ source/MainMenuState.hx | 2 +- source/OptionsMenu.hx | 76 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 assets/data/controls.txt diff --git a/assets/data/controls.txt b/assets/data/controls.txt new file mode 100644 index 000000000..7db8a8a86 --- /dev/null +++ b/assets/data/controls.txt @@ -0,0 +1,32 @@ +setUP +W +setUP (ALTERNATE) +FlxKey.UP +setDOWN +S +setDOWN (ALTERNATE) +FlxKey.DOWN +setLEFT +A +setLEFT (ALTERNATE) +FlxKey.LEFT +setRIGHT +D +setRIGHT (ALTERNATE) +FlxKey.RIGHT +setACCEPT +Z +setACCEPT (ALTERNATE) +ENTER +setBACK +BACKSPACE +setBACK (ALTERNATE) +ESCAPE +setPAUSE +P +setPAUSE (ALTERNATE) +ENTER +setRESET +R +setRESET (ALTERNATE) +null \ No newline at end of file diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index e1a1db228..02e40438e 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -22,7 +22,7 @@ class MainMenuState extends MusicBeatState var menuItems:FlxTypedGroup; #if !switch - var optionShit:Array = ['story mode', 'freeplay', 'donate']; + var optionShit:Array = ['story mode', 'freeplay', 'donate', 'options']; #else var optionShit:Array = ['story mode', 'freeplay']; #end diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 9e9f35408..d4d188d16 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -1,14 +1,29 @@ package; +import flash.text.TextField; import flixel.FlxG; import flixel.FlxSprite; +import flixel.addons.display.FlxGridOverlay; +import flixel.group.FlxGroup.FlxTypedGroup; +import flixel.math.FlxMath; +import flixel.text.FlxText; import flixel.util.FlxColor; - +import lime.utils.Assets; + class OptionsMenu extends MusicBeatState { + + var selector:FlxText; + var curSelected:Int = 0; + + var controlsStrings:Array = []; + + private var grpControls:FlxTypedGroup; + override function create() { var menuBG:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuDesat.png'); + controlsStrings = CoolUtil.coolTextFile('assets/data/controls.txt'); menuBG.color = 0xFFea71fd; menuBG.setGraphicSize(Std.int(menuBG.width * 1.1)); menuBG.updateHitbox(); @@ -16,14 +31,69 @@ class OptionsMenu extends MusicBeatState menuBG.antialiasing = true; add(menuBG); + grpControls = new FlxTypedGroup(); + add(grpControls); + + for (i in 0...controlsStrings.length) + { + if(controlsStrings[i].indexOf('set') != -1){ + var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3)+': '+controlsStrings[i+1], true, false); + controlLabel.isMenuItem = true; + controlLabel.targetY = i; + grpControls.add(controlLabel); + } + // DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !! + } + super.create(); } override function update(elapsed:Float) { + super.update(elapsed); + if (controls.BACK) FlxG.switchState(new MainMenuState()); - - super.update(elapsed); + if(controls.UP_P) + changeSelection(-1); + if(controls.DOWN_P) + changeSelection(1); + } + + function changeSelection(change:Int = 0) + { + #if !switch + NGio.logEvent('Fresh'); + #end + + FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt, 0.4); + + curSelected += change; + + if (curSelected < 0) + curSelected = controlsStrings.length - 1; + if (curSelected >= controlsStrings.length) + curSelected = 0; + + // selector.y = (70 * curSelected) + 30; + + var bullShit:Int = 0; + + for (item in grpControls.members) + { + item.targetY = bullShit - curSelected; + bullShit++; + + item.alpha = 0.6; + // item.setGraphicSize(Std.int(item.width * 0.8)); + + if (item.targetY == 0) + { + item.alpha = 1; + // item.setGraphicSize(Std.int(item.width)); + } + } + } + }