mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-30 12:23:42 +01:00
Add IpcPending.
This commit is contained in:
parent
960548f7b2
commit
eb7cc6ffa0
3 changed files with 26 additions and 6 deletions
|
|
@ -96,6 +96,11 @@ public sealed unsafe class MaterialManager : IRequiredService, IDisposable
|
||||||
state.Materials.UpdateValue(idx, new MaterialValueState(newGame, materialValue.Model, drawData, StateSource.Manual),
|
state.Materials.UpdateValue(idx, new MaterialValueState(newGame, materialValue.Model, drawData, StateSource.Manual),
|
||||||
out _);
|
out _);
|
||||||
break;
|
break;
|
||||||
|
case StateSource.IpcPending:
|
||||||
|
materialValue.Model.Apply(ref row);
|
||||||
|
state.Materials.UpdateValue(idx, new MaterialValueState(newGame, materialValue.Model, drawData, StateSource.IpcManual),
|
||||||
|
out _);
|
||||||
|
break;
|
||||||
case StateSource.IpcManual:
|
case StateSource.IpcManual:
|
||||||
case StateSource.Manual:
|
case StateSource.Manual:
|
||||||
deleteList.Add(idx);
|
deleteList.Add(idx);
|
||||||
|
|
|
||||||
|
|
@ -800,6 +800,12 @@ public class StateListener : IDisposable
|
||||||
if (_config.UseAdvancedParameters)
|
if (_config.UseAdvancedParameters)
|
||||||
model.ApplySingleParameterData(flag, state.ModelData.Parameters);
|
model.ApplySingleParameterData(flag, state.ModelData.Parameters);
|
||||||
break;
|
break;
|
||||||
|
case StateSource.IpcPending:
|
||||||
|
state.BaseData.Parameters.Set(flag, newValue);
|
||||||
|
state.Sources[flag] = StateSource.IpcManual;
|
||||||
|
if (_config.UseAdvancedParameters)
|
||||||
|
model.ApplySingleParameterData(flag, state.ModelData.Parameters);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,9 @@ public enum StateSource : byte
|
||||||
IpcFixed,
|
IpcFixed,
|
||||||
IpcManual,
|
IpcManual,
|
||||||
|
|
||||||
// Only used for CustomizeParameters.
|
// Only used for CustomizeParameters and advanced dyes.
|
||||||
Pending,
|
Pending,
|
||||||
|
IpcPending,
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class StateSourceExtensions
|
public static class StateSourceExtensions
|
||||||
|
|
@ -19,9 +20,10 @@ public static class StateSourceExtensions
|
||||||
public static StateSource Base(this StateSource source)
|
public static StateSource Base(this StateSource source)
|
||||||
=> source switch
|
=> source switch
|
||||||
{
|
{
|
||||||
StateSource.Manual or StateSource.IpcManual or StateSource.Pending => StateSource.Manual,
|
StateSource.Manual or StateSource.Pending => StateSource.Manual,
|
||||||
StateSource.Fixed or StateSource.IpcFixed => StateSource.Fixed,
|
StateSource.IpcManual or StateSource.IpcPending => StateSource.Manual,
|
||||||
_ => StateSource.Game,
|
StateSource.Fixed or StateSource.IpcFixed => StateSource.Fixed,
|
||||||
|
_ => StateSource.Game,
|
||||||
};
|
};
|
||||||
|
|
||||||
public static bool IsGame(this StateSource source)
|
public static bool IsGame(this StateSource source)
|
||||||
|
|
@ -34,7 +36,12 @@ public static class StateSourceExtensions
|
||||||
=> source.Base() is StateSource.Fixed;
|
=> source.Base() is StateSource.Fixed;
|
||||||
|
|
||||||
public static StateSource SetPending(this StateSource source)
|
public static StateSource SetPending(this StateSource source)
|
||||||
=> source is StateSource.Manual ? StateSource.Pending : source;
|
=> source switch
|
||||||
|
{
|
||||||
|
StateSource.Manual => StateSource.Pending,
|
||||||
|
StateSource.IpcManual => StateSource.IpcPending,
|
||||||
|
_ => source,
|
||||||
|
};
|
||||||
|
|
||||||
public static bool RequiresChange(this StateSource source)
|
public static bool RequiresChange(this StateSource source)
|
||||||
=> source switch
|
=> source switch
|
||||||
|
|
@ -46,7 +53,7 @@ public static class StateSourceExtensions
|
||||||
};
|
};
|
||||||
|
|
||||||
public static bool IsIpc(this StateSource source)
|
public static bool IsIpc(this StateSource source)
|
||||||
=> source is StateSource.IpcManual or StateSource.IpcFixed;
|
=> source is StateSource.IpcManual or StateSource.IpcFixed or StateSource.IpcPending;
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe struct StateSources
|
public unsafe struct StateSources
|
||||||
|
|
@ -97,6 +104,7 @@ public unsafe struct StateSources
|
||||||
case (byte)StateSource.Manual | ((byte)StateSource.Fixed << 4):
|
case (byte)StateSource.Manual | ((byte)StateSource.Fixed << 4):
|
||||||
case (byte)StateSource.IpcFixed | ((byte)StateSource.Fixed << 4):
|
case (byte)StateSource.IpcFixed | ((byte)StateSource.Fixed << 4):
|
||||||
case (byte)StateSource.Pending | ((byte)StateSource.Fixed << 4):
|
case (byte)StateSource.Pending | ((byte)StateSource.Fixed << 4):
|
||||||
|
case (byte)StateSource.IpcPending | ((byte)StateSource.Fixed << 4):
|
||||||
case (byte)StateSource.IpcManual | ((byte)StateSource.Fixed << 4):
|
case (byte)StateSource.IpcManual | ((byte)StateSource.Fixed << 4):
|
||||||
_data[i] = (byte)((value & 0x0F) | ((byte)StateSource.Manual << 4));
|
_data[i] = (byte)((value & 0x0F) | ((byte)StateSource.Manual << 4));
|
||||||
break;
|
break;
|
||||||
|
|
@ -104,6 +112,7 @@ public unsafe struct StateSources
|
||||||
case ((byte)StateSource.Manual << 4) | (byte)StateSource.Fixed:
|
case ((byte)StateSource.Manual << 4) | (byte)StateSource.Fixed:
|
||||||
case ((byte)StateSource.IpcFixed << 4) | (byte)StateSource.Fixed:
|
case ((byte)StateSource.IpcFixed << 4) | (byte)StateSource.Fixed:
|
||||||
case ((byte)StateSource.Pending << 4) | (byte)StateSource.Fixed:
|
case ((byte)StateSource.Pending << 4) | (byte)StateSource.Fixed:
|
||||||
|
case ((byte)StateSource.IpcPending << 4) | (byte)StateSource.Fixed:
|
||||||
case ((byte)StateSource.IpcManual << 4) | (byte)StateSource.Fixed:
|
case ((byte)StateSource.IpcManual << 4) | (byte)StateSource.Fixed:
|
||||||
_data[i] = (byte)((value & 0xF0) | (byte)StateSource.Manual);
|
_data[i] = (byte)((value & 0xF0) | (byte)StateSource.Manual);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue