assets submod

This commit is contained in:
Cameron Taylor 2024-03-10 13:34:40 -04:00
commit 528b01d739
6 changed files with 50 additions and 40 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ export/
RECOVER_*.fla RECOVER_*.fla
shitAudio/ shitAudio/
.build_time .build_time
.swp

View file

@ -22,8 +22,8 @@
<set name="BUILD_DIR" value="export/release" unless="debug" /> <set name="BUILD_DIR" value="export/release" unless="debug" />
<set name="BUILD_DIR" value="export/32bit" if="32bit" /> <set name="BUILD_DIR" value="export/32bit" if="32bit" />
<classpath name="source" /> <classpath name="source" />
<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web" /> <assets path="assets/preload" rename="assets" exclude="*.ogg|*.wav" if="web" />
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web" /> <assets path="assets/preload" rename="assets" exclude="*.mp3|*.wav" unless="web" />
<define name="PRELOAD_ALL" unless="web" /> <define name="PRELOAD_ALL" unless="web" />
<define name="NO_PRELOAD_ALL" unless="PRELOAD_ALL" /> <define name="NO_PRELOAD_ALL" unless="PRELOAD_ALL" />
<section if="PRELOAD_ALL"> <section if="PRELOAD_ALL">
@ -53,28 +53,28 @@
<library name="weekend1" preload="false" /> <library name="weekend1" preload="false" />
</section> </section>
<library name="art" preload="false" /> <library name="art" preload="false" />
<assets path="assets/songs" library="songs" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/songs" library="songs" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/songs" library="songs" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/songs" library="songs" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/shared" library="shared" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/shared" library="shared" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/shared" library="shared" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/shared" library="shared" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/tutorial" library="tutorial" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/tutorial" library="tutorial" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/tutorial" library="tutorial" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/tutorial" library="tutorial" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week1" library="week1" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week1" library="week1" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week1" library="week1" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week1" library="week1" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week2" library="week2" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week2" library="week2" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week2" library="week2" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week2" library="week2" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week3" library="week3" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week3" library="week3" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week3" library="week3" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week3" library="week3" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week4" library="week4" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week4" library="week4" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week4" library="week4" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week4" library="week4" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week5" library="week5" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week5" library="week5" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week5" library="week5" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week5" library="week5" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week6" library="week6" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week6" library="week6" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week6" library="week6" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week6" library="week6" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/week7" library="week7" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/week7" library="week7" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/week7" library="week7" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/week7" library="week7" exclude="*.fla|*.mp3|*.wav" unless="web" />
<assets path="assets/weekend1" library="weekend1" exclude="*.fla|*.ogg" if="web" /> <assets path="assets/weekend1" library="weekend1" exclude="*.fla|*.ogg|*.wav" if="web" />
<assets path="assets/weekend1" library="weekend1" exclude="*.fla|*.mp3" unless="web" /> <assets path="assets/weekend1" library="weekend1" exclude="*.fla|*.mp3|*.wav" unless="web" />
<!-- <assets path='example_mods' rename='mods' embed='false'/> --> <!-- <assets path='example_mods' rename='mods' embed='false'/> -->
<!-- <!--
AUTOMATICALLY MOVING EXAMPLE MODS INTO THE BUILD CAUSES ISSUES AUTOMATICALLY MOVING EXAMPLE MODS INTO THE BUILD CAUSES ISSUES

View file

@ -1032,7 +1032,7 @@ class PlayState extends MusicBeatSubState
if (isInCutscene && !disableKeys) handleCutsceneKeys(elapsed); if (isInCutscene && !disableKeys) handleCutsceneKeys(elapsed);
// Moving notes into position is now done by Strumline.update(). // Moving notes into position is now done by Strumline.update().
processNotes(elapsed); if (!isInCutscene) processNotes(elapsed);
justUnpaused = false; justUnpaused = false;
} }

View file

@ -378,12 +378,12 @@ class CharacterDataParser
} }
/** /**
* The default time the character should sing for, in beats. * The default time the character should sing for, in steps.
* Values that are too low will cause the character to stop singing between notes. * Values that are too low will cause the character to stop singing between notes.
* Originally, this value was set to 1, but it was changed to 2 because that became * Values that are too high will cause the character to hold their singing pose for too long after they're done.
* too low after some other code changes. * @default `8 steps`
*/ */
static final DEFAULT_SINGTIME:Float = 2.0; static final DEFAULT_SINGTIME:Float = 8.0;
static final DEFAULT_DANCEEVERY:Int = 1; static final DEFAULT_DANCEEVERY:Int = 1;
static final DEFAULT_FLIPX:Bool = false; static final DEFAULT_FLIPX:Bool = false;

View file

@ -167,10 +167,7 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
function update_shouldAlternate():Void function update_shouldAlternate():Void
{ {
if (hasAnimation('danceLeft')) this.shouldAlternate = hasAnimation('danceLeft');
{
this.shouldAlternate = true;
}
} }
/** /**
@ -228,10 +225,11 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
/** /**
* Ensure that a given animation exists before playing it. * Ensure that a given animation exists before playing it.
* Will gracefully check for name, then name with stripped suffixes, then 'idle', then fail to play. * Will gracefully check for name, then name with stripped suffixes, then fail to play.
* @param name * @param name The animation name to attempt to correct.
* @param fallback Instead of failing to play, try to play this animation instead.
*/ */
function correctAnimationName(name:String):String function correctAnimationName(name:String, ?fallback:String):String
{ {
// If the animation exists, we're good. // If the animation exists, we're good.
if (hasAnimation(name)) return name; if (hasAnimation(name)) return name;
@ -247,14 +245,22 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
} }
else else
{ {
if (name != 'idle') if (fallback != null)
{
if (fallback == name)
{
FlxG.log.error('Bopper tried to play animation "$name" that does not exist! This is bad!');
return null;
}
else
{ {
FlxG.log.warn('Bopper tried to play animation "$name" that does not exist, fallback to idle...'); FlxG.log.warn('Bopper tried to play animation "$name" that does not exist, fallback to idle...');
return correctAnimationName('idle'); return correctAnimationName('idle');
} }
}
else else
{ {
FlxG.log.error('Bopper tried to play animation "idle" that does not exist! This is bad!'); FlxG.log.error('Bopper tried to play animation "$name" that does not exist! This is bad!');
return null; return null;
} }
} }

View file

@ -45,6 +45,9 @@ class LevelProp extends Bopper
this.visible = true; this.visible = true;
} }
// Reset animation state.
this.shouldAlternate = null;
var isAnimated:Bool = propData.animations.length > 0; var isAnimated:Bool = propData.animations.length > 0;
if (isAnimated) if (isAnimated)
{ {