public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, TitleRectHeight); 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(SourceMassUsage, SourceMassCapacity, cachedSourceMassCapacityExplanation, SourceTilesPerDay, cachedSourceTilesPerDayExplanation, SourceDaysWorthOfFood, SourceForagedFoodPerDay, cachedSourceForagedFoodPerDayExplanation, SourceVisibility, cachedSourceVisibilityExplanation, -1f, -1f, null), null, caravan.Tile, (!caravan.pather.Moving) ? null : new int?(TicksToArrive), -9999f, new Rect(12f, TitleRectHeight, 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(); DoBottomButtons(rect2); Rect inRect2 = rect2; inRect2.yMax -= 59f; itemsTransfer.OnGUI(inRect2, out bool flag); if (flag) { CountToTransferChanged(); } GUI.EndGroup(); }
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, "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), new CaravanUIUtility.CaravanInfo(DestMassUsage, DestMassCapacity, cachedDestMassCapacityExplanation, DestTilesPerDay, cachedDestTilesPerDayExplanation, DestDaysWorthOfFood, DestForagedFoodPerDay, cachedDestForagedFoodPerDayExplanation, DestVisibility, cachedDestVisibilityExplanation), caravan.Tile, caravan.pather.Moving ? new int?(TicksToArrive) : null, -9999f, new Rect(12f, 35f, inRect.width - 24f, 40f)); 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); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); Rect rect2 = inRect.AtZero(); DoBottomButtons(rect2); Rect inRect2 = rect2; inRect2.yMax -= 59f; bool anythingChanged = false; switch (tab) { case Tab.Pawns: pawnsTransfer.OnGUI(inRect2, out anythingChanged); break; case Tab.Items: itemsTransfer.OnGUI(inRect2, out anythingChanged); break; case Tab.FoodAndMedicine: foodAndMedicineTransfer.OnGUI(inRect2, out anythingChanged); break; } if (anythingChanged) { CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { Rect rect = new Rect(0f, 0f, inRect.width, TitleRectHeight); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, "LoadTransporters".Translate(TransportersLabel)); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.DrawCaravanInfo(new CaravanUIUtility.CaravanInfo(MassUsage, MassCapacity, string.Empty, TilesPerDay, cachedTilesPerDayExplanation, DaysWorthOfFood, ForagedFoodPerDay, cachedForagedFoodPerDayExplanation, Visibility, cachedVisibilityExplanation, CaravanMassUsage, CaravanMassCapacity, cachedCaravanMassCapacityExplanation), null, map.Tile, null, lastMassFlashTime, new Rect(12f, 35f, inRect.width - 24f, 40f), false, 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; Tab curTab = tab; if (curTab != Tab.Pawns) { if (curTab == Tab.Items) { itemsTransfer.OnGUI(inRect2, out flag); } } else { pawnsTransfer.OnGUI(inRect2, out flag); } if (flag) { CountToTransferChanged(); } GUI.EndGroup(); }
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, vehicle.LabelShortCap); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; DrawCargoNumbers(new Rect(12f, 35f, inRect.width - 24f, 40f)); Rect checkRect = new Rect(inRect.width - 225f, 35f, 225f, 40f); bool checkBox = VehicleMod.settings.showAllCargoItems; Widgets.Label(checkRect, "ShowAllItemsOnMap".Translate()); checkRect.x += Text.CalcSize("ShowAllItemsOnMap".Translate()).x + 20f; Widgets.Checkbox(new Vector2(checkRect.x, checkRect.y), ref VehicleMod.settings.showAllCargoItems); if (checkBox != VehicleMod.settings.showAllCargoItems) { CalculateAndRecacheTransferables(); } inRect.yMin += 60; Widgets.DrawMenuSection(inRect); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); Rect bottomRect = inRect.AtZero(); BottomButtons(bottomRect); Rect inRect2 = bottomRect; inRect2.yMax -= 76f; itemsTransfer.OnGUI(inRect2, out bool flag); if (flag) { CountToTransferChanged(); } GUI.EndGroup(); }
public override void DoWindowContents(Rect inRect) { var rect = new Rect(0f, 0f, inRect.width, 35f); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(rect, "LoadTransporters".Translate( TransportersLabel )); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; CaravanUIUtility.DrawCaravanInfo( new CaravanUIUtility.CaravanInfo(MassUsage, MassCapacity, "", TilesPerDay, cachedTilesPerDayExplanation, DaysWorthOfFood, ForagedFoodPerDay, cachedForagedFoodPerDayExplanation, Visibility, cachedVisibilityExplanation), null, map.Tile, null, lastMassFlashTime, new Rect(12f, 35f, inRect.width - 24f, 40f), 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); inRect = inRect.ContractedBy(17f); GUI.BeginGroup(inRect); var rect2 = inRect.AtZero(); DoBottomButtons(rect2); var inRect2 = rect2; inRect2.yMax -= 59f; var flag = false; var tab1 = tab; if (tab1 != Tab.Pawns) { if (tab1 == Tab.Items) { itemsTransfer.OnGUI(inRect2, out flag); } } else { pawnsTransfer.OnGUI(inRect2, out flag); } if (flag) { CountToTransferChanged(); } GUI.EndGroup(); // 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.TransportersLabel // })); // Text.Font = GameFont.Small; // Text.Anchor = TextAnchor.UpperLeft; // Dialog_LoadTransportersPawn.tabsList.Clear(); // Dialog_LoadTransportersPawn.tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate // { // this.tab = Dialog_LoadTransportersPawn.Tab.Pawns; // }, this.tab == Dialog_LoadTransportersPawn.Tab.Pawns)); // //Dialog_LoadTransportersPawn.tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate // //{ // // this.tab = Dialog_LoadTransportersPawn.Tab.Items; // //}, this.tab == Dialog_LoadTransportersPawn.Tab.Items)); // inRect.yMin += 72f; // Widgets.DrawMenuSection(inRect); // TabDrawer.DrawTabs(inRect, Dialog_LoadTransportersPawn.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, true); // this.DoBottomButtons(rect2); // Rect inRect2 = rect2; // inRect2.yMax -= 59f; // bool flag = false; // Dialog_LoadTransportersPawn.Tab tab = this.tab; // if (tab != Dialog_LoadTransportersPawn.Tab.Pawns) // { // if (tab == Dialog_LoadTransportersPawn.Tab.Items) // { // this.itemsTransfer.OnGUI(inRect2, out flag); // } // } // else // { // this.pawnsTransfer.OnGUI(inRect2, out flag); // } // if (flag) // { // this.CountToTransferChanged(); // } // GUI.EndGroup(); }