Exemplo n.º 1
0
        private static void RainMeter_ctor(On.HUD.RainMeter.orig_ctor orig, RainMeter self, HUD.HUD hud, FContainer fContainer)
        {
            try
            {
                orig(self, hud, fContainer);
            }
            catch (Exception e)
            {
                Debug.Log("Error in Rainmeter ctor " + e.Message);
            }

            if (hud.owner != null & hud.owner is Player)
            {
                if (MonklandSteamManager.isInGame)
                {
                    self.circles = new HUDCircle[MonklandSteamManager.WorldManager.cycleLength / 1200];
                }
                else
                {
                    //self.circles = new HUDCircle[(hud.owner as Player).room.world.rainCycle.cycleLength / 1200];
                }
            }
            else if (hud.owner != null & (hud.owner is MultiplayerSleepAndDeathScreen) && MonklandSteamManager.isInGame && MonklandSteamManager.WorldManager != null)
            {
                self.circles = new HUDCircle[MonklandSteamManager.WorldManager.cycleLength / 1200];
            }

            for (int i = 0; i < self.circles.Length; i++)
            {
                self.circles[i] = new HUDCircle(hud, HUDCircle.SnapToGraphic.smallEmptyCircle, fContainer, 0);
            }
        }
Exemplo n.º 2
0
        private static void CtorHK(On.HUD.RainMeter.orig_ctor orig, RainMeter self, HUD.HUD hud, FContainer fContainer)
        {
            bool isMulti = true;

            if (!MonklandSteamManager.isInGame || MonklandSteamManager.WorldManager == null)
            {
                isMulti = false;
                if (hud.owner != null && hud.owner is Player p && p.room != null)
                {
                    orig(self, hud, fContainer);
                }
                else
                {
                    noOrigCtor(self, isMulti, hud, fContainer);
                }
            }