Dazzles BG Color Easing

pr soon™️
This commit is contained in:
MiiKEmblem 2024-05-14 22:11:02 -05:00 committed by GitHub
parent 711f8f0c98
commit 6bcf4ad5a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,14 +119,20 @@ namespace HeavenStudio.Games.Loaders
new GameAction("boxColor", "Background Colors") new GameAction("boxColor", "Background Colors")
{ {
function = delegate { var e = eventCaller.currentEntity; TheDazzles.instance.ChangeBoxColor(e["ext"], e["int"], e["wall"], e["roof"]); }, function = delegate { var e = eventCaller.currentEntity; TheDazzles.instance.ChangeBoxColor(e.beat, e.length, e["extStart"], e["extEnd"], e["intStart"], e["intEnd"], e["wallStart"], e["wallEnd"], e["roofStart"], e["roofEnd"], e["ease"]); },
defaultLength = 0.5f, defaultLength = 1f,
resizable = true,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("ext", TheDazzles.defaultExteriorColor, "Exterior", "Set the color of the boxes' exterior."), new Param("extStart", TheDazzles.defaultExteriorColor, "Exterior Start", "Set the color of the boxes' exterior."),
new Param("int", TheDazzles.defaultInteriorColor, "Interior", "Set the color of the boxes' interiors."), new Param("extEnd", TheDazzles.defaultExteriorColor, "Exterior End", "Set the color of the boxes' exterior."),
new Param("wall", TheDazzles.defaultWallColor, "Walls", "Set the color of the boxes' walls."), new Param("intStart", TheDazzles.defaultInteriorColor, "Interior Start", "Set the color of the boxes' interiors."),
new Param("roof", TheDazzles.defaultRoofColor, "Roof", "Set the color of the boxes' roofs."), new Param("intEnd", TheDazzles.defaultInteriorColor, "Interior End", "Set the color of the boxes' interiors."),
new Param("wallStart", TheDazzles.defaultWallColor, "Walls Start", "Set the color of the boxes' walls."),
new Param("wallEnd", TheDazzles.defaultWallColor, "Walls End", "Set the color of the boxes' walls."),
new Param("roofStart", TheDazzles.defaultRoofColor, "Roof Start", "Set the color of the boxes' roofs."),
new Param("roofEnd", TheDazzles.defaultRoofColor, "Roof End", "Set the color of the boxes' roofs."),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.")
}, },
}, },
}, },
@ -143,45 +149,6 @@ namespace HeavenStudio.Games
using Scripts_TheDazzles; using Scripts_TheDazzles;
public class TheDazzles : Minigame public class TheDazzles : Minigame
{ {
private static Color _defaultExteriorColor;
public static Color defaultExteriorColor
{
get
{
ColorUtility.TryParseHtmlString("#9CFEF6", out _defaultExteriorColor);
return _defaultExteriorColor;
}
}
private static Color _defaultInteriorColor;
public static Color defaultInteriorColor
{
get
{
ColorUtility.TryParseHtmlString("#42FFEF", out _defaultInteriorColor);
return _defaultInteriorColor;
}
}
private static Color _defaultWallColor;
public static Color defaultWallColor
{
get
{
ColorUtility.TryParseHtmlString("#00DEC5", out _defaultWallColor);
return _defaultWallColor;
}
}
private static Color _defaultRoofColor;
public static Color defaultRoofColor
{
get
{
ColorUtility.TryParseHtmlString("#00BDAC", out _defaultRoofColor);
return _defaultRoofColor;
}
}
public struct PosesToPerform : IComparable<PosesToPerform> public struct PosesToPerform : IComparable<PosesToPerform>
{ {
@ -274,6 +241,17 @@ namespace HeavenStudio.Games
Megamix = 1, Megamix = 1,
Random = 2, Random = 2,
} }
public static Color defaultExteriorColor = new(156/255f, 254/255f, 246/255f);
public static Color defaultInteriorColor = new(66/255f, 255/255f, 239/255f);
public static Color defaultWallColor = new(0f, 222/255f, 197/255f);
public static Color defaultRoofColor = new(0f, 189/255f, 172/255f);
private ColorEase extColorEase = new(defaultExteriorColor);
private ColorEase intColorEase = new(defaultInteriorColor);
private ColorEase wallColorEase = new(defaultWallColor);
private ColorEase roofColorEase = new(defaultRoofColor);
public static TheDazzles instance; public static TheDazzles instance;
[Header("Variables")] [Header("Variables")]
@ -337,6 +315,8 @@ namespace HeavenStudio.Games
void Update() void Update()
{ {
BoxColorUpdate();
if (conductor.isPlaying && !conductor.isPaused) if (conductor.isPlaying && !conductor.isPaused)
{ {
if (queuedPoses.Count > 0) if (queuedPoses.Count > 0)
@ -733,12 +713,20 @@ namespace HeavenStudio.Games
void Nothing(PlayerActionEvent caller) { } void Nothing(PlayerActionEvent caller) { }
public void ChangeBoxColor(Color exterior, Color interior, Color walls, Color roof) private void BoxColorUpdate()
{ {
interiorMat.SetColor("_ColorAlpha", roof); interiorMat.SetColor("_ColorAlpha", roofColorEase.GetColor());
interiorMat.SetColor("_ColorBravo", interior); interiorMat.SetColor("_ColorBravo", intColorEase.GetColor());
interiorMat.SetColor("_ColorDelta", walls); interiorMat.SetColor("_ColorDelta", wallColorEase.GetColor());
exteriorMat.SetColor("_AddColor", exterior); exteriorMat.SetColor("_AddColor", extColorEase.GetColor());
}
public void ChangeBoxColor(double beat, float length, Color exteriorStart, Color exteriorEnd, Color interiorStart, Color interiorEnd, Color wallsStart, Color wallsEnd, Color roofStart, Color roofEnd, int ease)
{
extColorEase = new ColorEase(beat, length, exteriorStart, exteriorEnd, ease);
intColorEase = new ColorEase(beat, length, interiorStart, interiorEnd, ease);
wallColorEase = new ColorEase(beat, length, wallsStart, wallsEnd, ease);
roofColorEase = new ColorEase(beat, length, roofStart, roofEnd, ease);
} }
private void PersistColor(double beat) private void PersistColor(double beat)
@ -748,7 +736,7 @@ namespace HeavenStudio.Games
{ {
allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case
var lastEvent = allEventsBeforeBeat[^1]; var lastEvent = allEventsBeforeBeat[^1];
ChangeBoxColor(lastEvent["ext"], lastEvent["int"], lastEvent["wall"], lastEvent["roof"]); ChangeBoxColor(lastEvent.beat, lastEvent.length, lastEvent["extStart"], lastEvent["extEnd"], lastEvent["intStart"], lastEvent["intEnd"], lastEvent["wallStart"], lastEvent["wallEnd"], lastEvent["roofStart"], lastEvent["roofEnd"], lastEvent["ease"]);
} }
} }