Skip to content

Commit

Permalink
fortnite balls im gay i like boys
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Apr 27, 2024
1 parent cfce0c3 commit d80dd0c
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 40 deletions.
2 changes: 2 additions & 0 deletions project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
<haxelib name="discord_rpc" if="DISCORD_ALLOWED"/>
</section>

<define name="TEXTURES_OFF" if="hl || web"/>

<!-- ______________________________ Haxedefines _____________________________ -->

<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />
Expand Down
35 changes: 12 additions & 23 deletions source/funkin/Controls.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@ class Controls
public static var keyboardBinds:Map<String, Array<FlxKey>>;
public static var gamepadBinds:Map<String, Array<FlxGamepadInputID>>;
public static var controlArray:Array<String> = [];
public static var gamepad:FlxGamepad = null;
public static var gamepad:FlxGamepad;

// Returns if the controler is being used
inline public static function inGamepad():Bool {
return gamepad != null ? gamepad.connected : false;
}

public static function connectGamepad(deviceConnected:FlxGamepad):Void {
gamepad = deviceConnected;
}

public static function disconnectGamepad(deviceDisconnected:FlxGamepad):Void {
gamepad = null;
}

inline public static function initGamepad():Void {
FlxG.gamepads.deviceConnected.add(connectGamepad);
FlxG.gamepads.deviceDisconnected.add(disconnectGamepad);
FlxG.gamepads.deviceConnected.add((device) -> gamepad = device);
FlxG.gamepads.deviceDisconnected.add((device) -> gamepad = null);
if (FlxG.gamepads.lastActive != null)
gamepad = FlxG.gamepads.lastActive;
}
Expand All @@ -46,8 +38,8 @@ class Controls
var keyboard:Array<Int> = [-1, -1];
var gamepad:Array<Int> = [-1, -1];

binds.fastForEach((bind, i) -> {keyboard[i] = fromString(bind, false);});
gamepadSave.get(key).fastForEach((bind, i) -> {gamepad[i] = fromString(bind, true);});
binds.fastForEach((bind, i) -> keyboard.unsafeSet(i, fromString(bind, false)));
gamepadSave.get(key).fastForEach((bind, i) -> gamepad.unsafeSet(i, fromString(bind, true)));

keyboardBinds.set(key, keyboard);
gamepadBinds.set(key, gamepad);
Expand Down Expand Up @@ -136,31 +128,28 @@ class Controls
public static function getBindNames(bind:String):Array<String>
{
bind = bind.toUpperCase().trim();
var names:Array<String> = ["", ""];
var names:Array<String> = [];

if (inGamepad()) {
var gamepadKeys = gamepadBinds.get(bind);
gamepadKeys.fastForEach((key, i) -> {
names[i] = FlxGamepadInputID.toStringMap.get(key);
});
gamepadKeys.fastForEach((key, i) -> names.push(FlxGamepadInputID.toStringMap.get(key)));
}
else {
var keyboardKeys = keyboardBinds.get(bind);
keyboardKeys.fastForEach((key, i) -> {
names[i] = FlxKey.toStringMap.get(key);
});
keyboardKeys.fastForEach((key, i) -> names.push(FlxKey.toStringMap.get(key)));
}

return names;
}

public static function setBind(bind:String, key:String, index:Int):Void {
public static function setBind(bind:String, key:String, index:Int):Void
{
bind = bind.toUpperCase().trim();
key = key.toUpperCase().trim();

final gamepad:Bool = inGamepad();

var binds:Array<Int> = gamepad ? gamepadBinds.get(bind) : keyboardBinds.get(bind);
binds[index] = fromString(key, gamepad);
binds.unsafeSet(index, fromString(key, gamepad));

gamepad ? gamepadBinds.set(bind, binds) : keyboardBinds.set(bind, binds);
SaveData.flushData();
Expand Down
4 changes: 2 additions & 2 deletions source/funkin/Preferences.hx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Preferences
#end
addPref('antialiasing', 'antialiasing', true);
addPref('quality', 'quality', {array:["rudy", "low", "medium", "high"], value:"high"});
#if !(hl || web)
#if !TEXTURES_OFF
addPref('gpu-textures', 'gpu textures', true);
#end
#if desktop
Expand Down Expand Up @@ -105,7 +105,7 @@ class Preferences
#if desktop Main.resizeGame(getPref('resolution')); #else {} #end

public static inline function updateGpuTextures():Void
#if !(hl || web) AssetManager.gpuTextures = getPref('gpu-textures'); #else {} #end
#if TEXTURES_OFF {} #else AssetManager.gpuTextures = getPref('gpu-textures'); #end

public static inline function updateAntialiasing():Void {
var anti:Bool = getPref('antialiasing');
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/graphics/FlxSpriteExt.hx
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,6 @@ class FlxSpriteExt extends FlxSkewedSprite
}

inline public function uploadGpu():FlxGraphic {
return AssetManager.uploadGraphicTexture(graphic);
return #if TEXTURES_OFF graphic; #else AssetManager.uploadGraphicTexture(graphic); #end
}
}
3 changes: 2 additions & 1 deletion source/funkin/graphics/TypedGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import flixel.group.FlxContainer.FlxTypedContainer;

typedef Group = TypedGroup<FlxBasic>;

@:access(flixel.FlxCamera)
class TypedGroup<T:FlxBasic> extends #if (flixel >= "5.7.0") FlxTypedContainer<T> #else FlxTypedGroup<T> #end
{
public inline function setNull(object:T) {
Expand Down Expand Up @@ -51,7 +52,7 @@ class TypedGroup<T:FlxBasic> extends #if (flixel >= "5.7.0") FlxTypedContainer<T
});
}

override public function draw():Void @:privateAccess
override public function draw():Void
{
final oldDefaultCameras = FlxCamera._defaultCameras;
if (cameras != null)
Expand Down
8 changes: 3 additions & 5 deletions source/funkin/objects/NotesGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ class NotesGroup extends Group
public function set_scrollSpeed(value:Float = 1.0) {
if (value != scrollSpeed)
{
unspawnNotes.fastForEach((note, i) -> {
note.noteSpeed = value;
});
unspawnNotes.fastForEach((note, i) -> note.noteSpeed = value);

notes.members.fastForEach((note, i) -> {
if (note != null)
Expand Down Expand Up @@ -362,7 +360,7 @@ class NotesGroup extends Group
final inStart:Bool = game.startingSong;
if (!game.inCutscene) if ((Conductor.playing || inStart || Conductor.songPosition < game.songLength))
{
Conductor.songPosition = Conductor.songPosition + (elapsed * 1000);
Conductor.update(elapsed);
if (game.startedCountdown) if (inStart) {
if (Conductor.songPosition >= 0)
game.startSong();
Expand All @@ -376,7 +374,7 @@ class NotesGroup extends Group
}
else
{
Conductor.songPosition = Conductor.songPosition + (elapsed * 1000);
Conductor.update(elapsed);
if (!Conductor.inst.playing) Conductor.play();
if (Conductor.songPosition % Conductor.stepCrochet <= 5)
Conductor.autoSync();
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/util/backend/AssetManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class AssetManager
* GRAPHIC CACHE
*/

public static var gpuTextures:Bool = #if (hl || web) false; #else true; #end
public static var gpuTextures:Bool = #if TEXTURES_OFF false; #else true; #end
public static var lodQuality:LodLevel = HIGH;
public static function setLodQuality(level:String):LodLevel {
return lodQuality = LodLevel.fromString(level);
Expand Down
4 changes: 4 additions & 0 deletions source/funkin/util/song/Conductor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ class Conductor
return lastChange;
}

public static inline function update(elapsed:Float) {
songPosition = songPosition + (elapsed * 1000);
}

public static var volume(default, set):Float = 1.0;
static inline function set_volume(value:Float) {
if (inst != null)
Expand Down
9 changes: 2 additions & 7 deletions source/import.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,12 @@ import funkin.objects.note.Event;

//PlayState Others
import funkin.objects.RatingGroup;
import funkin.objects.dialogue.DialogueBoxBase;
import funkin.objects.dialogue.PixelDialogueBox;
import funkin.objects.dialogue.NormalDialogueBox;
import funkin.objects.dialogue.*;
import funkin.objects.Character;
import funkin.objects.HealthIcon;

//Alphabet
import funkin.objects.alphabet.AlphabetFont;
import funkin.objects.alphabet.Alphabet;
import funkin.objects.alphabet.MenuAlphabet;
import funkin.objects.alphabet.TypedAlphabet;
import funkin.objects.alphabet.*;

// Sound
import funkin.sound.FlxFunkSound;
Expand Down

0 comments on commit d80dd0c

Please sign in to comment.