From afeedd3d1f08f247354d04c26ff62b21af41840b Mon Sep 17 00:00:00 2001 From: Jason Millard Date: Tue, 24 May 2022 21:22:12 -0400 Subject: [PATCH 1/3] api: Update to upstream changes. --- .../Editor/MpfGamelogicEngineInspector.cs | 6 +++--- VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs | 6 +++--- .../Runtime/MpfGamelogicEngine.cs | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/VisualPinball.Engine.Mpf.Unity/Editor/MpfGamelogicEngineInspector.cs b/VisualPinball.Engine.Mpf.Unity/Editor/MpfGamelogicEngineInspector.cs index f26a5d31..32b5c893 100644 --- a/VisualPinball.Engine.Mpf.Unity/Editor/MpfGamelogicEngineInspector.cs +++ b/VisualPinball.Engine.Mpf.Unity/Editor/MpfGamelogicEngineInspector.cs @@ -85,7 +85,7 @@ public override void OnInspectorGUI() if (_mpfEngine.RequestedCoils.Length + _mpfEngine.RequestedSwitches.Length + _mpfEngine.RequestedLamps.Length > 0) { if (_foldoutSwitches = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutSwitches, "Switches")) { foreach (var sw in _mpfEngine.RequestedSwitches) { - EditorGUILayout.LabelField(new GUIContent($" [{sw.InternalId}] {sw.Id} ", Icons.Switch(sw.NormallyClosed, IconSize.Small))); + EditorGUILayout.LabelField(new GUIContent($" {sw.Id} ", Icons.Switch(sw.NormallyClosed, IconSize.Small))); } if (_mpfEngine.RequestedSwitches.Length == 0) { EditorGUILayout.LabelField("No switches in this machine.", naStyle); @@ -95,7 +95,7 @@ public override void OnInspectorGUI() if (_foldoutCoils = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutCoils, "Coils")) { foreach (var sw in _mpfEngine.RequestedCoils) { - EditorGUILayout.LabelField(new GUIContent($" [{sw.InternalId}] {sw.Id} ", Icons.Coil(IconSize.Small))); + EditorGUILayout.LabelField(new GUIContent($" {sw.Id} ", Icons.Coil(IconSize.Small))); } if (_mpfEngine.RequestedCoils.Length == 0) { EditorGUILayout.LabelField("No coils in this machine.", naStyle); @@ -105,7 +105,7 @@ public override void OnInspectorGUI() if (_foldoutLamps = EditorGUILayout.BeginFoldoutHeaderGroup(_foldoutLamps, "Lamps")) { foreach (var sw in _mpfEngine.RequestedLamps) { - EditorGUILayout.LabelField(new GUIContent($" [{sw.InternalId}] {sw.Id} ", Icons.Light(IconSize.Small))); + EditorGUILayout.LabelField(new GUIContent($" {sw.Id} ", Icons.Light(IconSize.Small))); } if (_mpfEngine.RequestedLamps.Length == 0) { EditorGUILayout.LabelField("No lamps in this machine.", naStyle); diff --git a/VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs b/VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs index 6c39ada6..039cb64c 100644 --- a/VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs +++ b/VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs @@ -24,7 +24,7 @@ public static class MpfExtensions public static IEnumerable GetSwitches(this MachineDescription md) { return md.Switches.Select(sw => { - var gleSw = new GamelogicEngineSwitch(sw.Name, int.Parse(sw.HardwareNumber)) { + var gleSw = new GamelogicEngineSwitch(sw.Name) { NormallyClosed = sw.SwitchType.ToLower() == "nc" }; @@ -66,7 +66,7 @@ public static IEnumerable GetSwitches(this MachineDescrip public static IEnumerable GetCoils(this MachineDescription md) { var coils = md.Coils.Select(coil => { - var gleCoil = new GamelogicEngineCoil(coil.Name, int.Parse(coil.HardwareNumber)); + var gleCoil = new GamelogicEngineCoil(coil.Name); if (Regex.Match(coil.Name, "(l(eft)?_?flipper|flipper_?l(eft)?_?(main)?)$", RegexOptions.IgnoreCase).Success) { gleCoil.Description = "Left Flipper"; @@ -103,7 +103,7 @@ public static IEnumerable GetCoils(this MachineDescription public static IEnumerable GetLights(this MachineDescription md) { // todo color - return md.Lights.Select(light => new GamelogicEngineLamp(light.Name, int.Parse(light.HardwareChannelColor))); + return md.Lights.Select(light => new GamelogicEngineLamp(light.Name)); } } } diff --git a/VisualPinball.Engine.Mpf.Unity/Runtime/MpfGamelogicEngine.cs b/VisualPinball.Engine.Mpf.Unity/Runtime/MpfGamelogicEngine.cs index 13edd6b3..7816d85f 100644 --- a/VisualPinball.Engine.Mpf.Unity/Runtime/MpfGamelogicEngine.cs +++ b/VisualPinball.Engine.Mpf.Unity/Runtime/MpfGamelogicEngine.cs @@ -69,16 +69,15 @@ public void OnInit(Player player, TableApi tableApi, BallManager ballManager) _player = player; _switchIds.Clear(); foreach (var sw in requiredSwitches) { - _switchIds[sw.Id] = sw.InternalId; - _switchNames[sw.InternalId.ToString()] = sw.Id; + _switchNames[sw.Id] = sw.Id; } _coilNames.Clear(); foreach (var coil in requiredCoils) { - _coilNames[coil.InternalId.ToString()] = coil.Id; + _coilNames[coil.Id] = coil.Id; } _lampNames.Clear(); foreach (var lamp in requiredLamps) { - _lampNames[lamp.InternalId.ToString()] = lamp.Id; + _lampNames[lamp.Id] = lamp.Id; } _api = new MpfApi(machineFolder); _api.Launch(new MpfConsoleOptions { From 3ad5df8332e2bb28824e444754eea70382237f25 Mon Sep 17 00:00:00 2001 From: Jason Millard Date: Tue, 24 May 2022 21:27:50 -0400 Subject: [PATCH 2/3] deps: bump grpc deps --- VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj b/VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj index e2642d22..bda9c4cc 100644 --- a/VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj +++ b/VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj @@ -16,13 +16,13 @@ - + all runtime; build; native; contentfiles; analyzers - - - + + + From 4f08f46551e3c38d05c335b429197283e06369b7 Mon Sep 17 00:00:00 2001 From: Jason Millard Date: Sun, 29 May 2022 07:17:15 -0400 Subject: [PATCH 3/3] deps: bump VPE dep --- VisualPinball.Engine.Mpf.Unity/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VisualPinball.Engine.Mpf.Unity/package.json b/VisualPinball.Engine.Mpf.Unity/package.json index 293d50a4..59674bdf 100644 --- a/VisualPinball.Engine.Mpf.Unity/package.json +++ b/VisualPinball.Engine.Mpf.Unity/package.json @@ -7,10 +7,10 @@ "Unity", "Mission Pinball Framework" ], - "unity": "2021.2", - "unityRelease": "7f1", + "unity": "2021.3", + "unityRelease": "0f1", "dependencies": { - "org.visualpinball.engine.unity": "0.0.1-preview.84" + "org.visualpinball.engine.unity": "0.0.1-preview.105" }, "author": "freezy ", "contributors": [