Esempio n. 1
0
 public override void MapComponentTick()
 {
     cooldown = cooldown + 1;
     if (cooldown > 1250) //Update is called every 1250 ticks (Twice an in-game hour, or every 20.5 seconds real-time)
     {
         StateHandler.PushState(map);
         cooldown = 0;
     }
     base.MapComponentTick();
 }
Esempio n. 2
0
 public override void MapComponentTick()
 {
     //We use this variable to avoid lag. Update is called every 1250 ticks. Thats twice each ingame hour.
     pushcooldown = pushcooldown + 1;
     if (pushcooldown > 1250)
     {
         StateHandler.PushState(map);
         //Log.Message("[RichPressence] Calling presence update..."); commented to remove log spam
         pushcooldown = 0;
     }
     base.MapComponentTick();
 }
Esempio n. 3
0
        public override void DoSettingsWindowContents(Rect inRect)
        {
            Listing_Standard listing_Standard = new Listing_Standard();

            listing_Standard.Begin(inRect);
            //Default settings
            listing_Standard.CheckboxLabeled("RPC_ColonyLabel".Translate() + " ", ref settings.RPC_Colony);
            listing_Standard.CheckboxLabeled("RPC_ColonistCountLabel".Translate() + " ", ref settings.RPC_ColonistCount);
            listing_Standard.CheckboxLabeled("RPC_YearLabel".Translate() + " ", ref settings.RPC_Year);
            listing_Standard.CheckboxLabeled("RPC_YearShortLabel".Translate() + " ", ref settings.RPC_YearShort);
            listing_Standard.CheckboxLabeled("RPC_QuadrumLabel".Translate() + " ", ref settings.RPC_Quadrum);
            listing_Standard.CheckboxLabeled("RPC_DayLabel".Translate() + "  ", ref settings.RPC_Day);
            listing_Standard.CheckboxLabeled("RPC_HourLabel".Translate() + "  ", ref settings.RPC_Hour);
            listing_Standard.CheckboxLabeled("RPC_TimeLabel".Translate() + "  ", ref settings.RPC_Time);
            //Custom field settings
            listing_Standard.CheckboxLabeled("CustomTopCheckbox".Translate() + "  ", ref settings.RPC_CustomTop);
            if (RWRPCMod.settings.RPC_CustomTop)
            {
                settings.RPC_CustomTopText = listing_Standard.TextEntryLabeled("CustomTopLabel".Translate() + " ", settings.RPC_CustomTopText);
            }
            listing_Standard.CheckboxLabeled("CustomBottomCheckbox".Translate() + "  ", ref settings.RPC_CustomBottom);
            if (RWRPCMod.settings.RPC_CustomBottom)
            {
                settings.RPC_CustomBottomText = listing_Standard.TextEntryLabeled("CustomBottomLabel".Translate() + " ", settings.RPC_CustomBottomText);
            }
            if (listing_Standard.ButtonText("RPC_UpdateLabel".Translate()))
            {
                Verse.Log.Message("UPDATED");
                var world = Current.Game != null ? Current.Game.World : null;
                if (world != null)
                {
                    StateHandler.PushState(Current.Game.CurrentMap);
                }
            }
            listing_Standard.End();
            settings.Write();
        }
Esempio n. 4
0
 public static void GoToMainMenu_Postfix()
 {
     StateHandler.MenuState();
 }