This commit is contained in:
KrispyDotlessI 2022-09-04 13:16:58 +08:00
commit 4faedfdc98
104 changed files with 12358 additions and 1090 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 06e6e979954795a49824e8435a5298fc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -67,7 +67,7 @@ namespace HeavenStudio
return JsonConvert.DeserializeObject<Entity>(JsonConvert.SerializeObject(this));
}
public object this[string propertyName]
public dynamic this[string propertyName]
{
get
{

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 457977a51a5961a40b33da038cd88e9d
guid: 9ec74fe21af663f4d9645852eb4cfb88
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -0,0 +1,391 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using HeavenStudio.Util;
namespace HeavenStudio
{
[Serializable]
public class DynamicBeatmap
{
public static int CurrentRiqVersion = 0;
public float bpm;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue(100)] public int musicVolume; // In percent (1-100)
public Dictionary<string, object> properties =
new Dictionary<string, object>() {
// software version (MajorMinorPatch, revision)
{"productversion", 000},
{"productsubversion", 0},
// file format version
{"riqversion", CurrentRiqVersion},
// mapper set properties? (future: use this to flash the button)
{"propertiesmodified", false},
////// CATEGORY 1: SONG INFO
// general chart info
{"remixtitle", "New Remix"}, // chart name
{"remixauthor", "Your Name"}, // charter's name
{"remixdesc", "Remix Description"}, // chart description
{"remixlevel", 1}, // chart difficulty (maybe offer a suggestion but still have the mapper determine it)
{"remixtempo", 120f}, // avg. chart tempo
{"remixtags", ""}, // chart tags
{"icontype", 0}, // chart icon (presets, custom - future)
{"iconurl", ""}, // custom icon location (future)
// chart song info
{"idolgenre", "Song Genre"}, // song genre
{"idolsong", "Song Name"}, // song name
{"idolcredit", "Artist"}, // song artist
////// CATEGORY 2: PROLOGUE AND EPILOGUE
// chart prologue
{"prologuetype", 0}, // prologue card animation (future)
{"prologuecaption", "Remix"}, // prologue card sub-title (future)
// chart results screen messages
{"resultcaption", "Rhythm League Notes"}, // result screen header
{"resultcommon_hi", "Good rhythm."}, // generic "Superb" message (one-liner, or second line for single-type)
{"resultcommon_ok", "Eh. Passable."}, // generic "OK" message (one-liner, or second line for single-type)
{"resultcommon_ng", "Try harder next time."}, // generic "Try Again" message (one-liner, or second line for single-type)
// the following are shown / hidden in-editor depending on the tags of the games used
{"resultnormal_hi", "You show strong fundamentals."}, // "Superb" message for normal games (two-liner)
{"resultnormal_ng", "Work on your fundamentals."}, // "Try Again" message for normal games (two-liner)
{"resultkeep_hi", "You kept the beat well."}, // "Superb" message for keep-the-beat games (two-liner)
{"resultkeep_ng", "You had trouble keeping the beat."}, // "Try Again" message for keep-the-beat games (two-liner)
{"resultaim_hi", "You had great aim."}, // "Superb" message for aim games (two-liner)
{"resultaim_ng", "Your aim was a little shaky."}, // "Try Again" message for aim games (two-liner)
{"resultrepeat_hi", "You followed the example well."}, // "Superb" message for call-and-response games (two-liner)
{"resultrepeat_ng", "Next time, follow the example better."}, // "Try Again" message for call-and-response games (two-liner)
};
public List<DynamicEntity> entities = new List<DynamicEntity>();
public List<TempoChange> tempoChanges = new List<TempoChange>();
public List<VolumeChange> volumeChanges = new List<VolumeChange>();
public List<ChartSection> beatmapSections = new List<ChartSection>();
public float firstBeatOffset;
[Serializable]
public class DynamicEntity : ICloneable
{
public float beat;
public int track;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float length;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float swing;
public Dictionary<string, dynamic> DynamicData = new Dictionary<string, dynamic>();
public string datamodel;
[JsonIgnore] public Editor.Track.TimelineEventObj eventObj;
public object Clone()
{
return this.MemberwiseClone();
}
public DynamicEntity DeepCopy()
{
DynamicEntity copy = (DynamicEntity)this.MemberwiseClone();
copy.DynamicData = new Dictionary<string, dynamic>(this.DynamicData);
return copy;
}
public dynamic this[string propertyName]
{
get
{
switch (propertyName)
{
case "beat":
return beat;
case "track":
return track;
case "length":
return length;
case "swing":
return swing;
case "datamodel":
return datamodel;
default:
if (DynamicData.ContainsKey(propertyName))
return DynamicData[propertyName];
else
{
Minigames.Minigame game = EventCaller.instance.GetMinigame(datamodel.Split(0));
Minigames.Param param = EventCaller.instance.GetGameParam(game, datamodel.Split(1), propertyName);
return param.parameter;
}
}
}
set
{
switch (propertyName)
{
case "beat":
case "track":
case "length":
case "swing":
case "datamodel":
UnityEngine.Debug.LogWarning($"Property name {propertyName} is reserved and cannot be set.");
break;
default:
if (DynamicData.ContainsKey(propertyName))
DynamicData[propertyName] = value;
else
UnityEngine.Debug.LogError($"This entity does not have a property named {propertyName}! Attempted to insert value of type {value.GetType()}");
break;
}
}
}
public void CreateProperty(string name, dynamic defaultValue)
{
if (!DynamicData.ContainsKey(name))
DynamicData.Add(name, defaultValue);
}
}
[Serializable]
public class TempoChange : ICloneable
{
public float beat;
public float length;
public float tempo;
public object Clone()
{
return this.MemberwiseClone();
}
}
[Serializable]
public class VolumeChange : ICloneable
{
public float beat;
public float length;
public float volume;
public object Clone()
{
return this.MemberwiseClone();
}
}
[Serializable]
public class ChartSection : ICloneable
{
public float beat;
public bool startPerfect;
public string sectionName;
public bool isCheckpoint; // really don't think we need this but who knows
public object Clone()
{
return this.MemberwiseClone();
}
}
public dynamic this[string propertyName]
{
get
{
return properties[propertyName] ?? null;
}
set
{
if (properties.ContainsKey(propertyName))
{
properties[propertyName] = value;
}
else
{
UnityEngine.Debug.LogError($"This beatmap does not have a property named {propertyName}! Attempted to insert value of type {value.GetType()}");
}
}
}
/// <summary>
/// converts from the old "rhmania" / "tengoku" format to the new "riq" format
/// </summary>
/// <param name="beatmap">a deserialized .rhmania or .tengoku beatmap</param>
/// <returns>a .riq beatmap</returns>
public static DynamicBeatmap BeatmapConverter(Beatmap beatmap)
{
DynamicBeatmap dynamicBeatmap = new DynamicBeatmap();
dynamicBeatmap.bpm = beatmap.bpm;
dynamicBeatmap.musicVolume = beatmap.musicVolume;
dynamicBeatmap.firstBeatOffset = beatmap.firstBeatOffset;
Minigames.Minigame game;
Minigames.GameAction action;
System.Type type, pType;
foreach (var e in beatmap.entities)
{
game = EventCaller.instance.GetMinigame(e.datamodel.Split(0));
action = EventCaller.instance.GetGameAction(game, e.datamodel.Split(1));
// Debug.Log($"{game.name} {action.displayName} @ beat {e.beat}");
Dictionary<string, dynamic> dynamicData = new Dictionary<string, dynamic>();
//check each param of the action
if (action.parameters != null)
{
foreach (var param in action.parameters)
{
type = param.parameter.GetType();
pType = e[param.propertyName].GetType();
// Debug.Log($"adding parameter {param.propertyName} of type {type}");
if (!dynamicData.ContainsKey(param.propertyName))
{
if (pType == type)
{
dynamicData.Add(param.propertyName, e[param.propertyName]);
}
else
{
if (type == typeof(EntityTypes.Integer))
dynamicData.Add(param.propertyName, (int) e[param.propertyName]);
else if (type == typeof(EntityTypes.Float))
dynamicData.Add(param.propertyName, (float) e[param.propertyName]);
else if (type.IsEnum && param.propertyName != "ease")
dynamicData.Add(param.propertyName, (int) e[param.propertyName]);
else if (pType == typeof(Newtonsoft.Json.Linq.JObject))
dynamicData.Add(param.propertyName, e[param.propertyName].ToObject(type));
else
dynamicData.Add(param.propertyName, Convert.ChangeType(e[param.propertyName], type));
}
}
else
{
Debug.LogWarning($"Property {param.propertyName} already exists in the entity's dynamic data! Skipping...");
}
}
}
dynamicBeatmap.entities.Add(new DynamicEntity()
{
beat = e.beat,
track = e.track,
length = e.length,
swing = e.swing,
datamodel = e.datamodel,
DynamicData = dynamicData
});
}
foreach (var tempoChange in beatmap.tempoChanges)
{
dynamicBeatmap.tempoChanges.Add(new TempoChange()
{
beat = tempoChange.beat,
length = tempoChange.length,
tempo = tempoChange.tempo
});
}
foreach (var volumeChange in beatmap.volumeChanges)
{
dynamicBeatmap.volumeChanges.Add(new VolumeChange()
{
beat = volumeChange.beat,
length = volumeChange.length,
volume = volumeChange.volume
});
}
return dynamicBeatmap;
}
/// <summary>
/// FUTURE: converts from a karateka mania chart ("bor") to the "riq" format
/// </summary>
/// <param name="bor">a rawtext .bor chart</param>
/// <returns>a .riq beatmap</returns>
/// <remarks>not implemented yet</remarks>
public static DynamicBeatmap KManiaBorConverter(String bor)
{
return null;
}
/// <summary>
/// updates an "riq" beatmap
/// </summary>
/// <param name="beatmap">old beatmap</param>
/// <param name="version">version of old beatmap</param>
/// <returns>updated beatmap</returns>
/// <remarks>not implemented yet</remarks>
public static DynamicBeatmap BeatmapUpdater(DynamicBeatmap beatmap, int version)
{
return beatmap;
}
/// <summary>
/// processes an riq beatmap after it is loaded
/// </summary>
public void PostProcess()
{
DynamicBeatmap beatmapModel = new DynamicBeatmap();
Minigames.Minigame game;
Minigames.GameAction action;
System.Type type, pType;
foreach (var e in entities)
{
game = EventCaller.instance.GetMinigame(e.datamodel.Split(0));
action = EventCaller.instance.GetGameAction(game, e.datamodel.Split(1));
Dictionary<string, dynamic> dynamicData = new Dictionary<string, dynamic>();
//check each param of the action
if (action.parameters != null)
{
foreach (var param in action.parameters)
{
if (!dynamicData.ContainsKey(param.propertyName))
{
type = param.parameter.GetType();
pType = e[param.propertyName].GetType();
if (pType == type)
{
dynamicData.Add(param.propertyName, e[param.propertyName]);
}
else
{
if (type == typeof(EntityTypes.Integer))
dynamicData.Add(param.propertyName, (int)e[param.propertyName]);
else if (type == typeof(EntityTypes.Float))
dynamicData.Add(param.propertyName, (float)e[param.propertyName]);
else if (type == typeof(EasingFunction.Ease) && pType == typeof(string))
dynamicData.Add(param.propertyName, Enum.Parse(typeof(EasingFunction.Ease), (string)e[param.propertyName]));
else if (type.IsEnum)
dynamicData.Add(param.propertyName, (int)e[param.propertyName]);
else if (pType == typeof(Newtonsoft.Json.Linq.JObject))
dynamicData.Add(param.propertyName, e[param.propertyName].ToObject(type));
else
dynamicData.Add(param.propertyName, Convert.ChangeType(e[param.propertyName], type));
}
}
else
{
Debug.LogWarning($"Property {param.propertyName} already exists in the entity's dynamic data! Skipping...");
}
}
}
e.DynamicData = dynamicData;
}
//go thru each property of the model beatmap and add any missing keyvalue pair
foreach (var prop in beatmapModel.properties)
{
if (!properties.ContainsKey(prop.Key))
{
properties.Add(prop.Key, prop.Value);
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ca2149f692fc3d84ba6526d33c132822
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -245,9 +245,17 @@ namespace HeavenStudio
return tempoChanges;
}
private List<DynamicBeatmap.TempoChange> GetSortedTempoChanges(DynamicBeatmap chart)
{
//iterate over all tempo changes, adding to counter
List<DynamicBeatmap.TempoChange> tempoChanges = chart.tempoChanges;
tempoChanges.Sort((x, y) => x.beat.CompareTo(y.beat)); //sorts all tempo changes by ascending time (GameManager already does this but juste en cas...)
return tempoChanges;
}
public float GetSongPosFromBeat(float beat)
{
Beatmap chart = GameManager.instance.Beatmap;
var chart = GameManager.instance.Beatmap;
SetBpm(chart.bpm);
//initial counter
@ -257,7 +265,7 @@ namespace HeavenStudio
float lastTempoChangeBeat = 0f;
//iterate over all tempo changes, adding to counter
List<Beatmap.TempoChange> tempoChanges = GetSortedTempoChanges(chart);
var tempoChanges = GetSortedTempoChanges(chart);
foreach (var t in tempoChanges)
{
if (t.beat > beat)
@ -297,12 +305,12 @@ namespace HeavenStudio
public float GetBeatFromSongPos(float seconds)
{
// Debug.Log("Getting beat of seconds " + seconds);
Beatmap chart = GameManager.instance.Beatmap;
var chart = GameManager.instance.Beatmap;
float lastTempoChangeBeat = 0f;
float lastBpm = chart.bpm;
float counterSeconds = -firstBeatOffset;
List<Beatmap.TempoChange> tempoChanges = GetSortedTempoChanges(chart);
var tempoChanges = GetSortedTempoChanges(chart);
foreach (var t in tempoChanges)
{
float beatToNext = t.beat - lastTempoChangeBeat;

View File

@ -10,5 +10,11 @@ namespace HeavenStudio
{
return s.Split('/')[index];
}
public static string GetExtension(this string s)
{
string[] split = s.Split('.');
return split[split.Length - 1];
}
}
}

View File

@ -71,7 +71,6 @@ namespace HeavenStudio
SetText(currEvent, $"CurrentEvent: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - minus].datamodel}");
SetText(eventLength, $"Event Length: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - minus].length}");
SetText(eventType, $"Event Type: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - minus].type}");
}
}

View File

@ -9,16 +9,14 @@ namespace HeavenStudio
public class EventCaller : MonoBehaviour
{
public Transform GamesHolder;
public Beatmap.Entity currentEntity = new Beatmap.Entity();
public DynamicBeatmap.DynamicEntity currentEntity = new DynamicBeatmap.DynamicEntity();
public string currentSwitchGame;
public delegate void EventCallback();
public static EventCaller instance { get; private set; }
public List<Minigames.Minigame> minigames = new List<Minigames.Minigame>()
{
};
public List<Minigames.Minigame> minigames = new List<Minigames.Minigame>();
public Minigames.Minigame GetMinigame(string gameName)
{
@ -30,11 +28,16 @@ namespace HeavenStudio
return game.actions.Find(c => c.actionName == action);
}
public Minigames.Param GetGameParam(Minigames.Minigame game, string action, string param)
{
return GetGameAction(game, action).parameters.Find(c => c.propertyName == param);
}
public void Init()
{
instance = this;
currentEntity = new Beatmap.Entity();
currentEntity = new DynamicBeatmap.DynamicEntity();
Minigames.Init(this);
@ -60,7 +63,7 @@ namespace HeavenStudio
}
public void CallEvent(Beatmap.Entity entity, bool gameActive)
public void CallEvent(DynamicBeatmap.DynamicEntity entity, bool gameActive)
{
string[] details = entity.datamodel.Split('/');
Minigames.Minigame game = minigames.Find(c => c.name == details[0]);
@ -86,10 +89,10 @@ namespace HeavenStudio
}
}
public static List<Beatmap.Entity> GetAllInGameManagerList(string gameName, string[] include)
public static List<DynamicBeatmap.DynamicEntity> GetAllInGameManagerList(string gameName, string[] include)
{
List<Beatmap.Entity> temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<Beatmap.Entity> temp2 = new List<Beatmap.Entity>();
List<DynamicBeatmap.DynamicEntity> temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<DynamicBeatmap.DynamicEntity> temp2 = new List<DynamicBeatmap.DynamicEntity>();
for (int i = 0; i < temp1.Count; i++)
{
if (include.Any(temp1[i].datamodel.Split('/')[1].Contains))
@ -100,10 +103,10 @@ namespace HeavenStudio
return temp2;
}
public static List<Beatmap.Entity> GetAllInGameManagerListExclude(string gameName, string[] exclude)
public static List<DynamicBeatmap.DynamicEntity> GetAllInGameManagerListExclude(string gameName, string[] exclude)
{
List<Beatmap.Entity> temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<Beatmap.Entity> temp2 = new List<Beatmap.Entity>();
List<DynamicBeatmap.DynamicEntity> temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<DynamicBeatmap.DynamicEntity> temp2 = new List<DynamicBeatmap.DynamicEntity>();
for (int i = 0; i < temp1.Count; i++)
{
if (!exclude.Any(temp1[i].datamodel.Split('/')[1].Contains))
@ -114,18 +117,18 @@ namespace HeavenStudio
return temp2;
}
public static List<Beatmap.Entity> GetAllPlayerEntities(string gameName)
public static List<DynamicBeatmap.DynamicEntity> GetAllPlayerEntities(string gameName)
{
return GameManager.instance.playerEntities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
}
public static List<Beatmap.Entity> GetAllPlayerEntitiesExcept(string gameName)
public static List<DynamicBeatmap.DynamicEntity> GetAllPlayerEntitiesExcept(string gameName)
{
return GameManager.instance.playerEntities.FindAll(c => c.datamodel.Split('/')[0] != gameName);
}
// elaborate as fuck, boy
public static List<Beatmap.Entity> GetAllPlayerEntitiesExceptBeforeBeat(string gameName, float beat)
public static List<DynamicBeatmap.DynamicEntity> GetAllPlayerEntitiesExceptBeforeBeat(string gameName, float beat)
{
return GameManager.instance.playerEntities.FindAll(c => c.datamodel.Split('/')[0] != gameName && c.beat < beat);
}

View File

@ -12,10 +12,10 @@ namespace HeavenStudio
public static GameCamera instance { get; private set; }
public new Camera camera;
private List<Beatmap.Entity> positionEvents = new List<Beatmap.Entity>();
private List<Beatmap.Entity> rotationEvents = new List<Beatmap.Entity>();
private List<Beatmap.Entity> scaleEvents = new List<Beatmap.Entity>();
private List<Beatmap.Entity> shakeEvents = new List<Beatmap.Entity>();
private List<DynamicBeatmap.DynamicEntity> positionEvents = new List<DynamicBeatmap.DynamicEntity>();
private List<DynamicBeatmap.DynamicEntity> rotationEvents = new List<DynamicBeatmap.DynamicEntity>();
private List<DynamicBeatmap.DynamicEntity> scaleEvents = new List<DynamicBeatmap.DynamicEntity>();
private List<DynamicBeatmap.DynamicEntity> shakeEvents = new List<DynamicBeatmap.DynamicEntity>();
/**
default cam position, for quick-resetting
@ -125,15 +125,15 @@ namespace HeavenStudio
float prog = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (prog >= 0f)
{
EasingFunction.Function func = EasingFunction.GetEasingFunction(e.ease);
float dx = func(positionLast.x, e.valA, Mathf.Min(prog, 1f));
float dy = func(positionLast.y, e.valB, Mathf.Min(prog, 1f));
float dz = func(positionLast.z, -e.valC, Mathf.Min(prog, 1f));
EasingFunction.Function func = EasingFunction.GetEasingFunction((EasingFunction.Ease) e["ease"]);
float dx = func(positionLast.x, e["valA"], Mathf.Min(prog, 1f));
float dy = func(positionLast.y, e["valB"], Mathf.Min(prog, 1f));
float dz = func(positionLast.z, -e["valC"], Mathf.Min(prog, 1f));
position = new Vector3(dx, dy, dz);
}
if (prog > 1f)
{
positionLast = new Vector3(e.valA, e.valB, -e.valC);
positionLast = new Vector3(e["valA"], e["valB"], -e["valC"]);
}
}
}
@ -145,16 +145,16 @@ namespace HeavenStudio
float prog = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
if (prog >= 0f)
{
EasingFunction.Function func = EasingFunction.GetEasingFunction(e.ease);
float dx = func(rotEluerLast.x, e.valA, Mathf.Min(prog, 1f));
float dy = func(rotEluerLast.y, e.valB, Mathf.Min(prog, 1f));
float dz = func(-rotEluerLast.z, e.valC, Mathf.Min(prog, 1f));
EasingFunction.Function func = EasingFunction.GetEasingFunction((EasingFunction.Ease) e["ease"]);
float dx = func(rotEluerLast.x, e["valA"], Mathf.Min(prog, 1f));
float dy = func(rotEluerLast.y, e["valB"], Mathf.Min(prog, 1f));
float dz = func(-rotEluerLast.z, e["valC"], Mathf.Min(prog, 1f));
rotEluer = new Vector3(dx, dy, dz); //I'm stupid and forgot to negate the rotation gfd 😢
}
if (prog > 1f)
{
rotEluerLast = new Vector3(e.valA, e.valB, -e.valC);
rotEluerLast = new Vector3(e["valA"], e["valB"], -e["valC"]);
}
}
}
@ -167,7 +167,7 @@ namespace HeavenStudio
if (prog >= 0f)
{
float fac = Mathf.Cos(Time.time * 80f) * 0.5f;
shakeResult = new Vector3(fac * e.valA, fac * e.valB);
shakeResult = new Vector3(fac * e["valA"], fac * e["valB"]);
}
if (prog > 1f)
{

View File

@ -13,8 +13,8 @@ namespace HeavenStudio
public class GameManager : MonoBehaviour
{
[Header("Lists")]
public Beatmap Beatmap = new Beatmap();
[HideInInspector] public List<Beatmap.Entity> playerEntities = new List<Beatmap.Entity>();
public DynamicBeatmap Beatmap = new DynamicBeatmap();
[HideInInspector] public List<DynamicBeatmap.DynamicEntity> playerEntities = new List<DynamicBeatmap.DynamicEntity>();
private List<GameObject> preloadedGames = new List<GameObject>();
public List<GameObject> SoundObjects = new List<GameObject>();
@ -75,7 +75,7 @@ namespace HeavenStudio
if (txt != null)
{
string json = txt.text;
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
Beatmap = JsonConvert.DeserializeObject<DynamicBeatmap>(json);
}
else
{
@ -116,25 +116,39 @@ namespace HeavenStudio
public void NewRemix()
{
Beatmap = new Beatmap();
Beatmap = new DynamicBeatmap();
Beatmap.bpm = 120f;
Beatmap.musicVolume = 100;
Beatmap.firstBeatOffset = 0f;
Conductor.instance.musicSource.clip = null;
}
public void LoadRemix(string json = "")
public void LoadRemix(string json = "", string type = "riq", int version = 0)
{
SortEventsList();
if (json != "")
{
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
switch (type)
{
case "tengoku":
case "rhmania":
Beatmap toConvert = JsonConvert.DeserializeObject<Beatmap>(json);
Beatmap = DynamicBeatmap.BeatmapConverter(toConvert);
break;
case "riq":
Beatmap = JsonConvert.DeserializeObject<DynamicBeatmap>(json);
Beatmap.PostProcess();
break;
default:
NewRemix();
break;
}
}
else
{
NewRemix();
}
SortEventsList();
Conductor.instance.SetBpm(Beatmap.bpm);
Conductor.instance.SetVolume(Beatmap.musicVolume);
Conductor.instance.firstBeatOffset = Beatmap.firstBeatOffset;
@ -213,7 +227,7 @@ namespace HeavenStudio
// Debug.Log("Checking Tempo Change at " + tempoChanges[currentTempoEvent] + ", current beat " + Conductor.instance.songPositionInBeats);
if (Conductor.instance.songPositionInBeats >= tempoChanges[currentTempoEvent])
{
// Debug.Log("Tempo Change at " + Conductor.instance.songPositionInBeats + " of bpm " + Beatmap.tempoChanges[currentTempoEvent].tempo);
// Debug.Log("Tempo Change at " + Conductor.instance.songPositionInBeats + " of bpm " + DynamicBeatmap.tempoChanges[currentTempoEvent].tempo);
Conductor.instance.SetBpm(Beatmap.tempoChanges[currentTempoEvent].tempo);
Conductor.instance.timeSinceLastTempoChange = Time.time;
currentTempoEvent++;
@ -323,6 +337,7 @@ namespace HeavenStudio
{
Beatmap.entities.Sort((x, y) => x.beat.CompareTo(y.beat));
Beatmap.tempoChanges.Sort((x, y) => x.beat.CompareTo(y.beat));
Beatmap.volumeChanges.Sort((x, y) => x.beat.CompareTo(y.beat));
}
public void SetCurrentEventToClosest(float beat)

View File

@ -16,26 +16,45 @@ namespace HeavenStudio.Games.Loaders
{
return new Minigame("airRally", "Air Rally", "008c97", false, false, new List<GameAction>()
{
new GameAction("set distance", delegate { AirRally.instance.SetDistance(e.currentEntity.type); }, .5f, false, new List<Param>()
new GameAction("set distance", "Set Distance")
{
new Param("type", AirRally.DistanceSound.close, "Type", "How far is Forthington?")
}),
function = delegate { AirRally.instance.SetDistance(e.currentEntity["type"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("type", AirRally.DistanceSound.close, "Type", "How far is Forthington?")
}
},
//new GameAction("start rally", delegate { AirRally.instance.StartRally(true); }, .5f, false),
new GameAction("rally", delegate { AirRally.instance.Rally(e.currentEntity.beat, e.currentEntity.toggle, e.currentEntity.length); }, 2f, true, new List<Param>()
{
new Param("toggle", false, "Silent", "Make Forthington Silent"),
}),
new GameAction("ba bum bum bum", delegate { AirRally.instance.BaBumBumBum(e.currentEntity.beat, e.currentEntity.toggle, e.currentEntity.type); }, 7f, false, new List<Param>()
{
new Param("toggle", false, "Count", "Make Forthington Count"),
new Param("type", AirRally.DistanceSound.close, "Type", "How far is Forthington?")
}),
new GameAction("forthington voice lines", delegate { AirRally.instance.ForthVoice(e.currentEntity.type, e.currentEntity.type2); }, 1f, false, new List<Param>()
{
new Param("type", AirRally.CountSound.one, "Type", "The number Forthington will say"),
new Param("type2", AirRally.DistanceSound.close, "Type", "How far is Forthington?")
}),
new GameAction("rally", "Rally")
{
function = delegate { AirRally.instance.Rally(e.currentEntity.beat, e.currentEntity["toggle"], e.currentEntity.length); },
defaultLength = 2f,
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", false, "Silent", "Make Forthington Silent"),
}
},
new GameAction("ba bum bum bum", "Ba Bum Bum Bum")
{
function = delegate { AirRally.instance.BaBumBumBum(e.currentEntity.beat, e.currentEntity["toggle"], e.currentEntity["type"]); },
defaultLength = 7f,
parameters = new List<Param>()
{
new Param("toggle", false, "Count", "Make Forthington Count"),
new Param("type", AirRally.DistanceSound.close, "Type", "How far is Forthington?")
}
},
new GameAction("forthington voice lines", "Forthington Voice Lines")
{
function = delegate { AirRally.instance.ForthVoice(e.currentEntity["type"], e.currentEntity["type2"]); },
parameters = new List<Param>()
{
new Param("type", AirRally.CountSound.one, "Type", "The number Forthington will say"),
new Param("type2", AirRally.DistanceSound.close, "Type", "How far is Forthington?")
}
}
});
}
}

View File

@ -13,8 +13,16 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("blueBear", "Blue Bear", "B4E6F6", false, false, new List<GameAction>()
{
new GameAction("donut", delegate { BlueBear.instance.SpawnTreat(eventCaller.currentEntity.beat, false); }, 3, false),
new GameAction("cake", delegate { BlueBear.instance.SpawnTreat(eventCaller.currentEntity.beat, true); }, 4, false),
new GameAction("donut", "Donut")
{
function = delegate { BlueBear.instance.SpawnTreat(eventCaller.currentEntity.beat, false); },
defaultLength = 3,
},
new GameAction("cake", "Cake")
{
function = delegate { BlueBear.instance.SpawnTreat(eventCaller.currentEntity.beat, true); },
defaultLength = 4,
},
});
}
}

View File

@ -15,11 +15,19 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("builtToScaleDS", "Built To Scale (DS)", "00BB00", true, false, new List<GameAction>()
{
new GameAction("spawn blocks", delegate { }, 1f, true),
new GameAction("play piano", delegate { BuiltToScaleDS.instance.PlayPiano(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, eventCaller.currentEntity.type); }, 1f, true, new List<Param>()
new GameAction("spawn blocks", "Spawn Blocks")
{
new Param("type", new EntityTypes.Integer(-24, 24, 0), "Semitones", "The number of semitones up or down this note should be pitched")
} ),
resizable = true
},
new GameAction("play piano", "Play Note")
{
function = delegate { BuiltToScaleDS.instance.PlayPiano(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, eventCaller.currentEntity["type"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("type", new EntityTypes.Integer(-24, 24, 0), "Semitones", "The number of semitones up or down this note should be pitched")
}
},
});
}
}
@ -79,7 +87,7 @@ namespace HeavenStudio.Games
elevatorAnim.Play("MakeRod", 0, 1f);
}
List<Beatmap.Entity> spawnedBlockEvents = new List<Beatmap.Entity>();
List<DynamicBeatmap.DynamicEntity> spawnedBlockEvents = new List<DynamicBeatmap.DynamicEntity>();
void Update()
{
if (!Conductor.instance.isPlaying && !Conductor.instance.isPaused)

View File

@ -12,18 +12,38 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", false, false, new List<GameAction>()
{
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1, true),
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); } ),
new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(eventCaller.currentEntity.toggle ? 3 : 0); }, parameters: new List<Param>()
new GameAction("clap", "Clap")
{
new Param("toggle", false, "Alt", "Whether or not the alternate version should be played")
}),
new GameAction("change lion count", delegate { ClappyTrio.instance.ChangeLionCount((int)eventCaller.currentEntity.valA); }, 0.5f, false, new List<Param>()
function = delegate { ClappyTrio.instance.Clap(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); },
resizable = true
},
new GameAction("bop", "Bop")
{
new Param("valA", new EntityTypes.Integer(3, 8, 3), "Lion Count", "The amount of lions")
}),
function = delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); }
},
new GameAction("prepare", "Prepare Stance")
{
function = delegate { ClappyTrio.instance.Prepare(eventCaller.currentEntity["toggle"] ? 3 : 0); },
parameters = new List<Param>()
{
new Param("toggle", false, "Alt", "Whether or not the alternate version should be played")
}
},
new GameAction("change lion count", "Change Lion Count")
{
function = delegate { ClappyTrio.instance.ChangeLionCount((int)eventCaller.currentEntity["valA"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("valA", new EntityTypes.Integer(3, 8, 3), "Lion Count", "The amount of lions")
}
},
// This is still here for backwards-compatibility but is hidden in the editor
new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); }, hidden: true),
new GameAction("prepare_alt", "")
{
function = delegate { ClappyTrio.instance.Prepare(3); },
hidden = true
},
});
}
}
@ -59,7 +79,7 @@ namespace HeavenStudio.Games
}
public override void OnGameSwitch(float beat)
{
Beatmap.Entity changeLion = GameManager.instance.Beatmap.entities.FindLast(c => c.datamodel == "clappyTrio/change lion count" && c.beat <= beat);
DynamicBeatmap.DynamicEntity changeLion = GameManager.instance.Beatmap.entities.FindLast(c => c.datamodel == "clappyTrio/change lion count" && c.beat <= beat);
if(changeLion != null)
{
EventCaller.instance.CallEvent(changeLion, true);

View File

@ -14,40 +14,63 @@ namespace HeavenStudio.Games.Loaders
{
return new Minigame("coinToss", "Coin Toss", "B4E6F6", false, false, new List<GameAction>()
{
new GameAction("toss", delegate { CoinToss.instance.TossCoin(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle); }, 7, false, parameters: new List<Param>()
new GameAction("toss", "Toss Coin")
{
new Param("toggle", false, "Audience Reaction", "Enable Audience Reaction"),
}),
function = delegate { CoinToss.instance.TossCoin(eventCaller.currentEntity.beat, eventCaller.currentEntity["toggle"]); },
defaultLength = 7,
parameters = new List<Param>()
{
new Param("toggle", false, "Audience Reaction", "Enable Audience Reaction"),
}
},
new GameAction("set background color", "Set Background Color")
{
function = delegate { var e = eventCaller.currentEntity; CoinToss.instance.ChangeBackgroundColor(e["colorA"], 0f); CoinToss.instance.ChangeBackgroundColor(e["colorB"], 0f, true); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("colorA", CoinToss.defaultBgColor, "Background Color", "The background color to change to"),
new Param("colorB", CoinToss.defaultFgColor, "Foreground Color", "The foreground color to change to")
}
},
new GameAction("fade background color", "Fade Background Color")
{
function = delegate { var e = eventCaller.currentEntity; CoinToss.instance.FadeBackgroundColor(e["colorA"], e["colorB"], e.length); CoinToss.instance.FadeBackgroundColor(e["colorC"], e["colorD"], e.length, true); },
resizable = true,
parameters = new List<Param>()
{
new Param("colorA", Color.white, "BG Start Color", "The starting color in the fade"),
new Param("colorB", CoinToss.defaultBgColor, "BG End Color", "The ending color in the fade"),
new Param("colorC", Color.white, "FG Start Color", "The starting color in the fade"),
new Param("colorD", CoinToss.defaultFgColor, "FG End Color", "The ending color in the fade")
}
},
new GameAction("set background color", delegate { var e = eventCaller.currentEntity; CoinToss.instance.ChangeBackgroundColor(e.colorA, 0f); CoinToss.instance.ChangeBackgroundColor(e.colorB, 0f, true); }, 0.5f, false, new List<Param>()
{
new Param("colorA", CoinToss.defaultBgColor, "Background Color", "The background color to change to"),
new Param("colorB", CoinToss.defaultFgColor, "Foreground Color", "The foreground color to change to")
} ),
new GameAction("fade background color", delegate { var e = eventCaller.currentEntity; CoinToss.instance.FadeBackgroundColor(e.colorA, e.colorB, e.length); CoinToss.instance.FadeBackgroundColor(e.colorC, e.colorD, e.length, true); }, 1f, true, new List<Param>()
{
new Param("colorA", Color.white, "BG Start Color", "The starting color in the fade"),
new Param("colorB", CoinToss.defaultBgColor, "BG End Color", "The ending color in the fade"),
new Param("colorC", Color.white, "FG Start Color", "The starting color in the fade"),
new Param("colorD", CoinToss.defaultFgColor, "FG End Color", "The ending color in the fade")
} ),
//left in for backwards-compatibility, but cannot be placed
new GameAction("set foreground color", delegate { var e = eventCaller.currentEntity; CoinToss.instance.ChangeBackgroundColor(e.colorA, 0f, true); }, 0.5f, false, new List<Param>
new GameAction("set foreground color", "")
{
new Param("colorA", CoinToss.defaultFgColor, "Foreground Color", "The foreground color to change to")
function = delegate { var e = eventCaller.currentEntity; CoinToss.instance.ChangeBackgroundColor(e["colorA"], 0f, true); },
defaultLength = 0.5f,
parameters = new List<Param>
{
new Param("colorA", CoinToss.defaultFgColor, "Foreground Color", "The foreground color to change to")
}, hidden: true ),
},
hidden = true
},
new GameAction("fade foreground color", delegate { var e = eventCaller.currentEntity; CoinToss.instance.FadeBackgroundColor(e.colorA, e.colorB, e.length, true); }, 1f, true, new List<Param>()
new GameAction("fade foreground color", "")
{
new Param("colorA", Color.white, "Start Color", "The starting color in the fade"),
new Param("colorB", CoinToss.defaultFgColor, "End Color", "The ending color in the fade")
}, hidden: true ),
function = delegate { var e = eventCaller.currentEntity; CoinToss.instance.FadeBackgroundColor(e["colorA"], e["colorB"], e.length, true); },
resizable = true,
parameters = new List<Param>()
{
new Param("colorA", Color.white, "Start Color", "The starting color in the fade"),
new Param("colorB", CoinToss.defaultFgColor, "End Color", "The ending color in the fade")
},
hidden = true
},
},
new List<string>() {"ntr", "aim"},
"ntrcoin", "en",

View File

@ -13,9 +13,21 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("cropStomp", "Crop Stomp", "BFDEA6", false, false, new List<GameAction>()
{
new GameAction("start marching", delegate { CropStomp.instance.StartMarching(eventCaller.currentEntity.beat); }, 2f, false, inactiveFunction: delegate { CropStomp.MarchInactive(eventCaller.currentEntity.beat); }),
new GameAction("veggies", delegate { }, 4f, true),
new GameAction("mole", delegate { }, 2f, false),
new GameAction("start marching", "Start Marching")
{
function = delegate { CropStomp.instance.StartMarching(eventCaller.currentEntity.beat); },
defaultLength = 2f,
inactiveFunction = delegate { CropStomp.MarchInactive(eventCaller.currentEntity.beat); }
},
new GameAction("veggies", "Veggies")
{
defaultLength = 4f,
resizable = true
},
new GameAction("mole", "Mole")
{
defaultLength = 2f
},
});
}
}
@ -162,7 +174,7 @@ namespace HeavenStudio.Games
}
}
List<Beatmap.Entity> cuedMoleSounds = new List<Beatmap.Entity>();
List<DynamicBeatmap.DynamicEntity> cuedMoleSounds = new List<DynamicBeatmap.DynamicEntity>();
private void Update()
{
var cond = Conductor.instance;
@ -317,7 +329,7 @@ namespace HeavenStudio.Games
return;
}
inactiveStart = beat;
Beatmap.Entity gameSwitch = GameManager.instance.Beatmap.entities.Find(c => c.beat >= beat && c.datamodel == "gameManager/switchGame/cropStomp");
DynamicBeatmap.DynamicEntity gameSwitch = GameManager.instance.Beatmap.entities.Find(c => c.beat >= beat && c.datamodel == "gameManager/switchGame/cropStomp");
if (gameSwitch == null)
return;
int length = Mathf.CeilToInt((gameSwitch.beat - beat)/2);

View File

@ -12,39 +12,65 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("djSchool", "DJ School", "008c97", false, false, new List<GameAction>()
{
//new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.toggle); }, 0.5f, false, new List<Param>()
new GameAction("bop", "Bop")
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}),
new GameAction("and stop ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e.toggle); }, 2.5f, false,
inactiveFunction: delegate { var e = eventCaller.currentEntity; DJSchool.WarnAndStop(e.beat, e.toggle); },
parameters: new List<Param>()
function = delegate { DJSchool.instance.Bop(eventCaller.currentEntity["toggle"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}
},
new GameAction("and stop ooh", "And Stop!")
{
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
}),
new GameAction("break c'mon ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.BreakCmon(e.beat, e.type, e.toggle); }, 3f, false,
inactiveFunction: delegate { var e = eventCaller.currentEntity; DJSchool.WarnBreakCmon(e.beat, e.type, e.toggle); },
parameters: new List<Param>()
function = delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e["toggle"]); },
defaultLength = 2.5f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; DJSchool.WarnAndStop(e.beat, e["toggle"]); },
parameters = new List<Param>()
{
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
}
},
new GameAction("break c'mon ooh", "Break, C'mon!")
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
}),
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity.type, eventCaller.currentEntity.toggle); }, 3f, false, new List<Param>()
function = delegate { var e = eventCaller.currentEntity; DJSchool.instance.BreakCmon(e.beat, e["type"], e["toggle"]); },
defaultLength = 3f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; DJSchool.WarnBreakCmon(e.beat, e["type"], e["toggle"]); },
parameters = new List<Param>()
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
}
},
new GameAction("scratch-o hey", "Scratch-o")
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
new Param("toggle", false, "Fast Hey", "Activate Remix 4 (DS) beat")
}),
new GameAction("dj voice lines", delegate { DJSchool.instance.voiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 2f, false,
inactiveFunction: delegate { DJSchool.WarnDJVoiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); },
parameters: new List<Param>()
function = delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"], eventCaller.currentEntity["toggle"]); },
defaultLength = 3f,
parameters = new List<Param>()
{
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
new Param("toggle", false, "Fast Hey", "Activate Remix 4 (DS) beat")
}
},
new GameAction("dj voice lines", "DJ Yellow Banter")
{
new Param("type", DJSchool.DJVoiceLines.CheckItOut, "Voice Lines", "The voice line to play"),
}),
new GameAction("sound FX", delegate { DJSchool.instance.soundFX(eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
function = delegate { DJSchool.instance.voiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"]); },
defaultLength = 2f,
inactiveFunction = delegate { DJSchool.WarnDJVoiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"]); },
parameters = new List<Param>()
{
new Param("type", DJSchool.DJVoiceLines.CheckItOut, "Voice Lines", "The voice line to play"),
}
},
new GameAction("sound FX", "Scratchy Music")
{
new Param("toggle", false, "Radio FX", "Toggle on and off for Radio Effects")
})
function = delegate { DJSchool.instance.soundFX(eventCaller.currentEntity["toggle"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Radio FX", "Toggle on and off for Radio Effects")
}
}
},
new List<string>() {"ntr", "normal"},
"ntrdj", "en",

View File

@ -14,25 +14,44 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("drummingPractice", "Drumming Practice", "2BCF33", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length); }, 0.5f, true),
new GameAction("drum", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.Prepare(e.beat, e.toggle); }, 2f, parameters: new List<Param>()
new GameAction("bop", "Bop")
{
new Param("toggle", true, "Applause", "Whether or not an applause should be played on a successful hit")
}),
new GameAction("set mii", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetMiis(e.type, e.type2, e.type3, e.toggle); }, 0.5f, parameters: new List<Param>()
function = delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length); },
defaultLength = 0.5f,
resizable = true
},
new GameAction("drum", "Hit Drum")
{
new Param("type", DrummingPractice.MiiType.Random, "Player Mii", "The Mii that the player will control"),
new Param("type2", DrummingPractice.MiiType.Random, "Left Mii", "The Mii on the left"),
new Param("type3", DrummingPractice.MiiType.Random, "Right Mii", "The Mii on the right"),
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii")
}),
new GameAction("set background color", delegate {var e = eventCaller.currentEntity; DrummingPractice.instance.SetBackgroundColor(e.colorA, e.colorB, e.colorC); }, 0.5f, false, new List<Param>()
function = delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.Prepare(e.beat, e["toggle"]); },
defaultLength = 2f,
parameters = new List<Param>()
{
new Param("toggle", true, "Applause", "Whether or not an applause should be played on a successful hit")
}
},
new GameAction("set mii", "Set Miis")
{
new Param("colorA", new Color(43/255f, 207/255f, 51/255f), "Color A", "The top-most color of the background gradient"),
new Param("colorB", new Color(1, 1, 1), "Color B", "The bottom-most color of the background gradient"),
new Param("colorC", new Color(1, 247/255f, 0), "Streak Color", "The color of streaks that appear on a successful hit")
})
function = delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetMiis(e["type"], e["type2"], e["type3"], e["toggle"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", DrummingPractice.MiiType.Random, "Player Mii", "The Mii that the player will control"),
new Param("type2", DrummingPractice.MiiType.Random, "Left Mii", "The Mii on the left"),
new Param("type3", DrummingPractice.MiiType.Random, "Right Mii", "The Mii on the right"),
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii")
}
},
new GameAction("set background color", "Set Background Color")
{
function = delegate {var e = eventCaller.currentEntity; DrummingPractice.instance.SetBackgroundColor(e["colorA"], e["colorB"], e["colorC"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("colorA", new Color(43/255f, 207/255f, 51/255f), "Color A", "The top-most color of the background gradient"),
new Param("colorB", new Color(1, 1, 1), "Color B", "The bottom-most color of the background gradient"),
new Param("colorC", new Color(1, 247/255f, 0), "Streak Color", "The color of streaks that appear on a successful hit")
}
}
});
}
}
@ -81,7 +100,7 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(float beat)
{
Beatmap.Entity changeMii = GameManager.instance.Beatmap.entities.FindLast(c => c.datamodel == "drummingPractice/set mii" && c.beat <= beat);
var changeMii = GameManager.instance.Beatmap.entities.FindLast(c => c.datamodel == "drummingPractice/set mii" && c.beat <= beat);
if(changeMii != null)
{
EventCaller.instance.CallEvent(changeMii, true);

View File

@ -13,49 +13,76 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("fanClub", "Fan Club", "FDFD00", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e.type); }, 0.5f, true, parameters: new List<Param>()
new GameAction("bop", "Bop")
{
new Param("type", FanClub.IdolBopType.Both, "Bop target", "Who to make bop"),
}),
new GameAction("yeah, yeah, yeah", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallHai(e.beat, e.toggle); }, 8, false, parameters: new List<Param>()
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e["type"]); },
defaultLength = 0.5f,
resizable = true,
parameters = new List<Param>()
{
new Param("type", FanClub.IdolBopType.Both, "Bop target", "Who to make bop"),
}
},
new GameAction("yeah, yeah, yeah", "Yeah, Yeah, Yeah!")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallHai(e.beat, e["toggle"]); },
defaultLength = 8,
parameters = new List<Param>()
{
new Param("toggle", false, "Disable call", "Disable the idol's call")
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.WarnHai(e.beat, e.toggle);}
),
new GameAction("I suppose", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallKamone(e.beat, e.toggle, 0, e.type); }, 6, false, parameters: new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnHai(e.beat, e["toggle"]);}
},
new GameAction("I suppose", "I Suppose!")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallKamone(e.beat, e["toggle"], 0, e["type"]); },
defaultLength = 6,
parameters = new List<Param>()
{
new Param("type", FanClub.KamoneResponseType.Through, "Response type", "Type of response to use"),
new Param("toggle", false, "Disable call", "Disable the idol's call")
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.WarnKamone(e.beat, e.toggle, 0, e.type);}
),
new GameAction("double clap", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallBigReady(e.beat, e.toggle); }, 4, false, parameters: new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnKamone(e.beat, e["toggle"], 0, e["type"]);}
},
new GameAction("double clap", "Double Clap")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallBigReady(e.beat, e["toggle"]); },
defaultLength = 4,
parameters = new List<Param>()
{
new Param("toggle", false, "Disable call", "Disable the call")
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.WarnBigReady(e.beat, e.toggle); }
),
new GameAction("play idol animation", delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e.type); }, 1, true, parameters: new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnBigReady(e.beat, e["toggle"]); }
},
new GameAction("play idol animation", "Idol Coreography")
{
new Param("type", FanClub.IdolAnimations.Bop, "Animation", "Animation to play")
}),
new GameAction("play stage animation", delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnimStage(e.beat, e.type); }, 1, true, parameters: new List<Param>()
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e["type"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("type", FanClub.IdolAnimations.Bop, "Animation", "Animation to play")
}
},
new GameAction("play stage animation", "Stage Coreography")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnimStage(e.beat, e["type"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("type", FanClub.StageAnimations.Flash, "Animation", "Animation to play")
}
},
new GameAction("set performance type", "Coreography Type")
{
new Param("type", FanClub.StageAnimations.Flash, "Animation", "Animation to play")
}),
new GameAction("set performance type", delegate { var e = eventCaller.currentEntity; FanClub.SetPerformanceType(e.type);}, 0.5f, false, parameters: new List<Param>()
function = delegate { var e = eventCaller.currentEntity; FanClub.SetPerformanceType(e["type"]);},
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", FanClub.IdolPerformanceType.Normal, "Performance Type", "Set of animations for the idol to use")
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.SetPerformanceType(e.type); }
),
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.SetPerformanceType(e["type"]); }
},
},
new List<string>() {"ntr", "normal"},
"ntridol", "jp",

View File

@ -11,28 +11,60 @@ namespace HeavenStudio.Games.Loaders
{
return new Minigame("firstContact", "First Contact", "008c97", false, false, new List<GameAction>()
{
new GameAction("beat intervals", delegate { FirstContact.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 4f, true),
new GameAction("alien speak", delegate { FirstContact.instance.alienSpeak(eventCaller.currentEntity.beat, eventCaller.currentEntity.valA); }, 0.5f, false, new List<Param>()
new GameAction("beat intervals", "Start Interval")
{
new Param("valA", new EntityTypes.Float(.8f, 1.5f, 1f), "Pitch")
}),
new GameAction("alien turnover", delegate { FirstContact.instance.alienTurnOver(eventCaller.currentEntity.beat); }, 0.5f, false),
new GameAction("alien success", delegate { FirstContact.instance.alienSuccess(eventCaller.currentEntity.beat); }, 1f, false),
new GameAction("mission control", delegate { FirstContact.instance.missionControlDisplay(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle, eventCaller.currentEntity.length); }, 1f, true, new List<Param>
function = delegate { FirstContact.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); },
defaultLength = 4f,
resizable = true
},
new GameAction("alien speak", "Alien Speak")
{
new Param("toggle", false, "Stay", "If it's the end of the remix/song")
}),
new GameAction("look at", delegate { FirstContact.instance.lookAtDirection(eventCaller.currentEntity.type, eventCaller.currentEntity.type); }, .5f, false, new List<Param>()
function = delegate { FirstContact.instance.alienSpeak(eventCaller.currentEntity.beat, eventCaller.currentEntity["valA"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("valA", new EntityTypes.Float(.8f, 1.5f, 1f), "Pitch")
}
},
new GameAction("alien turnover", "Alien Turnover")
{
new Param("type", FirstContact.alienLookAt.lookAtTranslator, "alien look at what", "[Alien] will look at what"),
new Param("type2", FirstContact.translatorLookAt.lookAtAlien, "translator look at what", "[Translator] will look at what"),
}),
new GameAction("live bar beat", delegate { FirstContact.instance.liveBarBeat(eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
function = delegate { FirstContact.instance.alienTurnOver(eventCaller.currentEntity.beat); },
defaultLength = 0.5f,
},
new GameAction("alien success", "Confirm Response")
{
new Param("toggle", true, "On Beat", "If the live bar animation will be on beat or not")
}),
function = delegate { FirstContact.instance.alienSuccess(eventCaller.currentEntity.beat); },
},
new GameAction("mission control", "Show Mission Control")
{
function = delegate { var e = eventCaller.currentEntity; FirstContact.instance.missionControlDisplay(e.beat, e["toggle"], e.length); },
resizable = true,
parameters = new List<Param>
{
new Param("toggle", false, "Stay", "If it's the end of the remix/song")
}
},
new GameAction("look at", "Look At")
{
function = delegate { FirstContact.instance.lookAtDirection(eventCaller.currentEntity["type"], eventCaller.currentEntity["type"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("type", FirstContact.alienLookAt.lookAtTranslator, "alien look at what", "[Alien] will look at what"),
new Param("type2", FirstContact.translatorLookAt.lookAtAlien, "translator look at what", "[Translator] will look at what"),
}
},
new GameAction("live bar beat", "Live Bar Beat")
{
function = delegate { FirstContact.instance.liveBarBeat(eventCaller.currentEntity["toggle"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", true, "On Beat", "If the live bar animation will be on beat or not")
}
},
//new GameAction("Version of First Contact", delegate { FirstContact.instance.versionOfFirstContact(eventCaller.currentEntity.type); }, .5f, false, new List<Param>
//new GameAction("Version of First Contact", delegate { FirstContact.instance.versionOfFirstContact(eventCaller.currentEntity["type"]); }, .5f, false, new List<Param>
//{
// new Param("type", FirstContact.VersionOfContact.FirstContact, "Version", "Version of First Contact to play"),
//}),

View File

@ -14,18 +14,54 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("forkLifter", "Fork Lifter", "FFFFFF", false, false, new List<GameAction>()
{
new GameAction("flick", delegate { var e = eventCaller.currentEntity; ForkLifter.instance.Flick(e.beat, e.type); }, 3, false, new List<Param>()
new GameAction("flick", "Flick Food")
{
new Param("type", ForkLifter.FlickType.Pea, "Object", "The object to be flicked")
}),
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f),
new GameAction("gulp", delegate { ForkLifter.playerInstance.Eat(); }),
new GameAction("sigh", delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }),
function = delegate { var e = eventCaller.currentEntity; ForkLifter.instance.Flick(e.beat, e["type"]); },
defaultLength = 3,
parameters = new List<Param>()
{
new Param("type", ForkLifter.FlickType.Pea, "Object", "The object to be flicked")
}
},
new GameAction("prepare", "Prepare Hand")
{
function = delegate { ForkLifter.instance.ForkLifterHand.Prepare(); },
defaultLength = 0.5f
},
new GameAction("gulp", "Swallow")
{
function = delegate { ForkLifter.playerInstance.Eat(); }
},
new GameAction("sigh", "Sigh")
{
function = delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }
},
// These are still here for backwards-compatibility but are hidden in the editor
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); }, 3, hidden: true),
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); }, 3, hidden: true),
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); }, 3, hidden: true),
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); }, 3, hidden: true),
new GameAction("pea", "")
{
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); },
defaultLength = 3,
hidden = true
},
new GameAction("topbun", "")
{
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); },
defaultLength = 3,
hidden = true
},
new GameAction("burger", "")
{
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); },
defaultLength = 3,
hidden = true
},
new GameAction("bottombun", "")
{
function = delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); },
defaultLength = 3,
hidden = true
},
});
}
}

View File

@ -22,7 +22,7 @@ namespace HeavenStudio.Games.Global
[SerializeField] private Color currentCol;
private List<Beatmap.Entity> allFadeEvents = new List<Beatmap.Entity>();
private List<DynamicBeatmap.DynamicEntity> allFadeEvents = new List<DynamicBeatmap.DynamicEntity>();
private void Awake()
{
@ -64,7 +64,7 @@ namespace HeavenStudio.Games.Global
if (allFadeEvents.Count > 0)
{
Beatmap.Entity startEntity = null;
DynamicBeatmap.DynamicEntity startEntity = null;
for (int i = 0; i < allFadeEvents.Count; i++)
{
@ -85,14 +85,14 @@ namespace HeavenStudio.Games.Global
{
if (!override_)
{
Color colA = startEntity.colorA;
Color colB = startEntity.colorB;
Color colA = startEntity["colorA"];
Color colB = startEntity["colorB"];
startCol = new Color(colA.r, colA.g, colA.b, startEntity.valA);
endCol = new Color(colB.r, colB.g, colB.b, startEntity.valB);
startCol = new Color(colA.r, colA.g, colA.b, startEntity["valA"]);
endCol = new Color(colB.r, colB.g, colB.b, startEntity["valB"]);
}
SetFade(startEntity.beat, startEntity.length, startCol, endCol, startEntity.ease);
SetFade(startEntity.beat, startEntity.length, startCol, endCol, (EasingFunction.Ease) startEntity["ease"]);
}
}
}

View File

@ -27,10 +27,10 @@ namespace HeavenStudio.Games.Global
Bottom,
}
private List<Beatmap.Entity> textboxEvents = new List<Beatmap.Entity>();
private List<Beatmap.Entity> openCaptionsEvents = new List<Beatmap.Entity>();
private List<Beatmap.Entity> idolEvents = new List<Beatmap.Entity>();
private List<Beatmap.Entity> closedCaptionsEvents = new List<Beatmap.Entity>();
private List<DynamicBeatmap.DynamicEntity> textboxEvents = new List<DynamicBeatmap.DynamicEntity>();
private List<DynamicBeatmap.DynamicEntity> openCaptionsEvents = new List<DynamicBeatmap.DynamicEntity>();
private List<DynamicBeatmap.DynamicEntity> idolEvents = new List<DynamicBeatmap.DynamicEntity>();
private List<DynamicBeatmap.DynamicEntity> closedCaptionsEvents = new List<DynamicBeatmap.DynamicEntity>();
Textbox instance;
@ -114,11 +114,11 @@ namespace HeavenStudio.Games.Global
if (prog >= 0f && prog <= 1f)
{
TextboxEnabler.SetActive(true);
TextboxObject.SetText(e.text1);
TextboxObject.Resize(e.valA, e.valB);
TextboxObject.SetText(e["text1"]);
TextboxObject.Resize(e["valA"], e["valB"]);
// ouch
switch (e.type)
switch (e["type"])
{
case (int) TextboxAnchor.TopLeft:
TextboxEnabler.transform.localPosition = new Vector3(-XAnchor, YAnchor);
@ -170,12 +170,12 @@ namespace HeavenStudio.Games.Global
if (prog >= 0f && prog <= 1f)
{
OpenCaptionsEnabler.SetActive(true);
OpenCaptionsLabel.text = e.text1;
OpenCaptionsLabel.text = e["text1"];
OpenCaptionsLabelRect.sizeDelta = new Vector2(18f * e.valA, 2.5f * e.valB);
OpenCaptionsLabelRect.sizeDelta = new Vector2(18f * e["valA"], 2.5f * e["valB"]);
// ouch
switch (e.type)
switch (e["type"])
{
case (int) TextboxAnchor.TopLeft:
OpenCaptionsEnabler.transform.localPosition = new Vector3(-XAnchor, YAnchor);
@ -228,8 +228,8 @@ namespace HeavenStudio.Games.Global
if (prog >= 0f && prog <= 1f)
{
float inp = cond.GetPositionFromBeat(e.beat, 1);
IdolSongLabel.text = e.text1;
IdolArtistLabel.text = e.text2;
IdolSongLabel.text = e["text1"];
IdolArtistLabel.text = e["text2"];
IdolAnimator.Play("IdolShow", -1, Mathf.Min(inp, 1));
IdolAnimator.speed = 0;
@ -264,18 +264,18 @@ namespace HeavenStudio.Games.Global
if (prog >= 0f && prog <= 1f)
{
ClosedCaptionsEnabler.SetActive(true);
ClosedCaptionsLabel.text = e.text1;
ClosedCaptionsLabel.text = e["text1"];
ClosedCaptionsLabelRect.sizeDelta = new Vector2(9f, e.valA);
ClosedCaptionsBgRect.sizeDelta = new Vector2(9f, e.valA);
ClosedCaptionsLabelRect.sizeDelta = new Vector2(9f, e["valA"]);
ClosedCaptionsBgRect.sizeDelta = new Vector2(9f, e["valA"]);
switch (e.type)
switch (e["type"])
{
case (int) ClosedCaptionsAnchor.Bottom:
ClosedCaptionsEnabler.transform.localPosition = new Vector3(0, -2.5f + e.valA/2);
ClosedCaptionsEnabler.transform.localPosition = new Vector3(0, -2.5f + e["valA"]/2);
break;
default:
ClosedCaptionsEnabler.transform.localPosition = new Vector3(0, 2.5f - e.valA/2);
ClosedCaptionsEnabler.transform.localPosition = new Vector3(0, 2.5f - e["valA"]/2);
break;
}

View File

@ -13,58 +13,97 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { KarateMan.instance.ToggleBop(eventCaller.currentEntity.toggle); }, 0.5f, false, new List<Param>()
new GameAction("bop", "Bop")
{
function = delegate { KarateMan.instance.ToggleBop(eventCaller.currentEntity["toggle"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("toggle", true, "Bop", "Whether to bop to the beat or not")
},
inactiveFunction: delegate { KarateMan.ToggleBopUnloaded(eventCaller.currentEntity.toggle); }
),
new GameAction("hit", delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateItem(e.beat, e.type, e.type2); }, 2, false,
new List<Param>()
inactiveFunction = delegate { KarateMan.ToggleBopUnloaded(eventCaller.currentEntity["toggle"]); }
},
new GameAction("hit", "Toss Object") {
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateItem(e.beat, e["type"], e["type2"]); },
defaultLength = 2,
parameters = new List<Param>()
{
new Param("type", KarateMan.HitType.Pot, "Object", "The object to fire"),
new Param("type2", KarateMan.KarateManFaces.Normal, "Success Expression", "The facial expression to set Joe to on hit")
}),
new GameAction("bulb", delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateBulbSpecial(e.beat, e.type, e.colorA, e.type2); }, 2, false,
new List<Param>()
}
},
new GameAction("bulb", "Toss Lightbulb")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateBulbSpecial(e.beat, e["type"], e["colorA"], e["type2"]); },
defaultLength = 2,
parameters = new List<Param>()
{
new Param("type", KarateMan.LightBulbType.Normal, "Type", "The preset bulb type. Yellow is used for kicks while Blue is used for combos"),
new Param("colorA", new Color(1f,1f,1f), "Custom Color", "The color to use when the bulb type is set to Custom"),
new Param("type2", KarateMan.KarateManFaces.Normal, "Success Expression", "The facial expression to set Joe to on hit")
}),
new GameAction("kick", delegate { var e = eventCaller.currentEntity; KarateMan.instance.Kick(e.beat, e.toggle, e.type); }, 4f, false,
new List<Param>()
},
},
new GameAction("kick", "Special: Kick")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Kick(e.beat, e["toggle"], e["type"]); },
defaultLength = 4f,
parameters = new List<Param>()
{
new Param("toggle", false, "Contains Ball", "Barrel contains a ball instead of a bomb?"),
new Param("type", KarateMan.KarateManFaces.Smirk, "Success Expression", "The facial expression to set Joe to on hit")
}
),
new GameAction("combo", delegate { var e = eventCaller.currentEntity; KarateMan.instance.Combo(e.beat, e.type); }, 4f, false,
new List<Param>()
},
new GameAction("combo", "Special: Combo")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Combo(e.beat, e["type"]); },
defaultLength = 4,
parameters = new List<Param>()
{
new Param("type", KarateMan.KarateManFaces.Happy, "Success Expression", "The facial expression to set Joe to on hit")
}
),
new GameAction("hitX", delegate { var e = eventCaller.currentEntity; KarateMan.instance.DoWord(e.beat, e.type); }, 1f, false,
new List<Param>()
},
new GameAction("hitX", "Warnings")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.DoWord(e.beat, e["type"]); },
defaultLength = 1f,
parameters = new List<Param>()
{
new Param("type", KarateMan.HitThree.HitThree, "Type", "The warning text to show")
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.DoWordSound(e.beat, e.type); }
),
new GameAction("special camera", delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e.toggle); }, 8f, true, new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; KarateMan.DoWordSound(e.beat, e["type"]); }
},
new GameAction("special camera", "Special Camera")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); },
defaultLength = 8f,
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", true, "Return Camera", "Camera zooms back in?"),
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e.toggle); }
),
new GameAction("prepare", delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);}, 1f, true),
new GameAction("set gameplay modifiers", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e.type, e.toggle); }, 0.5f, false, new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); }
},
new GameAction("prepare", "Preparation Stance")
{
new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use"),
new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"),
}),
new GameAction("set background effects", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, e.type3); KarateMan.instance.SetBgTexture(e.type4, e.type5, e.colorC, e.colorD); }, 0.5f, true, new List<Param>()
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);},
resizable = true
},
new GameAction("set gameplay modifiers", "Gameplay Modifiers")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e["type"], e["toggle"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use"),
new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"),
}
},
new GameAction("set background effects", "Background Appearance")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"]); KarateMan.instance.SetBgTexture(e["type4"], e["type5"], e["colorC"], e["colorD"]); },
defaultLength = 0.5f,
resizable = true,
parameters = new List<Param>()
{
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
@ -77,43 +116,96 @@ namespace HeavenStudio.Games.Loaders
new Param("colorD", new Color(), "Fading Filter Color", "When using the Fade background effect, make filter colour fade to this colour"),
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.SetBgEffectsUnloaded(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, e.type3, e.type4, e.type5, e.colorC, e.colorD); }
),
new GameAction("set object colors", delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e.colorA, e.colorB, e.colorC); }, 0.5f, false, new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; KarateMan.SetBgEffectsUnloaded(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"], e["type4"], e["type5"], e["colorC"], e["colorD"]); }
},
new GameAction("set object colors", "Object Colors")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e["colorA"], e["colorB"], e["colorC"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("colorA", new Color(1,1,1,1), "Joe Body Color", "The color to use for Karate Joe's body"),
new Param("colorB", new Color(0.81f,0.81f,0.81f,1), "Joe Highlight Color", "The color to use for Karate Joe's highlights"),
new Param("colorC", new Color(1,1,1,1), "Item Color", "The color to use for the thrown items"),
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e.colorA, e.colorB, e.colorC); }
),
new GameAction("particle effects", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetParticleEffect(e.beat, e.type, e.valA, e.valB); }, 0.5f, false, new List<Param>()
inactiveFunction = delegate { var e = eventCaller.currentEntity; KarateMan.UpdateMaterialColour(e["colorA"], e["colorB"], e["colorC"]); }
},
new GameAction("particle effects", "Particle Effects")
{
new Param("type", KarateMan.ParticleType.None, "Particle Type", "The type of particle effect to spawn. Using \"None\" will stop all effects"),
new Param("valA", new EntityTypes.Float(0f, 64f, 1f), "Wind Strength", "The strength of the particle wind"),
new Param("valB", new EntityTypes.Float(1f, 16f, 1f), "Particle Intensity", "The intensity of the particle effect")
}),
new GameAction("force facial expression", delegate { KarateMan.instance.SetFaceExpression(eventCaller.currentEntity.type); }, 0.5f, false, new List<Param>()
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetParticleEffect(e.beat, e["type"], e["valA"], e["valB"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", KarateMan.ParticleType.None, "Particle Type", "The type of particle effect to spawn. Using \"None\" will stop all effects"),
new Param("valA", new EntityTypes.Float(0f, 64f, 1f), "Wind Strength", "The strength of the particle wind"),
new Param("valB", new EntityTypes.Float(1f, 16f, 1f), "Particle Intensity", "The intensity of the particle effect")
}
},
new GameAction("force facial expression", "Set Facial Expression")
{
new Param("type", KarateMan.KarateManFaces.Normal, "Facial Expression", "The facial expression to force Joe to. Special moves may override this")
}),
function = delegate { KarateMan.instance.SetFaceExpression(eventCaller.currentEntity["type"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", KarateMan.KarateManFaces.Normal, "Facial Expression", "The facial expression to force Joe to. Special moves may override this")
}
},
// These are still here for backwards-compatibility but are hidden in the editor
new GameAction("pot", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.Pot); }, 2, hidden: true),
new GameAction("rock", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.Rock); }, 2, hidden: true),
new GameAction("ball", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.Ball); }, 2, hidden: true),
new GameAction("tacobell", delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.TacoBell); }, 2, hidden: true),
new GameAction("hit4", delegate { KarateMan.instance.DoWord(eventCaller.currentEntity.beat, (int) KarateMan.HitThree.HitFour); }, hidden: true),
new GameAction("bgfxon", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgFx((int) KarateMan.BackgroundFXType.Sunburst, e.beat, e.length); }, hidden: true),
new GameAction("bgfxoff", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgFx((int) KarateMan.BackgroundFXType.None, e.beat, e.length); }, hidden: true),
new GameAction("hit3", delegate { var e = eventCaller.currentEntity; KarateMan.instance.DoWord(e.beat, e.type); }, 1f, false,
new List<Param>()
new GameAction("pot", "")
{
function = delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.Pot); },
defaultLength = 2,
hidden = true
},
new GameAction("rock", "")
{
function = delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.Rock); },
defaultLength = 2,
hidden = true
},
new GameAction("ball", "")
{
function = delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.Ball); },
defaultLength = 2,
hidden = true
},
new GameAction("tacobell", "")
{
function = delegate { KarateMan.instance.CreateItem(eventCaller.currentEntity.beat, 0, (int) KarateMan.HitType.TacoBell); },
defaultLength = 2,
hidden = true
},
new GameAction("bgfxon", "")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgFx((int) KarateMan.BackgroundFXType.Sunburst, e.beat, e.length); },
hidden = true
},
new GameAction("bgfxoff", "")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgFx((int) KarateMan.BackgroundFXType.None, e.beat, e.length); },
hidden = true
},
new GameAction("hit3", "")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.DoWord(e.beat, e["type"]); },
parameters = new List<Param>()
{
new Param("type", KarateMan.HitThree.HitThree, "Type", "The warning text to show")
},
hidden: true),
new GameAction("set background color", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, (int) KarateMan.currentBgEffect); }, 0.5f, false,
new List<Param>()
hidden = true
},
new GameAction("hit4", "")
{
function = delegate { KarateMan.instance.DoWord(eventCaller.currentEntity.beat, (int) KarateMan.HitThree.HitFour); },
hidden = true
},
new GameAction("set background color", "")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], (int) KarateMan.currentBgEffect); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
@ -121,22 +213,32 @@ namespace HeavenStudio.Games.Loaders
new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom"),
},
hidden: true),
new GameAction("set background fx", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgFx(e.type, e.beat, e.length); }, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed")
hidden = true
},
hidden: true),
new GameAction("set background texture", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgTexture(e.type, e.type2, e.colorA, e.colorB); }, 0.5f, false, new List<Param>()
new GameAction("set background fx", "")
{
new Param("type", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use"),
new Param("type2", KarateMan.ShadowType.Tinted, "Color Filter Type", "The method used to apply colour to the texture"),
new Param("colorA", new Color(), "Custom Filter Color", "The filter color to use when color filter type is set to Custom"),
new Param("colorB", new Color(), "Fading Filter Color", "When using the Fade background effect, make filter colour fade to this colour"),
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgFx(e["type"], e.beat, e.length); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed")
},
hidden = true
},
hidden: true),
new GameAction("set background texture", "")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgTexture(e["type"], e["type2"], e["colorA"], e["colorB"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use"),
new Param("type2", KarateMan.ShadowType.Tinted, "Color Filter Type", "The method used to apply colour to the texture"),
new Param("colorA", new Color(), "Custom Filter Color", "The filter color to use when color filter type is set to Custom"),
new Param("colorB", new Color(), "Fading Filter Color", "When using the Fade background effect, make filter colour fade to this colour"),
},
hidden = true
},
},
new List<string>() {"agb", "ntr", "rvl", "ctr", "pco", "normal"},
"karate", "en",
@ -440,8 +542,8 @@ namespace HeavenStudio.Games
BGEffect.transform.position = new Vector3(GameCamera.instance.transform.position.x, GameCamera.instance.transform.position.y, 0);
}
static List<Beatmap.Entity> allHits = new List<Beatmap.Entity>();
static List<Beatmap.Entity> allEnds = new List<Beatmap.Entity>();
static List<DynamicBeatmap.DynamicEntity> allHits = new List<DynamicBeatmap.DynamicEntity>();
static List<DynamicBeatmap.DynamicEntity> allEnds = new List<DynamicBeatmap.DynamicEntity>();
public static int CountHitsToEnd(float fromBeat)
{
allHits = EventCaller.GetAllInGameManagerList("karateman", new string[] { "hit", "bulb", "kick", "combo" });
@ -452,7 +554,7 @@ namespace HeavenStudio.Games
float endBeat = Single.MaxValue;
//get the beat of the closest end event
foreach (Beatmap.Entity end in allEnds)
foreach (var end in allEnds)
{
if (end.beat > fromBeat)
{
@ -467,7 +569,7 @@ namespace HeavenStudio.Games
string type;
for (int i = 0; i < allHits.Count; i++)
{
Beatmap.Entity h = allHits[i];
var h = allHits[i];
if (h.beat >= fromBeat)
{
if (h.beat < endBeat)
@ -704,8 +806,8 @@ namespace HeavenStudio.Games
var e = bgfx[i];
if (e.beat > beat)
break;
SetBgAndShadowCol(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, e.type3);
SetBgTexture(e.type4, e.type5, e.colorC, e.colorD);
SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"]);
SetBgTexture(e["type4"], e["type5"], e["colorC"], e["colorD"]);
}
var camfx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/special camera");
for (int i = 0; i < camfx.Count; i++)
@ -713,7 +815,7 @@ namespace HeavenStudio.Games
var e = camfx[i];
if (e.beat > beat)
break;
DoSpecialCamera(e.beat, e.length, e.toggle);
DoSpecialCamera(e.beat, e.length, e["toggle"]);
}
// has issues when creating a new hitx entity so this is deactivated for now
// var hitx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/hitX");
@ -723,7 +825,7 @@ namespace HeavenStudio.Games
// if (e.beat > beat)
// break;
// Debug.Log("hitx");
// DoWord(e.beat, e.type, false);
// DoWord(e.beat, e["type"], false);
// }
}

View File

@ -37,6 +37,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
static float PeriodHigh = 15 / 60f;
int noriMode = (int)KarateMan.NoriMode.None;
bool playedJust = false;
int inputsToSwitch = 0;
//takes 12% of inputs to fill the nori bar
@ -69,6 +70,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
NoriHolder = NoriHolderTengoku;
NoriManiaInk00.SetActive(false);
NoriManiaInk01.SetActive(false);
playedJust = false;
break;
case (int) KarateMan.NoriMode.Mania:
MaxNori = 10;
@ -77,6 +79,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
NoriHolder = NoriHolderMania00;
NoriManiaInk00.SetActive(true);
NoriManiaInk01.SetActive(false);
playedJust = false;
inputsToSwitch = KarateMan.CountHitsToEnd(fromBeat);
break;
@ -85,6 +88,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
Nori = 0;
NoriManiaInk00.SetActive(false);
NoriManiaInk01.SetActive(false);
playedJust = false;
return;
}
@ -136,8 +140,9 @@ namespace HeavenStudio.Games.Scripts_KarateMan
NoriHeartAnimators[i].Play("NoriFull", -1, (Time.time * PeriodHigh) % 1f);
}
}
if (KarateMan.instance.NoriPerformance >= 0.6f && oldNori / MaxNori < 0.6f)
if (KarateMan.instance.NoriPerformance >= 0.6f && oldNori / MaxNori < 0.6f && !playedJust)
{
playedJust = true;
Jukebox.PlayOneShotGame("karateman/nori_just");
}
UpdateHeartColours();
@ -176,6 +181,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
if (KarateMan.instance.NoriPerformance < 0.6f && oldNori / MaxNori >= 0.6f)
{
playedJust = false;
Jukebox.PlayOneShotGame("karateman/nori_ng");
}
UpdateHeartColours();
@ -189,6 +195,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
{
if (Nori >= MaxNori)
Jukebox.PlayOneShotGame("karateman/nori_through");
playedJust = false;
Nori = 0;
foreach (Animator anim in NoriHeartAnimators)
{
@ -215,6 +222,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
}
}
if (KarateMan.instance.NoriPerformance < 0.6f)
playedJust = false;
UpdateHeartColours();
}

View File

@ -15,12 +15,28 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("mrUpbeat", "Mr. Upbeat", "FFFFFF", false, false, new List<GameAction>()
{
new GameAction("prepare", delegate { MrUpbeat.instance.SetInterval(eventCaller.currentEntity.beat); }, 0.5f, true, inactiveFunction: delegate { MrUpbeat.Beep(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }),
new GameAction("go", delegate { MrUpbeat.instance.Go(eventCaller.currentEntity.beat); }, 4f, true),
new GameAction("ding!", delegate { MrUpbeat.instance.Ding(eventCaller.currentEntity.toggle); }, 0.5f, parameters: new List<Param>()
new GameAction("prepare", "Prepare")
{
new Param("toggle", false, "Applause")
}),
function = delegate { MrUpbeat.instance.SetInterval(eventCaller.currentEntity.beat); },
defaultLength = 0.5f,
resizable = true,
inactiveFunction = delegate { MrUpbeat.Beep(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }
},
new GameAction("go", "Start Stepping")
{
function = delegate { MrUpbeat.instance.Go(eventCaller.currentEntity.beat); },
defaultLength = 4f,
resizable = true
},
new GameAction("ding!", "Finish Stepping")
{
function = delegate { MrUpbeat.instance.Ding(eventCaller.currentEntity["toggle"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Applause")
}
},
});
}
}
@ -66,7 +82,7 @@ namespace HeavenStudio.Games
private void Update()
{
List<Beatmap.Entity> gos = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "mrUpbeat/go");
List<DynamicBeatmap.DynamicEntity> gos = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "mrUpbeat/go");
for (int i = 0; i < gos.Count; i++)
{
if ((gos[i].beat - 0.15f) <= Conductor.instance.songPositionInBeats && (gos[i].beat + gos[i].length) - 0.15f > Conductor.instance.songPositionInBeats)
@ -102,7 +118,7 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(float beat)
{
foreach (Beatmap.Entity entity in GameManager.instance.Beatmap.entities)
foreach (var entity in GameManager.instance.Beatmap.entities)
{
if (entity.beat > beat) //the list is sorted based on the beat of the entity, so this should work fine.
{

View File

@ -15,25 +15,38 @@ namespace HeavenStudio.Games.Loaders
return new Minigame("pajamaParty", "Pajama Party", "965076", false, false, new List<GameAction>()
{
// both same timing
new GameAction("jump (side to middle)", delegate {PajamaParty.instance.DoThreeJump(eventCaller.currentEntity.beat);}, 4f, false,
inactiveFunction: delegate {PajamaParty.WarnThreeJump(eventCaller.currentEntity.beat);}
),
new GameAction("jump (back to front)", delegate {PajamaParty.instance.DoFiveJump(eventCaller.currentEntity.beat);}, 4f, false,
inactiveFunction: delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);}
),
new GameAction("jump (side to middle)", "Side to Middle Jumps")
{
function = delegate {PajamaParty.instance.DoThreeJump(eventCaller.currentEntity.beat);},
defaultLength = 4f,
inactiveFunction = delegate {PajamaParty.WarnThreeJump(eventCaller.currentEntity.beat);}
},
new GameAction("jump (back to front)", "Back to Front Jumps")
{
function =delegate {PajamaParty.instance.DoFiveJump(eventCaller.currentEntity.beat);},
defaultLength = 4f,
inactiveFunction = delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);}
},
//idem
new GameAction("slumber", delegate {var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e.toggle, e.type);}, 8f, false, parameters: new List<Param>()
new GameAction("slumber", "Slumber")
{
function = delegate {var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e["toggle"], e["type"]);},
defaultLength = 8f,
parameters = new List<Param>()
{
new Param("type", PajamaParty.SleepType.Normal, "Sleep Type", "Type of sleep action to use"),
new Param("toggle", false, "Alt. Animation", "Use an alternate animation for Mako")
},
inactiveFunction: delegate {var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e.toggle);}
),
new GameAction("throw", delegate {PajamaParty.instance.DoThrowSequence(eventCaller.currentEntity.beat);}, 8f, false,
inactiveFunction: delegate {PajamaParty.WarnThrowSequence(eventCaller.currentEntity.beat);}
),
//cosmetic
// new GameAction("open / close background", delegate { }, 2f, true),
inactiveFunction = delegate {var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e["toggle"]);}
},
new GameAction("throw", "Throw Pillows")
{
function = delegate {PajamaParty.instance.DoThrowSequence(eventCaller.currentEntity.beat);},
defaultLength = 8f,
inactiveFunction = delegate {PajamaParty.WarnThrowSequence(eventCaller.currentEntity.beat);}
},
// todo cosmetic crap
// background stuff
// do shit with mako's face? (talking?)
},
new List<string>() {"ctr", "normal"},

View File

@ -14,24 +14,65 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("rhythmRally", "Rhythm Rally", "FFFFFF", true, false, new List<GameAction>()
{
new GameAction("bop", delegate { RhythmRally.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
new GameAction("whistle", delegate { RhythmRally.instance.PlayWhistle(); }, 0.5f),
new GameAction("toss ball", delegate { RhythmRally.instance.Toss(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, 6f, true); }, 2f),
new GameAction("rally", delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Normal); }, 4f, true),
new GameAction("slow rally", delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Slow); }, 8f, true),
new GameAction("fast rally", delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Fast); }, 6f),
new GameAction("superfast rally", delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.SuperFast); }, 12f),
new GameAction("pose", delegate { RhythmRally.instance.Pose(); }, 0.5f),
new GameAction("camera", delegate {
var e = eventCaller.currentEntity;
var rotation = new Vector3(0, e.valA, 0);
RhythmRally.instance.ChangeCameraAngle(rotation, e.valB, e.length, (Ease)e.type, (RotateMode)e.type2);
}, 4, true, new List<Param>() {
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle", "The rotation of the camera around the center of the table"),
new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom", "The camera's level of zoom (Lower value = Zoomed in)"),
new Param("type", Ease.Linear, "Ease", "The easing function to use"),
new Param("type2", RotateMode.Fast, "Rotation Mode", "The rotation mode to use")
} ),
new GameAction("bop", "Bop")
{
function = delegate { RhythmRally.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); },
defaultLength = 0.5f,
resizable = true
},
new GameAction("whistle", "Whistle")
{
function = delegate { RhythmRally.instance.PlayWhistle(); },
defaultLength = 0.5f
},
new GameAction("toss ball", "Toss Ball")
{
function = delegate { RhythmRally.instance.Toss(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, 6f, true); },
defaultLength = 2f
},
new GameAction("rally", "Rally")
{
function = delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Normal); },
defaultLength = 4f,
resizable = true
},
new GameAction("slow rally", "Slow Rally")
{
function = delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Slow); },
defaultLength = 8f,
resizable = true
},
new GameAction("fast rally", "Fast Rally")
{
function = delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Fast); },
defaultLength = 6f
},
new GameAction("superfast rally", "Superfast Rally")
{
function = delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.SuperFast); },
defaultLength = 12f
},
new GameAction("pose", "End Pose")
{
function = delegate { RhythmRally.instance.Pose(); },
defaultLength = 0.5f
},
new GameAction("camera", "Camera Controls")
{
function = delegate {
var e = eventCaller.currentEntity;
var rotation = new Vector3(0, e["valA"], 0);
RhythmRally.instance.ChangeCameraAngle(rotation, e["valB"], e.length, (Ease)e["type"], (RotateMode)e["type2"]);
},
defaultLength = 4,
resizable = true,
parameters = new List<Param>() {
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle", "The rotation of the camera around the center of the table"),
new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom", "The camera's level of zoom (Lower value = Zoomed in)"),
new Param("type", Ease.Linear, "Ease", "The easing function to use"),
new Param("type2", RotateMode.Fast, "Rotation Mode", "The rotation mode to use")
}
},
});
}
}
@ -218,7 +259,7 @@ namespace HeavenStudio.Games
// Check if the opponent should swing.
if (!served && timeBeforeNextHit <= 0f)
{
List<Beatmap.Entity> rallies = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "rhythmRally/rally" || c.datamodel == "rhythmRally/slow rally");
var rallies = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "rhythmRally/rally" || c.datamodel == "rhythmRally/slow rally");
for (int i = 0; i < rallies.Count; i++)
{
var rally = rallies[i];

View File

@ -11,10 +11,25 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("rhythmSomen", "Rhythm Sōmen", "99CC34", false, false, new List<GameAction>()
{
new GameAction("crane (far)", delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); }, 4.0f, false),
new GameAction("crane (close)", delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); }, 3.0f, false),
new GameAction("crane (both)", delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); }, 4.0f, false),
new GameAction("offbeat bell", delegate { RhythmSomen.instance.DoBell(eventCaller.currentEntity.beat); }, 1.0f, false),
new GameAction("crane (far)", "Far Crane")
{
function = delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); },
defaultLength = 4.0f,
},
new GameAction("crane (close)", "Close Crane")
{
function = delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); },
defaultLength = 3.0f,
},
new GameAction("crane (both)", "Both Cranes")
{
function = delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); },
defaultLength = 4.0f,
},
new GameAction("offbeat bell", "Offbeat Warning")
{
function = delegate { RhythmSomen.instance.DoBell(eventCaller.currentEntity.beat); },
},
});
}
}

View File

@ -15,32 +15,74 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("rhythmTweezers", "Rhythm Tweezers", "98b389", false, false, new List<GameAction>()
{
new GameAction("start interval", delegate { RhythmTweezers.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 4f, true),
new GameAction("short hair", delegate { RhythmTweezers.instance.SpawnHair(eventCaller.currentEntity.beat); }, 0.5f),
new GameAction("long hair", delegate { RhythmTweezers.instance.SpawnLongHair(eventCaller.currentEntity.beat); }, 0.5f),
new GameAction("next vegetable", delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.NextVegetable(e.beat, e.type, e.colorA, e.colorB); }, 0.5f, false, new List<Param>()
new GameAction("start interval", "Start Interval")
{
new Param("type", RhythmTweezers.VegetableType.Onion, "Type", "The vegetable to switch to"),
new Param("colorA", RhythmTweezers.defaultOnionColor, "Onion Color", "The color of the onion"),
new Param("colorB", RhythmTweezers.defaultPotatoColor, "Potato Color", "The color of the potato")
} ),
new GameAction("change vegetable", delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.ChangeVegetableImmediate(e.type, e.colorA, e.colorB); }, 0.5f, false, new List<Param>()
function = delegate { RhythmTweezers.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); },
defaultLength = 4f,
resizable = true
},
new GameAction("short hair", "Short Hair")
{
new Param("type", RhythmTweezers.VegetableType.Onion, "Type", "The vegetable to switch to"),
new Param("colorA", RhythmTweezers.defaultOnionColor, "Onion Color", "The color of the onion"),
new Param("colorB", RhythmTweezers.defaultPotatoColor, "Potato Color", "The color of the potato")
} ),
new GameAction("set tweezer delay", delegate { RhythmTweezers.instance.tweezerBeatOffset = eventCaller.currentEntity.length; }, 1f, true),
new GameAction("reset tweezer delay", delegate { RhythmTweezers.instance.tweezerBeatOffset = 0f; }, 0.5f),
new GameAction("set background color", delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.ChangeBackgroundColor(e.colorA, 0f); }, 0.5f, false, new List<Param>()
function = delegate { RhythmTweezers.instance.SpawnHair(eventCaller.currentEntity.beat); },
defaultLength = 0.5f
},
new GameAction("long hair", "Curly Hair")
{
new Param("colorA", RhythmTweezers.defaultBgColor, "Background Color", "The background color to change to")
} ),
new GameAction("fade background color", delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.FadeBackgroundColor(e.colorA, e.colorB, e.length); }, 1f, true, new List<Param>()
function = delegate { RhythmTweezers.instance.SpawnLongHair(eventCaller.currentEntity.beat); },
defaultLength = 0.5f
},
new GameAction("next vegetable", "Swap Vegetable")
{
new Param("colorA", Color.white, "Start Color", "The starting color in the fade"),
new Param("colorB", RhythmTweezers.defaultBgColor, "End Color", "The ending color in the fade")
} ),
function = delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.NextVegetable(e.beat, e["type"], e["colorA"], e["colorB"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", RhythmTweezers.VegetableType.Onion, "Type", "The vegetable to switch to"),
new Param("colorA", RhythmTweezers.defaultOnionColor, "Onion Color", "The color of the onion"),
new Param("colorB", RhythmTweezers.defaultPotatoColor, "Potato Color", "The color of the potato")
}
},
new GameAction("change vegetable", "Change Vegetable (Instant)")
{
function = delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.ChangeVegetableImmediate(e["type"], e["colorA"], e["colorB"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("type", RhythmTweezers.VegetableType.Onion, "Type", "The vegetable to switch to"),
new Param("colorA", RhythmTweezers.defaultOnionColor, "Onion Color", "The color of the onion"),
new Param("colorB", RhythmTweezers.defaultPotatoColor, "Potato Color", "The color of the potato")
}
},
new GameAction("set tweezer delay", "Offset Tweezer")
{
function = delegate { RhythmTweezers.instance.tweezerBeatOffset = eventCaller.currentEntity.length; },
resizable = true
},
new GameAction("reset tweezer delay", "Reset Tweezer Offset")
{
function = delegate { RhythmTweezers.instance.tweezerBeatOffset = 0f; },
defaultLength = 0.5f
},
new GameAction("set background color", "Background Colour")
{
function = delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.ChangeBackgroundColor(e["colorA"], 0f); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("colorA", RhythmTweezers.defaultBgColor, "Background Color", "The background color to change to")
}
},
new GameAction("fade background color", "Background Fade")
{
function = delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.FadeBackgroundColor(e["colorA"], e["colorB"], e.length); },
resizable = true,
parameters = new List<Param>()
{
new Param("colorA", Color.white, "Start Color", "The starting color in the fade"),
new Param("colorB", RhythmTweezers.defaultBgColor, "End Color", "The ending color in the fade")
}
}
});
}
}

View File

@ -14,15 +14,19 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("samuraiSliceNtr", "Samurai Slice (DS)", "00165D", false, false, new List<GameAction>()
{
new GameAction("spawn object", delegate
new GameAction("spawn object", "Toss Object")
{
SamuraiSliceNtr.instance.ObjectIn(eventCaller.currentEntity.beat, eventCaller.currentEntity.type, (int) eventCaller.currentEntity.valA);
}, 8, false, new List<Param>()
{
new Param("type", SamuraiSliceNtr.ObjectType.Melon, "Object", "The object to spawn"),
new Param("valA", new EntityTypes.Integer(0, 30, 1), "Money", "The amount of coins the object spills out when sliced"),
}),
//new GameAction("start bopping", delegate { SamuraiSliceNtr.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1),
function = delegate
{
SamuraiSliceNtr.instance.ObjectIn(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"], (int) eventCaller.currentEntity["valA"]);
},
defaultLength = 8,
parameters = new List<Param>()
{
new Param("type", SamuraiSliceNtr.ObjectType.Melon, "Object", "The object to spawn"),
new Param("valA", new EntityTypes.Integer(0, 30, 1), "Money", "The amount of coins the object spills out when sliced"),
}
},
},
new List<string>() {"ntr", "normal"},
"ntrsamurai", "en",

View File

@ -11,10 +11,25 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("spaceDance", "Space Dance \n<color=#eb5454>[WIP don't use]</color>", "FFFF34", false, false, new List<GameAction>()
{
new GameAction("turn right", delegate { SpaceDance.instance.DoTurnRight(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("sit down", delegate { SpaceDance.instance.DoSitDown(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("punch", delegate { SpaceDance.instance.DoPunch(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("bop", delegate { SpaceDance.instance.Bop(eventCaller.currentEntity.beat); }, 1.0f, false),
new GameAction("turn right", "Turn Right")
{
function = delegate { SpaceDance.instance.DoTurnRight(eventCaller.currentEntity.beat); },
defaultLength = 2.0f,
},
new GameAction("sit down", "Sit Down")
{
function = delegate { SpaceDance.instance.DoSitDown(eventCaller.currentEntity.beat); },
defaultLength = 2.0f,
},
new GameAction("punch", "Punch")
{
function = delegate { SpaceDance.instance.DoPunch(eventCaller.currentEntity.beat); },
defaultLength = 2.0f,
},
new GameAction("bop", "Bop")
{
function = delegate { SpaceDance.instance.Bop(eventCaller.currentEntity.beat); },
},
});
}
}

View File

@ -47,7 +47,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
return;
}
List<Beatmap.Entity> highKicks = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "spaceSoccer/high kick-toe!");
var highKicks = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "spaceSoccer/high kick-toe!");
int numHighKicks = 0;
//determine what state the ball was in for the previous kick.
for(int i = 0; i < highKicks.Count; i++)

View File

@ -183,7 +183,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer
// }
// }
List<Beatmap.Entity> highKicks = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "spaceSoccer/high kick-toe!");
var highKicks = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "spaceSoccer/high kick-toe!");
for (int i = 0; i < highKicks.Count; i++)
{
if ((highKicks[i].beat - 0.15f) <= Conductor.instance.songPositionInBeats && highKicks[i].beat + 1f > Conductor.instance.songPositionInBeats)

View File

@ -12,17 +12,30 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
{
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat, !eventCaller.currentEntity.toggle); }, 2f,
parameters: new List<Param>()
new GameAction("ball dispense", "Ball Dispense")
{
function = delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat, !eventCaller.currentEntity["toggle"]); },
defaultLength = 2f,
parameters = new List<Param>()
{
new Param("toggle", false, "Disable Sound", "Disables the dispense sound")
},
inactiveFunction: delegate { if (!eventCaller.currentEntity.toggle) { SpaceSoccer.DispenseSound(eventCaller.currentEntity.beat); } }),
new GameAction("high kick-toe!", delegate { }, 3f, false, new List<Param>()
inactiveFunction = delegate { if (!eventCaller.currentEntity["toggle"]) { SpaceSoccer.DispenseSound(eventCaller.currentEntity.beat); } }
},
new GameAction("high kick-toe!", "High Kick-Toe!")
{
new Param("swing", new EntityTypes.Float(0, 1, 0.5f), "Swing", "The amount of swing")
}),
new GameAction("keep-up", delegate { }, 4f, true, hidden: true),
defaultLength = 3f,
parameters = new List<Param>()
{
new Param("swing", new EntityTypes.Float(0, 1, 0.5f), "Swing", "The amount of swing")
}
},
// This is still here for "backwards-compatibility" but is hidden in the editor (it does absolutely nothing however)
new GameAction("keep-up", "")
{
defaultLength = 4f,
resizable = true
},
});
}
}
@ -69,7 +82,7 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(float beat)
{
foreach(Beatmap.Entity entity in GameManager.instance.Beatmap.entities)
foreach(var entity in GameManager.instance.Beatmap.entities)
{
if(entity.beat > beat) //the list is sorted based on the beat of the entity, so this should work fine.
{

View File

@ -12,25 +12,51 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("spaceball", "Spaceball", "00A518", false, false, new List<GameAction>()
{
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, false, eventCaller.currentEntity.type); }, 2, false, new List<Param>()
new GameAction("shoot", "Pitch Ball")
{
new Param("type", Spaceball.BallType.Baseball, "Type", "The type of ball/object to shoot")
} ),
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, true, eventCaller.currentEntity.type); }, 3, false, new List<Param>()
function = delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, false, eventCaller.currentEntity["type"]); },
defaultLength = 2,
parameters = new List<Param>()
{
new Param("type", Spaceball.BallType.Baseball, "Type", "The type of ball/object to shoot")
}
},
new GameAction("shootHigh", "Pitch High Ball")
{
new Param("type", Spaceball.BallType.Baseball, "Type", "The type of ball/object to shoot")
} ),
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentEntity.type); }, 1f, false, new List<Param>()
function = delegate { Spaceball.instance.Shoot(eventCaller.currentEntity.beat, true, eventCaller.currentEntity["type"]); },
defaultLength = 3,
parameters = new List<Param>()
{
new Param("type", Spaceball.BallType.Baseball, "Type", "The type of ball/object to shoot")
}
},
new GameAction("costume", "Change Batter Costume")
{
new Param("type", Spaceball.CostumeType.Standard, "Type", "The costume to change to")
} ),
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentEntity.beat); } ),
new GameAction("camera", delegate { Spaceball.instance.OverrideCurrentZoom(); }, 4, true, new List<Param>()
function = delegate { Spaceball.instance.Costume(eventCaller.currentEntity["type"]); },
parameters = new List<Param>()
{
new Param("type", Spaceball.CostumeType.Standard, "Type", "The costume to change to")
}
},
new GameAction("alien", "Show Alien")
{
new Param("valA", new EntityTypes.Integer(1, 320, 10), "Zoom", "The camera's zoom level (Lower value = Zoomed in)"),
new Param("ease", EasingFunction.Ease.Linear, "Ease", "The easing function to use while zooming")
} ),
new GameAction("prepare dispenser", delegate { Spaceball.instance.PrepareDispenser(); }, 1 ),
function = delegate { Spaceball.instance.alien.Show(eventCaller.currentEntity.beat); }
},
new GameAction("camera", "Zoom Camera")
{
function = delegate { Spaceball.instance.OverrideCurrentZoom(); },
defaultLength = 4,
resizable = true,
parameters = new List<Param>()
{
new Param("valA", new EntityTypes.Integer(1, 320, 10), "Zoom", "The camera's zoom level (Lower value = Zoomed in)"),
new Param("ease", EasingFunction.Ease.Linear, "Ease", "The easing function to use while zooming")
}
},
new GameAction("prepare dispenser", "Dispenser Prepare")
{
function = delegate { Spaceball.instance.PrepareDispenser(); },
},
});
}
}
@ -68,7 +94,7 @@ namespace HeavenStudio.Games
public Sprite[] Balls;
private List<Beatmap.Entity> allCameraEvents = new List<Beatmap.Entity>();
private List<DynamicBeatmap.DynamicEntity> allCameraEvents = new List<DynamicBeatmap.DynamicEntity>();
public Alien alien;
@ -95,7 +121,7 @@ namespace HeavenStudio.Games
{
instance = this;
var camEvents = EventCaller.GetAllInGameManagerList("spaceball", new string[] { "camera" });
List<Beatmap.Entity> tempEvents = new List<Beatmap.Entity>();
List<DynamicBeatmap.DynamicEntity> tempEvents = new List<DynamicBeatmap.DynamicEntity>();
for (int i = 0; i < camEvents.Count; i++)
{
if (camEvents[i].beat + camEvents[i].beat >= Conductor.instance.songPositionInBeats)
@ -161,26 +187,26 @@ namespace HeavenStudio.Games
if (currentZoomIndex < allCameraEvents.Count && currentZoomIndex >= 0)
{
if (currentZoomIndex - 1 >= 0)
lastCamDistance = allCameraEvents[currentZoomIndex - 1].valA * -1;
lastCamDistance = allCameraEvents[currentZoomIndex - 1]["valA"] * -1;
else
{
if (currentZoomIndex == 0)
lastCamDistance = -10;
else
lastCamDistance = allCameraEvents[0].valA * -1;
lastCamDistance = allCameraEvents[0]["valA"] * -1;
}
currentZoomCamBeat = allCameraEvents[currentZoomIndex].beat;
currentZoomCamLength = allCameraEvents[currentZoomIndex].length;
float dist = allCameraEvents[currentZoomIndex].valA * -1;
float dist = allCameraEvents[currentZoomIndex]["valA"] * -1;
if (dist > 0)
currentZoomCamDistance = 0;
else
currentZoomCamDistance = dist;
lastEase = allCameraEvents[currentZoomIndex].ease;
lastEase = (EasingFunction.Ease) allCameraEvents[currentZoomIndex]["ease"];
}
}

View File

@ -14,26 +14,72 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("tapTrial", "Tap Trial \n<color=#eb5454>[WIP]</color>", "93ffb3", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { TapTrial.instance.Bop(eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
new GameAction("bop", "Bop")
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}),
new GameAction("tap", delegate { TapTrial.instance.Tap(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("double tap", delegate { TapTrial.instance.DoubleTap(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("triple tap", delegate { TapTrial.instance.TripleTap(eventCaller.currentEntity.beat); }, 4.0f, false),
new GameAction("jump tap prep", delegate { TapTrial.instance.JumpTapPrep(eventCaller.currentEntity.beat); }, 1.0f, false),
new GameAction("jump tap", delegate { TapTrial.instance.JumpTap(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("final jump tap", delegate { TapTrial.instance.FinalJumpTap(eventCaller.currentEntity.beat); }, 2.0f, false),
new GameAction("scroll event", delegate { TapTrial.instance.scrollEvent(eventCaller.currentEntity.toggle, eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
function = delegate { TapTrial.instance.Bop(eventCaller.currentEntity["toggle"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
}
},
new GameAction("tap", "Tap")
{
new Param("toggle", false, "Scroll FX", "Will scroll"),
new Param("toggle", false, "Flash FX", "Will flash to white"),
}),
new GameAction("giraffe events", delegate { TapTrial.instance.giraffeEvent(eventCaller.currentEntity.toggle, eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
function = delegate { TapTrial.instance.Tap(eventCaller.currentEntity.beat); },
defaultLength = 2.0f
},
new GameAction("double tap", "Double Tap")
{
new Param("toggle", false, "Enter", "Giraffe will enter the scene"),
new Param("toggle", false, "Exit", "Giraffe will exit the scene"),
})
function = delegate { TapTrial.instance.DoubleTap(eventCaller.currentEntity.beat); },
defaultLength = 2.0f
},
new GameAction("triple tap", "Triple Tap")
{
function = delegate { TapTrial.instance.TripleTap(eventCaller.currentEntity.beat); },
defaultLength = 4.0f
},
new GameAction("jump tap prep", "Prepare Stance")
{
function = delegate { TapTrial.instance.JumpTapPrep(eventCaller.currentEntity.beat); },
},
new GameAction("jump tap", "Jump Tap")
{
function = delegate { TapTrial.instance.JumpTap(eventCaller.currentEntity.beat); },
defaultLength = 2.0f
},
new GameAction("final jump tap", "Final Jump Tap")
{
function = delegate { TapTrial.instance.FinalJumpTap(eventCaller.currentEntity.beat); },
defaultLength = 2.0f
},
new GameAction("scroll event", "Scroll Background")
{
function = delegate { TapTrial.instance.scrollEvent(eventCaller.currentEntity["toggle"], eventCaller.currentEntity["toggle"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Scroll FX", "Will scroll"),
new Param("toggle", false, "Flash FX", "Will flash to white"),
}
},
new GameAction("giraffe events", "Giraffe Animations")
{
function = delegate { TapTrial.instance.giraffeEvent(eventCaller.currentEntity["toggle"], eventCaller.currentEntity["toggle"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Enter", "Giraffe will enter the scene"),
new Param("toggle", false, "Exit", "Giraffe will exit the scene"),
}
}
});
}
}

View File

@ -12,11 +12,20 @@ namespace HeavenStudio.Games.Loaders
{
return new Minigame("tram&Pauline", "Tram & Pauline \n<color=#eb5454>[WIP]</color>", "E7A59C", false, false, new List<GameAction>()
{
new GameAction("curtains", delegate { TramAndPauline.instance.Curtains(eventCaller.currentEntity.beat); }, 0.5f),
new GameAction("SFX", delegate { var e = eventCaller.currentEntity; TramAndPauline.instance.SFX(e.beat, e.toggle); }, 2.5f, false, new List<Param>()
new GameAction("curtains", "Curtains")
{
new Param("type", TramAndPauline.SoundEffects.Henge, "calls", "the sound effects to choose from"),
}),
function = delegate { TramAndPauline.instance.Curtains(eventCaller.currentEntity.beat); },
defaultLength = 0.5f
},
new GameAction("SFX", "SFX")
{
function = delegate { var e = eventCaller.currentEntity; TramAndPauline.instance.SFX(e.beat, e["toggle"]); },
defaultLength = 2.5f,
parameters = new List<Param>()
{
new Param("type", TramAndPauline.SoundEffects.Henge, "calls", "the sound effects to choose from"),
}
},
});
}

View File

@ -15,14 +15,24 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("trickClass", "Trick on the Class", "C0171D", false, false, new List<GameAction>()
{
new GameAction("toss", delegate
new GameAction("toss", "Toss Object")
{
TrickClass.instance.TossObject(eventCaller.currentEntity.beat, eventCaller.currentEntity.type);
}, 3, false, new List<Param>()
function = delegate
{
TrickClass.instance.TossObject(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"]);
},
defaultLength = 3,
parameters = new List<Param>()
{
new Param("type", TrickClass.TrickObjType.Ball, "Object", "The object to toss")
}
},
new GameAction("bop", "")
{
new Param("type", TrickClass.TrickObjType.Ball, "Object", "The object to toss")
}),
new GameAction("bop", delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length); }, 1, true, hidden: true),
function = delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length); },
resizable = true,
hidden = true
},
});
}
}
@ -100,7 +110,7 @@ namespace HeavenStudio.Games
if (timeToEvent > 0f && timeToEvent <= 1f)
{
string anim = "WarnBall";
switch (e.type)
switch (e["type"])
{
case (int) TrickObjType.Plane:
anim = "WarnPlane";

View File

@ -15,8 +15,17 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("wizardsWaltz", "Wizard's Waltz \n<color=#adadad>(Mahou Tsukai)</color>", "FFEF9C", false, false, new List<GameAction>()
{
new GameAction("start interval", delegate { WizardsWaltz.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 4f, true),
new GameAction("plant", delegate { WizardsWaltz.instance.SpawnFlower(eventCaller.currentEntity.beat); }, 0.5f, false),
new GameAction("start interval", "Start Interval")
{
function = delegate { WizardsWaltz.instance.SetIntervalStart(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); },
defaultLength = 4f,
resizable = true
},
new GameAction("plant", "Plant")
{
function = delegate { WizardsWaltz.instance.SpawnFlower(eventCaller.currentEntity.beat); },
defaultLength = 0.5f,
},
});
}
}
@ -51,7 +60,7 @@ namespace HeavenStudio.Games
instance = this;
wizard.Init();
Beatmap.Entity nextStart = GameManager.instance.Beatmap.entities.Find(c => c.datamodel == "wizardsWaltz/start interval" && c.beat + c.length >= Conductor.instance.songPositionInBeats);
var nextStart = GameManager.instance.Beatmap.entities.Find(c => c.datamodel == "wizardsWaltz/start interval" && c.beat + c.length >= Conductor.instance.songPositionInBeats);
if (nextStart != null)
{

View File

@ -127,7 +127,7 @@ namespace HeavenStudio.Editor.Commands
deletedObj = eventObj;
Selections.instance.Deselect(eventObj);
Timeline.instance.DestroyEventObject(eventObj.entity);
// Beatmap.Entity e = deletedObjs[i].entity;
// DynamicBeatmap.DynamicEntity e = deletedObjs[i].entity;
// Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
}
}
@ -166,7 +166,7 @@ namespace HeavenStudio.Editor.Commands
{
for (int i = 0; i < deletedObjs.Count; i++)
{
Beatmap.Entity e = deletedObjs[i].entity;
DynamicBeatmap.DynamicEntity e = deletedObjs[i].entity;
eventObjs[i] = Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
}
}
@ -190,7 +190,7 @@ namespace HeavenStudio.Editor.Commands
{
for (int i = 0; i < copiedObjs.Count; i++)
{
Beatmap.Entity e = copiedObjs[i].entity;
DynamicBeatmap.DynamicEntity e = copiedObjs[i].entity;
eventObjs[i] = Timeline.instance.AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * Timeline.instance.LayerHeight()), e, true, e.eventObj.eventObjID);
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37f86271d7b215d48a41243e6b22ae5b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public class Dialog : MonoBehaviour
{
[SerializeField] protected GameObject dialog;
public void ForceState(bool onoff = false)
{
Editor.instance.canSelect = onoff;
Editor.instance.inAuthorativeMenu = !onoff;
dialog.SetActive(onoff);
}
public static void ResetAllDialogs()
{
foreach(var dialog in FindObjectsOfType<Dialog>())
{
dialog.ForceState(false);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e317d304732b562489c993ae93ce2265
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public abstract class TabsContent : MonoBehaviour
{
public abstract void OnOpenTab();
public abstract void OnCloseTab();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c95e3e333c0372d498ab6cdad5a6ac1d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15,10 +15,28 @@ namespace HeavenStudio.Editor
{
if (activeContent != null)
{
activeContent.GetComponent<TabsContent>().OnCloseTab();
activeContent.SetActive(false);
}
activeContent = content;
activeContent.SetActive(true);
activeContent.GetComponent<TabsContent>().OnOpenTab();
}
public void OpenContent()
{
if (activeContent != null)
{
activeContent.GetComponent<TabsContent>().OnOpenTab();
}
}
public void CloseContent()
{
if (activeContent != null)
{
activeContent.GetComponent<TabsContent>().OnCloseTab();
}
}
}
}

View File

@ -52,10 +52,14 @@ namespace HeavenStudio.Editor
[SerializeField] private Button FullScreenBTN;
[SerializeField] private Button TempoFinderBTN;
[SerializeField] private Button SnapDiagBTN;
[SerializeField] private Button ChartParamBTN;
[SerializeField] private Button EditorThemeBTN;
[SerializeField] private Button EditorSettingsBTN;
[Header("Dialogs")]
[SerializeField] private Dialog[] Dialogs;
[Header("Tooltip")]
public TMP_Text tooltipText;
@ -68,8 +72,11 @@ namespace HeavenStudio.Editor
public bool discordDuringTesting = false;
public bool canSelect = true;
public bool editingInputField = false;
public bool inAuthorativeMenu = false;
public bool isCursorEnabled = true;
public bool isShortcutsEnabled { get { return (!inAuthorativeMenu) && (!editingInputField); } }
private byte[] MusicBytes;
public static Editor instance { get; private set; }
@ -111,6 +118,7 @@ namespace HeavenStudio.Editor
Tooltip.AddTooltip(FullScreenBTN.gameObject, "Preview <color=#adadad>[Tab]</color>");
Tooltip.AddTooltip(TempoFinderBTN.gameObject, "Tempo Finder");
Tooltip.AddTooltip(SnapDiagBTN.gameObject, "Snap Settings");
Tooltip.AddTooltip(ChartParamBTN.gameObject, "Remix Properties");
Tooltip.AddTooltip(EditorSettingsBTN.gameObject, "Editor Settings <color=#adadad>[Ctrl+Shift+O]</color>");
UpdateEditorStatus(true);
@ -119,7 +127,7 @@ namespace HeavenStudio.Editor
public void LateUpdate()
{
#region Keyboard Shortcuts
if (!editingInputField)
if (isShortcutsEnabled)
{
if (Input.GetKeyDown(KeyCode.Tab))
{
@ -160,7 +168,7 @@ namespace HeavenStudio.Editor
{
if (Input.GetKeyDown(KeyCode.N))
{
NewRemix();
NewBTN.onClick.Invoke();
}
else if (Input.GetKeyDown(KeyCode.O))
{
@ -299,18 +307,31 @@ namespace HeavenStudio.Editor
try
{
if (clip != null)
MusicBytes = OggVorbis.VorbisPlugin.GetOggVorbis(Conductor.instance.musicSource.clip, 1);
MusicBytes = OggVorbis.VorbisPlugin.GetOggVorbis(clip, 1);
else
{
MusicBytes = null;
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
}
}
catch (System.Exception)
catch (System.ArgumentNullException)
{
clip = null;
MusicBytes = null;
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
}
catch (System.ArgumentOutOfRangeException)
{
clip = null;
MusicBytes = null;
Debug.LogWarning("Failed to load music file! The stream is malformed.");
}
catch (System.ArgumentException)
{
clip = null;
MusicBytes = null;
Debug.LogWarning("Failed to load music file! Only 1 or 2 channels are supported!.");
}
return clip;
}
@ -339,7 +360,7 @@ namespace HeavenStudio.Editor
{
var extensions = new[]
{
new ExtensionFilter("Heaven Studio Remix File", "tengoku")
new ExtensionFilter("Heaven Studio Remix File", "riq")
};
StandaloneFileBrowser.SaveFilePanelAsync("Save Remix As", "", "remix_level", extensions, (string path) =>
@ -376,13 +397,17 @@ namespace HeavenStudio.Editor
public void NewRemix()
{
if (Timeline.instance != null)
Timeline.instance?.Stop(0);
else
GameManager.instance.Stop(0);
MusicBytes = null;
LoadRemix("");
}
public void LoadRemix(string json = "")
public void LoadRemix(string json = "", string type = "riq")
{
GameManager.instance.LoadRemix(json);
GameManager.instance.LoadRemix(json, type);
Timeline.instance.LoadRemix();
Timeline.instance.TempoInfo.UpdateStartingBPMText();
Timeline.instance.VolumeInfo.UpdateStartingVolumeText();
@ -396,7 +421,9 @@ namespace HeavenStudio.Editor
{
var extensions = new[]
{
new ExtensionFilter("Heaven Studio Remix File", new string[] { "tengoku", "rhmania" })
new ExtensionFilter("All Supported Files ", new string[] { "riq", "tengoku", "rhmania" }),
new ExtensionFilter("Heaven Studio Remix File ", new string[] { "riq" }),
new ExtensionFilter("Legacy Heaven Studio Remix ", new string[] { "tengoku", "rhmania" })
};
StandaloneFileBrowser.OpenFilePanelAsync("Open Remix", "", extensions, false, (string[] paths) =>
@ -405,6 +432,7 @@ namespace HeavenStudio.Editor
if (path == string.Empty) return;
loadedMusic = false;
string extension = path.GetExtension();
using var zipFile = File.Open(path, FileMode.Open);
using var archive = new ZipArchive(zipFile, ZipArchiveMode.Read);
@ -416,7 +444,7 @@ namespace HeavenStudio.Editor
{
using var stream = entry.Open();
using var reader = new StreamReader(stream);
LoadRemix(reader.ReadToEnd());
LoadRemix(reader.ReadToEnd(), extension);
break;
}
@ -435,7 +463,10 @@ namespace HeavenStudio.Editor
}
if (!loadedMusic)
{
Conductor.instance.musicSource.clip = null;
MusicBytes = null;
}
currentRemixPath = path;
remixName = Path.GetFileName(path);

View File

@ -20,7 +20,7 @@ namespace HeavenStudio.Editor
[SerializeField] private GameObject ColorP;
[SerializeField] private GameObject StringP;
public Beatmap.Entity entity;
public DynamicBeatmap.DynamicEntity entity;
public bool active;
@ -61,13 +61,13 @@ namespace HeavenStudio.Editor
Editor.instance.SetGameEventTitle($"Select game event for {gridGameSelector.SelectedMinigame.Replace("\n", "")}");
}
public void StartParams(Beatmap.Entity entity)
public void StartParams(DynamicBeatmap.DynamicEntity entity)
{
active = true;
AddParams(entity);
}
private void AddParams(Beatmap.Entity entity)
private void AddParams(DynamicBeatmap.DynamicEntity entity)
{
var minigame = EventCaller.instance.GetMinigame(entity.datamodel.Split(0));
int actionIndex = minigame.actions.IndexOf(minigame.actions.Find(c => c.actionName == entity.datamodel.Split(1)));
@ -99,46 +99,70 @@ namespace HeavenStudio.Editor
private void AddParam(string propertyName, object type, string caption, string tooltip = "")
{
GameObject prefab = IntegerP;
GameObject input;
var objType = type.GetType();
if (objType == typeof(EntityTypes.Integer))
{
prefab = IntegerP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<NumberPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
}
else if (objType == typeof(EntityTypes.Float))
{
prefab = FloatP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<NumberPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
}
else if(type is bool)
{
prefab = BooleanP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<BoolPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
}
else if (objType.IsEnum)
{
prefab = DropdownP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<EnumPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
}
else if (objType == typeof(Color))
{
prefab = ColorP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<ColorPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
}
else if(objType == typeof(string))
{
prefab = StringP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<StringPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
}
else
{
Debug.LogError("Can't make property interface of type: " + type.GetType());
return;
}
}
private GameObject InitPrefab(GameObject prefab, string tooltip = "")
{
GameObject input = Instantiate(prefab);
input.transform.SetParent(this.gameObject.transform);
input.SetActive(true);
input.transform.localScale = Vector2.one;
if(tooltip != "")
{
if(tooltip != string.Empty)
Tooltip.AddTooltip(input, "", tooltip);
}
var property = input.GetComponent<EventPropertyPrefab>();
property.SetProperties(propertyName, type, caption);
return input;
}
private void DestroyParams()

View File

@ -14,188 +14,16 @@ namespace HeavenStudio.Editor
public class EventPropertyPrefab : MonoBehaviour
{
public TMP_Text caption;
[SerializeField] private EventParameterManager parameterManager;
public EventParameterManager parameterManager;
public string propertyName;
[Header("Integer and Float")]
[Space(10)]
public Slider slider;
public TMP_InputField inputField;
public void SetProperties(string propertyName, object type, string caption) {}
[Header("Boolean")]
[Space(10)]
public Toggle toggle;
[Header("Dropdown")]
[Space(10)]
public TMP_Dropdown dropdown;
[Header("Color")]
[Space(10)]
public Button ColorBTN;
public RectTransform ColorTable;
public bool colorTableActive;
public ColorPreview colorPreview;
[Header("String")] //why wasn't this a thing before
[Space(10)]
public TMP_InputField inputFieldString;
private string propertyName;
public void SetProperties(string propertyName, object type, string caption)
public void InitProperties(string propertyName, string caption)
{
this.parameterManager = EventParameterManager.instance;
this.propertyName = propertyName;
this.caption.text = caption;
switch (type)
{
case EntityTypes.Integer integer:
slider.minValue = integer.min;
slider.maxValue = integer.max;
slider.wholeNumbers = true;
slider.value = Convert.ToSingle(parameterManager.entity[propertyName]);
inputField.text = slider.value.ToString();
slider.onValueChanged.AddListener(
_ =>
{
inputField.text = slider.value.ToString();
parameterManager.entity[propertyName] = (int) slider.value;
}
);
inputField.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputField.onEndEdit.AddListener(
_ =>
{
slider.value = Convert.ToSingle(inputField.text);
parameterManager.entity[propertyName] = (int) slider.value;
Editor.instance.editingInputField = false;
}
);
break;
case EntityTypes.Float fl:
slider.minValue = fl.min;
slider.maxValue = fl.max;
slider.value = Convert.ToSingle(parameterManager.entity[propertyName]);
inputField.text = slider.value.ToString("G");
slider.onValueChanged.AddListener(
_ =>
{
var newValue = (float) Math.Round(slider.value, 4);
inputField.text = newValue.ToString("G");
parameterManager.entity[propertyName] = newValue;
}
);
inputField.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputField.onEndEdit.AddListener(
_ =>
{
slider.value = (float) Math.Round(Convert.ToSingle(inputField.text), 4);
parameterManager.entity[propertyName] = slider.value;
Editor.instance.editingInputField = false;
}
);
break;
case bool _:
// ' (bool)type ' always results in false
toggle.isOn = Convert.ToBoolean(parameterManager.entity[propertyName]);
toggle.onValueChanged.AddListener(
_ => parameterManager.entity[propertyName] = toggle.isOn
);
break;
case Color _:
colorPreview.colorPicker.onColorChanged += _ =>
parameterManager.entity[propertyName] = colorPreview.colorPicker.color;
var paramCol = (Color) parameterManager.entity[propertyName];
ColorBTN.onClick.AddListener(
() =>
{
ColorTable.gameObject.SetActive(true);
colorTableActive = true;
colorPreview.ChangeColor(paramCol);
}
);
colorPreview.ChangeColor(paramCol);
ColorTable.gameObject.SetActive(false);
break;
case string _:
inputFieldString.text = (string) parameterManager.entity[propertyName];
inputFieldString.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputFieldString.onEndEdit.AddListener(
_ =>
{;
parameterManager.entity[propertyName] = inputFieldString.text;
Editor.instance.editingInputField = false;
}
);
break;
case Enum enumKind:
var enumType = enumKind.GetType();
var enumVals = Enum.GetValues(enumType);
var enumNames = Enum.GetNames(enumType).ToList();
// Can we assume non-holey enum?
// If we can we can simplify to dropdown.value = (int) parameterManager.entity[propertyName]
var currentlySelected = (int) parameterManager.entity[propertyName];
var selected = enumVals
.Cast<object>()
.ToList()
.FindIndex(val => (int) val == currentlySelected);
dropdown.AddOptions(enumNames);
dropdown.value = selected;
dropdown.onValueChanged.AddListener(_ =>
parameterManager.entity[propertyName] = (int) enumVals.GetValue(dropdown.value)
);
break;
default:
throw new ArgumentOutOfRangeException(
nameof(type), type, "I don't know how to make a property of this type!"
);
}
}
private void Update()
{
if (colorTableActive)
{
if (!Editor.MouseInRectTransform(ColorTable))
{
if (Input.GetMouseButtonDown(0))
{
ColorTable.gameObject.SetActive(false);
colorTableActive = false;
}
}
}
}
}
}

View File

@ -140,7 +140,7 @@ namespace HeavenStudio.Editor
if (!EventCaller.FXOnlyGames().Contains(EventCaller.instance.GetMinigame(mg.name)))
{
GameObject sg = Instantiate(EventRef, eventsParent);
sg.GetComponent<TMP_Text>().text = "switchGame";
sg.GetComponent<TMP_Text>().text = "Switch Game";
sg.SetActive(true);
sg.GetComponent<TMP_Text>().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB();
}
@ -149,7 +149,7 @@ namespace HeavenStudio.Editor
{
if (mg.actions[i].actionName == "switchGame" || mg.actions[i].hidden) continue;
GameObject g = Instantiate(EventRef, eventsParent);
g.GetComponent<TMP_Text>().text = mg.actions[i].actionName;
g.GetComponent<TMP_Text>().text = mg.actions[i].displayName;
g.SetActive(true);
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 28745dfd251ff86468a98978665f553b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b86ddd3d47bb04e48a61db47242e02ed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class BoolPropertyPrefab : EventPropertyPrefab
{
[Header("Boolean")]
[Space(10)]
public Toggle toggle;
new public void SetProperties(string propertyName, object type, string caption)
{
InitProperties(propertyName, caption);
// ' (bool)type ' always results in false
toggle.isOn = Convert.ToBoolean(parameterManager.entity[propertyName]);
toggle.onValueChanged.AddListener(
_ => parameterManager.entity[propertyName] = toggle.isOn
);
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9aa690f14ccbf9e4bb6bd339d500c3e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,61 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class ColorPropertyPrefab : EventPropertyPrefab
{
[Header("Color")]
[Space(10)]
public Button ColorBTN;
public RectTransform ColorTable;
public bool colorTableActive;
public ColorPreview colorPreview;
new public void SetProperties(string propertyName, object type, string caption)
{
InitProperties(propertyName, caption);
colorPreview.colorPicker.onColorChanged += _ =>
parameterManager.entity[propertyName] = colorPreview.colorPicker.color;
Color paramCol = parameterManager.entity[propertyName];
ColorBTN.onClick.AddListener(
() =>
{
ColorTable.gameObject.SetActive(true);
colorTableActive = true;
colorPreview.ChangeColor(paramCol);
}
);
colorPreview.ChangeColor(paramCol);
ColorTable.gameObject.SetActive(false);
}
private void Update()
{
if (colorTableActive)
{
if (!Editor.MouseInRectTransform(ColorTable))
{
if (Input.GetMouseButtonDown(0))
{
ColorTable.gameObject.SetActive(false);
colorTableActive = false;
}
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c1c576a0586b70d4395de537078023d5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class EnumPropertyPrefab : EventPropertyPrefab
{
[Header("Dropdown")]
[Space(10)]
public TMP_Dropdown dropdown;
new public void SetProperties(string propertyName, object type, string caption)
{
InitProperties(propertyName, caption);
var enumType = type.GetType();
var enumVals = Enum.GetValues(enumType);
var enumNames = Enum.GetNames(enumType).ToList();
// Can we assume non-holey enum?
// If we can we can simplify to dropdown.value = (int) parameterManager.entity[propertyName]
var currentlySelected = (int) parameterManager.entity[propertyName];
var selected = enumVals
.Cast<object>()
.ToList()
.FindIndex(val => (int) val == currentlySelected);
dropdown.AddOptions(enumNames);
dropdown.value = selected;
dropdown.onValueChanged.AddListener(_ =>
parameterManager.entity[propertyName] = (int) enumVals.GetValue(dropdown.value)
);
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8ada001011e54c74b87c04d7186d5f3c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,101 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class NumberPropertyPrefab : EventPropertyPrefab
{
[Header("Integer and Float")]
[Space(10)]
public Slider slider;
public TMP_InputField inputField;
new public void SetProperties(string propertyName, object type, string caption)
{
InitProperties(propertyName, caption);
switch (type)
{
case EntityTypes.Integer integer:
slider.minValue = integer.min;
slider.maxValue = integer.max;
slider.wholeNumbers = true;
slider.value = Convert.ToSingle(parameterManager.entity[propertyName]);
inputField.text = slider.value.ToString();
slider.onValueChanged.AddListener(
_ =>
{
inputField.text = slider.value.ToString();
parameterManager.entity[propertyName] = (int) slider.value;
}
);
inputField.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputField.onEndEdit.AddListener(
_ =>
{
slider.value = Convert.ToSingle(inputField.text);
parameterManager.entity[propertyName] = (int) slider.value;
Editor.instance.editingInputField = false;
}
);
break;
case EntityTypes.Float fl:
slider.minValue = fl.min;
slider.maxValue = fl.max;
slider.value = Convert.ToSingle(parameterManager.entity[propertyName]);
inputField.text = slider.value.ToString("G");
slider.onValueChanged.AddListener(
_ =>
{
var newValue = (float) Math.Round(slider.value, 4);
inputField.text = newValue.ToString("G");
parameterManager.entity[propertyName] = newValue;
}
);
inputField.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputField.onEndEdit.AddListener(
_ =>
{
slider.value = (float) Math.Round(Convert.ToSingle(inputField.text), 4);
parameterManager.entity[propertyName] = slider.value;
Editor.instance.editingInputField = false;
}
);
break;
default:
throw new ArgumentOutOfRangeException(
nameof(type), type, "I don't know how to make a property of this type!"
);
}
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6e9ad350a96f5644dbb1e4686a6bcaed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class StringPropertyPrefab : EventPropertyPrefab
{
[Header("String")] //why wasn't this a thing before
[Space(10)]
public TMP_InputField inputFieldString;
new public void SetProperties(string propertyName, object type, string caption)
{
InitProperties(propertyName, caption);
inputFieldString.text = (string) parameterManager.entity[propertyName];
inputFieldString.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputFieldString.onEndEdit.AddListener(
_ =>
{;
parameterManager.entity[propertyName] = inputFieldString.text;
Editor.instance.editingInputField = false;
}
);
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c01fcc0bb14adee46a4869c1c009850e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fb311ef0878d3e342bdfb042366b90e5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor;
public class NewRemixDialog : Dialog
{
public void SwitchNewDialog()
{
if(dialog.activeSelf) {
dialog.SetActive(false);
} else {
ResetAllDialogs();
dialog.SetActive(true);
}
}
public void Confirm()
{
Editor.instance.NewRemix();
if(dialog.activeSelf) {
dialog.SetActive(false);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5e1b2b36751952147bb6126f9ffd6086
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ad016dbf1f5b3ef4cad714464aaec76a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eccea73a04818a844bc25e6308bc1d05
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class BoolChartPropertyPrefab : RemixPropertyPrefab
{
[Header("Boolean")]
[Space(10)]
public Toggle toggle;
new public void SetProperties(RemixPropertiesDialog diag, string propertyName, object type, string caption)
{
InitProperties(diag, propertyName, caption);
// ' (bool)type ' always results in false
toggle.isOn = Convert.ToBoolean(parameterManager.chart[propertyName]);
toggle.onValueChanged.AddListener(
_ => parameterManager.chart[propertyName] = toggle.isOn
);
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5765785c18f751f4196e09d11dd30ff3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,61 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class ColorChartPropertyPrefab : RemixPropertyPrefab
{
[Header("Color")]
[Space(10)]
public Button ColorBTN;
public RectTransform ColorTable;
public bool colorTableActive;
public ColorPreview colorPreview;
new public void SetProperties(RemixPropertiesDialog diag, string propertyName, object type, string caption)
{
InitProperties(diag, propertyName, caption);
colorPreview.colorPicker.onColorChanged += _ =>
parameterManager.chart[propertyName] = colorPreview.colorPicker.color;
Color paramCol = parameterManager.chart[propertyName];
ColorBTN.onClick.AddListener(
() =>
{
ColorTable.gameObject.SetActive(true);
colorTableActive = true;
colorPreview.ChangeColor(paramCol);
}
);
colorPreview.ChangeColor(paramCol);
ColorTable.gameObject.SetActive(false);
}
private void Update()
{
if (colorTableActive)
{
if (!Editor.MouseInRectTransform(ColorTable))
{
if (Input.GetMouseButtonDown(0))
{
ColorTable.gameObject.SetActive(false);
colorTableActive = false;
}
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 83f718678c662f9448813df185f1283f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class EnumChartPropertyPrefab : RemixPropertyPrefab
{
[Header("Dropdown")]
[Space(10)]
public TMP_Dropdown dropdown;
new public void SetProperties(RemixPropertiesDialog diag, string propertyName, object type, string caption)
{
InitProperties(diag, propertyName, caption);
var enumType = type.GetType();
var enumVals = Enum.GetValues(enumType);
var enumNames = Enum.GetNames(enumType).ToList();
// Can we assume non-holey enum?
// If we can we can simplify to dropdown.value = (int) parameterManager.chart[propertyName]
var currentlySelected = (int) parameterManager.chart[propertyName];
var selected = enumVals
.Cast<object>()
.ToList()
.FindIndex(val => (int) val == currentlySelected);
dropdown.AddOptions(enumNames);
dropdown.value = selected;
dropdown.onValueChanged.AddListener(_ =>
parameterManager.chart[propertyName] = (int) enumVals.GetValue(dropdown.value)
);
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bddf1f894c08d91429a4a36f21a3c10e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,101 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class NumberChartPropertyPrefab : RemixPropertyPrefab
{
[Header("Integer and Float")]
[Space(10)]
public Slider slider;
public TMP_InputField inputField;
new public void SetProperties(RemixPropertiesDialog diag, string propertyName, object type, string caption)
{
InitProperties(diag, propertyName, caption);
switch (type)
{
case EntityTypes.Integer integer:
slider.minValue = integer.min;
slider.maxValue = integer.max;
slider.wholeNumbers = true;
slider.value = Convert.ToSingle(parameterManager.chart[propertyName]);
inputField.text = slider.value.ToString();
slider.onValueChanged.AddListener(
_ =>
{
inputField.text = slider.value.ToString();
parameterManager.chart[propertyName] = (int) slider.value;
}
);
inputField.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputField.onEndEdit.AddListener(
_ =>
{
slider.value = Convert.ToSingle(inputField.text);
parameterManager.chart[propertyName] = (int) slider.value;
Editor.instance.editingInputField = false;
}
);
break;
case EntityTypes.Float fl:
slider.minValue = fl.min;
slider.maxValue = fl.max;
slider.value = Convert.ToSingle(parameterManager.chart[propertyName]);
inputField.text = slider.value.ToString("G");
slider.onValueChanged.AddListener(
_ =>
{
var newValue = (float) Math.Round(slider.value, 4);
inputField.text = newValue.ToString("G");
parameterManager.chart[propertyName] = newValue;
}
);
inputField.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputField.onEndEdit.AddListener(
_ =>
{
slider.value = (float) Math.Round(Convert.ToSingle(inputField.text), 4);
parameterManager.chart[propertyName] = slider.value;
Editor.instance.editingInputField = false;
}
);
break;
default:
throw new ArgumentOutOfRangeException(
nameof(type), type, "I don't know how to make a property of this type!"
);
}
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3541b2824368eef4b94655619c05c3bc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
using HeavenStudio.Editor;
namespace HeavenStudio.Editor
{
public class StringChartPropertyPrefab : RemixPropertyPrefab
{
[Header("String")] //why wasn't this a thing before
[Space(10)]
public TMP_InputField inputFieldString;
new public void SetProperties(RemixPropertiesDialog diag, string propertyName, object type, string caption)
{
InitProperties(diag, propertyName, caption);
inputFieldString.text = (string) parameterManager.chart[propertyName];
inputFieldString.onSelect.AddListener(
_ =>
Editor.instance.editingInputField = true
);
inputFieldString.onEndEdit.AddListener(
_ =>
{;
parameterManager.chart[propertyName] = inputFieldString.text;
Editor.instance.editingInputField = false;
}
);
}
private void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1d094b0b57b4a1945a8ca587d9478b75
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,96 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public class RemixPropertiesDialog : Dialog
{
[Header("General References")]
[SerializeField] TabsManager tabsManager;
[Header("Containers")]
[SerializeField] ChartInfoProperties[] containers;
public DynamicBeatmap chart;
private void Start() { }
public void SwitchPropertiesDialog()
{
if (dialog.activeSelf)
{
tabsManager.CloseContent();
Editor.instance.canSelect = true;
Editor.instance.inAuthorativeMenu = false;
dialog.SetActive(false);
}
else
{
ResetAllDialogs();
foreach (var container in containers)
{
container.Init(this);
}
tabsManager.OpenContent();
Editor.instance.canSelect = false;
Editor.instance.inAuthorativeMenu = true;
dialog.SetActive(true);
chart = GameManager.instance.Beatmap;
chart["propertiesmodified"] = true;
}
}
public void SetupDialog(PropertyTag[] tags, ChartInfoProperties container)
{
chart = GameManager.instance.Beatmap;
chart["propertiesmodified"] = true;
foreach (PropertyTag property in tags)
{
if (chart.properties.ContainsKey(property.tag))
{
container.AddParam(this, property.tag, chart.properties[property.tag], property.label, property.isReadOnly);
}
else
{
if (property.tag == "divider")
{
container.AddDivider(this);
}
else if (property.tag == "header")
{
container.AddHeader(this, property.label);
}
else if (property.tag == "subheader")
{
container.AddSubHeader(this, property.label);
}
else
{
Debug.LogWarning("Property Menu generation Warning: Property " + property.tag + " not found, skipping...");
}
}
}
}
private void CleanDialog() {}
private void Update() {}
[Serializable]
public class PropertyTag
{
public string tag;
public string label;
public bool isReadOnly;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eedc1c2d03f4b22478ebb914e36371d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Linq;
using TMPro;
using Starpelly;
using HeavenStudio.Util;
namespace HeavenStudio.Editor
{
public class RemixPropertyPrefab : MonoBehaviour
{
public TMP_Text caption;
public RemixPropertiesDialog parameterManager;
public string propertyName;
public void SetProperties(RemixPropertiesDialog diag, string propertyName, object type, string caption) {}
public void InitProperties(RemixPropertiesDialog diag, string propertyName, string caption)
{
this.parameterManager = diag;
this.propertyName = propertyName;
this.caption.text = caption;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2483aa618d773c143857f608a2d2d32a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 814063e92ed9584478db2112bd34ca75
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,132 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace HeavenStudio.Editor
{
public class ChartInfoProperties : TabsContent
{
[Header("General References")]
[SerializeField] private GameObject propertyHolder;
RemixPropertiesDialog dialog;
[Header("Property Prefabs")]
[SerializeField] private GameObject IntegerP;
[SerializeField] private GameObject FloatP;
[SerializeField] private GameObject BooleanP;
[SerializeField] private GameObject DropdownP;
[SerializeField] private GameObject ColorP;
[SerializeField] private GameObject StringP;
[Header("Layout Prefabs")]
[SerializeField] private GameObject DividerP;
[SerializeField] private GameObject HeaderP;
[SerializeField] private GameObject SubHeaderP;
[Header("Editable Properties")]
[SerializeField] RemixPropertiesDialog.PropertyTag[] tags;
public void Init(RemixPropertiesDialog diag)
{
dialog = diag;
}
public void AddParam(RemixPropertiesDialog diag, string propertyName, object type, string caption, bool isReadOnly = false, string tooltip = "")
{
GameObject prefab = IntegerP;
GameObject input;
var objType = type.GetType();
if (objType == typeof(EntityTypes.Integer))
{
prefab = IntegerP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<NumberChartPropertyPrefab>();
property.SetProperties(diag, propertyName, type, caption);
}
else if (objType == typeof(EntityTypes.Float))
{
prefab = FloatP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<NumberChartPropertyPrefab>();
property.SetProperties(diag, propertyName, type, caption);
}
else if (type is bool)
{
prefab = BooleanP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<BoolChartPropertyPrefab>();
property.SetProperties(diag, propertyName, type, caption);
}
else if (objType.IsEnum)
{
prefab = DropdownP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<EnumChartPropertyPrefab>();
property.SetProperties(diag, propertyName, type, caption);
}
else if (objType == typeof(Color))
{
prefab = ColorP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<ColorChartPropertyPrefab>();
property.SetProperties(diag, propertyName, type, caption);
}
else if (objType == typeof(string))
{
prefab = StringP;
input = InitPrefab(prefab, tooltip);
var property = input.GetComponent<StringChartPropertyPrefab>();
property.SetProperties(diag, propertyName, type, caption);
}
else
{
Debug.LogError("Can't make property interface of type: " + type.GetType());
return;
}
}
public void AddDivider(RemixPropertiesDialog diag)
{
InitPrefab(DividerP);
}
public void AddHeader(RemixPropertiesDialog diag, string text)
{
var input = InitPrefab(HeaderP);
input.GetComponent<RemixPropertyPrefab>().InitProperties(diag, "", text);
}
public void AddSubHeader(RemixPropertiesDialog diag, string text)
{
var input = InitPrefab(SubHeaderP);
input.GetComponent<RemixPropertyPrefab>().InitProperties(diag, "", text);
}
private GameObject InitPrefab(GameObject prefab, string tooltip = "")
{
GameObject input = Instantiate(prefab);
input.transform.SetParent(propertyHolder.transform);
input.SetActive(true);
input.transform.localScale = Vector2.one;
if(tooltip != string.Empty)
Tooltip.AddTooltip(input, "", tooltip);
return input;
}
public override void OnOpenTab()
{
dialog.SetupDialog(tags, this);
}
public override void OnCloseTab()
{
foreach (Transform child in propertyHolder.transform) {
Destroy(child.gameObject);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4567e0acf98a9ef48b747da3b836a1a2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,19 +7,21 @@ using TMPro;
namespace HeavenStudio.Editor
{
public class SettingsDialog : MonoBehaviour
public class SettingsDialog : Dialog
{
[SerializeField] private GameObject settingsMenu;
//this may all be moved to a different script in the future
private void Start() {}
public void SwitchSettingsDialog()
{
if(settingsMenu.activeSelf) {
settingsMenu.SetActive(false);
if(dialog.activeSelf) {
Editor.instance.canSelect = true;
Editor.instance.inAuthorativeMenu = false;
dialog.SetActive(false);
} else {
settingsMenu.SetActive(true);
ResetAllDialogs();
Editor.instance.canSelect = false;
Editor.instance.inAuthorativeMenu = true;
dialog.SetActive(true);
}
}

View File

@ -12,7 +12,7 @@ using static JSL;
namespace HeavenStudio.Editor
{
public class ControllerSettings : MonoBehaviour
public class ControllerSettings : TabsContent
{
[SerializeField] private TMP_Text numConnectedLabel;
[SerializeField] private TMP_Text currentControllerLabel;
@ -245,5 +245,13 @@ namespace HeavenStudio.Editor
yield return new WaitForSeconds(0.25f);
JslSetRumbleFrequency(controller.GetHandle(), 0f, 0f, 0f, 0f);
}
public override void OnOpenTab()
{
}
public override void OnCloseTab()
{
}
}
}

View File

@ -9,7 +9,7 @@ using TMPro;
namespace HeavenStudio.Editor
{
public class CreditsLegalSettings : MonoBehaviour
public class CreditsLegalSettings : TabsContent
{
private int SecretCounter = 0;
private bool SecretActive = false;
@ -50,5 +50,13 @@ namespace HeavenStudio.Editor
SecretActive = false;
secretContent.CloseDanceWindow();
}
public override void OnOpenTab()
{
}
public override void OnCloseTab()
{
}
}
}

View File

@ -6,7 +6,7 @@ using TMPro;
namespace HeavenStudio.Editor
{
public class DispAudioSettings : MonoBehaviour
public class DispAudioSettings : TabsContent
{
public TMP_Dropdown resolutionsDropdown;
public GameObject customSetter;
@ -71,5 +71,13 @@ namespace HeavenStudio.Editor
volSlider.value = (float)System.Math.Round(System.Convert.ToSingle(volLabel.text) / 100f, 2);
GlobalGameManager.ChangeMasterVolume(volSlider.value);
}
public override void OnOpenTab()
{
}
public override void OnCloseTab()
{
}
}
}

View File

@ -4,7 +4,7 @@ using TMPro;
namespace HeavenStudio.Editor
{
public class EditorSettings : MonoBehaviour
public class EditorSettings : TabsContent
{
public Toggle cursorCheckbox;
@ -16,5 +16,13 @@ namespace HeavenStudio.Editor
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
public override void OnOpenTab()
{
}
public override void OnCloseTab()
{
}
}
}

View File

@ -7,9 +7,8 @@ using TMPro;
namespace HeavenStudio.Editor
{
public class SnapDialog : MonoBehaviour
public class SnapDialog : Dialog
{
[SerializeField] private GameObject snapSetter;
[SerializeField] private TMP_Text snapText;
private Timeline timeline;
@ -22,10 +21,11 @@ namespace HeavenStudio.Editor
public void SwitchSnapDialog()
{
if(snapSetter.activeSelf) {
snapSetter.SetActive(false);
if(dialog.activeSelf) {
dialog.SetActive(false);
} else {
snapSetter.SetActive(true);
ResetAllDialogs();
dialog.SetActive(true);
}
}

View File

@ -4,9 +4,8 @@ using UnityEngine;
namespace HeavenStudio.Editor
{
public class TempoFinder : MonoBehaviour
public class TempoFinder : Dialog
{
[SerializeField] private GameObject tempoFinder;
private bool pressed;
private float timePressed;
[SerializeField] private BPMText bpmText;
@ -17,12 +16,13 @@ namespace HeavenStudio.Editor
}
public void SwitchTempoDialog()
{
if(tempoFinder.activeSelf) {
tempoFinder.SetActive(false);
if(dialog.activeSelf) {
dialog.SetActive(false);
timePressed = 0;
bpmText.ResetText();
} else {
tempoFinder.SetActive(true);
ResetAllDialogs();
dialog.SetActive(true);
}
}
public void TapBPM()

View File

@ -29,7 +29,7 @@ namespace HeavenStudio.Editor.Track
for (int i = 0; i < GameManager.instance.Beatmap.tempoChanges.Count; i++)
{
Beatmap.TempoChange tempoChange = GameManager.instance.Beatmap.tempoChanges[i];
DynamicBeatmap.TempoChange tempoChange = GameManager.instance.Beatmap.tempoChanges[i];
AddTempoChange(false, tempoChange);
}
}
@ -140,7 +140,7 @@ namespace HeavenStudio.Editor.Track
tempoTimelineObjs.Clear();
}
public void AddTempoChange(bool create, Beatmap.TempoChange tempoChange_ = null)
public void AddTempoChange(bool create, DynamicBeatmap.TempoChange tempoChange_ = null)
{
GameObject tempoChange = Instantiate(RefTempoChange.gameObject, this.transform);
@ -157,7 +157,7 @@ namespace HeavenStudio.Editor.Track
tempoChange.transform.position = new Vector3(Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition).x + 0.08f, tempoChange.transform.position.y);
tempoChange.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(tempoChange.transform.localPosition.x, Timeline.SnapInterval()), tempoChange.transform.localPosition.y);
Beatmap.TempoChange tempoC = new Beatmap.TempoChange();
DynamicBeatmap.TempoChange tempoC = new DynamicBeatmap.TempoChange();
tempoC.beat = tempoChange.transform.localPosition.x;
tempoC.tempo = GameManager.instance.Beatmap.bpm;

View File

@ -15,7 +15,7 @@ namespace HeavenStudio.Editor.Track
[SerializeField] private TMP_Text tempoTXT;
[SerializeField] private RectTransform raycastRect;
public Beatmap.TempoChange tempoChange;
public DynamicBeatmap.TempoChange tempoChange;
private float startPosX;
private bool moving = false;

View File

@ -273,7 +273,7 @@ namespace HeavenStudio.Editor.Track
SliderControl();
#region Keyboard Shortcuts
if (!userIsEditingInputField)
if ((!userIsEditingInputField) && Editor.instance.isShortcutsEnabled)
{
if (Input.GetKeyDown(KeyCode.Space))
@ -503,11 +503,13 @@ namespace HeavenStudio.Editor.Track
#region Functions
public TimelineEventObj AddEventObject(string eventName, bool dragNDrop = false, Vector3 pos = new Vector3(), Beatmap.Entity entity = null, bool addEvent = false, string eventId = "")
public TimelineEventObj AddEventObject(string eventName, bool dragNDrop = false, Vector3 pos = new Vector3(), DynamicBeatmap.DynamicEntity entity = null, bool addEvent = false, string eventId = "")
{
var game = EventCaller.instance.GetMinigame(eventName.Split(0));
var action = EventCaller.instance.GetGameAction(game, eventName.Split(1));
GameObject g = Instantiate(TimelineEventObjRef.gameObject, TimelineEventObjRef.parent);
g.transform.localPosition = pos;
g.transform.GetChild(3).GetComponent<TMP_Text>().text = eventName.Split('/')[1];
g.transform.GetChild(3).GetComponent<TMP_Text>().text = action.displayName;
TimelineEventObj eventObj = g.GetComponent<TimelineEventObj>();
@ -559,11 +561,11 @@ namespace HeavenStudio.Editor.Track
if (addEvent)
{
Beatmap.Entity tempEntity = entity;
DynamicBeatmap.DynamicEntity tempEntity = entity;
if (entity == null)
{
Beatmap.Entity en = new Beatmap.Entity();
DynamicBeatmap.DynamicEntity en = new DynamicBeatmap.DynamicEntity();
en.datamodel = eventName;
en.eventObj = eventObj;
@ -572,9 +574,8 @@ namespace HeavenStudio.Editor.Track
tempEntity = en;
// default param value
var game = EventCaller.instance.GetMinigame(eventName.Split(0));
var ep = EventCaller.instance.GetGameAction(game, eventName.Split(1)).parameters;
// default param values
var ep = action.parameters;
if (ep != null)
{
@ -591,8 +592,13 @@ namespace HeavenStudio.Editor.Track
{
returnVal = ((EntityTypes.Float)ep[i].parameter).val;
}
else if (propertyType.IsEnum)
{
returnVal = (int) ep[i].parameter;
}
tempEntity[ep[i].propertyName] = returnVal;
//tempEntity[ep[i].propertyName] = returnVal;
tempEntity.CreateProperty(ep[i].propertyName, returnVal);
}
}
}
@ -613,7 +619,7 @@ namespace HeavenStudio.Editor.Track
private List<TimelineEventObj> duplicatedEventObjs = new List<TimelineEventObj>();
public TimelineEventObj CopyEventObject(TimelineEventObj e)
{
Beatmap.Entity clone = e.entity.DeepCopy();
DynamicBeatmap.DynamicEntity clone = e.entity.DeepCopy();
TimelineEventObj dup = AddEventObject(clone.datamodel, false, new Vector3(clone.beat, -clone.track * Timeline.instance.LayerHeight()), clone, true, RandomID());
duplicatedEventObjs.Add(dup);
@ -626,7 +632,7 @@ namespace HeavenStudio.Editor.Track
duplicatedEventObjs = new List<TimelineEventObj>();
}
public void DestroyEventObject(Beatmap.Entity entity)
public void DestroyEventObject(DynamicBeatmap.DynamicEntity entity)
{
if (EventParameterManager.instance.entity == entity)
EventParameterManager.instance.Disable();

Some files were not shown because too many files have changed in this diff Show More