From 004c88e2111a033143520d441348fd080d77bce3 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Wed, 16 Aug 2023 14:03:34 -0400 Subject: [PATCH] fix compliation errors in previous commit --- VmcMessages/VmcExtCon.cs | 35 +++++++++++++++++++++++++++------- VmcMessages/VmcExtDevicePos.cs | 1 - 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/VmcMessages/VmcExtCon.cs b/VmcMessages/VmcExtCon.cs index 7569656..10d45da 100644 --- a/VmcMessages/VmcExtCon.cs +++ b/VmcMessages/VmcExtCon.cs @@ -1,3 +1,24 @@ +/* + godotVmcSharp + Copyright (C) 2023 Cassandra de la Cruz-Munoz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + +using Godot; +using godotOscSharp; + namespace godotVmcSharp { public class VmcExtCon : VmcMessage @@ -50,17 +71,17 @@ namespace godotVmcSharp { GD.Print(InvalidArgumentType.GetErrorString(addr, "Axis.z", 'f', m.Data[7].Type)); } - if ((int)m.Data[0] < 0 || (int)m.Data[0] > 2) + if ((int)m.Data[0].Value < 0 || (int)m.Data[0].Value > 2) { GD.Print($"Invalid value for \"active\" 'i' argument of /VMC/Ext/Con. Expected 0-2, received {(int)m.Data[0].Value}"); return; } - active = (int)m.Data[0]; - name = (string)m.Data[1]; - isLeft = (int)m.Data[2]; - isTouch = (int)m.Data[3]; - isAxis = (int)m.Data[4]; - axis = new Godot.Vector3((float)m.Data[5], (float)m.Data[6], (float)m.Data[7]); + active = (int)m.Data[0].Value; + name = (string)m.Data[1].Value; + isLeft = (int)m.Data[2].Value; + isTouch = (int)m.Data[3].Value; + isAxis = (int)m.Data[4].Value; + axis = new Godot.Vector3((float)m.Data[5].Value, (float)m.Data[6].Value, (float)m.Data[7].Value); } } } \ No newline at end of file diff --git a/VmcMessages/VmcExtDevicePos.cs b/VmcMessages/VmcExtDevicePos.cs index 31c7b1f..9401f0d 100644 --- a/VmcMessages/VmcExtDevicePos.cs +++ b/VmcMessages/VmcExtDevicePos.cs @@ -18,7 +18,6 @@ using Godot; using godotOscSharp; -using System.Collections.Generic; namespace godotVmcSharp {