Skip to content

Commit 8bd95b4

Browse files
committed
changes
1 parent 7c433c4 commit 8bd95b4

File tree

4 files changed

+35
-98
lines changed

4 files changed

+35
-98
lines changed

source/funkin/InitState.hx

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ import funkin.api.discord.DiscordClient;
4444
#if FEATURE_NEWGROUNDS
4545
import funkin.api.newgrounds.NewgroundsClient;
4646
#end
47-
#if FEATURE_LOST_FOCUS_VOLUME
48-
import flixel.tweens.FlxTween;
49-
import flixel.tweens.FlxEase;
50-
#end
5147

5248
/**
5349
* A core class which performs initialization of the game.
@@ -297,45 +293,18 @@ class InitState extends FlxState
297293

298294
#if FEATURE_LOST_FOCUS_VOLUME
299295
@:noCompletion var _lastFocusVolume:Null<Float>;
300-
@:noCompletion var _lostFocusVolumeTween:Null<FlxTween>;
301296

302297
function onLostFocus()
303298
{
304-
if (FlxG.sound.muted || FlxG.sound.volume == 0 || Preferences.lostVolumeFocusMode == "Off" || FlxG.autoPause) return;
305-
_lostFocusVolumeTween?.cancel();
299+
if (FlxG.sound.muted || FlxG.sound.volume == 0 || FlxG.autoPause) return;
306300
_lastFocusVolume = FlxG.sound.volume;
307-
308-
if (Preferences.lostVolumeFocusMode == "Instant")
309-
{
310-
FlxG.sound.volume *= Constants.LOST_FOCUS_VOLUME_MULTIPLIER;
311-
}
312-
else if (Preferences.lostVolumeFocusMode == "Delayed")
313-
{
314-
_lostFocusVolumeTween = FlxTween.num(FlxG.sound.volume, FlxG.sound.volume * Constants.LOST_FOCUS_VOLUME_MULTIPLIER, Constants.LOST_FOCUS_VOLUME_DURATION,
315-
{
316-
startDelay: Constants.LOST_FOCUS_VOLUME_DELAY,
317-
ease: FlxEase.smootherStepOut
318-
}, (volume:Float) -> FlxG.sound.volume = volume);
319-
}
301+
FlxG.sound.volume *= Constants.LOST_FOCUS_VOLUME_MULTIPLIER;
320302
}
321303

322304
function onGainFocus()
323305
{
324-
if (FlxG.sound.muted || Preferences.lostVolumeFocusMode == "Off" || FlxG.autoPause) return;
325-
_lostFocusVolumeTween?.cancel();
326-
327-
if (_lastFocusVolume != null)
328-
{
329-
if (Preferences.lostVolumeFocusMode == "Instant")
330-
{
331-
FlxG.sound.volume = _lastFocusVolume;
332-
}
333-
else if (Preferences.lostVolumeFocusMode == "Delayed")
334-
{
335-
_lostFocusVolumeTween = FlxTween.num(FlxG.sound.volume, _lastFocusVolume, Math.max(0.15, FlxG.sound.volume / _lastFocusVolume * .5),
336-
{ease: FlxEase.smootherStepInOut}, (volume:Float) -> FlxG.sound.volume = volume);
337-
}
338-
}
306+
if (FlxG.sound.muted || FlxG.autoPause) return;
307+
if (_lastFocusVolume != null) FlxG.sound.volume = _lastFocusVolume;
339308
}
340309
#end
341310

source/funkin/save/Save.hx

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ class Save implements ConsoleClass
124124
zoomCamera: true,
125125
debugDisplay: 'Off',
126126
debugDisplayBGOpacity: 50,
127-
subtitles: true,
128127
hapticsMode: 'All',
129128
hapticsIntensityMultiplier: 1,
130129
autoPause: true,
130+
videoSubtitles: true,
131131
vsyncMode: 'Off',
132132
strumlineBackgroundOpacity: 0,
133133
autoFullscreen: false,
@@ -379,23 +379,6 @@ class Save implements ConsoleClass
379379
return data.optionsChartEditor.showNoteKinds;
380380
}
381381

382-
public var chartEditorShowSubtitles(get, set):Bool;
383-
384-
function get_chartEditorShowSubtitles():Bool
385-
{
386-
if (data.optionsChartEditor.showSubtitles == null) data.optionsChartEditor.showSubtitles = true;
387-
388-
return data.optionsChartEditor.showSubtitles;
389-
}
390-
391-
function set_chartEditorShowSubtitles(value:Bool):Bool
392-
{
393-
// Set and apply.
394-
data.optionsChartEditor.showSubtitles = value;
395-
flush();
396-
return data.optionsChartEditor.showSubtitles;
397-
}
398-
399382
public var chartEditorPlaytestStartTime(get, set):Bool;
400383

401384
function get_chartEditorPlaytestStartTime():Bool
@@ -1635,12 +1618,6 @@ typedef SaveDataOptions =
16351618
*/
16361619
var debugDisplayBGOpacity:Int;
16371620

1638-
/**
1639-
* If enabled, subtitles will appear.
1640-
* @default `true`
1641-
*/
1642-
var subtitles:Bool;
1643-
16441621
/**
16451622
* If enabled, haptic feedback will be enabled.
16461623
* @default `All`
@@ -1659,6 +1636,12 @@ typedef SaveDataOptions =
16591636
*/
16601637
var autoPause:Bool;
16611638

1639+
/**
1640+
* If enabled, subtitles will be shown on video cutscenes.
1641+
* @default `true`
1642+
*/
1643+
var videoSubtitles:Bool;
1644+
16621645
/**
16631646
* If enabled, the game will utilize VSync (or adaptive VSync) on startup.
16641647
* @default `Off`
@@ -1903,12 +1886,6 @@ typedef SaveDataChartEditorOptions =
19031886
*/
19041887
var ?showNoteKinds:Bool;
19051888

1906-
/**
1907-
* Show Subtitles in the Chart Editor.
1908-
* @default `true`
1909-
*/
1910-
var ?showSubtitles:Bool;
1911-
19121889
/**
19131890
* Metronome volume in the Chart Editor.
19141891
* @default `1.0`

source/funkin/ui/options/PreferencesMenu.hx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,20 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
109109
function createPrefItems():Void
110110
{
111111
#if FEATURE_NAUGHTYNESS
112-
createPrefItemCheckbox('Naughtyness', 'When enabled, raunchy content (such as swearing, etc.) is displayed.', function(value:Bool):Void {
112+
createPrefItemCheckbox('Naughtyness', 'If enabled, raunchy content (such as swearing, etc.) will be displayed.', function(value:Bool):Void {
113113
Preferences.naughtyness = value;
114114
}, Preferences.naughtyness);
115115
#end
116-
createPrefItemCheckbox('Downscroll', 'When enabled, notes move downwards toward the strumline at the bottom of the screen.', function(value:Bool):Void {
116+
createPrefItemCheckbox('Downscroll', 'If enabled, this will make the notes move downwards.', function(value:Bool):Void {
117117
Preferences.downscroll = value;
118118
},
119119
Preferences.downscroll, #if mobile ControlsHandler.hasExternalInputDevice
120120
|| Preferences.controlsScheme != FunkinHitboxControlSchemes.Arrows #end);
121-
createPrefItemPercentage('Strumline Background', 'Show a semi-transparent background behind the strumline.', function(value:Int):Void {
121+
createPrefItemPercentage('Strumline Background', 'Give the strumline a semi-transparent background', function(value:Int):Void {
122122
Preferences.strumlineBackgroundOpacity = value;
123123
}, Preferences.strumlineBackgroundOpacity);
124124
#if FEATURE_HAPTICS
125-
createPrefItemEnum('Haptics', 'When enabled, the game plays haptic feedback effects.', [
125+
createPrefItemEnum('Haptics', 'If enabled, game will use haptic feedback effects.', [
126126
"All" => HapticsMode.ALL,
127127
"Notes Only" => HapticsMode.NOTES_ONLY,
128128
"None" => HapticsMode.NONE,
@@ -134,51 +134,52 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
134134
case HapticsMode.NONE: "None";
135135
default: "All";
136136
});
137-
createPrefItemNumber('Haptics Intensity', 'Intensity multiplier for all haptic feedback effects.', function(value:Float) {
137+
createPrefItemNumber('Haptics Intensity', 'Multiplier of intensity for all the haptic feedback effects.', function(value:Float) {
138138
Preferences.hapticsIntensityMultiplier = value;
139139
}, null, Preferences.hapticsIntensityMultiplier, 0.1, 5, 0.1, 1);
140140
#end
141-
createPrefItemCheckbox('Flashing Lights', 'When disabled, flashing effects are dampened. Useful for people with photosensitive epilepsy.',
141+
createPrefItemCheckbox('Flashing Lights', 'If disabled, it will dampen flashing effects. Useful for people with photosensitive epilepsy.',
142142
function(value:Bool):Void {
143143
Preferences.flashingLights = value;
144144
}, Preferences.flashingLights);
145-
createPrefItemCheckbox('Camera Zooms', 'When enabled, the camera bounces during songs.', function(value:Bool):Void {
145+
createPrefItemCheckbox('Camera Zooms', 'If disabled, camera stops bouncing to the song.', function(value:Bool):Void {
146146
Preferences.zoomCamera = value;
147147
}, Preferences.zoomCamera);
148-
createPrefItemCheckbox('Subtitles', 'When enabled, subtitles appear during some songs and cutscenes.', function(value:Bool):Void {
149-
Preferences.subtitles = value;
150-
}, Preferences.subtitles);
151-
#if FEATURE_DEBUG_DISPLAY
148+
#if FEATURE_VIDEO_SUBTITLES
149+
createPrefItemCheckbox('Video Subtitles', 'If enabled, subtitles will be shown on video cutscenes.', function(value:Bool):Void {
150+
Preferences.videoSubtitles = value;
151+
}, Preferences.videoSubtitles);
152+
#end
153+
#if !mobile
152154
// note: technically we can do DebugDisplayMode.Advanced => DebugDisplayMode.Advanced, etc. here, but that's a bit headache inducing.
153-
createPrefItemEnum('Debug Display', 'When enabled, FPS and other debug stats are displayed.', [
155+
createPrefItemEnum('Debug Display', 'If enabled, FPS and other debug stats will be displayed.', [
154156
"Advanced" => DebugDisplayMode.Advanced,
155157
"Simple" => DebugDisplayMode.Simple,
156158
"Off" => DebugDisplayMode.Off
157159
], (key:String, value:DebugDisplayMode) -> {
158160
Preferences.debugDisplay = value;
159161
}, Preferences.debugDisplay);
160-
createPrefItemPercentage('Debug Display BG', "Adjust the debug display's background opacity.", function(value:Int):Void {
162+
163+
createPrefItemPercentage('Debug Display BG', "Change debug display's background opacity", function(value:Int):Void {
161164
Preferences.debugDisplayBGOpacity = value;
162165
}, Preferences.debugDisplayBGOpacity);
163-
#end
164-
#if !mobile
165-
createPrefItemCheckbox('Pause on Unfocus', 'When enabled, the game automatically pauses when losing focus.', function(value:Bool):Void {
166+
createPrefItemCheckbox('Pause on Unfocus', 'If enabled, game automatically pauses when it loses focus.', function(value:Bool):Void {
166167
Preferences.autoPause = value;
167168
}, Preferences.autoPause);
168-
createPrefItemCheckbox('Launch in Fullscreen', 'When enabled, the game automatically starts up in fullscreen mode.', function(value:Bool):Void {
169+
createPrefItemCheckbox('Launch in Fullscreen', 'Automatically launch the game in fullscreen on startup.', function(value:Bool):Void {
169170
Preferences.autoFullscreen = value;
170171
}, Preferences.autoFullscreen);
171172
#end
172173

173174
#if web
174-
createPrefItemCheckbox('Unlocked Framerate', 'When enabled, the framerate is unlocked.', function(value:Bool):Void {
175+
createPrefItemCheckbox('Unlocked Framerate', 'If enabled, the framerate will be unlocked.', function(value:Bool):Void {
175176
Preferences.unlockedFramerate = value;
176177
}, Preferences.unlockedFramerate);
177178
#else
178179
// disabled on macos due to "error: Late swap tearing currently unsupported"
179180
// disable on mobile since it barely has any effect
180181
#if !(mac || mobile)
181-
createPrefItemEnum('VSync', "When enabled, the game attempts to match the framerate with your monitor's refresh rate.", [
182+
createPrefItemEnum('VSync', 'If enabled, game will attempt to match framerate with your monitor.', [
182183
"Off" => WindowVSyncMode.OFF,
183184
"On" => WindowVSyncMode.ON,
184185
"Adaptive" => WindowVSyncMode.ADAPTIVE,
@@ -200,13 +201,13 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
200201
#end
201202

202203
#if FEATURE_SCREENSHOTS
203-
createPrefItemCheckbox('Hide Mouse', 'When enabled, the mouse is hidden while taking a screenshot.', function(value:Bool):Void {
204+
createPrefItemCheckbox('Hide Mouse', 'If enabled, the mouse will be hidden when taking a screenshot.', function(value:Bool):Void {
204205
Preferences.shouldHideMouse = value;
205206
}, Preferences.shouldHideMouse);
206-
createPrefItemCheckbox('Fancy Preview', 'When enabled, a preview is shown after taking a screenshot.', function(value:Bool):Void {
207+
createPrefItemCheckbox('Fancy Preview', 'If enabled, a preview will be shown after taking a screenshot.', function(value:Bool):Void {
207208
Preferences.fancyPreview = value;
208209
}, Preferences.fancyPreview);
209-
createPrefItemCheckbox('Preview on Save', 'When enabled, the preview is only shown after a screenshot is saved.', function(value:Bool):Void {
210+
createPrefItemCheckbox('Preview on save', 'If enabled, the preview will be shown only after a screenshot is saved.', function(value:Bool):Void {
210211
Preferences.previewOnSave = value;
211212
}, Preferences.previewOnSave);
212213
#end

source/funkin/util/Constants.hx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -574,17 +574,7 @@ class Constants
574574
/**
575575
* How much volume should be reduced on Application Focus Lost.
576576
*/
577-
public static final LOST_FOCUS_VOLUME_MULTIPLIER:Float = 0.1;
578-
579-
/**
580-
* Duration, in seconds, how long should volume reduce.
581-
*/
582-
public static final LOST_FOCUS_VOLUME_DURATION:Float = 0.85;
583-
584-
/**
585-
* Delay how long should game wait before fading volume with `Delayed` volume fade option.
586-
*/
587-
public static final LOST_FOCUS_VOLUME_DELAY:Float = 0.15;
577+
public static final LOST_FOCUS_VOLUME_MULTIPLIER:Float = 0.5;
588578
#end
589579

590580
/**

0 commit comments

Comments
 (0)