Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3f71c4e
doc: Update install instructions (thanks @remdwaas!).
freezy Jan 29, 2022
688ab9e
style: Cleanup.
freezy Jan 29, 2022
e0a8106
api: Properly handle drop and raise events.
freezy Jan 30, 2022
c4f95af
editor: Retrieve table from scene if none selected.
freezy Feb 2, 2022
e60f41e
editor: Add more UVS icons.
freezy Feb 3, 2022
a7247ad
doc: Add some documentation for visual scripting.
freezy Feb 5, 2022
905d97c
doc: Add variables of visual scripting.
freezy Feb 7, 2022
39bd794
refactor: Change GLE API to Requested instead of Available for coils,…
freezy Feb 10, 2022
ad7abe8
display: Make score reel component usable.
freezy Feb 11, 2022
0e247ab
doc: Update overview and displays
freezy Feb 12, 2022
ef9612d
editor: Add score reel icons.
freezy Feb 12, 2022
d300dce
editor: Add inspector for score reel.
freezy Feb 12, 2022
b99415c
doc: Add visual scripting setup.
freezy Feb 12, 2022
7fa749b
doc: Add screenshots to UVS variables.
freezy Feb 12, 2022
bda9d58
doc: Update node reference.
freezy Feb 12, 2022
c380a11
doc: Update visual scripting node reference.
freezy Feb 12, 2022
fcad075
lamps: expose lamp player needed for LampSequenceUnit
jsm174 Feb 15, 2022
a4b3ab8
patcher: Remove AllGI from Rock
jsm174 Feb 15, 2022
478ff23
doc: Finish variable nodes documentation in visual scripting.
freezy Feb 13, 2022
966f3d8
doc: Update displays.
freezy Feb 15, 2022
2073abb
lights: do not switch lamp state when state is blinking
jsm174 Feb 18, 2022
2251dbc
lamps: Use status object instead of float.
freezy Feb 16, 2022
a2dcfb9
lamps: Fix values in player.
freezy Feb 18, 2022
5659c68
doc: Add lamps into to visual scripting.
freezy Feb 18, 2022
33f599e
lamps: Change API to receive states.
freezy Feb 18, 2022
5337e0d
api: Refactor player to accept lamp states.
freezy Feb 19, 2022
002258f
lamps: Refactor APIs.
freezy Feb 20, 2022
48efc15
lamps: Separate APIs for intensity, state and color.
freezy Feb 21, 2022
08de997
fix: Add missing modification.
freezy Feb 21, 2022
c3f3f7b
assets: Add cleaned up bumper ring model.
freezy Feb 22, 2022
50a26be
doc: Add lamps page to UVS.
freezy Feb 24, 2022
02c0dda
misc: revert expose lamp player needed for LampSequenceUnit
jsm174 Mar 3, 2022
4a22413
lamps: Keep track of unmapped states.
freezy Mar 3, 2022
038c7cc
coils: Keep track of unmapped states.
freezy Mar 3, 2022
e78177b
fix(lamps): Always update state.
freezy Mar 4, 2022
65ced36
doc: Events for visual scripting.
freezy Mar 4, 2022
efe686d
doc: Update copyright year.
freezy Mar 4, 2022
0bb3afd
doc: More lamp nodes to UVS.
freezy Mar 4, 2022
60267d2
docs: misc text updates
jsm174 Mar 6, 2022
fcdbb0a
doc: Add switch lamp to UVS.
freezy Mar 7, 2022
737ac39
doc: Add displays to UVS node reference.
freezy Mar 7, 2022
6fed321
doc: Replace banner and add disclaimer to UVS doc.
freezy Mar 8, 2022
857dd1e
misc: update docs to include coil nodes. Bump deps
jsm174 Mar 9, 2022
694a4f6
docs: add Pulse switch
jsm174 Mar 9, 2022
afb90e7
lamps: Check channel when matching existing mappings.
freezy Mar 9, 2022
f3d0380
Update node-reference.md
DanLShane Mar 10, 2022
10e2e41
input: add sam input constants/bindings
jsm174 Mar 10, 2022
469a1bc
input: tweak sam coin door actions
jsm174 Mar 11, 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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ MigrationBackup/
# Vi swap files
*.swp

**/Plugins/**
/VisualPinball.Unity/Plugins/**

obj.meta
VisualPinball.Unity/VisualPinball.Unity.Test/TestProject~/*.vpx
Expand All @@ -386,4 +386,4 @@ VisualPinball.Unity/VisualPinball.Unity.Test/TestProject~/VisualPinball.Unity.cs
VisualPinball.Unity/VisualPinball.Unity.Test/TestProject~/editmode-results.xml

.DS_Store

10 changes: 5 additions & 5 deletions VisualPinball.Engine.Test/VisualPinball.Engine.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
<None Remove="Fixtures*/*" Visible="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0-preview-20211130-02" />
<PackageReference Include="FluentAssertions" Version="6.3.0" ExcludeAssets="Compile" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0-preview-20220131-20" />
<PackageReference Include="FluentAssertions" Version="6.5.1" ExcludeAssets="Compile" />
<PackageReference Include="JeremyAnsel.Media.WavefrontObj" Version="2.0.19" />
</ItemGroup>
<ItemGroup>
Expand All @@ -40,7 +40,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="FluentAssertions">
<HintPath>$(NuGetPackageRoot)\fluentassertions\6.3.0\lib\netstandard2.1\FluentAssertions.dll</HintPath>
<HintPath>$(NuGetPackageRoot)\fluentassertions\6.5.1\lib\netstandard2.1\FluentAssertions.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PluginsDeploy" AfterTargets="Build">
Expand Down
4 changes: 4 additions & 0 deletions VisualPinball.Engine/Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public static class InputConstants
public const string ActionCoinDoorDown = "Coin Door Down (WPC)";
public const string ActionCoinDoorUp = "Coin Door Up (WPC)";
public const string ActionCoinDoorEnter = "Coin Door Enter (WPC)";
public const string ActionCoinDoorBack = "Coin Door Back (SAM)";
public const string ActionCoinDoorMinus = "Coin Door Minus (-) (SAM)";
public const string ActionCoinDoorPlus = "Coin Door Plus (+) (SAM)";
public const string ActionCoinDoorSelect = "Coin Door Select (SAM)";
public const string ActionCoinDoorAdvance = "Coin Door Advance";
public const string ActionCoinDoorUpDown = "Coin Door Up/Down";
public const string ActionSlamTilt = "Slam Tilt";
Expand Down
88 changes: 88 additions & 0 deletions VisualPinball.Engine/Game/Engines/GamelogicEngineLamp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,92 @@ public enum LampType
RgbMulti = 2,
Rgb = 3,
}

public enum LampStatus
{
Off = 0,
On = 1,
Blinking = 2,
}

public class LampState
{
public LampStatus Status {
get => _status;
set {
if (value != LampStatus.Off) {
_lastOnStatus = value;
}
_status = value;
}
}

public bool IsOn {
get => _status is LampStatus.On or LampStatus.Blinking;
set => _status = value ? _lastOnStatus : LampStatus.Off;
}

public float Intensity {
get => Color.A;
set => Color = Color.WithAlpha(value);
}

public Color Color;

private LampStatus _status;
private LampStatus _lastOnStatus = LampStatus.On;

public LampState(LampStatus status, Color color)
{
Status = status;
Color = color;
}

public LampState(float intensity)
{
if (intensity == 0f) {
_status = LampStatus.Off;
Color = new Color(255, 255, 255, 255);

} else {
_status = LampStatus.On;
Color = new Color(255, 255, 255, (int)(intensity * 255));
}
}

public LampState(Color color)
{
_status = color.A > 0 ? LampStatus.On : LampStatus.Off;
Color = color;
}

public void SetChannel(ColorChannel channel, float value)
{
switch (channel) {

case ColorChannel.Red:
Color.R = value;
break;
case ColorChannel.Green:
Color.G = value;
break;
case ColorChannel.Blue:
Color.B = value;
break;
case ColorChannel.Alpha:
Color.A = value;
break;

default:
throw new ArgumentOutOfRangeException(nameof(channel), channel, null);
}
}

public override string ToString()
{
return $"[{_status}] {Color}";
}

public static LampState Default => new LampState(LampStatus.Off, Colors.White);
}
}
23 changes: 19 additions & 4 deletions VisualPinball.Engine/Math/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
// 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 InconsistentNaming

using System;

namespace VisualPinball.Engine.Math
{
// todo make struct
[Serializable]
public class Color
{
Expand All @@ -26,10 +29,10 @@ public class Color
public int Blue;
public int Alpha = 0xff;

public float R => Red / 255f;
public float G => Green / 255f;
public float B => Blue / 255f;
public float A => Alpha / 255f;
public float R { get => Red / 255f; set => Red = (int)(value * 255f); }
public float G { get => Green / 255f; set => Green = (int)(value * 255f); }
public float B { get => Blue / 255f; set => Blue = (int)(value * 255f); }
public float A { get => Alpha / 255f; set => Alpha = (int)(value * 255f); }

public uint Bgr => (uint)Alpha * 16777216 + (uint)Blue * 65536 + (uint)Green * 256 + (uint)Red;

Expand Down Expand Up @@ -69,11 +72,23 @@ public Color WithAlpha(int alpha)
return new Color(Red, Green, Blue, alpha);
}

public Color WithAlpha(float alpha)
{
return new Color(Red, Green, Blue, (int)(alpha * 255f));
}

public bool IsGray()
{
return Red == Green && Green == Blue;
}

public void SetColorWithoutAlpha(Color color)
{
Red = color.Red;
Green = color.Green;
Blue = color.Blue;
}

public override string ToString()
{
return $"rgba({System.Math.Round(R, 3)}, {System.Math.Round(G, 3)}, {System.Math.Round(B, 3)}, {System.Math.Round(A, 3)})";
Expand Down
6 changes: 3 additions & 3 deletions VisualPinball.Engine/VisualPinball.Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<None Remove="obj\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="4.7.13" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="OpenMcdf" Version="2.2.1.9" />
<PackageReference Include="NetMiniZ" Version="1.3.0-preview.1" />
<PackageReference Include="NetMiniZ.Native" Version="1.3.0" />
<PackageReference Include="NetVips" Version="2.1.0" />
<PackageReference Include="NetVips.Native" Version="8.12.1" />
<PackageReference Include="NetVips.Native" Version="8.12.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VisualPinball.Resources\VisualPinball.Resources.csproj" />
Expand All @@ -60,7 +60,7 @@
</ItemGroup>
<ItemGroup Condition="'$(RuntimeIdentifier)' != 'ios-arm64' And '$(RuntimeIdentifier)' != 'android-arm64-v8a'">
<Plugins Include="$(NuGetPackageRoot)\netminiz.native.$(RuntimeIdentifier)\1.3.0\runtimes\$(RuntimeIdentifier)\native\*" />
<Plugins Include="$(NuGetPackageRoot)\netvips.native.$(RuntimeIdentifier)\8.12.1\runtimes\$(RuntimeIdentifier)\native\*" />
<Plugins Include="$(NuGetPackageRoot)\netvips.native.$(RuntimeIdentifier)\8.12.2\runtimes\$(RuntimeIdentifier)\native\*" />
</ItemGroup>
<Message Text="PluginsDeploy: @(Plugins)" />
<Copy SourceFiles="@(Plugins)" DestinationFolder="..\VisualPinball.Unity\Plugins\$(RuntimeIdentifier)\" SkipUnchangedFiles="true" />
Expand Down
Binary file not shown.
105 changes: 105 additions & 0 deletions VisualPinball.Unity/Assets/Art/Meshes/Bumper/Bumper (Ring).fbx.meta

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading