Skip to content

Commit

Permalink
Properly add types
Browse files Browse the repository at this point in the history
Add enum and classify events in list
  • Loading branch information
clubby789 committed Oct 8, 2020
1 parent b7313b8 commit b05dadc
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 34 deletions.
3 changes: 2 additions & 1 deletion ClockLib/OWClock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,16 @@ public override void Configure(IModConfig config)
Milliseconds = config.GetSettingsValue<bool>("Count In Milliseconds");
EventCount = config.GetSettingsValue<int>("Events to Display");
HudScale = config.GetSettingsValue<float>("HudScale");
EnabledTypes.Clear();
for (int i = 0; i < Enum.GetNames(typeof(TimeEvent.Type)).Length; i++)
{
var name = Enum.GetName(typeof(TimeEvent.Type), i);
EnabledTypes.Clear();
if (config.GetSettingsValue<bool>(name))
{
EnabledTypes.Add(i);
}
}

}
}
}
9 changes: 9 additions & 0 deletions ClockLib/TimeEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ namespace Clock
[Serializable]
public class TimeEvent
{
public enum Type
{
Sun,
TimeLoop,
WarpPlatforms,
Chert,
Misc
}
public float Timestamp;
public string Name;
public Type type = Type.Misc;
public TimeEvent(float timestamp, string name)
{
Timestamp = timestamp;
Expand Down
30 changes: 20 additions & 10 deletions ClockLib/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,37 @@
"Sun": {
"title": "Show Sun Events",
"type": "toggle",
"value": true
"value": true,
"yes": "Yes",
"no": "No"
},
"TimeLoop": {
"title": "Show Timeloop Events",
"type": "toggle",
"value": true,
"yes": "Yes",
"no": "No"
},
"WarpPlatforms": {
"title": "Show Warp Platform Events",
"type": "toggle",
"value": true
"value": true,
"yes": "Yes",
"no": "No"
},
"Chert": {
"title": "Show Chert's Mood",
"type": "toggle",
"value": true
},
"TimeLoop": {
"title": "Show Timeloop Events",
"type": "toggle",
"value": true
"value": true,
"yes": "Yes",
"no": "No"
},
"Misc": {
"title": "Show Other Events",
"type": "toggle",
"value": true
}
"value": true,
"yes": "Yes",
"no": "No"
}
}
}
69 changes: 46 additions & 23 deletions ClockLib/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,118 @@
"eventList": [
{
"Timestamp": 0.0,
"Name": "Loop Begins"
"Name": "Loop Begins",
"type": 1
},
{
"Timestamp": 120.0,
"Name": "Hourglass Sand Begins to Flow"
"Name": "Hourglass Sand Begins to Flow",
"type": 4
},
{
"Timestamp": 430.0,
"Name": "Sun Station Warp"
"Name": "Sun Station Warp",
"type": 2
},
{
"Timestamp": 470.0,
"Name": "Ash Twin Warp"
"Name": "Ash Twin Warp",
"type": 2
},
{
"Timestamp": 480.0,
"Name": "Sun Station Warp"
"Name": "Sun Station Warp",
"type": 2
},
{
"Timestamp": 530.0,
"Name": "Sun Station Warp"
"Name": "Sun Station Warp",
"type": 2
},
{
"Timestamp": 580.0,
"Name": "Sun Station Warp"
"Name": "Sun Station Warp",
"type": 2
},
{
"Timestamp": 620.0,
"Name": "Ash Twin Warp"
"Name": "Ash Twin Warp",
"type": 2
},
{
"Timestamp": 630.0,
"Name": "Sun Station Warp"
"Name": "Sun Station Warp",
"type": 2
},
{
"Timestamp": 660.0,
"Name": "Chert Becomes Nervous"
"Name": "Chert Becomes Nervous",
"type": 3
},
{
"Timestamp": 680.0,
"Name": "Sun Station Warp"
"Name": "Sun Station Warp",
"type": 2
},
{
"Timestamp": 690.0,
"Name": "Sun Station Falls (47s ago)"
"Name": "Sun Station Falls",
"type": 0
},
{
"Timestamp": 765.0,
"Name": "Ash Twin Warp"
"Name": "Ash Twin Warp",
"type": 2
},
{
"Timestamp": 910.0,
"Name": "Ash Twin Warp"
"Name": "Ash Twin Warp",
"type": 2
},
{
"Timestamp": 1020.0,
"Name": "Chert Panics"
"Name": "Chert Panics",
"type": 3
},
{
"Timestamp": 1050.0,
"Name": "Ash Twin Warp"
"Name": "Ash Twin Warp",
"type": 2
},
{
"Timestamp": 1200.0,
"Name": "Ash Twin Warp"
"Name": "Ash Twin Warp",
"type": 2
},
{
"Timestamp": 1220.0,
"Name": "Sand Stops Flowing"
"Name": "Sand Stops Flowing",
"type": 4
},
{
"Timestamp": 1230.0,
"Name": "Chert Becomes Catatonic"
"Name": "Chert Becomes Catatonic",
"type": 3
},
{
"Timestamp": 1235.0,
"Name": "Beginning of the End"
"Name": "Beginning of the End",
"type": 1
},
{
"Timestamp": 1290.0,
"Name": "Warp Platforms Inactive"
"Name": "Warp Platforms Inactive",
"type": 2
},
{
"Timestamp": 1320.0,
"Name": "Supernova"
"Name": "Supernova",
"type": 0
},
{
"Timestamp": 1360.0,
"Name": "Loop Ends"
"Name": "Loop Ends",
"type": 1
}
]
}

0 comments on commit b05dadc

Please sign in to comment.