Skip to content

Commit

Permalink
opaa
Browse files Browse the repository at this point in the history
Co-Authored-By: Ne_Eo <NeeEoo@users.noreply.github.com>
  • Loading branch information
NexIsDumb and NeeEoo committed Oct 17, 2024
1 parent 682358c commit d197205
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions source/funkin/game/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
public function prepareInfos(node:Access)
return XMLImportedScriptInfo.prepareInfos(node, scripts, (infos) -> xmlImportedScripts.push(infos));

// backward compat - Nex
private function set_script(script:Script):Script {
if (scripts == null) (scripts = new ScriptPack("Character")).setParent(this);
else scripts.remove(scripts.scripts[0]);
if(script != null) scripts.insert(0, script);
this.script = script;
return script;
}

public var idleSuffix:String = "";
public var stunned(default, set):Bool = false;

Expand Down Expand Up @@ -443,13 +434,30 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
return stunned = b;
}

// ---- Backwards compat ----
// Interval at which the character will dance (higher number = slower dance)
@:noCompletion public var danceInterval(get, set):Int;
@:noCompletion private function set_danceInterval(v:Int)
return beatInterval = v;
@:noCompletion private function get_danceInterval()
return beatInterval;

private function set_script(script:Script):Script {
if (scripts == null) (scripts = new ScriptPack("Character")).setParent(this);

var lastIndex = scripts.scripts.indexOf(this.script);
if(lastIndex >= 0) {
if(script == null) // last != null && new == null
scripts.scripts.splice(lastIndex, 1);
else // last != null && new != null
scripts.scripts[lastIndex] = script;
} else if(script != null) // last == null
scripts.insert(0, script);

return this.script = script;
}
// ---- end of Backwards compat ----


public static var FALLBACK_CHARACTER:String = "bf";
public static var FALLBACK_DEAD_CHARACTER:String = "bf-dead";
Expand Down

0 comments on commit d197205

Please sign in to comment.