Exemplo n.º 1
0
 public static void Postfix(Selectable __instance, qkButtonMesser __state)
 {
     if (__state != null)
     {
         StrikePatch.striked = null;
         __state.SubmitButton(__instance);
         __state.AvoidStrike.Remove(__instance);
     }
 }
Exemplo n.º 2
0
    public static bool Prefix(Selectable __instance, ILog ___logger, out qkButtonMesser __state, ref bool __result)
    {
        Selectable parented = Patcher.GetParent(__instance);
        var        messer   = Patcher.GetMeser((parented.Parent == null ? parented : parented.Parent).GetComponent <BombComponent>());

        if (messer != null && messer._enable)
        {
            if (messer._forced)
            {
                if (__instance.GetComponent <Messed>() != null)
                {
                    messer.DestroyObject(__instance.GetComponent <Messed>());
                }
                __state = null;
                return(true);
            }
            if (messer.AvoidStrike.Contains(__instance))
            {
                StrikePatch.striked = __instance;
                __state             = messer;
                return(true);
            }
            if (messer.AvoidVanilla.Contains(__instance))
            {
                __state = null;
                bool flag = true;
                ___logger.DebugFormat("OnInteract: {0}", __instance.name);
                BombComponent component = __instance.GetComponent <BombComponent>();
                if (component != null)
                {
                    component.Focused();
                    if (__instance.OnFocus != null)
                    {
                        __instance.OnFocus();
                    }
                }
                if (__instance.OnInteract != null)
                {
                    flag &= __instance.OnInteract();
                }
                __result = flag;
                return(false);
            }
        }
        __state = null;
        return(true);
    }