mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Minor code changes and fixes
Sometimes I dream about cheese
This commit is contained in:
parent
7fcfb04e0f
commit
fd48185bdd
14 changed files with 183 additions and 177 deletions
|
@ -20,10 +20,6 @@ namespace ml_dht
|
|||
ms_instance = this;
|
||||
|
||||
Settings.Init();
|
||||
Settings.EnabledChange += this.OnEnabledChanged;
|
||||
Settings.MirroredChange += this.OnMirroredChanged;
|
||||
Settings.SmoothingChange += this.OnSmoothingChanged;
|
||||
Settings.FaceOverrideChange += this.OnFaceOverrideChange;
|
||||
|
||||
m_mapReader = new MemoryMapReader();
|
||||
m_buffer = new byte[1024];
|
||||
|
@ -64,6 +60,18 @@ namespace ml_dht
|
|||
m_localTracked.SetEnabled(Settings.Enabled);
|
||||
m_localTracked.SetMirrored(Settings.Mirrored);
|
||||
m_localTracked.SetSmoothing(Settings.Smoothing);
|
||||
m_localTracked.SetFaceOverride(Settings.FaceOverride);
|
||||
}
|
||||
|
||||
public override void OnDeinitializeMelon()
|
||||
{
|
||||
if(ms_instance == this)
|
||||
ms_instance = null;
|
||||
|
||||
m_mapReader?.Close();
|
||||
m_mapReader = null;
|
||||
m_buffer = null;
|
||||
m_localTracked = null;
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
|
@ -76,27 +84,6 @@ namespace ml_dht
|
|||
}
|
||||
}
|
||||
|
||||
void OnEnabledChanged(bool p_state)
|
||||
{
|
||||
if(m_localTracked != null)
|
||||
m_localTracked.SetEnabled(p_state);
|
||||
}
|
||||
void OnMirroredChanged(bool p_state)
|
||||
{
|
||||
if(m_localTracked != null)
|
||||
m_localTracked.SetMirrored(p_state);
|
||||
}
|
||||
void OnSmoothingChanged(float p_value)
|
||||
{
|
||||
if(m_localTracked != null)
|
||||
m_localTracked.SetSmoothing(p_value);
|
||||
}
|
||||
void OnFaceOverrideChange(bool p_state)
|
||||
{
|
||||
if(m_localTracked != null)
|
||||
m_localTracked.SetFaceOverride(p_state);
|
||||
}
|
||||
|
||||
static void OnCalibrateAvatar_Postfix() => ms_instance?.OnCalibrateAvatar();
|
||||
void OnCalibrateAvatar()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue