From cd0a868f39602e720c210536cf26439b5191e333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Meni=C4=87anin?= <126715034+Stefan2008Git@users.noreply.github.com> Date: Tue, 30 May 2023 19:51:07 +0200 Subject: [PATCH] Time bar style selection You can now choose time bar style! --- assets/shared/images/sbEngineTimeBar.png | Bin 0 -> 307 bytes assets/shared/images/timeBar.png | Bin 307 -> 370 bytes source/ClassicMainMenuState.hx | 4 +-- source/ClientPrefs.hx | 7 +++- source/PlayState.hx | 25 +++++++++---- source/options/GameplaySettingsSubState.hx | 40 +++++++++++++++++++++ source/options/GraphicsSettingsSubState.hx | 2 +- source/options/VisualsUISubState.hx | 36 ------------------- 8 files changed, 67 insertions(+), 47 deletions(-) create mode 100644 assets/shared/images/sbEngineTimeBar.png diff --git a/assets/shared/images/sbEngineTimeBar.png b/assets/shared/images/sbEngineTimeBar.png new file mode 100644 index 0000000000000000000000000000000000000000..ef0c3494fde6ecae5cd07fc3947b91fd604d3eeb GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0y~yV2T8?g*n)Ol{MZ{j3Yh6@KWGYfXcTq?agE0ST}s;$q;cIV16 zKQLc*w0_gELZAEJUms&+_~GoODcP1-_GG63!vaQCZiWZ0mrZofP0?X!5WoBW`_Y*o zgBsw(0YlH5RxAt$c7FsaUC?;6_x<(Prc0-YE@rR^&-Ptg`dWg)e%@Wrc9rBwbxU;^ y82&f*zGq<2)d2dOcg`f8_s#4#rh{C5&s^AFwRJ_x`~|>JVDNPHb6Mw<&;$S$M1MG8;@yQhm|NJZS+yN+Im9Yok3ELTX{ezT%M zh-G?I!SmK41%A=px!PYCV#}{9S#<`lV#&0=T_gV|C9bGpJ`Yc^sNi}{_W7Fqn&1Dj zJT9C3X-?5?e}lMq&2mlszf($CFV!+MbjLhbXNYlWWC%#v&}usSY?9H;C!EK!x8HWX zy=~+D_n)O7Oz(GWTobl>#cL~n27!%n>yxeKK3i$Ny_MBLkd^6xXZKO1^?f274C=Yt zZ||`RQeY4XgyNT6PyVKJGCcpx&g3xhokHU5PgndsFPj90hR#da!>4|6w|dXrw9TDQ zi)JprR}-MXP{5{skx^r@1B1q;+{C?0ZIyjKY*VUAlqc#Ng@b K=d#Wzp$P!GcZ>4? literal 307 zcmeAS@N?(olHy`uVBq!ia0y~yV2T8?g*n)Ol{MZ{j3Yh6@KWGYfXcTq?agE0ST}s;$q;cIV16 zKQLc*w0_gELZAEJUms&+_~GoODcP1-_GG63!vaQCZiWZ0mrZofP0?X!5WoBW`_Y*o zgBsw(0YlH5RxAt$c7FsaUC?;6_x<(Prc0-YE@rR^&-Ptg`dWg)e%@Wrc9rBwbxU;^ y82&f*zGq<2)d2dOcg`f8_s#4#rh{C5&s^AFwRJ_x`~|>JVDNPHb6Mw<&;$S$ ', true); add(selectorLeft); - selectorRight = new Alphabet(0, 0, ' >', true); + selectorRight = new Alphabet(0, 0, ' <', true); add(selectorRight); changeSelection(); diff --git a/source/ClientPrefs.hx b/source/ClientPrefs.hx index 03fc92f9..821d6cde 100644 --- a/source/ClientPrefs.hx +++ b/source/ClientPrefs.hx @@ -21,7 +21,7 @@ class ClientPrefs { public static var globalAntialiasing:Bool = true; public static var noteSplashes:Bool = true; public static var lowQuality:Bool = false; - public static var shaders:Bool = false; + public static var shaders:Bool = true; public static var framerate:Int = 60; public static var cursing:Bool = true; public static var violence:Bool = true; @@ -34,6 +34,7 @@ class ClientPrefs { public static var vibration:Bool = false; public static var ghostTapping:Bool = true; public static var timeBarType:String = 'Time Left'; + public static var sbEngineTimeBar:Bool = true; public static var iconBounce:Bool = true; public static var colorblindMode:String = 'None'; public static var scoreZoom:Bool = true; @@ -119,6 +120,7 @@ class ClientPrefs { FlxG.save.data.vibration = vibration; FlxG.save.data.ghostTapping = ghostTapping; FlxG.save.data.timeBarType = timeBarType; + FlxG.save.data.sbEngineTimeBar = sbEngineTimeBar; FlxG.save.data.scoreZoom = scoreZoom; FlxG.save.data.noReset = noReset; FlxG.save.data.healthBarAlpha = healthBarAlpha; @@ -239,6 +241,9 @@ class ClientPrefs { if (FlxG.save.data.timeBarType != null) { timeBarType = FlxG.save.data.timeBarType; } + if (FlxG.save.data.sbEngineTimeBar != null) { + sbEngineTimeBar = FlxG.save.data.sbEngineTimeBar; + } if (FlxG.save.data.scoreZoom != null) { scoreZoom = FlxG.save.data.scoreZoom; } diff --git a/source/PlayState.hx b/source/PlayState.hx index cd2db653..a03561b0 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1019,11 +1019,18 @@ class PlayState extends MusicBeatState { } updateTime = showTime; - timeBarBG = new AttachedSprite('timeBar'); - timeBarBG.x = timeTxt.x; - timeBarBG.y = timeTxt.y + (timeTxt.height / 4); - timeBarBG.scrollFactor.set(); - timeBarBG.screenCenter(X); + if (ClientPrefs.sbEngineTimeBar) { + timeBarBG = new AttachedSprite('sbEngineTimeBar'); + timeBarBG.x = timeTxt.x; + timeBarBG.y = timeTxt.y + (timeTxt.height / 4); + timeBarBG.scrollFactor.set(); + timeBarBG.screenCenter(X); + } else { + timeBarBG = new AttachedSprite('timeBar'); + timeBarBG.x = timeTxt.x; + timeBarBG.y = timeTxt.y + (timeTxt.height / 4); + timeBarBG.scrollFactor.set(); + } timeBarBG.alpha = 0; timeBarBG.visible = showTime; timeBarBG.color = FlxColor.BLACK; @@ -1034,8 +1041,12 @@ class PlayState extends MusicBeatState { timeBar = new FlxBar(timeBarBG.x + 4, timeBarBG.y + 4, LEFT_TO_RIGHT, Std.int(timeBarBG.width - 8), Std.int(timeBarBG.height - 8), this, 'songPercent', 0, 1); timeBar.scrollFactor.set(); - timeBar.createFilledBar(0xFF000000, 0xFF800080); - timeBar.numDivisions = 800; // How much lag this causes?? Should i tone it down to idk, 400 or 200? + if (ClientPrefs.sbEngineTimeBar) { + timeBar.createFilledBar(0xFF000000, 0xFF800080); + } else { + timeBar.createFilledBar(0xFF000000, 0xFFFFFFFF); + } + timeBar.numDivisions = 800; timeBar.alpha = 0; timeBar.visible = showTime; add(timeBar); diff --git a/source/options/GameplaySettingsSubState.hx b/source/options/GameplaySettingsSubState.hx index 99c4f9e0..bffcceb1 100644 --- a/source/options/GameplaySettingsSubState.hx +++ b/source/options/GameplaySettingsSubState.hx @@ -39,6 +39,23 @@ class GameplaySettingsSubState extends BaseOptionsMenu { 'controllerMode', 'bool', #if android true #else false #end); addOption(option); + var option:Option = new Option('Time Bar:', "What should the Time Bar display?", 'timeBarType', 'string', 'Time Left', + ['Time Left', 'Time Elapsed', 'Song Name', 'Disabled']); + addOption(option); + + var option:Option = new Option('Note Splashes', "If unchecked, hitting \"Sick!\" notes won't show particles.", 'noteSplashes', 'bool', true); + addOption(option); + + var option:Option = new Option('Hide HUD', 'If checked, hides most HUD elements.', 'hideHud', 'bool', false); + addOption(option); + + var option:Option = new Option('Hide Watermark', 'If checked, hides watermark with song name, difficulty name and SB Engine version.', + 'hideWatermark', 'bool', false); + addOption(option); + + var option:Option = new Option('Hide Judgement Counter', 'If checked, hides Judgement Counter.', 'hideJudgementCounter', 'bool', false); + addOption(option); + // I'd suggest using "Downscroll" as an example for making your own option since it is the simplest here var option:Option = new Option('Downscroll', // Name 'If checked, notes go Down instead of Up, simple enough.', // Description @@ -60,6 +77,21 @@ class GameplaySettingsSubState extends BaseOptionsMenu { var option:Option = new Option('Disable Reset Button', "If checked, pressing Reset won't do anything.", 'noReset', 'bool', false); addOption(option); + var option:Option = new Option('Camera Zooms', "If unchecked, the camera won't zoom in on a beat hit.", 'camZooms', 'bool', true); + addOption(option); + + var option:Option = new Option('Score Text Zoom on Hit', "If unchecked, disables the Score text zooming\neverytime you hit a note.", 'scoreZoom', + 'bool', true); + addOption(option); + + var option:Option = new Option('Health Bar Transparency', 'How much transparent should the health bar and icons be.', 'healthBarAlpha', 'percent', 1); + option.scrollSpeed = 1.6; + option.minValue = 0.0; + option.maxValue = 1; + option.changeValue = 0.1; + option.decimals = 1; + addOption(option); + #if android var option:Option = new Option('Vibrations', "If unchecked, your phone will not vibrate.", 'vibration', 'bool', true); addOption(option); @@ -121,6 +153,14 @@ class GameplaySettingsSubState extends BaseOptionsMenu { "If checked, you will have results screen about your rating, accruracy and rating name when you finish the song.", 'resultsScreen', 'bool', false); addOption(option); + var option:Option = new Option('SB Engine timebar style', + "If checked, you will have SB Engine time bar.\nIf unchecked, you will have basic Psych Engine timebar style", 'sbEngineTimeBar', 'bool', true); + addOption(option); + + var option:Option = new Option('Combo Stacking', + "If unchecked, Ratings and Combo won't stack, saving on System Memory and making them easier to read", 'comboStacking', 'bool', true); + addOption(option); + super(); } diff --git a/source/options/GraphicsSettingsSubState.hx b/source/options/GraphicsSettingsSubState.hx index 4658bf36..de9238cf 100644 --- a/source/options/GraphicsSettingsSubState.hx +++ b/source/options/GraphicsSettingsSubState.hx @@ -51,7 +51,7 @@ class GraphicsSettingsSubState extends BaseOptionsMenu { 'If unchecked, disables lua shaders.\nIt\'s used for some visual effects, and also CPU intensive for weaker PCs and Android phones.\nOriginal lua shaders maked on old version of Psych Engine', // Description 'shaders', // Save data variable name 'bool', // Variable type - false); // Default value + true); // Default value addOption(option); #if !html5 // Apparently other framerates isn't correctly supported on Browser? Probably it has some V-Sync freak enabled by default, idk diff --git a/source/options/VisualsUISubState.hx b/source/options/VisualsUISubState.hx index 25b1f580..51a8020d 100644 --- a/source/options/VisualsUISubState.hx +++ b/source/options/VisualsUISubState.hx @@ -32,47 +32,15 @@ class VisualsUISubState extends BaseOptionsMenu { title = 'Visuals and UI'; rpcTitle = 'Visuals & UI Settings Menu'; // for Discord Rich Presence - var option:Option = new Option('Note Splashes', "If unchecked, hitting \"Sick!\" notes won't show particles.", 'noteSplashes', 'bool', true); - addOption(option); - - var option:Option = new Option('Hide HUD', 'If checked, hides most HUD elements.', 'hideHud', 'bool', false); - addOption(option); - - var option:Option = new Option('Hide Watermark', 'If checked, hides watermark with song name, difficulty name and SB Engine version.', - 'hideWatermark', 'bool', false); - addOption(option); - - var option:Option = new Option('Hide Judgement Counter', 'If checked, hides Judgement Counter.', 'hideJudgementCounter', 'bool', false); - addOption(option); - var option:Option = new Option('Colorblind Filter', 'You can set colorblind filter (makes the game more playable for colorblind people)\nCredits: notweuz (Creator of OS Engine.)', 'colorblindMode', 'string', 'None', ['None', 'Deuteranopia', 'Protanopia', 'Tritanopia']); option.onChange = ColorblindFilter.applyFiltersOnGame; addOption(option); - var option:Option = new Option('Time Bar:', "What should the Time Bar display?", 'timeBarType', 'string', 'Time Left', - ['Time Left', 'Time Elapsed', 'Song Name', 'Disabled']); - addOption(option); - var option:Option = new Option('Flashing Lights', "Uncheck this if you're sensitive to flashing lights!", 'flashing', 'bool', true); addOption(option); - var option:Option = new Option('Camera Zooms', "If unchecked, the camera won't zoom in on a beat hit.", 'camZooms', 'bool', true); - addOption(option); - - var option:Option = new Option('Score Text Zoom on Hit', "If unchecked, disables the Score text zooming\neverytime you hit a note.", 'scoreZoom', - 'bool', true); - addOption(option); - - var option:Option = new Option('Health Bar Transparency', 'How much transparent should the health bar and icons be.', 'healthBarAlpha', 'percent', 1); - option.scrollSpeed = 1.6; - option.minValue = 0.0; - option.maxValue = 1; - option.changeValue = 0.1; - option.decimals = 1; - addOption(option); - var option:Option = new Option('FPS Counter', 'If unchecked, hides FPS Counter.', 'showFPS', 'bool', true); addOption(option); option.onChange = onChangeFPSCounter; @@ -109,10 +77,6 @@ class VisualsUISubState extends BaseOptionsMenu { addOption(option); #end - var option:Option = new Option('Combo Stacking', - "If unchecked, Ratings and Combo won't stack, saving on System Memory and making them easier to read", 'comboStacking', 'bool', true); - addOption(option); - var option:Option = new Option('Simple Main Menu', 'Change main menu style.\nOriginal - Original main menu with animated sprites.\nClassic - Basic main menu without sprites, but with alphabet text.', 'mainMenuStyle', 'string', 'Original', // Credits: Joalor64 (Creator of Joalor64.)