Skip to content

Commit

Permalink
hello
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Aug 29, 2024
1 parent 04a311f commit 692f613
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 37 deletions.
2 changes: 2 additions & 0 deletions source/funkin/backend/utils/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ import funkin.game.Init.Volume;
public var showRatingStats:Bool = true;
public var darkMode:Bool = false;

public var gayFurryStuff:Bool = false;

public var stats:Map<String, Dynamic> = ['Max Misses' => 0, 'Max Score' => 0];

public var achievementsMap:Map<String, Bool> = new Map<String, Bool>();
Expand Down
55 changes: 28 additions & 27 deletions source/funkin/backend/utils/native/MouseUtil.hx
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
package funkin.backend.utils.native;

import flixel.input.mouse.FlxMouseEvent;
import flixel.FlxSprite;
import flixel.input.mouse.*;

typedef MouseUtilStruc = {
// Mouse shit
var onClick:FlxSprite->Void;
var onHover:Void ->Void;//clicklmao
typedef MouseUtilStruc =
{
// Mouse shit
var onClick:flixel.FlxSprite->Void;
var onHover:Void->Void; // clicklmao

// Selected Smth
var selectedSomethin:Bool;
var selectedSomethinMouse:Bool;
}
// Selected Smth
var selectedSomethin:Bool;
var selectedSomethinMouse:Bool;
}

class MouseUtil {
public static function MOUSESUPPORT(spr:FlxSprite, data:MouseUtilStruc)
{
if (ClientPrefs.data.mouseEvents && !ClientPrefs.data.lowQuality)
{
FlxMouseEvent.add(spr, null, data.onClick, function(_)
{
new FlxTimer().start(0.01, function(tmr:FlxTimer) data.selectedSomethinMouse = true);

if (!data.selectedSomethin && data.selectedSomethinMouse)
{
data.onHover();
}
});
}
}
}
class MouseUtil
{
private static var globalManager:FlxMouseEventManager = new FlxMouseEventManager();

public static function MOUSESUPPORT(spr:flixel.FlxSprite, data:MouseUtilStruc)
{
if (ClientPrefs.data.mouseEvents && !ClientPrefs.data.lowQuality)
{
globalManager.add(spr, null, data.onClick, function(_)
{
new FlxTimer().start(0.01, function(tmr:FlxTimer) data.selectedSomethinMouse = true);

if (!data.selectedSomethin && data.selectedSomethinMouse)
data.onHover();
});
}
}
}
43 changes: 34 additions & 9 deletions source/funkin/backend/utils/native/WindowUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package funkin.backend.utils.native;

import lime.app.Application;


#if windows
@:buildXml('
<target id="haxe">
Expand All @@ -15,6 +14,9 @@ import lime.app.Application;
#end
class WindowUtil
{
static var osInfo(get, never):String;
static var osVersion(get, never):String;

#if windows
@:functionCode('
int darkMode = enable ? 1 : 0;
Expand All @@ -27,21 +29,44 @@ class WindowUtil
trace('Darkmode ${enable ? 'Enabled' : 'Disabled'}');

// Windows 10 support?
lime.app.Application.current.window.borderless = true;
lime.app.Application.current.window.borderless = false;
if (!osInfo.contains('11')){
Application.current.window.borderless = true;
Application.current.window.borderless = false;
}

trace(osInfo + ' ' + osVersion);
}
#end

public static function setTitle(?s:String, ?normal:Bool = true)
{
if (normal)
Application.current.window.title = Application.current.meta.get('name') + " - " + s;
else if (s == null)
Application.current.window.title = Application.current.meta.get('name');
else
Application.current.window.title = s;
if (s == null)
{
if (normal)
Application.current.window.title = Application.current.meta.get('name') + " - " + s;
else
Application.current.window.title = s;
}
}

public static function resetTitle()
Application.current.window.title = Application.current.meta.get('name');

// bro

private static function get_osInfo()
{ // stolen from twist engine lmao
if (lime.system.System.platformLabel != null
&& lime.system.System.platformLabel != ""
&& lime.system.System.platformVersion != null
&& lime.system.System.platformVersion != "")
return lime.system.System.platformLabel.replace(lime.system.System.platformVersion, "").trim();
else
trace('Unable to grab OS Label');

return null;
}

private static inline function get_osVersion()
return lime.system.System.platformVersion;
}
2 changes: 1 addition & 1 deletion source/funkin/game/FPS.hx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class FPS extends TextField

if (currentCount != cacheCount)
{
text = "FPS: " + currentFPS;
text = '${ClientPrefs.data.gayFurryStuff ? "owo's per seconds" : 'FPS'}: $currentFPS';

var memoryMegas:Float = 0;

Expand Down
7 changes: 7 additions & 0 deletions source/funkin/game/options/GameplaySettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ class GameplaySettingsSubState extends BaseOptionsMenu
option.changeValue = 0.1;
addOption(option);

var option:Option = new Option('Furry Stuff',
'erm, owo?',
'gayFurryStuff',
'bool',
false);
addOption(option);

super();
}

Expand Down

0 comments on commit 692f613

Please sign in to comment.