mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-14 19:25:16 -05:00
Merge branch 'feature/pico-character-script' into rewrite/master
This commit is contained in:
commit
35005df32a
9 changed files with 47 additions and 36 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit a6861ae85433fb10d8cf2fd03f5e769d1e4479ea
|
||||
Subproject commit da96dc519a00bb8eb24a164bae64a4c6c064e87d
|
|
@ -6,7 +6,7 @@
|
|||
"name": "EliteMasterEric"
|
||||
}
|
||||
],
|
||||
"api_version": "0.1.0",
|
||||
"api_version": "0.5.0",
|
||||
"mod_version": "1.0.0",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ class FlxAtlasSprite extends FlxAnimate
|
|||
|
||||
// Move to the first frame of the animation.
|
||||
// goToFrameLabel(id);
|
||||
trace('Playing animation $id');
|
||||
// trace('Playing animation $id');
|
||||
if ((id == null || id == "") || this.anim.symbolDictionary.exists(id) || (this.anim.getByName(id) != null))
|
||||
{
|
||||
this.anim.play(id, restart, false, startFrame);
|
||||
|
|
|
@ -258,7 +258,7 @@ class PolymodHandler
|
|||
Polymod.blacklistImport('cpp.Lib');
|
||||
|
||||
// `Unserializer`
|
||||
// Unserializerr.DEFAULT_RESOLVER.resolveClass() can access blacklisted packages
|
||||
// Unserializer.DEFAULT_RESOLVER.resolveClass() can access blacklisted packages
|
||||
Polymod.blacklistImport('Unserializer');
|
||||
|
||||
// `lime.system.CFFI`
|
||||
|
|
|
@ -17,7 +17,7 @@ import thx.semver.Version;
|
|||
@:nullSafety
|
||||
class Save
|
||||
{
|
||||
public static final SAVE_DATA_VERSION:thx.semver.Version = "2.0.5";
|
||||
public static final SAVE_DATA_VERSION:thx.semver.Version = "2.0.4";
|
||||
public static final SAVE_DATA_VERSION_RULE:thx.semver.VersionRule = "2.0.x";
|
||||
|
||||
// We load this version's saves from a new save path, to maintain SOME level of backwards compatibility.
|
||||
|
@ -34,19 +34,19 @@ class Save
|
|||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new Save(FlxG.save.data);
|
||||
return _instance = load();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
var data:RawSaveData;
|
||||
|
||||
public static function load():Void
|
||||
public static function load():Save
|
||||
{
|
||||
trace("[SAVE] Loading save...");
|
||||
|
||||
// Bind save data.
|
||||
loadFromSlot(1);
|
||||
return loadFromSlot(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,9 @@ class Save
|
|||
public static function getDefault():RawSaveData
|
||||
{
|
||||
return {
|
||||
version: Save.SAVE_DATA_VERSION,
|
||||
// Version number is an abstract(Array) internally.
|
||||
// This means it copies by reference, so merging save data overides the version number lol.
|
||||
version: thx.Dynamics.clone(Save.SAVE_DATA_VERSION),
|
||||
|
||||
volume: 1.0,
|
||||
mute: false,
|
||||
|
@ -433,7 +435,9 @@ class Save
|
|||
{
|
||||
if (!data.unlocks.charactersSeen.contains(character))
|
||||
{
|
||||
trace('Character seen: ' + character);
|
||||
data.unlocks.charactersSeen.push(character);
|
||||
trace('New characters seen list: ' + data.unlocks.charactersSeen);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
@ -832,7 +836,7 @@ class Save
|
|||
* If you set slot to `2`, it will load an independe
|
||||
* @param slot
|
||||
*/
|
||||
static function loadFromSlot(slot:Int):Void
|
||||
static function loadFromSlot(slot:Int):Save
|
||||
{
|
||||
trace("[SAVE] Loading save from slot " + slot + "...");
|
||||
|
||||
|
@ -850,12 +854,14 @@ class Save
|
|||
trace('[SAVE] Found legacy save data, converting...');
|
||||
var gameSave = SaveDataMigrator.migrateFromLegacy(legacySaveData);
|
||||
FlxG.save.mergeData(gameSave.data, true);
|
||||
return gameSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
trace('[SAVE] No legacy save data found.');
|
||||
var gameSave = new Save();
|
||||
FlxG.save.mergeData(gameSave.data, true);
|
||||
return gameSave;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -863,6 +869,8 @@ class Save
|
|||
trace('[SAVE] Found existing save data.');
|
||||
var gameSave = SaveDataMigrator.migrate(FlxG.save.data);
|
||||
FlxG.save.mergeData(gameSave.data, true);
|
||||
|
||||
return gameSave;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.0.4] - 2024-09-12
|
||||
Note to self: Only update to 2.1.0 when migration is needed.
|
||||
### Added
|
||||
- `unlocks.charactersSeen:Array<String>` to `Save`
|
||||
- `unlocks.oldChar:Bool` to `Save`
|
||||
|
||||
## [2.0.5] - 2024-05-21
|
||||
### Fixed
|
||||
- Resolved an issue where HTML5 wouldn't store the semantic version properly, causing the game to fail to load the save.
|
||||
|
|
|
@ -47,7 +47,6 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass
|
|||
//
|
||||
if (getCurrentAnimation() == "idle")
|
||||
{
|
||||
trace('Player beat hit');
|
||||
playAnimation("idle", true, false, false);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -356,7 +356,7 @@ class MainMenuState extends MusicBeatState
|
|||
#if FEATURE_DEBUG_FUNCTIONS
|
||||
// Ctrl+Alt+Shift+P = Character Unlock screen
|
||||
// Ctrl+Alt+Shift+W = Meet requirements for Pico Unlock
|
||||
// Ctrl+Alt+Shift+L = Revoke requirements for Pico Unlock
|
||||
// Ctrl+Alt+Shift+M = Revoke requirements for Pico Unlock
|
||||
// Ctrl+Alt+Shift+R = Score/Rank conflict test
|
||||
// Ctrl+Alt+Shift+N = Mark all characters as not seen
|
||||
// Ctrl+Alt+Shift+E = Dump save data
|
||||
|
@ -369,7 +369,7 @@ class MainMenuState extends MusicBeatState
|
|||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.W)
|
||||
{
|
||||
FunkinSound.playOnce(Paths.sound('confirmMenu'));
|
||||
// Give the user a score of 1 point on Weekend 1 story mode.
|
||||
// Give the user a score of 1 point on Weekend 1 story mode (Easy difficulty).
|
||||
// This makes the level count as cleared and displays the songs in Freeplay.
|
||||
funkin.save.Save.instance.setLevelScore('weekend1', 'easy',
|
||||
{
|
||||
|
@ -389,27 +389,30 @@ class MainMenuState extends MusicBeatState
|
|||
});
|
||||
}
|
||||
|
||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.L)
|
||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.M)
|
||||
{
|
||||
FunkinSound.playOnce(Paths.sound('confirmMenu'));
|
||||
// Give the user a score of 0 points on Weekend 1 story mode.
|
||||
// Give the user a score of 0 points on Weekend 1 story mode (all difficulties).
|
||||
// This makes the level count as uncleared and no longer displays the songs in Freeplay.
|
||||
funkin.save.Save.instance.setLevelScore('weekend1', 'easy',
|
||||
{
|
||||
score: 1,
|
||||
tallies:
|
||||
{
|
||||
sick: 0,
|
||||
good: 0,
|
||||
bad: 0,
|
||||
shit: 0,
|
||||
missed: 0,
|
||||
combo: 0,
|
||||
maxCombo: 0,
|
||||
totalNotesHit: 0,
|
||||
totalNotes: 0,
|
||||
}
|
||||
});
|
||||
for (diff in ['easy', 'normal', 'hard'])
|
||||
{
|
||||
funkin.save.Save.instance.setLevelScore('weekend1', diff,
|
||||
{
|
||||
score: 0,
|
||||
tallies:
|
||||
{
|
||||
sick: 0,
|
||||
good: 0,
|
||||
bad: 0,
|
||||
shit: 0,
|
||||
missed: 0,
|
||||
combo: 0,
|
||||
maxCombo: 0,
|
||||
totalNotesHit: 0,
|
||||
totalNotes: 0,
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.R)
|
||||
|
|
|
@ -273,11 +273,6 @@ class TitleState extends MusicBeatState
|
|||
}
|
||||
#end
|
||||
|
||||
if (Save.instance.charactersSeen.contains("pico"))
|
||||
{
|
||||
Save.instance.charactersSeen.remove("pico");
|
||||
Save.instance.oldChar = false;
|
||||
}
|
||||
Conductor.instance.update();
|
||||
|
||||
/* if (FlxG.onMobile)
|
||||
|
|
Loading…
Reference in a new issue