some fixes

This commit is contained in:
lunarcleint
2023-06-30 23:45:07 -07:00
parent 0b1166f2cc
commit 1f3cea635d
3 changed files with 14 additions and 2 deletions
+1
View File
@@ -763,6 +763,7 @@ class Charter extends UIState {
var strID = getStrumlineID(strL);
FlxG.state.openSubState(new CharterStrumlineScreen(strID, strL, (_) -> {
strumLines.members[strID].strumLine = _;
strumLines.members[strID].updateInfo();
}));
}
@@ -39,13 +39,23 @@ class CharterStrumline extends UISprite {
}
public override function update(elapsed:Float) {
healthIcon.follow(this, ((40 * 4) - healthIcon.width) / 2, 0);
if (healthIcon != null)
healthIcon.follow(this, ((40 * 4) - healthIcon.width) / 2, 0);
button.follow(this, 0, 95);
super.update(elapsed);
}
public function updateInfo() {
// todo
members.remove(healthIcon);
healthIcon.destroy();
var icon = Character.getIconFromCharName(strumLine.characters != null ? strumLine.characters[0] : null);
healthIcon = new HealthIcon(icon);
healthIcon.scale.set(80 / 150, 80 / 150);
healthIcon.updateHitbox();
healthIcon.alpha = strumLine.visible ? 1 : 0.4;
members.push(healthIcon);
}
}
@@ -127,6 +127,7 @@ class CharterStrumlineScreen extends UISubstateWindow {
(charactersTextBox.y + 16) - (iconSprite.height/2)
);
add(iconSprite);
characterIcons.push(iconSprite);
}
}