From 91bd056486ff566f92cb4ad9ebf1115a5d5b53c5 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Wed, 16 Aug 2023 19:24:53 -0400 Subject: [PATCH] create new constructor for VmcExtCon --- VmcMessages/VmcExtCon.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/VmcMessages/VmcExtCon.cs b/VmcMessages/VmcExtCon.cs index 10d45da..de27305 100644 --- a/VmcMessages/VmcExtCon.cs +++ b/VmcMessages/VmcExtCon.cs @@ -83,5 +83,20 @@ namespace godotVmcSharp 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); } + + public VmcExtCon(int _active, string _name, int _isLeft, int _isTouch, int _isAxis, Godot.Vector3 _axis): base(new godotOscSharp.Address("/VMC/Ext/Con")) + { + if (_active < 0 || _active > 2) + { + GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0-2, received {_active}"); + return; + } + active = _active; + name = _name; + isLeft = _isLeft; + isTouch = _isTouch; + isAxis = _isAxis; + axis = _axis + } } } \ No newline at end of file