/// <summary> /// Registers tooltip for the existing Controls /// </summary> public void RegisterTooltips() { foreach (Control organelleSelection in organelleSelectionElements) { ToolTipManager.RegisterToolTipForControl( organelleSelection, tooltipCallbacks, ToolTipManager.Instance.GetToolTip( organelleSelection.Name, "organelleSelection")); } foreach (Control membraneSelection in membraneSelectionElements) { ToolTipManager.RegisterToolTipForControl( membraneSelection, tooltipCallbacks, ToolTipManager.Instance.GetToolTip( membraneSelection.Name, "membraneSelection")); } ToolTipManager.RegisterToolTipForControl( rigiditySlider, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("rigiditySlider", "editor")); ToolTipManager.RegisterToolTipForControl( helpButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("helpButton")); ToolTipManager.RegisterToolTipForControl( symmetryButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("symmetryButton", "editor")); ToolTipManager.RegisterToolTipForControl( undoButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("undoButton", "editor")); ToolTipManager.RegisterToolTipForControl( redoButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("redoButton", "editor")); ToolTipManager.RegisterToolTipForControl( newCellButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("newCellButton", "editor")); ToolTipManager.RegisterToolTipForControl( timeIndicator, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("timeIndicator", "editor")); ToolTipManager.RegisterToolTipForControl( finishButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("finishButton", "editor")); ToolTipManager.RegisterToolTipForControl( menuButton, tooltipCallbacks, ToolTipManager.Instance.GetToolTip("menuButton")); }
public void UpdateEnergyBalanceToolTips(EnergyBalanceInfo energyBalance) { // Clear previous callbacks processesTooltipCallbacks.Clear(); foreach (var subBar in atpProductionBar.SubBars) { var tooltip = ToolTipManager.Instance.GetToolTip(subBar.Name, "processesProduction"); ToolTipManager.RegisterToolTipForControl(subBar, processesTooltipCallbacks, tooltip); tooltip.Description = $"{SimulationParameters.Instance.GetOrganelleType(subBar.Name).Name}: " + $"+{energyBalance.Production[subBar.Name]} ATP"; } foreach (var subBar in atpConsumptionBar.SubBars) { var tooltip = ToolTipManager.Instance.GetToolTip(subBar.Name, "processesConsumption"); ToolTipManager.RegisterToolTipForControl(subBar, processesTooltipCallbacks, tooltip); string displayName; switch (subBar.Name) { case "osmoregulation": { displayName = "Osmoregulation"; break; } case "baseMovement": { displayName = "Base Movement"; break; } default: { displayName = SimulationParameters.Instance.GetOrganelleType(subBar.Name).Name; break; } } tooltip.Description = $"{displayName}: -{energyBalance.Consumption[subBar.Name]} ATP"; } }
/// <summary> /// Setup the main menu. /// </summary> private void RunMenuSetup() { Background = GetNode <TextureRect>("Background"); guiAnimations = GetNode <AnimationPlayer>("GUIAnimations"); thriveLogo = GetNode <TextureRect>(ThriveLogoPath); newGameButton = GetNode <Button>(NewGameButtonPath); freebuildButton = GetNode <Button>(FreebuildButtonPath); MenuArray?.Clear(); // Get all of menu items MenuArray = GetTree().GetNodesInGroup("MenuItem"); if (MenuArray == null) { GD.PrintErr("Failed to find all the menu items!"); return; } RandomizeBackground(); options = GetNode <OptionsMenu>("OptionsMenu"); saves = GetNode <SaveManagerGUI>("SaveManagerGUI"); // Load settings if (Settings.Instance == null) { GD.PrintErr("Failed to initialize settings."); } // Set initial menu SwitchMenu(); // Easter egg message ToolTipManager.RegisterToolTipForControl( thriveLogo, toolTipCallbacks, ToolTipManager.Instance.GetToolTip("thriveLogoEasterEgg", "mainMenu")); }