public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(false); DrawTitle(screenInstance, drawer); drawer.NewLine(26); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(UsingSnapshot ? "CLICK" : "DRAG", Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText("BACK", Styles_Instruction.Standard); if (UsingSnapshot) { drawer.NewLine(32); drawer.DrawText(BlueprintsAssets.BLUEPRINTS_STRING_DELETESNAPSHOT, Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(false); DrawTitle(screenInstance, drawer); drawer.NewLine(26); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(UsingSnapshot ? Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_CLICK) : Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_CREATE_ACTION_DRAG), Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_BACK), Styles_Instruction.Standard); if (UsingSnapshot) { drawer.NewLine(32); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_NEWSNAPSHOT), BlueprintsAssets.BLUEPRINTS_KEYBIND_SNAPSHOT_NEWSNAPSHOT.GetStringFormatted()), Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(); DrawTitle(screenInstance, drawer); drawer.NewLine(); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(UsingSnapshot ? BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_CLICK : BlueprintsStrings.STRING_BLUEPRINTS_CREATE_ACTION_DRAG, Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_BACK, Styles_Instruction.Standard); if (UsingSnapshot) { drawer.NewLine(32); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_NEWSNAPSHOT, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsDeleteAction.GetKAction()) + "]")), Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> selected) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); switch (currentReqState) { case PlanScreen.RequirementsState.Materials: case PlanScreen.RequirementsState.Complete: hoverTextDrawer.DrawText(UI.TOOLTIPS.NOMATERIAL.text.ToUpper(), HoverTextStyleSettings[0]); hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawText(UI.TOOLTIPS.SELECTAMATERIAL, HoverTextStyleSettings[1]); break; case PlanScreen.RequirementsState.Tech: { TechItem techItem = Db.Get().TechItems.Get(currentDef.PrefabID); Tech parentTech = techItem.parentTech; hoverTextDrawer.DrawText(string.Format(UI.PRODUCTINFO_RESEARCHREQUIRED, parentTech.Name).ToUpper(), HoverTextStyleSettings[0]); break; } } hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawIcon(instance.GetSprite("icon_mouse_right"), 18); hoverTextDrawer.DrawText(backStr, Styles_Instruction.Standard); hoverTextDrawer.EndShadowBar(); hoverTextDrawer.EndDrawing(); }
public virtual void UpdateHoverElements(List <KSelectable> hover_objects) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); DrawTitle(instance, hoverTextDrawer); DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer); hoverTextDrawer.EndShadowBar(); hoverTextDrawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(false); DrawTitle(screenInstance, drawer); drawer.NewLine(26); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_CLICK), Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_BACK), Styles_Instruction.Standard); drawer.NewLine(32); if (BlueprintsState.LoadedBlueprints.Count > 0) { drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_CYCLEBLUEPRINTS), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_CYCLELEFT), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_CYCLERIGHT)), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_NAMEBLUEPRINT), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_RENAME)), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_DELETEBLUEPRINT), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_DELETE)), Styles_Instruction.Standard); if (PrefabErrorCount > 0) { drawer.NewLine(32); drawer.DrawIcon(screenInstance.GetSprite("iconWarning"), 18); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ERRORMESSAGE), PrefabErrorCount), Styles_Instruction.Selected); } drawer.NewLine(32); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_SELECTEDBLUEPRINT), BlueprintsState.SelectedBlueprint.FriendlyName, BlueprintsState.SelectedBlueprintIndex + 1, BlueprintsState.LoadedBlueprints.Count), Styles_Instruction.Standard); } else { drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_NOBLUEPRINTS), Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> selected) { int num = Grid.PosToCell(Camera.main.ScreenToWorldPoint(KInputManager.GetMousePos())); if (Grid.IsValidCell(num)) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); if (Grid.IsVisible(num)) { DrawTitle(instance, hoverTextDrawer); DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer); Element element = Grid.Element[num]; bool flag = false; if (Grid.Solid[num] && Diggable.IsDiggable(num)) { flag = true; } if (flag) { hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawText(element.nameUpperCase, Styles_Title.Standard); hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawIcon(instance.GetSprite("dash"), 18); hoverTextDrawer.DrawText(element.GetMaterialCategoryTag().ProperName(), Styles_BodyText.Standard); hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawIcon(instance.GetSprite("dash"), 18); string[] array = WorldInspector.MassStringsReadOnly(num); hoverTextDrawer.DrawText(array[0], Styles_Values.Property.Standard); hoverTextDrawer.DrawText(array[1], Styles_Values.Property_Decimal.Standard); hoverTextDrawer.DrawText(array[2], Styles_Values.Property.Standard); hoverTextDrawer.DrawText(array[3], Styles_Values.Property.Standard); hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawIcon(instance.GetSprite("dash"), 18); hoverTextDrawer.DrawText(GameUtil.GetHardnessString(Grid.Element[num], true), Styles_BodyText.Standard); } } else { hoverTextDrawer.DrawIcon(instance.GetSprite("iconWarning"), 18); hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.UNKNOWN, Styles_BodyText.Standard); } hoverTextDrawer.EndShadowBar(); hoverTextDrawer.EndDrawing(); } }
public static void Postfix(SelectToolHoverTextCard __instance, List <KSelectable> hoverObjects) { foreach (KSelectable selectable in hoverObjects) { Notepad pad = selectable.gameObject.GetComponent <Notepad>(); if (pad != null) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hover = instance.BeginDrawing(); hover.BeginShadowBar(); hover.DrawIcon(Assets.GetSprite("icon_category_furniture"), 20); hover.DrawText(pad.activateText, __instance.ToolTitleTextStyle); hover.EndShadowBar(); hover.EndDrawing(); } } }
public override void UpdateHoverElements(List <KSelectable> selected) { ToolParameterMenu toolParameterMenu = ToolMenu.Instance.toolParameterMenu; string lastEnabledFilter = toolParameterMenu.GetLastEnabledFilter(); HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); DrawTitle(instance, hoverTextDrawer); DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer); if (lastEnabledFilter != null && lastEnabledFilter != lastUpdatedFilter) { ConfigureTitle(instance); } hoverTextDrawer.EndShadowBar(); hoverTextDrawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> selected) { HoverTextScreen screen = HoverTextScreen.Instance; Sprite dash = screen.GetSprite("dash"); HoverTextDrawer txt = screen.BeginDrawing(); txt.BeginShadowBar(); string title = Input.GetKey(KeyCode.LeftShift) ? SandboxConduitToolStrings.HOVER_TEXT_TITLE_CLEAR : SandboxConduitToolStrings.HOVER_TEXT_TITLE_INJECT; txt.DrawText(title.ToUpper(), ToolTitleTextStyle); DrawInstructions(screen, txt); txt.EndShadowBar(); txt.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(); DrawTitle(screenInstance, drawer); drawer.NewLine(); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_CREATE_ACTION_DRAG, Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_CREATE_ACTION_BACK, Styles_Instruction.Standard); drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> selected) { int num = Grid.PosToCell(Camera.main.ScreenToWorldPoint(KInputManager.GetMousePos())); if (Grid.IsValidCell(num)) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); DrawTitle(HoverTextScreen.Instance, hoverTextDrawer); DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer); if (!MoveToLocationTool.Instance.CanMoveTo(num)) { hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawText(UI.TOOLS.MOVETOLOCATION.UNREACHABLE, HoverTextStyleSettings[1]); } hoverTextDrawer.EndShadowBar(); hoverTextDrawer.EndDrawing(); } }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(false); DrawTitle(screenInstance, drawer); drawer.NewLine(26); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText("DRAG", Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText("BACK", Styles_Instruction.Standard); drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(false); DrawTitle(screenInstance, drawer); drawer.NewLine(26); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText("CLICK", Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText("BACK", Styles_Instruction.Standard); drawer.NewLine(32); if (BlueprintsState.LoadedBlueprints.Count > 0) { drawer.DrawText(BlueprintsAssets.BLUEPRINTS_STRING_CYCLEBLUEPRINTS, Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(BlueprintsAssets.BLUEPRINTS_STRING_RENAMEBLUEPRINT, Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(BlueprintsAssets.BLUEPRINTS_STRING_DELETEBLUEPRINT, Styles_Instruction.Standard); drawer.NewLine(32); drawer.DrawText("Selected \"" + BlueprintsState.SelectedBlueprint.FriendlyName + "\" (" + (BlueprintsState.SelectedBlueprintIndex + 1) + "/" + BlueprintsState.LoadedBlueprints.Count + ")", Styles_Instruction.Standard); } else { drawer.DrawText("No blueprints loaded!", Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hover_objects) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); DrawTitle(instance, hoverTextDrawer); DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer); hoverTextDrawer.EndShadowBar(); if (hover_objects != null) { foreach (KSelectable hover_object in hover_objects) { if ((Object)hover_object.GetComponent <AttackableBase>() != (Object)null) { hoverTextDrawer.BeginShadowBar(false); hoverTextDrawer.DrawText(hover_object.GetProperName().ToUpper(), Styles_Title.Standard); hoverTextDrawer.EndShadowBar(); break; } } } hoverTextDrawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> selected) { if (!((Object)ToolMenu.Instance.PriorityScreen == (Object)null)) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); DrawTitle(instance, hoverTextDrawer); DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer); hoverTextDrawer.NewLine(26); HoverTextDrawer hoverTextDrawer2 = hoverTextDrawer; string format = UI.TOOLS.PRIORITIZE.SPECIFIC_PRIORITY; PrioritySetting lastSelectedPriority = ToolMenu.Instance.PriorityScreen.GetLastSelectedPriority(); hoverTextDrawer2.DrawText(string.Format(format, lastSelectedPriority.priority_value.ToString()), Styles_Title.Standard); ToolParameterMenu toolParameterMenu = ToolMenu.Instance.toolParameterMenu; string lastEnabledFilter = toolParameterMenu.GetLastEnabledFilter(); if (lastEnabledFilter != null && lastEnabledFilter != "ALL") { ConfigureTitle(instance); } hoverTextDrawer.EndShadowBar(); hoverTextDrawer.EndDrawing(); } }
public override void UpdateHoverElements(List <KSelectable> hoverObjects) { HoverTextScreen instance = HoverTextScreen.Instance; HoverTextDrawer hoverTextDrawer = instance.BeginDrawing(); hoverTextDrawer.BeginShadowBar(false); ActionName = ((!((UnityEngine.Object)currentDef != (UnityEngine.Object)null) || !currentDef.DragBuild) ? UI.TOOLS.BUILD.TOOLACTION : UI.TOOLS.BUILD.TOOLACTION_DRAG); if ((UnityEngine.Object)currentDef != (UnityEngine.Object)null && currentDef.Name != null) { ToolName = string.Format(UI.TOOLS.BUILD.NAME, currentDef.Name); } DrawTitle(instance, hoverTextDrawer); DrawInstructions(instance, hoverTextDrawer); int cell = Grid.PosToCell(Camera.main.ScreenToWorldPoint(KInputManager.GetMousePos())); int min_height = 26; int width = 8; if ((UnityEngine.Object)currentDef != (UnityEngine.Object)null) { Orientation orientation = Orientation.Neutral; if ((UnityEngine.Object)PlayerController.Instance.ActiveTool != (UnityEngine.Object)null) { Type type = PlayerController.Instance.ActiveTool.GetType(); if (typeof(BuildTool).IsAssignableFrom(type) || typeof(BaseUtilityBuildTool).IsAssignableFrom(type)) { if ((UnityEngine.Object)currentDef.BuildingComplete.GetComponent <Rotatable>() != (UnityEngine.Object)null) { hoverTextDrawer.NewLine(min_height); hoverTextDrawer.AddIndent(width); string text = UI.TOOLTIPS.HELP_ROTATE_KEY.ToString(); text = text.Replace("{Key}", GameUtil.GetActionString(Action.RotateBuilding)); hoverTextDrawer.DrawText(text, Styles_Instruction.Standard); } orientation = BuildTool.Instance.GetBuildingOrientation; string fail_reason = "Unknown reason"; Vector3 pos = Grid.CellToPosCCC(cell, Grid.SceneLayer.Building); if (!currentDef.IsValidPlaceLocation(BuildTool.Instance.visualizer, pos, orientation, out fail_reason)) { hoverTextDrawer.NewLine(min_height); hoverTextDrawer.AddIndent(width); hoverTextDrawer.DrawText(fail_reason, HoverTextStyleSettings[1]); } RoomTracker component = currentDef.BuildingComplete.GetComponent <RoomTracker>(); if ((UnityEngine.Object)component != (UnityEngine.Object)null && !component.SufficientBuildLocation(cell)) { hoverTextDrawer.NewLine(min_height); hoverTextDrawer.AddIndent(width); hoverTextDrawer.DrawText(UI.TOOLTIPS.HELP_REQUIRES_ROOM, HoverTextStyleSettings[1]); } } } hoverTextDrawer.NewLine(min_height); hoverTextDrawer.AddIndent(width); hoverTextDrawer.DrawText(ResourceRemainingDisplayScreen.instance.GetString(), Styles_BodyText.Standard); hoverTextDrawer.EndShadowBar(); HashedString mode = SimDebugView.Instance.GetMode(); if (mode == OverlayModes.Logic.ID && hoverObjects != null) { SelectToolHoverTextCard component2 = SelectTool.Instance.GetComponent <SelectToolHoverTextCard>(); foreach (KSelectable hoverObject in hoverObjects) { LogicPorts component3 = hoverObject.GetComponent <LogicPorts>(); if ((UnityEngine.Object)component3 != (UnityEngine.Object)null && component3.TryGetPortAtCell(cell, out LogicPorts.Port port, out bool isInput)) { bool flag = component3.IsPortConnected(port.id); hoverTextDrawer.BeginShadowBar(false); int num; if (isInput) { string replacement = (!port.displayCustomName) ? UI.LOGIC_PORTS.PORT_INPUT_DEFAULT_NAME.text : port.description; num = component3.GetInputValue(port.id); hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.LOGIC_INPUT_HOVER_FMT.Replace("{Port}", replacement).Replace("{Name}", hoverObject.GetProperName().ToUpper()), component2.Styles_Title.Standard); } else { string replacement2 = (!port.displayCustomName) ? UI.LOGIC_PORTS.PORT_OUTPUT_DEFAULT_NAME.text : port.description; num = component3.GetOutputValue(port.id); hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.LOGIC_OUTPUT_HOVER_FMT.Replace("{Port}", replacement2).Replace("{Name}", hoverObject.GetProperName().ToUpper()), component2.Styles_Title.Standard); } hoverTextDrawer.NewLine(26); TextStyleSetting textStyleSetting = (!flag) ? component2.Styles_LogicActive.Standard : ((num != 1) ? component2.Styles_LogicSignalInactive : component2.Styles_LogicActive.Selected); hoverTextDrawer.DrawIcon((num != 1 || !flag) ? component2.iconDash : component2.iconActiveAutomationPort, textStyleSetting.textColor, 18, 2); hoverTextDrawer.DrawText(port.activeDescription, textStyleSetting); hoverTextDrawer.NewLine(26); TextStyleSetting textStyleSetting2 = (!flag) ? component2.Styles_LogicStandby.Standard : ((num != 0) ? component2.Styles_LogicSignalInactive : component2.Styles_LogicStandby.Selected); hoverTextDrawer.DrawIcon((num != 0 || !flag) ? component2.iconDash : component2.iconActiveAutomationPort, textStyleSetting2.textColor, 18, 2); hoverTextDrawer.DrawText(port.inactiveDescription, textStyleSetting2); hoverTextDrawer.EndShadowBar(); } LogicGate component4 = hoverObject.GetComponent <LogicGate>(); if ((UnityEngine.Object)component4 != (UnityEngine.Object)null && component4.TryGetPortAtCell(cell, out LogicGateBase.PortId port2)) { int portValue = component4.GetPortValue(port2); bool portConnected = component4.GetPortConnected(port2); LogicGate.LogicGateDescriptions.Description portDescription = component4.GetPortDescription(port2); hoverTextDrawer.BeginShadowBar(false); if (port2 == LogicGateBase.PortId.Output) { hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.LOGIC_MULTI_OUTPUT_HOVER_FMT.Replace("{Port}", portDescription.name).Replace("{Name}", hoverObject.GetProperName().ToUpper()), component2.Styles_Title.Standard); } else { hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.LOGIC_MULTI_INPUT_HOVER_FMT.Replace("{Port}", portDescription.name).Replace("{Name}", hoverObject.GetProperName().ToUpper()), component2.Styles_Title.Standard); } hoverTextDrawer.NewLine(26); TextStyleSetting textStyleSetting3 = (!portConnected) ? component2.Styles_LogicActive.Standard : ((portValue != 1) ? component2.Styles_LogicSignalInactive : component2.Styles_LogicActive.Selected); hoverTextDrawer.DrawIcon((portValue != 1 || !portConnected) ? component2.iconDash : component2.iconActiveAutomationPort, textStyleSetting3.textColor, 18, 2); hoverTextDrawer.DrawText(portDescription.active, textStyleSetting3); hoverTextDrawer.NewLine(26); TextStyleSetting textStyleSetting4 = (!portConnected) ? component2.Styles_LogicStandby.Standard : ((portValue != 0) ? component2.Styles_LogicSignalInactive : component2.Styles_LogicStandby.Selected); hoverTextDrawer.DrawIcon((portValue != 0 || !portConnected) ? component2.iconDash : component2.iconActiveAutomationPort, textStyleSetting4.textColor, 18, 2); hoverTextDrawer.DrawText(portDescription.inactive, textStyleSetting4); hoverTextDrawer.EndShadowBar(); } } } else if (mode == OverlayModes.Power.ID) { CircuitManager circuitManager = Game.Instance.circuitManager; ushort circuitID = circuitManager.GetCircuitID(cell); if (circuitID != 65535) { hoverTextDrawer.BeginShadowBar(false); float wattsNeededWhenActive = circuitManager.GetWattsNeededWhenActive(circuitID); wattsNeededWhenActive += currentDef.EnergyConsumptionWhenActive; float maxSafeWattageForCircuit = circuitManager.GetMaxSafeWattageForCircuit(circuitID); Color color = (!(wattsNeededWhenActive >= maxSafeWattageForCircuit)) ? Color.white : Color.red; hoverTextDrawer.AddIndent(width); hoverTextDrawer.DrawText(string.Format(UI.DETAILTABS.ENERGYGENERATOR.POTENTIAL_WATTAGE_CONSUMED, GameUtil.GetFormattedWattage(wattsNeededWhenActive, GameUtil.WattageFormatterUnit.Automatic)), Styles_BodyText.Standard, color, true); hoverTextDrawer.EndShadowBar(); } } } hoverTextDrawer.EndDrawing(); }
private void DrawTextCard() { int cell = Grid.PosToCell(Camera.main.ScreenToWorldPoint(KInputManager.GetMousePos())); if (!Grid.IsValidCell(cell)) { return; } HoverTextScreen screen = HoverTextScreen.Instance; Sprite dash = screen.GetSprite("dash"); HoverTextDrawer txt = screen.BeginDrawing(); txt.BeginShadowBar(); if (!Grid.IsVisible(cell)) { txt.DrawIcon(screen.GetSprite("iconWarning")); txt.DrawText(UI.TOOLS.GENERIC.UNKNOWN, Styles_BodyText.Standard); } else { DrawTitle(screen, txt); DrawInstructions(screen, txt); var standard = Styles_BodyText.Standard; if (!InspectTool.Instance.Dragging) { var element = ElementInfo.FromCellNumber(cell); txt.NewLine(); txt.DrawText(element.NameUppercase, ToolTitleTextStyle); txt.NewLine(); txt.DrawIcon(dash); txt.DrawText(element.Category, standard); txt.NewLine(); txt.DrawIcon(dash); string[] array = WorldInspector.MassStringsReadOnly(cell); txt.DrawText(array[0], Styles_Values.Property.Standard); txt.DrawText(array[1], Styles_Values.Property_Decimal.Standard); txt.DrawText(array[2], Styles_Values.Property.Standard); txt.DrawText(array[3], Styles_Values.Property.Standard); txt.NewLine(); txt.DrawIcon(dash); txt.DrawText(GameUtil.GetFormattedTemperature(element.Temperature), standard); txt.NewLine(); txt.DrawIcon(dash); txt.DrawText(element.GetFormattedTotalRelativeHeat(InspectToolSettings.Instance.RelativeTemp), standard); if (Grid.Solid[cell] && Diggable.IsDiggable(cell)) { txt.NewLine(); txt.DrawIcon(dash); txt.DrawText(GameUtil.GetHardnessString(Grid.Element[cell]), standard); } } else { txt.NewLine(); txt.DrawText(((string)InspectToolStrings.HOVER_TEXT_TITLE).ToUpper(), ToolTitleTextStyle); var elements = ElementInspector.ElementData; if (elements != null && elements.Length > 0) { foreach (var e in elements) { txt.NewLine(); txt.DrawIcon(dash); txt.DrawText(e, standard); } } else { txt.NewLine(); txt.DrawText(InspectToolStrings.HOVER_TEXT_NO_ELEMENTS, standard); } } } txt.EndShadowBar(); txt.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(false); DrawTitle(screenInstance, drawer); drawer.NewLine(26); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_CLICK), Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_BACK), Styles_Instruction.Standard); drawer.NewLine(32); if (BlueprintsState.HasBlueprints()) { if (BlueprintsState.SelectedFolder.BlueprintCount > 0) { drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_CYCLEFOLDERS), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_USE_CYCLEFOLDERS_NEXT.GetKAction()) + "]"), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_USE_CYCLEFOLDERS_PREVIOUS.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_CYCLEBLUEPRINTS), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_USE_CYCLEBLUEPRINTS_NEXT.GetKAction()) + "]"), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_USE_CYCLEBLUEPRINTS_PREVIOUS.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(32); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_FOLDERBLUEPRINT), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_USE_CREATEFOLDER.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_NAMEBLUEPRINT), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_USE_RENAME.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_DELETEBLUEPRINT), UI.FormatAsHotkey("[" + GameUtil.GetActionString(BlueprintsAssets.BLUEPRINTS_MULTI_DELETE.GetKAction()) + "]")), Styles_Instruction.Standard); if (PrefabErrorCount > 0) { drawer.NewLine(32); drawer.DrawIcon(screenInstance.GetSprite("iconWarning"), 18); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ERRORMESSAGE), PrefabErrorCount), Styles_Instruction.Selected); } drawer.NewLine(32); drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_SELECTEDBLUEPRINT), BlueprintsState.SelectedBlueprint.FriendlyName, BlueprintsState.SelectedFolder.SelectedBlueprintIndex + 1, BlueprintsState.SelectedFolder.BlueprintCount, BlueprintsState.SelectedFolder.Name, BlueprintsState.SelectedBlueprintFolderIndex + 1, BlueprintsState.LoadedBlueprints.Count), Styles_Instruction.Standard); } else { drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_FOLDEREMPTY), BlueprintsState.SelectedFolder.Name), Styles_Instruction.Standard); } } else { drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_NOBLUEPRINTS), Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }
// 本体 internal void UpdateHoverElements(List <KSelectable> hoverObjects) { if (__this.iconWarning == null) { __this.ConfigureHoverScreen(); } if (OverlayScreen.Instance == null || !Grid.IsValidCell(cellPos)) { return; } HoverTextDrawer hoverTextDrawer = HoverTextScreen.Instance.BeginDrawing(); __private_accessor.overlayValidHoverObjects.Clear(); foreach (KSelectable kselectable in hoverObjects) { if (__private_accessor.ShouldShowSelectableInCurrentOverlay(kselectable)) { __private_accessor.overlayValidHoverObjects.Add(kselectable); } } __this.currentSelectedSelectableIndex = -1; if (SelectToolHoverTextCard.highlightedObjects.Count > 0) { SelectToolHoverTextCard.highlightedObjects.Clear(); } if (CurrentMode == OverlayModes.Temperature.ID && Game.Instance.temperatureOverlayMode == Game.TemperatureOverlayModes.HeatFlow) { HeatflowCard(hoverTextDrawer); } else if (CurrentMode == OverlayModes.Decor.ID) { DecorCard(hoverTextDrawer); } else if (CurrentMode == OverlayModes.Rooms.ID) { RoomCard(hoverTextDrawer); } else if (CurrentMode == OverlayModes.Light.ID) { LightingCard(hoverTextDrawer); } else if (CurrentMode == OverlayModes.Logic.ID) { LogicCard(hoverTextDrawer, hoverObjects); } int numOfSelectableCard = 0; // kを使いたいのでforeachではなくfor for (int k = 0; k < __private_accessor.overlayValidHoverObjects.Count; k++) { KSelectable kselectable3 = __private_accessor.overlayValidHoverObjects[k]; if (kselectable3 == null) { continue; } if (kselectable3.GetComponent <CellSelectionObject>() != null) { continue; } // if ((!(OverlayScreen.Instance != null) || !(OverlayScreen.Instance.mode != OverlayModes.None.ID) || (kselectable3.gameObject.layer & __private_accessor.maskOverlay) == 0) && isVisible) if (!isVisible) { continue; } if (!(OverlayScreen.Instance != null) || !(OverlayScreen.Instance.mode != OverlayModes.None.ID) || (kselectable3.gameObject.layer & __private_accessor.maskOverlay) == 0) { } else { continue; } bool selected = SelectTool.Instance.selected == kselectable3; if (selected) { __this.currentSelectedSelectableIndex = k; } numOfSelectableCard++; ItemCard(hoverTextDrawer, kselectable3, selected); } __this.recentNumberOfDisplayedSelectables = numOfSelectableCard + 1; if (displayMiscCard) { MiscCard(hoverTextDrawer); } else if (!isVisible) { hoverTextDrawer.BeginShadowBar(false); hoverTextDrawer.DrawIcon(__this.iconWarning, 18); hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.UNKNOWN, __this.Styles_BodyText.Standard); hoverTextDrawer.EndShadowBar(); } hoverTextDrawer.EndDrawing(); }
public override void UpdateHoverElements(List <KSelectable> hoveredObjects) { HoverTextScreen screenInstance = HoverTextScreen.Instance; HoverTextDrawer drawer = screenInstance.BeginDrawing(); drawer.BeginShadowBar(); DrawTitle(screenInstance, drawer); drawer.NewLine(); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20); drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_CLICK, Styles_Instruction.Standard); drawer.AddIndent(8); drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20); drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_BACK, Styles_Instruction.Standard); drawer.NewLine(32); if (BlueprintsState.HasBlueprints()) { if (BlueprintsState.SelectedFolder.BlueprintCount > 0) { drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_CYCLEFOLDERS, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsCycleFoldersNextAction.GetKAction()) + "]"), UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsCycleFoldersPrevAction.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_CYCLEBLUEPRINTS, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsCycleBlueprintsNextAction.GetKAction()) + "]"), UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsCycleBlueprintsPrevAction.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(32); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_FOLDERBLUEPRINT, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsCreateFolderAction.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_NAMEBLUEPRINT, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsRenameAction.GetKAction()) + "]")), Styles_Instruction.Standard); drawer.NewLine(20); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_DELETEBLUEPRINT, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsDeleteAction.GetKAction()) + "]")), Styles_Instruction.Standard); if (prefabErrorCount > 0) { drawer.NewLine(32); drawer.DrawIcon(screenInstance.GetSprite("iconWarning")); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_ERRORMESSAGE, prefabErrorCount), Styles_Instruction.Selected); } drawer.NewLine(32); drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_SELECTEDBLUEPRINT, BlueprintsState.SelectedBlueprint.FriendlyName, BlueprintsState.SelectedFolder.SelectedBlueprintIndex + 1, BlueprintsState.SelectedFolder.BlueprintCount, BlueprintsState.SelectedFolder.Name, BlueprintsState.SelectedBlueprintFolderIndex + 1, BlueprintsState.LoadedBlueprints.Count), Styles_Instruction.Standard); } else { drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_USE_FOLDEREMPTY, BlueprintsState.SelectedFolder.Name), Styles_Instruction.Standard); } } else { drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_USE_NOBLUEPRINTS, Styles_Instruction.Standard); } drawer.EndShadowBar(); drawer.EndDrawing(); }