Skip to content

Commit 02196b5

Browse files
committed
Assign icons to player state nodes.
1 parent 0e3f103 commit 02196b5

16 files changed

+245
-7
lines changed

Editor/Descriptors/CreateBallUnitDescriptor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ protected override string DefinedSummary()
3434
return "This node spawns a new ball at a given position.";
3535
}
3636

37+
38+
3739
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.BallRoller(IconSize.Large, IconColor.Orange));
3840

3941
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)

Editor/Descriptors/PlayerStateChangeUnitDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected override string DefinedSummary()
3232
return "This node changes the current player state with another one.";
3333
}
3434

35-
//protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.BallRoller(IconSize.Large, IconColor.Orange));
35+
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);
3636

3737
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
3838
{

Editor/Descriptors/PlayerStateCreateUnitDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected override string DefinedSummary()
3232
return "This node creates a new player state.";
3333
}
3434

35-
//protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.BallRoller(IconSize.Large, IconColor.Orange));
35+
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);
3636

3737
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
3838
{
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Visual Pinball Engine
2+
// Copyright (C) 2022 freezy and VPE Team
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
// ReSharper disable UnusedType.Global
18+
19+
using Unity.VisualScripting;
20+
21+
namespace VisualPinball.Unity.VisualScripting.Editor
22+
{
23+
[Descriptor(typeof(PlayerVariableChangedEventUnit))]
24+
public class PlayerVariableChangedEventUnitDescriptor : UnitDescriptor<PlayerVariableChangedEventUnit>
25+
{
26+
public PlayerVariableChangedEventUnitDescriptor(PlayerVariableChangedEventUnit target) : base(target)
27+
{
28+
}
29+
30+
protected override string DefinedSummary()
31+
{
32+
return "This event is emitted when a given player variable changes.";
33+
}
34+
35+
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariableEvent);
36+
37+
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
38+
{
39+
base.DefinedPort(port, desc);
40+
41+
switch (port.key) {
42+
case nameof(PlayerVariableChangedEventUnit.Value):
43+
desc.summary = "The new value of the player variable.";
44+
break;
45+
}
46+
}
47+
}
48+
}

Editor/Descriptors/PlayerVariableChangedEventUnitDescriptor.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Visual Pinball Engine
2+
// Copyright (C) 2022 freezy and VPE Team
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
// ReSharper disable UnusedType.Global
18+
19+
using Unity.VisualScripting;
20+
21+
namespace VisualPinball.Unity.VisualScripting.Editor
22+
{
23+
[Descriptor(typeof(PlayerVariableGetUnit))]
24+
public class PlayerVariableGetUnitDescriptor : UnitDescriptor<PlayerVariableGetUnit>
25+
{
26+
public PlayerVariableGetUnitDescriptor(PlayerVariableGetUnit target) : base(target)
27+
{
28+
}
29+
30+
protected override string DefinedSummary()
31+
{
32+
return "This node retrieves the value of a given player variable.";
33+
}
34+
35+
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);
36+
37+
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
38+
{
39+
base.DefinedPort(port, desc);
40+
41+
switch (port.key) {
42+
case nameof(PlayerVariableGetUnit.Value):
43+
desc.summary = "The current value of the player variable.";
44+
break;
45+
}
46+
}
47+
}
48+
}

Editor/Descriptors/PlayerVariableGetUnitDescriptor.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Visual Pinball Engine
2+
// Copyright (C) 2022 freezy and VPE Team
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
// ReSharper disable UnusedType.Global
18+
19+
using Unity.VisualScripting;
20+
21+
namespace VisualPinball.Unity.VisualScripting.Editor
22+
{
23+
[Descriptor(typeof(PlayerVariableIncreaseUnit))]
24+
public class PlayerVariableIncreaseUnitDescriptor : UnitDescriptor<PlayerVariableIncreaseUnit>
25+
{
26+
public PlayerVariableIncreaseUnitDescriptor(PlayerVariableIncreaseUnit target) : base(target)
27+
{
28+
}
29+
30+
protected override string DefinedSummary()
31+
{
32+
return "This node increases the value of a given player variable.\n\nTo decrease, use a negative value.";
33+
}
34+
35+
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);
36+
37+
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
38+
{
39+
base.DefinedPort(port, desc);
40+
41+
switch (port.key) {
42+
case nameof(PlayerVariableIncreaseUnit.Value):
43+
desc.summary = "The value to add to the existing value.";
44+
break;
45+
}
46+
}
47+
}
48+
}

Editor/Descriptors/PlayerVariableIncreaseUnitDescriptor.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Visual Pinball Engine
2+
// Copyright (C) 2022 freezy and VPE Team
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
// ReSharper disable UnusedType.Global
18+
19+
using Unity.VisualScripting;
20+
21+
namespace VisualPinball.Unity.VisualScripting.Editor
22+
{
23+
[Descriptor(typeof(PlayerVariableSetUnit))]
24+
public class PlayerVariableSetUnitDescriptor : UnitDescriptor<PlayerVariableSetUnit>
25+
{
26+
public PlayerVariableSetUnitDescriptor(PlayerVariableSetUnit target) : base(target)
27+
{
28+
}
29+
30+
protected override string DefinedSummary()
31+
{
32+
return "This node sets the value of a given player variable.";
33+
}
34+
35+
protected override EditorTexture DefinedIcon() => EditorTexture.Single(Unity.Editor.Icons.PlayerVariable);
36+
37+
protected override void DefinedPort(IUnitPort port, UnitPortDescription desc)
38+
{
39+
base.DefinedPort(port, desc);
40+
41+
switch (port.key) {
42+
case nameof(PlayerVariableSetUnit.Value):
43+
desc.summary = "The new value of the player variable.";
44+
break;
45+
}
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)