Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4722e2c
trough: Setup authoring component and link in switch manager.
freezy Oct 28, 2020
23d2bab
Minimal boilerplate for new trough items.
ecurtz Oct 20, 2020
dae0513
More empty boilerplate trough classes
ecurtz Oct 24, 2020
9e43783
Generic inspector field for references between ItemAuthoring ocmponents.
ecurtz Oct 28, 2020
7333c20
Post rebase cleanup of Trough classes.
ecurtz Oct 28, 2020
65a59f8
trough: Make switches dynamic.
freezy Oct 29, 2020
12cd55a
trough: Wire it up!
freezy Oct 29, 2020
1adf2ad
trough: Add missing files.
freezy Oct 29, 2020
715a834
trough: Cosmetics.
freezy Oct 29, 2020
e9fd228
trough: Add come documentation.
freezy Oct 30, 2020
56ff498
trough: Add unit tests.
freezy Oct 30, 2020
af3f481
trough: Update inspector.
freezy Oct 30, 2020
775c1fb
trough: Add entry coil.
freezy Oct 30, 2020
e33c465
doc: Add trough screenshots.
freezy Oct 30, 2020
63ab13a
trough: Update documentation.
freezy Oct 30, 2020
90a07e4
trough: Fix coil documentation.
freezy Oct 30, 2020
8bad214
trough: Clean up unnecessary files.
freezy Oct 30, 2020
c7e3ff2
trough: Fix switch manager screenshot.
freezy Oct 30, 2020
610aa17
Trough document copyedit pass.
ecurtz Oct 31, 2020
e65cd41
Schedule events for device switches when balls enter and exit trough.
ecurtz Nov 1, 2020
b76401c
chore: Minor cleanups.
freezy Nov 9, 2020
d1c1993
refactor: Change ItemMain* to ItemMainRenderable* and use ItemMain* f…
freezy Nov 9, 2020
85d11f7
trough: Set local position between entry and exit kicker.
freezy Nov 9, 2020
bbe0d5a
editor: Draw arrow from entry kicker to trough to exit kicker.
freezy Nov 9, 2020
ab18615
rubber: Fix transformation matrix.
freezy Nov 11, 2020
6110343
trough: Update mapping tests.
freezy Nov 11, 2020
0b793fe
trough: Various runtime fixes.
freezy Nov 11, 2020
cea94d7
trough: Use our own logger.
freezy Nov 11, 2020
f4de22d
trough: Only register when gamelogic engine is set.
freezy Nov 11, 2020
dbfdd6a
doc: Update switch- and coil manager screenshots.
freezy Nov 12, 2020
1e2cec3
doc: Fix selection in screenshot.
freezy Nov 12, 2020
710edd3
doc: Update coil- and switch manager with devices.
freezy Nov 12, 2020
cfaa0da
doc: Update README with a few more links.
freezy Nov 12, 2020
7929ba9
trough: Address comments from @jsm174.
freezy Nov 12, 2020
ba8ccb7
Coil manager documentation pass.
ecurtz Nov 12, 2020
35b13de
Switch manager documentation pass.
ecurtz Nov 12, 2020
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ other "current gen" engines, while keeping backwards-compatibility.
VPE also aims to significantly improve the editor experience by extending the
editor of the game engine.

For a more detailed overview, header over to the [website](https://docs.visualpinball.org/creators-guide/introduction/overview.html)!

## How?

The "core" of VPE (i.e. the `VisualPinball.Engine` project) is a pure C# port
Expand All @@ -32,7 +34,7 @@ VPE is still work in progress. You can check the current features list [here](ht
and the open issues [here](https://github.com/freezy/VisualPinball.Engine/issues).

There are a few videos in the [VPF thread](https://www.vpforums.org/index.php?showtopic=43651),
where you can discuss.
where you can discuss. Screenshots are [here](https://github.com/freezy/VisualPinball.Engine/wiki/Unity-Screenshots! :)

## Credits

Expand Down
Binary file modified VisualPinball.Engine.Test/Fixtures~/MappingsTest.vpx
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions VisualPinball.Engine.Test/Test/Fixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static class VpxPath
public static readonly string Texture = PathHelper.GetFixturePath("TextureTest.vpx");
public static readonly string Timer = PathHelper.GetFixturePath("TimerTest.vpx");
public static readonly string Trigger = PathHelper.GetFixturePath("TriggerTest.vpx");
public static readonly string Trough = PathHelper.GetFixturePath("TroughTest.vpx");
}

public static class ObjPath
Expand Down
25 changes: 23 additions & 2 deletions VisualPinball.Engine.Test/VPT/Mappings/MappingsDataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void ShouldWriteMappingsData()

private static void ValidateTableData(MappingsData data)
{
data.Switches.Length.Should().Be(4);
data.Switches.Length.Should().Be(13);

data.Switches[0].Id.Should().Be("s_create_ball");
data.Switches[0].Description.Should().Be("Create Ball");
Expand Down Expand Up @@ -72,7 +72,20 @@ private static void ValidateTableData(MappingsData data)
data.Switches[3].Source.Should().Be(SwitchSource.Constant);
data.Switches[3].Constant.Should().Be(SwitchConstant.NormallyClosed);

data.Coils.Length.Should().Be(2);
data.Switches[3].Id.Should().Be("s_right_flipper");
data.Switches[3].Description.Should().Be("Right Flipper");
data.Switches[3].Source.Should().Be(SwitchSource.Constant);
data.Switches[3].Constant.Should().Be(SwitchConstant.NormallyClosed);

data.Switches[7].Id.Should().Be("s_trough1");
data.Switches[7].Description.Should().Be("Trough 1 (eject)");
data.Switches[7].Source.Should().Be(SwitchSource.Device);
data.Switches[7].Device.Should().Be("Trough");
data.Switches[7].DeviceItem.Should().Be("1");
data.Switches[7].Type.Should().Be(SwitchType.OnOff);
data.Switches[7].PulseDelay.Should().Be(250);

data.Coils.Length.Should().Be(6);

data.Coils[0].Id.Should().Be("c_auto_plunger");
data.Coils[0].Description.Should().Be("Auto Plunger");
Expand All @@ -86,6 +99,14 @@ private static void ValidateTableData(MappingsData data)
data.Coils[1].PlayfieldItem.Should().Be("Flipper1");
data.Coils[1].Type.Should().Be(CoilType.DualWound);
data.Coils[1].HoldCoilId.Should().Be("c_left_flipper_hold");

data.Coils[5].Id.Should().Be("c_trough_eject");
data.Coils[5].Description.Should().Be("Trough Eject");
data.Coils[5].Destination.Should().Be(CoilDestination.Device);
data.Coils[5].Device.Should().Be("Trough");
data.Coils[5].DeviceItem.Should().Be("eject");
data.Coils[5].Type.Should().Be(CoilType.SingleWound);
data.Coils[5].HoldCoilId.Should().Be("");
}
}
}
53 changes: 53 additions & 0 deletions VisualPinball.Engine.Test/VPT/Trough/TroughDataTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Visual Pinball Engine
// Copyright (C) 2020 freezy and VPE Team
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

using FluentAssertions;
using NUnit.Framework;
using VisualPinball.Engine.Test.Test;
using VisualPinball.Engine.VPT.Trough;

namespace VisualPinball.Engine.Test.VPT.Trough
{
public class TroughDataTests
{
[Test]
public void ShouldReadTroughData()
{
var table = Engine.VPT.Table.Table.Load(VpxPath.Trough);
ValidateTroughData(table.Trough("Trough1").Data);
}

[Test]
public void ShouldWriteTroughData()
{
const string tmpFileName = "ShouldWriteTroughData.vpx";
var table = Engine.VPT.Table.Table.Load(VpxPath.Trough);
table.Save(tmpFileName);
var writtenTable = Engine.VPT.Table.Table.Load(tmpFileName);
ValidateTroughData(writtenTable.Trough("Trough1").Data);
}

private static void ValidateTroughData(TroughData data)
{
data.BallCount.Should().Be(3);
data.SwitchCount.Should().Be(4);
data.SettleTime.Should().Be(112);
data.EntryKicker.Should().Be("BallDrain");
data.ExitKicker.Should().Be("BallRelease");
data.JamSwitch.Should().Be("TroughJam");
}
}
}
2 changes: 2 additions & 0 deletions VisualPinball.Engine/Game/Engines/GamelogicEngineCoil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ public struct GamelogicEngineCoil
public string Description;
public string PlayfieldItemHint;
public string MainCoilIdOfHoldCoil;
public string DeviceHint;
public string DeviceItemHint;
}
}
2 changes: 2 additions & 0 deletions VisualPinball.Engine/Game/Engines/GamelogicEngineSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ public struct GamelogicEngineSwitch
public string InputActionHint;
public string InputMapHint;
public string PlayfieldItemHint;
public string DeviceHint;
public string DeviceItemHint;
}
}
1 change: 0 additions & 1 deletion VisualPinball.Engine/Game/ICoilable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ namespace VisualPinball.Engine.Game
public interface ICoilable
{
string Name { get; }
bool IsDualWound { get; set; }
}
}
28 changes: 28 additions & 0 deletions VisualPinball.Engine/Game/ICoilableDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Visual Pinball Engine
// Copyright (C) 2020 freezy and VPE Team
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

using System.Collections.Generic;
using VisualPinball.Engine.Game.Engines;

namespace VisualPinball.Engine.Game
{
public interface ICoilableDevice
{
string Name { get; }

IEnumerable<GamelogicEngineCoil> AvailableCoils { get; }
}
}
11 changes: 11 additions & 0 deletions VisualPinball.Engine/Game/ICoilableDevice.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions VisualPinball.Engine/Game/ISwitchableDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Visual Pinball Engine
// Copyright (C) 2020 freezy and VPE Team
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

using System.Collections.Generic;
using VisualPinball.Engine.Game.Engines;

namespace VisualPinball.Engine.Game
{
public interface ISwitchableDevice
{
string Name { get; }

IEnumerable<GamelogicEngineSwitch> AvailableSwitches { get; }
}
}
11 changes: 11 additions & 0 deletions VisualPinball.Engine/Game/ISwitchableDevice.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion VisualPinball.Engine/VPT/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

using System;
using VisualPinball.Engine.Math;

namespace VisualPinball.Engine.VPT
{
Expand Down
1 change: 1 addition & 0 deletions VisualPinball.Engine/VPT/ItemType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ public enum ItemType

// VPE internal
Ball = 100,
Trough = 101,
}
}
Loading