namespace CheatEnabler.Patches.Tech;
///
/// The key-modifier semantics shared by the upgrade and the downgrade side.
///
/// The mapping mirrors the built-in handler so both features behave
/// identically, and the downgrade side is its exact mirror:
///
///
/// - Shift+1 / -1
/// - Ctrl+10 / -10
/// - Ctrl + Shift+100 / -100
/// - Altto MAX / back to locked
/// - Shift + Alt, Ctrl + Altignored
///
///
internal static class TechKeyCombo
{
/// Sentinel for the "Alt" combination: apply or revert everything this click can.
public const int LevelToMax = int.MaxValue;
///
/// Decodes the currently held modifiers.
/// Returns false when the combination carries no meaning and the click must be left alone.
///
public static bool TryDecode(out int steps)
{
steps = 0;
if (VFInput.shift)
{
if (VFInput.alt)
{
return false;
}
steps = VFInput.control ? 100 : 1;
return true;
}
if (VFInput.control)
{
if (VFInput.alt)
{
return false;
}
steps = 10;
return true;
}
if (VFInput.alt)
{
steps = LevelToMax;
return true;
}
return false;
}
}