Skip to content

Commit 201d9f6

Browse files
committed
api: Use LampState instead of float.
1 parent 6421f76 commit 201d9f6

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

Runtime/Gamelogic/VisualScriptingGamelogicEngine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ public void SetLamp(string id, Color color)
181181
OnLampColorChanged?.Invoke(this, new LampColorEventArgs(id, color));
182182
}
183183

184-
public float GetLamp(string id)
184+
public LampState GetLamp(string id)
185185
{
186-
return _player.LampStatuses.ContainsKey(id) ? _player.LampStatuses[id] : 0;
186+
return _player.LampStatuses.ContainsKey(id) ? _player.LampStatuses[id] : LampState.Default;
187187
}
188188

189189
public bool GetSwitch(string id)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
namespace VisualPinball.Unity.VisualScripting
18+
{
19+
public enum LampDataType
20+
{
21+
Status, Intensity, Color,
22+
}
23+
}

Runtime/Nodes/Lamps/LampDataType.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.

0 commit comments

Comments
 (0)