// Token: 0x06000081 RID: 129 RVA: 0x000046AC File Offset: 0x000028AC protected override void FillTab() { float num = 50f; Rect rect = GenUI.ContractedBy(new Rect(0f, num, this.size.x, this.size.y), 5f); List <TabRecord> pages = new List <TabRecord>(); TabRecord item = new TabRecord("Manage", delegate() { ITab_BellManager.tab = ITab_BellManager.ArenaCardTab.Manager; }, ITab_BellManager.tab == ITab_BellManager.ArenaCardTab.Manager); pages.Add(item); TabRecord item2 = new TabRecord("Leaderboard", delegate() { ITab_BellManager.tab = ITab_BellManager.ArenaCardTab.Leaderboard; }, ITab_BellManager.tab == ITab_BellManager.ArenaCardTab.Leaderboard); pages.Add(item2); TabDrawer.DrawTabs(rect, pages, 200f); Rect rectTabs = new Rect(0f, num, rect.width, rect.height - num); bool flag = ITab_BellManager.tab == ITab_BellManager.ArenaCardTab.Manager; if (flag) { this.FillTabManager(rectTabs); } else { bool flag2 = ITab_BellManager.tab == ITab_BellManager.ArenaCardTab.Leaderboard; if (flag2) { this.FillTabLeaderboard(rectTabs); } } }
/// <inheritdoc /> public override void Draw(Rect inRect) { // Do nothing if there's no tabs if (tabs.Count == 0) { return; } // Ok, so for whatever reason the tabs are drawn /above/ whatever region you give them (why?!) // To work around this we just trim the tab height off of the container rect inRect = inRect.BottomPartPixels(inRect.height - TabDrawer.TabHeight); // We draw the top with tabs TabRecord selectedRecord = TabDrawer.DrawTabs(inRect, tabs.Select(e => e.tab).ToList()); // Change the selected record if it was clicked if (selectedRecord != null) { selectedTab = tabs.IndexOf(tabs.Single(tabEntry => tabEntry.tab.label == selectedRecord.label)); onTabChange?.Invoke(selectedTab); } // We draw the selected tab Displayable selectedDisplayable = tabs[selectedTab].displayable; selectedDisplayable.Draw(inRect); }
public override void DoWindowContents(Rect rect) { base.DoWindowContents(rect); Rect rect2 = rect; rect2.yMin += 45f; List <TabRecord> list = new List <TabRecord>(); list.Add(new TabRecord("Graph".Translate(), delegate { this.curTab = HistoryTab.Graph; }, this.curTab == HistoryTab.Graph)); list.Add(new TabRecord("Statistics".Translate(), delegate { this.curTab = HistoryTab.Statistics; }, this.curTab == HistoryTab.Statistics)); TabDrawer.DrawTabs(rect2, list); switch (this.curTab) { case HistoryTab.Graph: this.DoGraphPage(rect2); break; case HistoryTab.Statistics: this.DoStatisticsPage(rect2); break; } }
public void DoSettingsWindowContents(Rect inRect) { // GUI.BeginGroup(inRect); Rect tabRect = new Rect(0, TabDrawer.TabHeight, inRect.width, 0); Rect menuRect = new Rect(0, TabDrawer.TabHeight, inRect.width, inRect.height - TabDrawer.TabHeight); Widgets.DrawMenuSection(menuRect); // var tabs = new List <TabRecord>(); tabs.Add(new TabRecord("Advanced", delegate { SelTab = GraphicsTabOption.Advanced; }, SelTab == GraphicsTabOption.Advanced)); tabs.Add(new TabRecord("Memory", delegate { SelTab = GraphicsTabOption.Memory; }, SelTab == GraphicsTabOption.Memory)); TabDrawer.DrawTabs(tabRect, tabs); switch (SelTab) { case GraphicsTabOption.Advanced: DrawAdvanced(menuRect.ContractedBy(15)); break; case GraphicsTabOption.Memory: DrawMemory(menuRect.ContractedBy(10)); break; } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { base.DoWindowContents(inRect); if (GenTicks.TicksAbs - lastUpdateTick >= (GenDate.TicksPerHour / 6)) { lastUpdateTick = GenTicks.TicksAbs; predictor.MakePrediction(0); } Rect rect2 = inRect; rect2.yMin += 45f; // move top border downs List <TabRecord> list = new List <TabRecord>(); list.Add(new TabRecord("Graph".Translate(), delegate { this.curTab = TabType.Graph; }, this.curTab == TabType.Graph)); list.Add(new TabRecord("Analytics", delegate { this.curTab = TabType.Analytics; }, this.curTab == TabType.Analytics)); list.Add(new TabRecord("Detailed List", delegate { this.curTab = TabType.DetailedList; }, this.curTab == TabType.DetailedList)); list.Add(new TabRecord("Help", delegate { this.curTab = TabType.Help; }, this.curTab == TabType.Help)); list.Add(new TabRecord("Note", delegate { this.curTab = TabType.Note; }, this.curTab == TabType.Note)); TabDrawer.DrawTabs(rect2, list); if (this.curTab == TabType.Graph) { this.DisplayGraphPage(rect2); } else if (this.curTab == TabType.Analytics) { this.DisplayAnalyticsPage(rect2); } else if (this.curTab == TabType.Help) { this.DisplayHelpPage(rect2); } else if (this.curTab == TabType.DetailedList) { this.DisplayDetailedListPage(rect2); } else if (this.curTab == TabType.Note) { this.DisplayNotePage(rect2); } }
public override void DoWindowContents(Rect rect) { base.DoWindowContents(rect); Rect rect2 = rect; rect2.yMin += 45f; TabDrawer.DrawTabs(rect2, this.tabs, 200f); switch (MainTabWindow_ColonistHistory.curTab) { case MainTabWindow_ColonistHistory.TabType.Home: this.DoHomePage(rect2); return; case MainTabWindow_ColonistHistory.TabType.Table: this.DoTablePage(rect2); return; case MainTabWindow_ColonistHistory.TabType.Graph: this.DoGraphPage(rect2); return; default: return; } }
/// <summary> /// Draw the frame around the tabs (and not the tab contents!). /// </summary> /// <param name="inRect">The <see cref="Rect" /> of the tabs.</param> public void DrawTabs(Rect inRect) { if (_tabGuiUtilities.Count == 0) { return; } var tabRecordsToDraw = _tabGuiUtilities.Where(tab => tab.CanBeDrawn) .Select(tab => { /* fix for god mode: if god mode is selected in world map and then you settle your colony * and then you click on the world button, you end up having 'God mode' selected, * which can't be displayed while playing */ if (!SelectedTab.CanBeDrawn) { SetPreviousTabAsSelectedTab(); // try to get the previously displayed tab } if (!SelectedTab.CanBeDrawn) { SetSelectedTabById("Terrain"); // fallback to terrain } /* end fix */ tab.TabRecord.selected = SelectedTab == tab; return(tab.TabRecord); }); TabDrawer.DrawTabs(inRect, tabRecordsToDraw); }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, 35f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, ((!this.reform) ? "FormCaravan" : "ReformCaravan").Translate()); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.CaravanInfo info = new CaravanUIUtility.CaravanInfo(this.MassUsage, this.MassCapacity, this.cachedMassCapacityExplanation, this.TilesPerDay, this.cachedTilesPerDayExplanation, this.DaysWorthOfFood, this.ForagedFoodPerDay, this.cachedForagedFoodPerDayExplanation, this.Visibility, this.cachedVisibilityExplanation, -1f, -1f, null); CaravanUIUtility.CaravanInfo?info2 = null; int currentTile = this.CurrentTile; int? ticksToArrive = (this.destinationTile != -1) ? new int?(this.TicksToArrive) : null; float num = this.lastMassFlashTime; Rect rect2 = new Rect(12f, 35f, inRect.width - 24f, 40f); string extraDaysWorthOfFoodTipInfo = (this.destinationTile != -1) ? ("\n" + "DaysWorthOfFoodTooltip_OnlyFirstWaypoint".Translate()) : null; CaravanUIUtility.DrawCaravanInfo(info, info2, currentTile, ticksToArrive, num, rect2, true, extraDaysWorthOfFoodTipInfo, false); Dialog_FormCaravan.tabsList.Clear(); Dialog_FormCaravan.tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate { this.tab = Dialog_FormCaravan.Tab.Pawns; }, this.tab == Dialog_FormCaravan.Tab.Pawns)); Dialog_FormCaravan.tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate { this.tab = Dialog_FormCaravan.Tab.Items; }, this.tab == Dialog_FormCaravan.Tab.Items)); inRect.yMin += 119f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, Dialog_FormCaravan.tabsList, 200f); Dialog_FormCaravan.tabsList.Clear(); inRect = inRect.ContractedBy(17f); inRect.height += 17f; GUI.BeginGroup(inRect); Rect rect3 = inRect.AtZero(); this.DoBottomButtons(rect3); Rect inRect2 = rect3; inRect2.yMax -= 76f; bool flag = false; Dialog_FormCaravan.Tab tab = this.tab; if (tab != Dialog_FormCaravan.Tab.Pawns) { if (tab == Dialog_FormCaravan.Tab.Items) { this.itemsTransfer.OnGUI(inRect2, out flag); } } else { this.pawnsTransfer.OnGUI(inRect2, out flag); } if (flag) { this.CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { try { if (!SessionClient.Get.IsLogined) { Close(); return; } var screenRect = new Rect(inRect.x, inRect.y + 31f, 400f, 0); var tabRect = new Rect(inRect.x, inRect.y + 31f, inRect.width, inRect.height - 31f); ///Внимание! Вкладки разбивают событие на очереди ожидания (т.е. одномерменно можно вызвать по одному со всех вкладок) ///Реализацию NumberOrder смотри в FMailIncident List <TabRecord> list = new List <TabRecord>(); list.Add(new TabRecord("OC_Incidents_Hire_label".Translate(), () => { TabIndex = 0; StatusNeedUpdate = true; }, TabIndex == 0)); list.Add(new TabRecord("OC_Incidents_Impact_label".Translate(), () => { TabIndex = 1; StatusNeedUpdate = true; }, TabIndex == 1)); TabDrawer.DrawTabs(screenRect, list); if (TabIndex == 0) { DoTab0Contents(tabRect); } else if (TabIndex == 1) { DoTab1Contents(tabRect); } } catch (Exception e) { Loger.Log("Dialog_BaseOnlineButton Exception: " + e.Message + Environment.NewLine + e.ToString()); } }
public override void DoWindowContents(Rect rect) { base.DoWindowContents(rect); Rect rect2 = rect; rect2.yMin += 45f; List <TabRecord> list = new List <TabRecord>(); list.Add(new TabRecord("Graph".Translate(), delegate { this.curTab = MainTabWindow_History.HistoryTab.Graph; }, this.curTab == MainTabWindow_History.HistoryTab.Graph)); list.Add(new TabRecord("Statistics".Translate(), delegate { this.curTab = MainTabWindow_History.HistoryTab.Statistics; }, this.curTab == MainTabWindow_History.HistoryTab.Statistics)); TabDrawer.DrawTabs(rect2, list); MainTabWindow_History.HistoryTab historyTab = this.curTab; if (historyTab != MainTabWindow_History.HistoryTab.Graph) { if (historyTab == MainTabWindow_History.HistoryTab.Statistics) { this.DoStatisticsPage(rect2); } } else { this.DoGraphPage(rect2); } }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(inRect); rect = rect.ContractedBy(18f); rect.height = 34f; Text.Font = GameFont.Medium; Widgets.Label(rect, GetTitle()); Rect rect2 = new Rect(inRect); rect2.yMin = rect.yMax; rect2.yMax -= 38f; Rect rect3 = rect2; rect3.yMin += 45f; List <TabRecord> list = new List <TabRecord>(); TabRecord item = new TabRecord("TabStats".Translate(), delegate { tab = InfoCardTab.Stats; }, tab == InfoCardTab.Stats); list.Add(item); TabDrawer.DrawTabs(rect3, list); FillCard(rect3.ContractedBy(18f)); }
public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Rect rect2 = inRect; rect2.yMin += 35; tabsList.Clear(); tabsList.Add(new TabRecord("RogerEdmonson_OrderWindow_BodyParts".Translate(), delegate { tab = Tab.BodyParts; }, tab == Tab.BodyParts)); tabsList.Add(new TabRecord("RogerEdmonson_OrderWindow_Arts".Translate(), delegate { tab = Tab.Arts; }, tab == Tab.Arts)); Widgets.DrawMenuSection(rect2); TabDrawer.DrawTabs(rect2, tabsList, maxTabWidth: 300); tabsList.Clear(); rect2.y += 32; switch (tab) { case Tab.BodyParts: DrawBodyPartsOders(rect2); break; case Tab.Arts: DrawArtsOrders(rect2); break; } }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, 35f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, "DockCaravan".Translate()); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.DrawCaravanInfo(new CaravanUIUtility.CaravanInfo(this.SourceMassUsage, this.SourceMassCapacity, this.cachedSourceMassCapacityExplanation, this.SourceTilesPerDay, this.cachedSourceTilesPerDayExplanation, this.SourceDaysWorthOfFood, this.SourceForagedFoodPerDay, this.cachedSourceForagedFoodPerDayExplanation, this.SourceVisibility, this.cachedSourceVisibilityExplanation, -1f, -1f, null), null, this.caravan.Tile, (!this.caravan.pather.Moving) ? null : new int?(this.TicksToArrive), -9999f, new Rect(12f, 35f, inRect.width - 24f, 40f), true, null, false); inRect.yMin += 119f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, new List <TabRecord>() { new TabRecord("ItemsTab".Translate(), null, true) }, 200f); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); Rect rect2 = inRect.AtZero(); this.DoBottomButtons(rect2); Rect inRect2 = rect2; inRect2.yMax -= 59f; this.itemsTransfer.OnGUI(inRect2, out bool flag); if (flag) { this.CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoSettingsWindowContents(Rect inRect) { base.DoSettingsWindowContents(inRect); Listing_Standard listingStandard = new Listing_Standard(); Rect menuRect = inRect.ContractedBy(10f); menuRect.y += 20f; menuRect.height -= 20f; Widgets.DrawMenuSection(menuRect); TabDrawer.DrawTabs(menuRect, tabs, 200f); CurrentSection.DrawSection(menuRect); /* Reset Buttons */ float padding = ResetImageSize + 5; Rect resetAllButton = new Rect(menuRect.width - padding, menuRect.y + 15, ResetImageSize, ResetImageSize); Rect resetButton = new Rect(resetAllButton.x - padding, resetAllButton.y, ResetImageSize, ResetImageSize); listingStandard.Begin(resetAllButton); if (listingStandard.ButtonImage(VehicleTex.ResetPage, ResetImageSize, ResetImageSize)) { List <FloatMenuOption> options = CurrentSection.ResetOptions.ToList(); FloatMenu floatMenu = new FloatMenu(options) { vanishIfMouseDistant = true }; //floatMenu.onCloseCallback... Find.WindowStack.Add(floatMenu); } listingStandard.End(); }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, 35f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, (reform ? "ReformCaravan" : "FormCaravan").Translate()); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.DrawCaravanInfo(new CaravanUIUtility.CaravanInfo(MassUsage, MassCapacity, cachedMassCapacityExplanation, TilesPerDay, cachedTilesPerDayExplanation, DaysWorthOfFood, ForagedFoodPerDay, cachedForagedFoodPerDayExplanation, Visibility, cachedVisibilityExplanation), null, CurrentTile, (destinationTile == -1) ? null : new int?(TicksToArrive), lastMassFlashTime, new Rect(12f, 35f, inRect.width - 24f, 40f), lerpMassColor: true, (destinationTile == -1) ? ((TaggedString)null) : ("\n" + "DaysWorthOfFoodTooltip_OnlyFirstWaypoint".Translate())); tabsList.Clear(); tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate { tab = Tab.Pawns; }, tab == Tab.Pawns)); tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate { tab = Tab.Items; }, tab == Tab.Items)); tabsList.Add(new TabRecord("FoodAndMedicineTab".Translate(), delegate { tab = Tab.FoodAndMedicine; }, tab == Tab.FoodAndMedicine)); inRect.yMin += 119f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, tabsList); tabsList.Clear(); inRect = inRect.ContractedBy(17f); inRect.height += 17f; GUI.BeginGroup(inRect); Rect rect2 = inRect.AtZero(); DoBottomButtons(rect2); Rect rect3 = rect2; rect3.yMax -= 76f; bool anythingChanged = false; switch (tab) { case Tab.Pawns: pawnsTransfer.OnGUI(rect3, out anythingChanged); break; case Tab.Items: itemsTransfer.OnGUI(rect3, out anythingChanged); break; case Tab.FoodAndMedicine: foodAndMedicineTransfer.extraHeaderSpace = 35f; foodAndMedicineTransfer.OnGUI(rect3, out anythingChanged); DrawAutoSelectCheckbox(rect3, ref anythingChanged); break; } if (anythingChanged) { CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Rect rect2 = inRect; rect2.yMin += 35; tabsList.Clear(); tabsList.Add(new TabRecord("Modules_ArmorTab".Translate(), delegate { tab = Category.Armor; }, tab == Category.Armor)); tabsList.Add(new TabRecord("Modules_CapacityTab".Translate(), delegate { tab = Category.Capacity; }, tab == Category.Capacity)); tabsList.Add(new TabRecord("Modules_ChargingTab".Translate(), delegate { tab = Category.Charging; }, tab == Category.Charging)); Widgets.DrawMenuSection(rect2); TabDrawer.DrawTabs(rect2, tabsList, maxTabWidth: 250); tabsList.Clear(); DrawModuleTab(rect2, tab); }
public override void DoWindowContents(Rect baseRect) { base.DoWindowContents(baseRect); Rect rect = baseRect; rect.yMin += 45f; List <TabRecord> tabList = new List <TabRecord>(); tabList.Add(new TabRecord("Graph".Translate(), delegate { this.curTab = MainTabWindow_DetailedHistory.HistoryTab.Graph; }, this.curTab == MainTabWindow_DetailedHistory.HistoryTab.Graph)); tabList.Add(new TabRecord("Ranking".Translate(), delegate { this.curTab = MainTabWindow_DetailedHistory.HistoryTab.Ranking; }, this.curTab == MainTabWindow_DetailedHistory.HistoryTab.Ranking)); TabDrawer.DrawTabs(rect, tabList); rect.yMin += 17f; switch (curTab) { case HistoryTab.Graph: this.DoGraphPage(rect); break; case HistoryTab.Ranking: this.DoGraphPage(rect); break; case HistoryTab.Misc: this.DoGraphPage(rect); break; } }
public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Rect rect2 = inRect; rect2.yMin += 35; tabsList.Clear(); tabsList.Add(new TabRecord("Eisenberg_OrderWindow_OneTime".Translate(), delegate { tab = Tab.OneTime; }, tab == Tab.OneTime)); Widgets.DrawMenuSection(rect2); TabDrawer.DrawTabs(rect2, tabsList, maxTabWidth: 550); tabsList.Clear(); rect2.y += 65; switch (tab) { case Tab.OneTime: DrawOneTimeWindow(rect2); break; } }
public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Rect rect2 = inRect; rect2.yMin += 35; tabsList.Clear(); tabsList.Add(new TabRecord("StationTab".Translate(), delegate { tab = Tab.Station; }, tab == Tab.Station)); tabsList.Add(new TabRecord("ArmorTab".Translate(), delegate { tab = Tab.Armor; }, tab == Tab.Armor)); Widgets.DrawMenuSection(rect2); TabDrawer.DrawTabs(rect2, tabsList, maxTabWidth: 550); tabsList.Clear(); switch (tab) { case Tab.Station: DrawStation(rect2); break; case Tab.Armor: DrawArmor(rect2); break; } }
/// <summary> /// Override of Dialog_SplitCaravan.DoWindowContents that calls into this dialog's DoBottomButtons. /// This was needed because Dialog_SplitCaravan.DoBottomButtons isn't virtual, but needed to be overridden. /// </summary> public override void DoWindowContents(Rect inRect) { if (session == null) { Close(); } else if (session.uiDirty) { CountToTransferChanged(); session.uiDirty = false; } Rect rect = new Rect(0f, 0f, inRect.width, 35f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, "SplitCaravan".Translate()); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.DrawCaravanInfo(new CaravanUIUtility.CaravanInfo(SourceMassUsage, SourceMassCapacity, cachedSourceMassCapacityExplanation, SourceTilesPerDay, cachedSourceTilesPerDayExplanation, SourceDaysWorthOfFood, SourceForagedFoodPerDay, cachedSourceForagedFoodPerDayExplanation, SourceVisibility, cachedSourceVisibilityExplanation, -1f, -1f, null), new CaravanUIUtility.CaravanInfo(DestMassUsage, DestMassCapacity, cachedDestMassCapacityExplanation, DestTilesPerDay, cachedDestTilesPerDayExplanation, DestDaysWorthOfFood, DestForagedFoodPerDay, cachedDestForagedFoodPerDayExplanation, DestVisibility, cachedDestVisibilityExplanation, -1f, -1f, null), caravan.Tile, (!caravan.pather.Moving) ? null : new int?(TicksToArrive), -9999f, new Rect(12f, 35f, inRect.width - 24f, 40f), true, null, false); tabsList.Clear(); tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate { tab = Tab.Pawns; }, tab == Tab.Pawns)); tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate { tab = Tab.Items; }, tab == Tab.Items)); inRect.yMin += 119f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, tabsList, 200f); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); Rect rect2 = inRect.AtZero(); DoBottomButtons(rect2); Rect inRect2 = rect2; inRect2.yMax -= 59f; bool flag = false; switch (tab) { case Tab.Pawns: pawnsTransfer.OnGUI(inRect2, out flag); break; case Tab.Items: itemsTransfer.OnGUI(inRect2, out flag); break; } if (flag) { CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, 40f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, "LoadTransporters".Translate(new object[] { this.TransportersLabelFull })); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Dialog_LoadShipCargo.tabsList.Clear(); Dialog_LoadShipCargo.tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate { this.tab = Dialog_LoadShipCargo.Tab.Pawns; }, this.tab == Dialog_LoadShipCargo.Tab.Pawns)); Dialog_LoadShipCargo.tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate { this.tab = Dialog_LoadShipCargo.Tab.Items; }, this.tab == Dialog_LoadShipCargo.Tab.Items)); inRect.yMin += 72f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, Dialog_LoadShipCargo.tabsList); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); Rect rect2 = inRect.AtZero(); Rect rect3 = rect2; rect3.xMin += rect2.width - this.pawnsTransfer.TotalNumbersColumnsWidths; rect3.y += 32f; TransferableUIUtility.DrawMassInfo(rect3, this.MassUsage, this.MassCapacity, "TransportersMassUsageTooltip".Translate(), this.lastMassFlashTime, true); CaravanUIUtility.DrawDaysWorthOfFoodInfo(new Rect(rect3.x, rect3.y + 22f, rect3.width, rect3.height), this.DaysWorthOfFood.First, this.DaysWorthOfFood.Second, this.EnvironmentAllowsEatingVirtualPlantsNow, true, 3.40282347E+38f); this.DrawPassengerCapacity(rect3); this.DoBottomButtons(rect2); Rect inRect2 = rect2; inRect2.yMax += 59f; bool flag = false; Dialog_LoadShipCargo.Tab tab = this.tab; if (tab != Dialog_LoadShipCargo.Tab.Pawns) { if (tab == Dialog_LoadShipCargo.Tab.Items) { this.itemsTransfer.OnGUI(inRect2, out flag); } } else { this.pawnsTransfer.OnGUI(inRect2, out flag); } if (flag) { this.CountToTransferChanged(); } GUI.EndGroup(); }
private void DrawAchievementsMenu(Rect rect) { Widgets.DrawMenuSection(rect); TabDrawer.DrawTabs(rect, tabs, 200f); Rect searchRect = new Rect(rect.width - 240, rect.y + 15f, 200f, 30f); searchText = Widgets.TextField(searchRect, searchText); }
// Token: 0x06000080 RID: 128 RVA: 0x00004360 File Offset: 0x00002560 public override void Draw(Rect inRect) { TabDrawer.DrawTabs(inRect.TopPartPixels(45f), (from o in tabs select o.tab).ToList()); var inRect2 = inRect.BottomPartPixels(inRect.height - 45f); tabs[selectedTab].displayable.Draw(inRect2); }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, 35f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, ((!reform) ? "FormCaravan" : "ReformCaravan").Translate()); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.CaravanInfo info = new CaravanUIUtility.CaravanInfo(MassUsage, MassCapacity, cachedMassCapacityExplanation, TilesPerDay, cachedTilesPerDayExplanation, DaysWorthOfFood, ForagedFoodPerDay, cachedForagedFoodPerDayExplanation, Visibility, cachedVisibilityExplanation); CaravanUIUtility.CaravanInfo?info2 = null; int currentTile = CurrentTile; int? ticksToArrive = (destinationTile != -1) ? new int?(TicksToArrive) : null; float num = lastMassFlashTime; Rect rect2 = new Rect(12f, 35f, inRect.width - 24f, 40f); string extraDaysWorthOfFoodTipInfo = (destinationTile != -1) ? ("\n" + "DaysWorthOfFoodTooltip_OnlyFirstWaypoint".Translate()) : null; CaravanUIUtility.DrawCaravanInfo(info, info2, currentTile, ticksToArrive, num, rect2, lerpMassColor: true, extraDaysWorthOfFoodTipInfo); tabsList.Clear(); tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate { tab = Tab.Pawns; }, tab == Tab.Pawns)); tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate { tab = Tab.Items; }, tab == Tab.Items)); inRect.yMin += 119f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, tabsList); tabsList.Clear(); inRect = inRect.ContractedBy(17f); inRect.height += 17f; GUI.BeginGroup(inRect); Rect rect3 = inRect.AtZero(); DoBottomButtons(rect3); Rect inRect2 = rect3; inRect2.yMax -= 76f; bool anythingChanged = false; switch (tab) { case Tab.Pawns: pawnsTransfer.OnGUI(inRect2, out anythingChanged); break; case Tab.Items: itemsTransfer.OnGUI(inRect2, out anythingChanged); break; } if (anythingChanged) { CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { LastInitialSize = new Vector2(windowRect.width, windowRect.height); LastInitialPos = new Vector2(windowRect.x, windowRect.y); if (MainHelper.DebugMode) { if (!DevTest && new DevelopTest().Run()) { DevTest = true; Close(); } if (DevTest) { return; } } if (!SessionClient.Get.IsLogined) { Close(); Find.WindowStack.Add(new Dialog_LoginForm()); return; } //Rect r1 = new Rect(inRect.x - 5f, inRect.y, 180f, 40f); // inRect.width, inRect.height); //Widgets.DrawBoxSolid(r1, new Color(0, 1, 1)); var screenRect = new Rect(inRect.x, inRect.y + 31f, 400f, 0); var tabRect = new Rect(inRect.x, inRect.y + 31f, inRect.width, inRect.height - 31f); List <TabRecord> list = new List <TabRecord>(); list.Add(new TabRecord("OCity_Dialog_ListChat".Translate(), () => { TabIndex = 0; }, TabIndex == 0)); list.Add(new TabRecord("OCity_Dialog_ListInfo".Translate(), () => { TabIndex = 1; }, TabIndex == 1)); list.Add(new TabRecord("OCity_Dialog_ListAbout".Translate(), () => { TabIndex = 2; }, TabIndex == 2)); TabDrawer.DrawTabs(screenRect, list); if (TabIndex == 0) { DoTab0Contents(tabRect); } else if (TabIndex == 1) { DoTab1Contents(tabRect); } else if (TabIndex == 2) { DoTab2Contents(tabRect); } Text.Font = GameFont.Small; var loginRect = new Rect(inRect.width - 180f, -2f, 180f, 50f); Widgets.Label(loginRect, SessionClientController.Data.LastServerConnectFail ? "OCity_Dialog_Connecting".Translate() : "OCity_Dialog_Login".Translate() + SessionClientController.My.Login + " " + (int)SessionClientController.Data.Ping.TotalMilliseconds + "ms"); }
protected override void FillTab() { Rect rect = new Rect(0f, 0f, this.size.x, this.size.y); GUI.BeginGroup(rect); Rect rect2 = new Rect(rect.x, rect.y + 20f, rect.width, 30f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect2, ship.ShipNick); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Rect rect3 = rect2; rect3.y = rect2.yMax + 100; rect3.height = rect.height - rect2.height; Widgets.DrawMenuSection(rect3, true); List <TabRecord> list = new List <TabRecord>(); list.Add(new TabRecord("ShipPassengers".Translate(), delegate { this.tab = ITab_ShipCargo.Tab.Passengers; }, this.tab == ITab_ShipCargo.Tab.Passengers)); list.Add(new TabRecord("ShipCargo".Translate(), delegate { this.tab = ITab_ShipCargo.Tab.Cargo; }, this.tab == ITab_ShipCargo.Tab.Cargo)); list.Add(new TabRecord("ShipWeapons".Translate(), delegate { this.tab = ITab_ShipCargo.Tab.Weapons; }, this.tab == ITab_ShipCargo.Tab.Weapons)); TabDrawer.DrawTabs(rect3, list); rect3 = rect3.ContractedBy(9f); // GUI.BeginGroup(rect3); GUI.color = Color.white; if (this.tab == Tab.Passengers) { DrawCargo(rect3, false); } else if (this.tab == Tab.Cargo) { DrawCargo(rect3, true); } else if (this.tab == Tab.Weapons) { this.DrawWeaponSlots(rect3); } // GUI.EndGroup(); GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { GUI.color = Color.white; Text.Font = GameFont.Small; try { int y = 90; IEnumerable <Thing> thingsToShow = this.GetThingsToShow(out int rows); if (rows == 0) { return; } this.searchText = Widgets.TextEntryLabeled(new Rect(20, 15, 300, 32), "InfiniteStorage.Search".Translate() + ": ", this.searchText).ToLower().Trim(); this.searchText = Regex.Replace(this.searchText, @"\t|\n|\r", ""); if (this.searchText.Length == 0) { TabDrawer.DrawTabs(new Rect(0, y, inRect.width, inRect.height - y), this.tabs); y += 32; } Rect r = new Rect(0, y, 368, (rows + 1) * (HEIGHT + BUFFER)); scrollPosition = GUI.BeginScrollView( new Rect(50, y, r.width + 18, inRect.height - y - 75), scrollPosition, r); int i = 0; foreach (Thing t in thingsToShow) { if (t != null) { string label = this.FormatLabel(t); if (searchText.Length == 0 || label.ToLower().Contains(searchText)) { if (this.DrawRow(t, label, y, i, r)) { break; } ++i; } } } GUI.EndScrollView(); } catch (Exception e) { String msg = this.GetType().Name + " closed due to: " + e.GetType().Name + " " + e.Message; Log.Error(msg); Messages.Message(msg, MessageTypeDefOf.NegativeEvent); base.Close(); } finally { Text.Anchor = TextAnchor.UpperLeft; GUI.color = Color.white; } }
public void DoSettingsWindowContents(Rect inRect) { if (!_isWindowSetup || lastRect != inRect) { lastRect = inRect; InitialiseWindow(inRect); _isWindowSetup = true; } Widgets.DrawMenuSection(menuRect); TabDrawer.DrawTabs(menuRect, _tabsList, 1); GUI.BeginGroup(tabRect); var font = Text.Font; var anchor = Text.Anchor; Text.Font = GameFont.Small; Text.Anchor = TextAnchor.MiddleCenter; switch (_tab) { default: _generalTab.DrawTab(tabRect); break; case Tab.Combat: _combatTab.DrawTab(tabRect); break; case Tab.Races: _raceTab.DrawTab(tabRect); break; case Tab.Apparel: _apparelTab.DrawTab(tabRect); break; case Tab.Bionics: _hediffTab.DrawTab(tabRect); break; case Tab.Debug: _debugTab.DrawTab(tabRect); break; } Text.Font = font; Text.Anchor = anchor; GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { Text.Anchor = TextAnchor.UpperLeft; Text.Font = GameFont.Small; inRect.yMin += 32f; Widgets.DrawMenuSection(inRect); TabDrawer.DrawTabs(inRect, tabs); inRect.yMin += TabDrawer.TabHeight; GetTable(CurTab).DoWindowContents(inRect); }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, 40f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, "SplitCaravan".Translate()); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; Dialog_SplitCaravan.tabsList.Clear(); Dialog_SplitCaravan.tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate { this.tab = Dialog_SplitCaravan.Tab.Pawns; }, this.tab == Dialog_SplitCaravan.Tab.Pawns)); Dialog_SplitCaravan.tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate { this.tab = Dialog_SplitCaravan.Tab.Items; }, this.tab == Dialog_SplitCaravan.Tab.Items)); inRect.yMin += 72f; Widgets.DrawMenuSection(inRect, true); TabDrawer.DrawTabs(inRect, Dialog_SplitCaravan.tabsList); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); Rect rect2 = inRect.AtZero(); Rect rect3 = rect2; rect3.y += 32f; rect3.xMin += rect2.width - 515f; this.DrawMassAndFoodInfo(rect3); this.DoBottomButtons(rect2); Rect inRect2 = rect2; inRect2.yMax -= 59f; bool flag = false; Dialog_SplitCaravan.Tab tab = this.tab; if (tab != Dialog_SplitCaravan.Tab.Pawns) { if (tab == Dialog_SplitCaravan.Tab.Items) { this.itemsTransfer.OnGUI(inRect2, out flag); } } else { this.pawnsTransfer.OnGUI(inRect2, out flag); } if (flag) { this.CountToTransferChanged(); } GUI.EndGroup(); }