public static Season Season(int tile) { return(GenDate.Season(TicksAbs, Find.WorldGrid.LongLatOf(tile))); }
public static float YearPercent(Thing thing) { return(GenDate.YearPercent((long)GenLocalDate.TicksAbs, GenLocalDate.LongitudeForDate(thing))); }
public static float HourFloat(Thing thing) { return(GenDate.HourFloat((long)GenLocalDate.TicksAbs, GenLocalDate.LongitudeForDate(thing))); }
public static int TimeZoneAt(float longitude) { return(Mathf.RoundToInt(GenDate.TimeZoneFloatAt(longitude))); }
public static Season Season(Thing thing) { return(GenDate.Season((long)GenLocalDate.TicksAbs, GenLocalDate.LocationForDate(thing))); }
public static float HourFloat(long absTicks, float longitude) { return(GenDate.DayPercent(absTicks, longitude) * 24f); }
public static string QuadrumDateStringAt(Quadrum quadrum) { return(GenDate.QuadrumDateStringAt((long)((int)quadrum * 900000 + 1), 0f)); }
public static int DayOfTwelfth(Thing thing) { return(GenDate.DayOfTwelfth(TicksAbs, LongitudeForDate(thing))); }
public static Twelfth Twelfth(Thing thing) { return(GenDate.Twelfth(TicksAbs, LongitudeForDate(thing))); }
public static float HourFloat(int tile) { return(GenDate.HourFloat(TicksAbs, Find.WorldGrid.LongLatOf(tile).x)); }
public static int HourOfDay(Thing thing) { return(GenDate.HourOfDay(TicksAbs, LongitudeForDate(thing))); }
public static int HourInteger(int tile) { return(GenDate.HourInteger(TicksAbs, Find.WorldGrid.LongLatOf(tile).x)); }
public static float YearPercent(int tile) { return(GenDate.YearPercent(TicksAbs, Find.WorldGrid.LongLatOf(tile).x)); }
public static int DayTick(int tile) { return(GenDate.DayTick(TicksAbs, Find.WorldGrid.LongLatOf(tile).x)); }
public static int DayOfSeason(long absTicks, float longitude) { int num = GenDate.DayOfYear(absTicks, longitude); return((num - (int)(SeasonUtility.FirstSeason.GetFirstTwelfth(0f) * RimWorld.Twelfth.Sixth)) % 15); }
private void DoArchivableRow(Rect rect, IArchivable archivable, int index) { if (index % 2 == 1) { Widgets.DrawLightHighlight(rect); } Widgets.DrawHighlightIfMouseover(rect); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.MiddleLeft; Text.WordWrap = false; Rect rect2 = rect; Rect rect3 = rect2; rect3.width = 30f; rect2.xMin += 35f; float num = Find.Archive.IsPinned(archivable) ? 1f : ((!Mouse.IsOver(rect3)) ? 0f : 0.25f); Rect position = new Rect(rect3.x + (rect3.width - 22f) / 2f, rect3.y + (rect3.height - 22f) / 2f, 22f, 22f).Rounded(); if (num > 0f) { GUI.color = new Color(1f, 1f, 1f, num); GUI.DrawTexture(position, PinTex); } else { GUI.color = PinOutlineColor; GUI.DrawTexture(position, PinOutlineTex); } GUI.color = Color.white; Rect rect4 = rect2; Rect outerRect = rect2; outerRect.width = 30f; rect2.xMin += 35f; Texture archivedIcon = archivable.ArchivedIcon; if (archivedIcon != null) { GUI.color = archivable.ArchivedIconColor; Widgets.DrawTextureFitted(outerRect, archivedIcon, 0.8f); GUI.color = Color.white; } Rect rect5 = rect2; rect5.width = 80f; rect2.xMin += 85f; Vector2 location = (Find.CurrentMap != null) ? Find.WorldGrid.LongLatOf(Find.CurrentMap.Tile) : default(Vector2); GUI.color = new Color(0.75f, 0.75f, 0.75f); Widgets.Label(label: GenDate.DateShortStringAt(GenDate.TickGameToAbs(archivable.CreatedTicksGame), location).Truncate(rect5.width), rect: rect5); GUI.color = Color.white; Rect rect6 = rect2; Widgets.Label(rect6, archivable.ArchivedLabel.Truncate(rect6.width)); GenUI.ResetLabelAlign(); Text.WordWrap = true; TooltipHandler.TipRegionByKey(rect3, "PinArchivableTip", 200); if (Mouse.IsOver(rect4)) { displayedMessageIndex = index; } if (Widgets.ButtonInvisible(rect3)) { if (Find.Archive.IsPinned(archivable)) { Find.Archive.Unpin(archivable); SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(); } else { Find.Archive.Pin(archivable); SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(); } } if (!Widgets.ButtonInvisible(rect4)) { return; } if (Event.current.button == 1) { LookTargets lookTargets = archivable.LookTargets; if (CameraJumper.CanJump(lookTargets.TryGetPrimaryTarget())) { CameraJumper.TryJumpAndSelect(lookTargets.TryGetPrimaryTarget()); Find.MainTabsRoot.EscapeCurrentTab(); } } else { archivable.OpenArchived(); } }
public static int DayOfQuadrum(long absTicks, float longitude) { int num = GenDate.DayOfYear(absTicks, longitude); return((num - (int)(QuadrumUtility.FirstQuadrum.GetFirstTwelfth() * RimWorld.Twelfth.Sixth)) % 15); }
private void DoGraphPage(Rect rect) { rect.yMin += 17f; GUI.BeginGroup(rect); Rect graphRect = new Rect(0f, 0f, rect.width, 450f); Rect legendRect = new Rect(0f, graphRect.yMax, rect.width / 2f, 40f); Rect rect2 = new Rect(0f, legendRect.yMax, rect.width, 40f); if (historyAutoRecorderGroup != null) { marks.Clear(); List <Tale> allTalesListForReading = Find.TaleManager.AllTalesListForReading; for (int i = 0; i < allTalesListForReading.Count; i++) { Tale tale = allTalesListForReading[i]; if (tale.def.type == TaleType.PermanentHistorical) { float x = (float)GenDate.TickAbsToGame(tale.date) / 60000f; marks.Add(new CurveMark(x, tale.ShortSummary, tale.def.historyGraphColor)); } } historyAutoRecorderGroup.DrawGraph(graphRect, legendRect, graphSection, marks); } Text.Font = GameFont.Small; float num = (float)Find.TickManager.TicksGame / 60000f; if (Widgets.ButtonText(new Rect(legendRect.xMin + legendRect.width, legendRect.yMin, 110f, 40f), "Last30Days".Translate())) { graphSection = new FloatRange(Mathf.Max(0f, num - 30f), num); SoundDefOf.Click.PlayOneShotOnCamera(); } if (Widgets.ButtonText(new Rect(legendRect.xMin + legendRect.width + 110f + 4f, legendRect.yMin, 110f, 40f), "Last100Days".Translate())) { graphSection = new FloatRange(Mathf.Max(0f, num - 100f), num); SoundDefOf.Click.PlayOneShotOnCamera(); } if (Widgets.ButtonText(new Rect(legendRect.xMin + legendRect.width + 228f, legendRect.yMin, 110f, 40f), "Last300Days".Translate())) { graphSection = new FloatRange(Mathf.Max(0f, num - 300f), num); SoundDefOf.Click.PlayOneShotOnCamera(); } if (Widgets.ButtonText(new Rect(legendRect.xMin + legendRect.width + 342f, legendRect.yMin, 110f, 40f), "AllDays".Translate())) { graphSection = new FloatRange(0f, num); SoundDefOf.Click.PlayOneShotOnCamera(); } if (Widgets.ButtonText(new Rect(rect2.x, rect2.y, 110f, 40f), "SelectGraph".Translate())) { List <FloatMenuOption> list = new List <FloatMenuOption>(); List <HistoryAutoRecorderGroup> list2 = Find.History.Groups(); for (int j = 0; j < list2.Count; j++) { HistoryAutoRecorderGroup groupLocal = list2[j]; if (!groupLocal.def.devModeOnly || Prefs.DevMode) { list.Add(new FloatMenuOption(groupLocal.def.LabelCap, delegate { historyAutoRecorderGroup = groupLocal; })); } } FloatMenu window = new FloatMenu(list, "SelectGraph".Translate()); Find.WindowStack.Add(window); PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.HistoryTab, KnowledgeAmount.Total); } GUI.EndGroup(); }
public static string SeasonDateStringAt(Twelfth twelfth, Vector2 longLat) { return(GenDate.SeasonDateStringAt((long)((int)twelfth * 300000 + 1), longLat)); }
private static long LocalTicksOffsetFromLongitude(float longitude) { return((long)GenDate.TimeZoneAt(longitude) * 2500L); }
public static string QuadrumDateStringAt(Twelfth twelfth) { return(GenDate.QuadrumDateStringAt((long)((int)twelfth * 300000 + 1), 0f)); }
public static int HourOfDay(long absTicks, float longitude) { long num = absTicks + GenDate.LocalTicksOffsetFromLongitude(longitude); return((int)(num % 60000L / 2500L)); }
public static Twelfth Twelfth(Thing thing) { return(GenDate.Twelfth((long)GenLocalDate.TicksAbs, GenLocalDate.LongitudeForDate(thing))); }
public static Season Season(long absTicks, Vector2 longLat) { return(GenDate.Season(absTicks, longLat.y, longLat.x)); }
public static int DayTick(Thing thing) { return(GenDate.DayTick((long)GenLocalDate.TicksAbs, GenLocalDate.LongitudeForDate(thing))); }
public static Season Season(long absTicks, float latitude, float longitude) { float yearPct = GenDate.YearPercent(absTicks, longitude); return(SeasonUtility.GetReportedSeason(yearPct, latitude)); }
public static int HourInteger(Thing thing) { return(GenDate.HourInteger((long)GenLocalDate.TicksAbs, GenLocalDate.LongitudeForDate(thing))); }
public static Quadrum Quadrum(long absTicks, float longitude) { Twelfth twelfth = GenDate.Twelfth(absTicks, longitude); return(twelfth.GetQuadrum()); }
public static int HourOfDay(int tile) { return(GenDate.HourOfDay((long)GenLocalDate.TicksAbs, Find.WorldGrid.LongLatOf(tile).x)); }
public static Twelfth Twelfth(int tile) { return(GenDate.Twelfth(TicksAbs, Find.WorldGrid.LongLatOf(tile).x)); }