Skip to content

Commit eadce15

Browse files
jsm174freezy
authored andcommitted
api: Update to upstream changes.
1 parent 70c3419 commit eadce15

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

VisualPinball.Engine.Mpf.Unity/Editor/MpfGamelogicEngineInspector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public override void OnInspectorGUI()
8585
if (_mpfEngine.RequestedCoils.Length + _mpfEngine.RequestedSwitches.Length + _mpfEngine.RequestedLamps.Length > 0) {
8686
if (_foldoutSwitches = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutSwitches, "Switches")) {
8787
foreach (var sw in _mpfEngine.RequestedSwitches) {
88-
EditorGUILayout.LabelField(new GUIContent($" [{sw.InternalId}] {sw.Id} ", Icons.Switch(sw.NormallyClosed, IconSize.Small)));
88+
EditorGUILayout.LabelField(new GUIContent($" {sw.Id} ", Icons.Switch(sw.NormallyClosed, IconSize.Small)));
8989
}
9090
if (_mpfEngine.RequestedSwitches.Length == 0) {
9191
EditorGUILayout.LabelField("No switches in this machine.", naStyle);
@@ -95,7 +95,7 @@ public override void OnInspectorGUI()
9595

9696
if (_foldoutCoils = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutCoils, "Coils")) {
9797
foreach (var sw in _mpfEngine.RequestedCoils) {
98-
EditorGUILayout.LabelField(new GUIContent($" [{sw.InternalId}] {sw.Id} ", Icons.Coil(IconSize.Small)));
98+
EditorGUILayout.LabelField(new GUIContent($" {sw.Id} ", Icons.Coil(IconSize.Small)));
9999
}
100100
if (_mpfEngine.RequestedCoils.Length == 0) {
101101
EditorGUILayout.LabelField("No coils in this machine.", naStyle);
@@ -105,7 +105,7 @@ public override void OnInspectorGUI()
105105

106106
if (_foldoutLamps = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutLamps, "Lamps")) {
107107
foreach (var sw in _mpfEngine.RequestedLamps) {
108-
EditorGUILayout.LabelField(new GUIContent($" [{sw.InternalId}] {sw.Id} ", Icons.Light(IconSize.Small)));
108+
EditorGUILayout.LabelField(new GUIContent($" {sw.Id} ", Icons.Light(IconSize.Small)));
109109
}
110110
if (_mpfEngine.RequestedLamps.Length == 0) {
111111
EditorGUILayout.LabelField("No lamps in this machine.", naStyle);

VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static class MpfExtensions
2424
public static IEnumerable<GamelogicEngineSwitch> GetSwitches(this MachineDescription md)
2525
{
2626
return md.Switches.Select(sw => {
27-
var gleSw = new GamelogicEngineSwitch(sw.Name, int.Parse(sw.HardwareNumber)) {
27+
var gleSw = new GamelogicEngineSwitch(sw.Name) {
2828
NormallyClosed = sw.SwitchType.ToLower() == "nc"
2929
};
3030

@@ -66,7 +66,7 @@ public static IEnumerable<GamelogicEngineSwitch> GetSwitches(this MachineDescrip
6666
public static IEnumerable<GamelogicEngineCoil> GetCoils(this MachineDescription md)
6767
{
6868
var coils = md.Coils.Select(coil => {
69-
var gleCoil = new GamelogicEngineCoil(coil.Name, int.Parse(coil.HardwareNumber));
69+
var gleCoil = new GamelogicEngineCoil(coil.Name);
7070

7171
if (Regex.Match(coil.Name, "(l(eft)?_?flipper|flipper_?l(eft)?_?(main)?)$", RegexOptions.IgnoreCase).Success) {
7272
gleCoil.Description = "Left Flipper";
@@ -103,7 +103,7 @@ public static IEnumerable<GamelogicEngineCoil> GetCoils(this MachineDescription
103103
public static IEnumerable<GamelogicEngineLamp> GetLights(this MachineDescription md)
104104
{
105105
// todo color
106-
return md.Lights.Select(light => new GamelogicEngineLamp(light.Name, int.Parse(light.HardwareChannelColor)));
106+
return md.Lights.Select(light => new GamelogicEngineLamp(light.Name));
107107
}
108108
}
109109
}

VisualPinball.Engine.Mpf.Unity/Runtime/MpfGamelogicEngine.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,15 @@ public void OnInit(Player player, TableApi tableApi, BallManager ballManager)
6969
_player = player;
7070
_switchIds.Clear();
7171
foreach (var sw in requiredSwitches) {
72-
_switchIds[sw.Id] = sw.InternalId;
73-
_switchNames[sw.InternalId.ToString()] = sw.Id;
72+
_switchNames[sw.Id] = sw.Id;
7473
}
7574
_coilNames.Clear();
7675
foreach (var coil in requiredCoils) {
77-
_coilNames[coil.InternalId.ToString()] = coil.Id;
76+
_coilNames[coil.Id] = coil.Id;
7877
}
7978
_lampNames.Clear();
8079
foreach (var lamp in requiredLamps) {
81-
_lampNames[lamp.InternalId.ToString()] = lamp.Id;
80+
_lampNames[lamp.Id] = lamp.Id;
8281
}
8382
_api = new MpfApi(machineFolder);
8483
_api.Launch(new MpfConsoleOptions {

0 commit comments

Comments
 (0)