untested style changes

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-08-17 15:56:29 -04:00
parent 93b6b512ca
commit de222b1d91
Signed by: cassdlcm
GPG Key ID: BFEBACEA812DDA70
6 changed files with 85 additions and 77 deletions

View File

@ -23,7 +23,7 @@ namespace godotVmcSharp
{
public class VmcExtSetShortcut : VmcMessage
{
public string shortcut { get; }
public string Shortcut { get; }
public VmcExtSetShortcut(OscMessage m) : base(m.Address)
{
@ -37,17 +37,17 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "shortcut", 's', m.Data[0].Type));
return;
}
shortcut = (string)m.Data[0].Value;
Shortcut = (string)m.Data[0].Value;
}
public VmcExtSetShortcut(string _shortcut) : base(new OscAddress("/VMC/Ext/Set/Shortcut"))
public VmcExtSetShortcut(string shortcut) : base(new OscAddress("/VMC/Ext/Set/Shortcut"))
{
shortcut = _shortcut;
Shortcut = shortcut;
}
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(shortcut, 's')});
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{new OscArgument(Shortcut, 's')});
}
}
}

View File

@ -24,9 +24,9 @@ namespace godotVmcSharp
{
public class VmcExtSettingColor : VmcMessage
{
public Godot.Color color { get; }
public Color Color { get; }
public VmcExtSettingColor(godotOscSharp.OscMessage m) : base(m.Address)
public VmcExtSettingColor(OscMessage m) : base(m.Address)
{
if (m.Data.Count != 4)
{
@ -53,21 +53,21 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "a", 'f', m.Data[3].Type));
return;
}
color = new Godot.Color((float)m.Data[0].Value, (float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value);
Color = new Godot.Color((float)m.Data[0].Value, (float)m.Data[1].Value, (float)m.Data[2].Value, (float)m.Data[3].Value);
}
public VmcExtSettingColor(Godot.Color _color) : base(new godotOscSharp.OscAddress("/VMC/Ext/Setting/Color"))
public VmcExtSettingColor(Color color) : base(new OscAddress("/VMC/Ext/Setting/Color"))
{
color = _color;
Color = color;
}
public godotOscSharp.OscMessage ToMessage()
public OscMessage ToMessage()
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(color.R, 'f'),
new godotOscSharp.OscArgument(color.G, 'f'),
new godotOscSharp.OscArgument(color.B, 'f'),
new godotOscSharp.OscArgument(color.A, 'f')
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Color.R, 'f'),
new OscArgument(Color.G, 'f'),
new OscArgument(Color.B, 'f'),
new OscArgument(Color.A, 'f')
});
}
}

View File

@ -18,18 +18,17 @@
using Godot;
using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp
{
public class VmcExtSettingWin : VmcMessage
{
public int isTopMost { get; }
public int isTransparent { get; }
public int windowClickThrough { get; }
public int hideBorder { get; }
public int IsTopMost { get; }
public int IsTransparent { get; }
public int WindowClickThrough { get; }
public int HideBorder { get; }
public VmcExtSettingWin(godotOscSharp.OscMessage m) : base(m.Address)
public VmcExtSettingWin(OscMessage m) : base(m.Address)
{
if (m.Data.Count != 4)
{
@ -76,47 +75,47 @@ namespace godotVmcSharp
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {addr}. Expected 0 or 1, received {(int)m.Data[3].Value}");
return;
}
isTopMost = (int)m.Data[0].Value;
isTransparent = (int)m.Data[1].Value;
windowClickThrough = (int)m.Data[2].Value;
hideBorder = (int)m.Data[3].Value;
IsTopMost = (int)m.Data[0].Value;
IsTransparent = (int)m.Data[1].Value;
WindowClickThrough = (int)m.Data[2].Value;
HideBorder = (int)m.Data[3].Value;
}
public VmcExtSettingWin(int _isTopMost, int _isTransparent, int _windowClickThrough, int _hideBorder) : base(new godotOscSharp.OscAddress("/VMC/Ext/Setting/Win"))
public VmcExtSettingWin(int isTopMost, int isTransparent, int windowClickThrough, int hideBorder) : base(new OscAddress("/VMC/Ext/Setting/Win"))
{
if (_isTopMost < 0 || _isTopMost > 1)
if (isTopMost < 0 || isTopMost > 1)
{
GD.Print($"Invalid value for \"isTopMost\" 'i' argument of {addr}. Expected 0 or 1, received {_isTopMost}");
GD.Print($"Invalid value for \"isTopMost\" 'i' argument of {addr}. Expected 0 or 1, received {isTopMost}");
return;
}
if (_isTransparent < 0 || _isTransparent > 1)
if (isTransparent < 0 || isTransparent > 1)
{
GD.Print($"Invalid value for \"isTransparent\" 'i' argument of {addr}. Expected 0 or 1, received {_isTransparent}");
GD.Print($"Invalid value for \"isTransparent\" 'i' argument of {addr}. Expected 0 or 1, received {isTransparent}");
return;
}
if (_windowClickThrough < 0 || _windowClickThrough > 1)
if (windowClickThrough < 0 || windowClickThrough > 1)
{
GD.Print($"Invalid value for \"windowClickThrough\" 'i' argument of {addr}. Expected 0 or 1, received {_windowClickThrough}");
GD.Print($"Invalid value for \"windowClickThrough\" 'i' argument of {addr}. Expected 0 or 1, received {windowClickThrough}");
return;
}
if (_hideBorder < 0 || _hideBorder > 1)
if (hideBorder < 0 || hideBorder > 1)
{
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {addr}. Expected 0 or 1, received {_hideBorder}");
GD.Print($"Invalid value for \"hideBorder\" 'i' argument of {addr}. Expected 0 or 1, received {hideBorder}");
return;
}
isTopMost = _isTopMost;
isTransparent = _isTransparent;
windowClickThrough = _windowClickThrough;
hideBorder = _hideBorder;
IsTopMost = isTopMost;
IsTransparent = isTransparent;
WindowClickThrough = windowClickThrough;
HideBorder = hideBorder;
}
public godotOscSharp.OscMessage ToMessage()
public new OscMessage ToMessage()
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(isTopMost, 'i'),
new godotOscSharp.OscArgument(isTransparent, 'i'),
new godotOscSharp.OscArgument(windowClickThrough, 'i'),
new godotOscSharp.OscArgument(hideBorder, 'i')
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(IsTopMost, 'i'),
new OscArgument(IsTransparent, 'i'),
new OscArgument(WindowClickThrough, 'i'),
new OscArgument(HideBorder, 'i')
});
}
}

View File

@ -23,7 +23,7 @@ namespace godotVmcSharp
{
public class VmcExtT : VmcMessage
{
public float time { get; }
public float Time { get; }
public VmcExtT(godotOscSharp.OscMessage m) : base(m.Address)
{
if (m.Data.Count != 1)
@ -36,12 +36,19 @@ namespace godotVmcSharp
InvalidArgumentType.GetErrorString(m.Address.ToString(), "time", 'f', m.Data[0].Type);
return;
}
time = (float)m.Data[0].Value;
Time = (float)m.Data[0].Value;
}
public VmcExtT(float _time) : base(new godotOscSharp.OscAddress("/VMC/Ext/T"))
public VmcExtT(float time) : base(new godotOscSharp.OscAddress("/VMC/Ext/T"))
{
time = _time;
Time = time;
}
public new OscMessage ToMessage()
{
return new OscMessage(addr, new System.Collections.Generic.List<OscArgument>{
new OscArgument(Time, 'f')
});
}
}
}

View File

@ -24,11 +24,11 @@ namespace godotVmcSharp
{
public class VmcExtVrm : VmcMessage
{
public string path { get; }
public string title { get; }
public string? hash { get; }
public string Path { get; }
public string Title { get; }
public string Hash { get; }
public VmcExtVrm(godotOscSharp.OscMessage m) : base(m.Address)
public VmcExtVrm(OscMessage m) : base(m.Address)
{
switch (m.Data.Count)
{
@ -43,8 +43,9 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "title", 's', m.Data[1].Type));
return;
}
path = (string)m.Data[0].Value;
title = (string)m.Data[1].Value;
Path = (string)m.Data[0].Value;
Title = (string)m.Data[1].Value;
Hash = "";
break;
case 3:
if (m.Data[0].Type != 's')
@ -62,9 +63,9 @@ namespace godotVmcSharp
GD.Print(InvalidArgumentType.GetErrorString(addr, "hash", 's', m.Data[1].Type));
return;
}
path = (string)m.Data[0].Value;
title = (string)m.Data[1].Value;
hash = (string)m.Data[2].Value;
Path = (string)m.Data[0].Value;
Title = (string)m.Data[1].Value;
Hash = (string)m.Data[2].Value;
break;
default:
GD.Print($"Invalid number of arguments for {addr} message. Expected 2 or 3 but received {m.Data.Count}");
@ -72,32 +73,33 @@ namespace godotVmcSharp
}
}
public VmcExtVrm(string _path, string _title) : base(new godotOscSharp.OscAddress("/VMC/Ext/VRM"))
public VmcExtVrm(string path, string title) : base(new OscAddress("/VMC/Ext/VRM"))
{
path = _path;
title = _title;
Path = path;
Title = title;
Hash = "";
}
public VmcExtVrm(string _path, string _title, string _hash) : base(new godotOscSharp.OscAddress("/VMC/Ext/VRM"))
public VmcExtVrm(string path, string title, string hash) : base(new OscAddress("/VMC/Ext/VRM"))
{
path = _path;
title = _title;
hash = _hash;
Path = path;
Title = title;
Hash = hash;
}
public godotOscSharp.OscMessage ToMessage()
public new OscMessage ToMessage()
{
if (hash == null)
if (Hash == null)
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(path, 's'),
new godotOscSharp.OscArgument(title, 's')
return new OscMessage(addr, new List<OscArgument>{
new OscArgument(Path, 's'),
new OscArgument(Title, 's')
});
}
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(path, 's'),
new godotOscSharp.OscArgument(title, 's'),
new godotOscSharp.OscArgument(hash, 's')
return new OscMessage(addr, new List<OscArgument>{
new OscArgument(Path, 's'),
new OscArgument(Title, 's'),
new OscArgument(Hash, 's')
});
}
}

View File

@ -22,16 +22,16 @@ namespace godotVmcSharp
{
public class VmcMessage
{
public godotOscSharp.OscAddress addr { get; }
public godotOscSharp.OscAddress Addr { get; }
public VmcMessage(godotOscSharp.OscAddress address)
{
addr = address;
Addr = address;
}
public godotOscSharp.OscMessage ToMessage()
{
return new godotOscSharp.OscMessage(addr);
return new godotOscSharp.OscMessage(Addr);
}
}
}