Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions VisualPinball.Engine.Mpf.Unity/Runtime/MpfExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class MpfExtensions
public static IEnumerable<GamelogicEngineSwitch> 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"
};

Expand Down Expand Up @@ -66,7 +66,7 @@ public static IEnumerable<GamelogicEngineSwitch> GetSwitches(this MachineDescrip
public static IEnumerable<GamelogicEngineCoil> 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";
Expand Down Expand Up @@ -103,7 +103,7 @@ public static IEnumerable<GamelogicEngineCoil> GetCoils(this MachineDescription
public static IEnumerable<GamelogicEngineLamp> 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));
}
}
}
7 changes: 3 additions & 4 deletions VisualPinball.Engine.Mpf.Unity/Runtime/MpfGamelogicEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions VisualPinball.Engine.Mpf.Unity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <freezy@vpdb.io>",
"contributors": [
Expand Down
8 changes: 4 additions & 4 deletions VisualPinball.Engine.Mpf/VisualPinball.Engine.Mpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Tools" Version="2.42.0">
<PackageReference Include="Grpc.Tools" Version="2.46.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Grpc" Version="2.42.0" />
<PackageReference Include="Google.Protobuf" Version="3.19.1" />
<PackageReference Include="NLog" Version="4.7.12" />
<PackageReference Include="Grpc" Version="2.46.3" />
<PackageReference Include="Google.Protobuf" Version="3.20.1" />
<PackageReference Include="NLog" Version="4.7.15" />
</ItemGroup>

<ItemGroup>
Expand Down