Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Time bar style selection
Browse files Browse the repository at this point in the history
You can now choose time bar style!
  • Loading branch information
Stefan2008Git committed May 30, 2023
1 parent 0938921 commit cd0a868
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 47 deletions.
Binary file added assets/shared/images/sbEngineTimeBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/shared/images/timeBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions source/ClassicMainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ class ClassicMainMenuState extends MusicBeatState {
fnfVersionTxt.setFormat("Bahnschrift", 17, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(fnfVersionTxt);

selectorLeft = new Alphabet(0, 0, '< ', true);
selectorLeft = new Alphabet(0, 0, '> ', true);
add(selectorLeft);
selectorRight = new Alphabet(0, 0, ' >', true);
selectorRight = new Alphabet(0, 0, ' <', true);
add(selectorRight);

changeSelection();
Expand Down
7 changes: 6 additions & 1 deletion source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
25 changes: 18 additions & 7 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
40 changes: 40 additions & 0 deletions source/options/GameplaySettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion source/options/GraphicsSettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 0 additions & 36 deletions source/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.)
Expand Down

0 comments on commit cd0a868

Please sign in to comment.