Skip to content

Milestone 1 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
633b1ee
units: add get switch unit
jsm174 Jan 26, 2022
ee77970
events: Added SwitchEnabled event
jsm174 Jan 28, 2022
e40761b
cosmetics: lamp to switch update
jsm174 Jan 28, 2022
e270438
refactor: Don't use separate event for enabled switch event.
freezy Jan 29, 2022
27003b1
switches: update SwitchEnabledEvent to accept multiple ids (OR). upda…
jsm174 Jan 31, 2022
d77583d
coils: update pulse coil unit to take multiple coils
jsm174 Jan 31, 2022
002f62c
scripting: update set coil unit to accept multiple coils
jsm174 Jan 31, 2022
6c6e37a
Add groundwork for player states.
freezy Jan 31, 2022
31dbe36
Add set player state unit that allows selecting the variable.
freezy Feb 1, 2022
102fb78
state: Make player variables types work (somewhat).
freezy Feb 2, 2022
d944f58
More player state units.
freezy Feb 2, 2022
79ce9d4
Assign icons to player state nodes.
freezy Feb 3, 2022
c3a7176
Add table state.
freezy Feb 3, 2022
dd48e07
Add missing widgets.
freezy Feb 3, 2022
ac06cfd
Rename state nodes to be more coherent.
freezy Feb 3, 2022
c8ceeb0
Add node for toggling lights.
freezy Feb 3, 2022
d29eb7c
gle: Fix table variable errors.
freezy Feb 3, 2022
48b9424
fix: Retrieve table and GLE globally instead from reference.
freezy Feb 3, 2022
d7c5985
gle: Fix state notifications.
freezy Feb 4, 2022
5aacdd9
unit: add switch lamp unit.
jsm174 Feb 8, 2022
6656ead
unit: update LampIdValue to convert to/from JSON
jsm174 Feb 10, 2022
f6046aa
unit: update SwitchLampUnit to cache based on json hash
jsm174 Feb 10, 2022
93f7c47
Add display unit.
freezy Feb 8, 2022
92b7513
unit: cleanup switch lamp unit before renaming
jsm174 Feb 11, 2022
ed6f49f
deps: bump visual scripting to 1.7.7
jsm174 Feb 11, 2022
a5746e8
misc: fix switch lamp unit to use RequestedLamps
jsm174 Feb 11, 2022
739b1f8
Update score reel scoring.
freezy Feb 11, 2022
8c8ec42
misc: cleanup default value keys
jsm174 Feb 12, 2022
8033dbd
Add "next player" option to player state change node.
freezy Feb 12, 2022
7a3ee70
Add get player ID node.
freezy Feb 12, 2022
0169ee5
Add string and boolean support to increase variable node.
freezy Feb 13, 2022
ecfe6ea
Provide both old and new value in variables changed event.
freezy Feb 13, 2022
778317a
Add all switches enabled node.
freezy Feb 13, 2022
0fde182
units: rework itemCount/item keys to match MultiInput units
jsm174 Feb 14, 2022
b2655f8
misc: update to SetLampUnit/SwitchLampUnit to use IMultiInputUnit
jsm174 Feb 15, 2022
f54634e
misc: updated SetLampEnabledUnit to support IMultiInput
jsm174 Feb 15, 2022
6e213de
misc: cleanup. Added IMultiInputUnit to SwitchEvent
jsm174 Feb 15, 2022
d63630c
misc: Added IMultiInputUnit support to LampEventUnit
jsm174 Feb 15, 2022
acbffb7
units: Add new SetSwitch and PulseSwitch units
jsm174 Feb 15, 2022
de95676
units: refactored SetLampComponentUnit into SetLampColorUnit
jsm174 Feb 15, 2022
bfbd43a
misc: refactor SetLightSequenceUnit to LampSequenceUnit
jsm174 Feb 15, 2022
f116e09
Refactor multi widgets to inherit from GleMultiUnitWidget.
freezy Feb 15, 2022
4d2f7ec
misc: update LampSequenceUnitWidget to use GleMultiUnitWidget
jsm174 Feb 15, 2022
ead5de5
api: Use LampState instead of float.
freezy Feb 17, 2022
9f1da0f
Refactor lamp nodes.
freezy Feb 21, 2022
5a25a21
Remove obsolete lamp nodes.
freezy Feb 21, 2022
6f7194e
Add pinball events.
freezy Feb 21, 2022
0ac09a8
Update pinball event nodes.
freezy Feb 22, 2022
186da10
Remove target from pinball event.
freezy Feb 26, 2022
9a3b0e8
unit: update switch lamp unit to work more like set lamp unit
jsm174 Mar 2, 2022
9b651cd
Multiply intensity by 255 if mapping is set to RGB.
freezy Feb 28, 2022
c02055b
unit: rework LampSequenceUnit to use mappings
jsm174 Mar 3, 2022
5fb47c6
misc: update lamp sequence to find all lights in a mapping
jsm174 Mar 4, 2022
a21524c
units: added coil units to mirror what we have for switches
jsm174 Mar 8, 2022
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
32 changes: 32 additions & 0 deletions Editor/Descriptors/AllCoilsEnabledEventUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(AllCoilsEnabledEventUnit))]
public class AllCoilsEnabledEventUnitDescriptor : MultiUnitDescriptor<AllCoilsEnabledEventUnit>
{
public AllCoilsEnabledEventUnitDescriptor(AllCoilsEnabledEventUnit target) : base(target) { }
protected override string ItemLabel(int id) => $"Coil ID {id}";
protected override string ItemDescription(int id) => $"Coil ID {id} to look for enabled status.";
protected override string DefinedSummary() => "This node triggers an event when the last coil in the list gets enabled.";
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.CoilEvent);
}
}

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

32 changes: 32 additions & 0 deletions Editor/Descriptors/AllSwitchesEnabledEventUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(AllSwitchesEnabledEventUnit))]
public class AllSwitchesEnabledEventUnitDescriptor : MultiUnitDescriptor<AllSwitchesEnabledEventUnit>
{
public AllSwitchesEnabledEventUnitDescriptor(AllSwitchesEnabledEventUnit target) : base(target) { }
protected override string ItemLabel(int id) => $"Switch ID {id}";
protected override string ItemDescription(int id) => $"Switch ID {id} to look for enabled status.";
protected override string DefinedSummary() => "This node triggers an event when the last switch in the list gets enabled.";
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.SwitchEvent);
}
}

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

48 changes: 48 additions & 0 deletions Editor/Descriptors/ChangePlayerStateUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(ChangePlayerStateUnit))]
public class ChangePlayerStateUnitDescriptor : UnitDescriptor<ChangePlayerStateUnit>
{
public ChangePlayerStateUnitDescriptor(ChangePlayerStateUnit target) : base(target)
{
}

protected override string DefinedSummary()
{
return "This node changes the current player state with another one.";
}

protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);

protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
{
base.DefinedPort(port, desc);

switch (port.key) {
case nameof(ChangePlayerStateUnit.PlayerId):
desc.summary = "The player ID of the desired state";
break;
}
}
}
}

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

49 changes: 49 additions & 0 deletions Editor/Descriptors/CoilEnabledEventUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(CoilEnabledEventUnit))]
public class CoilEnabledEventUnitDescriptor : UnitDescriptor<CoilEnabledEventUnit>
{
public CoilEnabledEventUnitDescriptor(CoilEnabledEventUnit target) : base(target)
{
}

protected override string DefinedSummary()
{
return "This node triggers an event when a coil in the list of given ID is enabled.";
}

protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.CoilEvent);

protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
{
base.DefinedPort(port, desc);

if (int.TryParse(port.key, out int id)) {
id += 1;

desc.label = $"Coil ID {id}";
desc.summary = $"Coil ID {id} to look for enabled status.";
}
}
}
}

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

52 changes: 52 additions & 0 deletions Editor/Descriptors/CoilEventUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(CoilEventUnit))]
public class CoilEventUnitDescriptor : UnitDescriptor<CoilEventUnit>
{
public CoilEventUnitDescriptor(CoilEventUnit target) : base(target)
{
}

protected override string DefinedSummary()
{
return "This node triggers an event when a coil with a given ID changes.";
}

protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.CoilEvent);

protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
{
base.DefinedPort(port, desc);

if (port.key == nameof(CoilEventUnit.IsEnabled)) {
desc.summary = "The new value of the coil, true if enabled, false otherwise.";
}
else if (int.TryParse(port.key, out int id)) {
id += 1;

desc.label = $"Coil ID {id}";
desc.summary = $"Coil ID {id} to look for a change status.";
}
}
}
}
11 changes: 11 additions & 0 deletions Editor/Descriptors/CoilEventUnitDescriptor.cs.meta

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

57 changes: 57 additions & 0 deletions Editor/Descriptors/CreatePlayerStateUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(CreatePlayerStateUnit))]
public class CreatePlayerStateUnitDescriptor : UnitDescriptor<CreatePlayerStateUnit>
{
public CreatePlayerStateUnitDescriptor(CreatePlayerStateUnit target) : base(target)
{
}

protected override string DefinedSummary()
{
return "This node creates a new player state.";
}

protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);

protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
{
base.DefinedPort(port, desc);

switch (port.key) {
case nameof(CreatePlayerStateUnit.PlayerId):
desc.summary = "The player ID of the new state";
break;
// case nameof(PlayerStateCreateUnit.AutoIncrement):
// desc.summary = "If set, the new player ID will be the currently largest ID, plus one.";
// break;
case nameof(CreatePlayerStateUnit.SetAsActive):
desc.summary = "If set, the new state will be the current state. Otherwise, it will only be the current state if there is no state set.";
break;
case nameof(CreatePlayerStateUnit.DestroyPrevious):
desc.summary = "If set, all player states are destroyed before creating a new one. This is typically used when starting the first ball.";
break;
}
}
}
}
11 changes: 11 additions & 0 deletions Editor/Descriptors/CreatePlayerStateUnitDescriptor.cs.meta

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

53 changes: 53 additions & 0 deletions Editor/Descriptors/GetCoilUnitDescriptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Visual Pinball Engine
// Copyright (C) 2022 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/>.

// ReSharper disable UnusedType.Global

using Unity.VisualScripting;
using VisualPinball.Unity.Editor;
using IconSize = VisualPinball.Unity.Editor.IconSize;

namespace VisualPinball.Unity.VisualScripting.Editor
{
[Descriptor(typeof(GetCoilUnit))]
public class GetCoilUnitDescriptor : UnitDescriptor<GetCoilUnit>
{
public GetCoilUnitDescriptor(GetCoilUnit target) : base(target)
{
}

protected override string DefinedSummary()
{
return "This node retrieves the current status of the coil.";
}

protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.Coil(IconSize.Large, IconColor.Orange));

protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
{
base.DefinedPort(port, desc);

switch (port.key) {
case nameof(GetCoilUnit.Id):
desc.summary = "Coil ID to check if enabled.";
break;
case nameof(GetCoilUnit.IsEnabled):
desc.summary = "Whether the coil is enabled.";
break;
}
}
}
}
11 changes: 11 additions & 0 deletions Editor/Descriptors/GetCoilUnitDescriptor.cs.meta

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

Loading