From e01a89d96e55ac378157c2f01127a3afa46aef31 Mon Sep 17 00:00:00 2001 From: Christian Heinemann Date: Sat, 31 Aug 2024 16:09:39 +0200 Subject: [PATCH] tooltips added --- source/Gui/HelpStrings.h | 12 +++++++----- source/Gui/SimulationParametersWindow.cpp | 14 ++++++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/Gui/HelpStrings.h b/source/Gui/HelpStrings.h index f1f7b3ec3..a67e4c0e0 100644 --- a/source/Gui/HelpStrings.h +++ b/source/Gui/HelpStrings.h @@ -73,7 +73,8 @@ namespace Const "#0: The strength of the movement, bending or expansion/contraction. A negative sign corresponds to the opposite " "action.\n\n" ICON_FA_CHEVRON_RIGHT " Input channel #1: This channel is solely utilized for acceleration due to bending. If the sign of channel #1 " "differs from the sign of channel #0, no acceleration will be obtained during the bending process.\n\n " ICON_FA_CHEVRON_RIGHT - " Input channel #3: This channel is used for muscles in movement mode. It allows to determine the relative angle of the movement. A value of -0.5 " + " Input channel #3: This channel is used for muscles in movement mode. It contains the relative angle of the movement with respect to a " + "detected object. The object must have been targeted from a sensor cell from which the input signal originates (it does not have to be an adjacent cell). A value of -0.5 " "correspond to -180 deg and +0.5 to +180 deg."; std::string const DefenderTooltip = @@ -241,8 +242,9 @@ namespace Const "The duration of the injection process depends on the simulation parameter 'Injection time'."; std::string const GenomeMuscleModeTooltip = ICON_FA_CHEVRON_RIGHT - " Movement: Results in movement in the direction (or counter-direction) determined by the path from the " - "input cell to the muscle cell.\n\n" ICON_FA_CHEVRON_RIGHT " Expansion and contraction: Causes an elongation (or contraction) of the " + " Movement to sensor target: A movement can be performed if the input signal has its origin in a sensor cell which has previously detected a " + "target. The direction of movement is specified relative to the target.\n\n" ICON_FA_CHEVRON_RIGHT + " Expansion and contraction: Causes an elongation (or contraction) of the " "reference distance to the input cell.\n\n" ICON_FA_CHEVRON_RIGHT " Bending: Increases (or decreases) the angle between the muscle " "cell, input cell, and the nearest connected cell clockwise from the muscle cell."; @@ -452,8 +454,8 @@ namespace Const "during the bending process.", "The following cell functions obtain their input from channel #2:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron", "The following cell functions obtain their input from channel #3:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron\n\n" ICON_FA_CHEVRON_RIGHT - " Muscle: This channel is used for muscles in movement mode. It allows to determine the relative angle of the movement. A value of -0.5 correspond to " - "-180 deg and +0.5 to +180 deg.", + " Muscle: This channel is used for muscles in movement mode. It allows to determine the relative angle of the movement with respect to a previously " + "detected target from a sensor cell. A value of -0.5 correspond to -180 deg and +0.5 to +180 deg.", "The following cell functions obtain their input from channel #4:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron", "The following cell functions obtain their input from channel #5:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron", "The following cell functions obtain their input from channel #6:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron", diff --git a/source/Gui/SimulationParametersWindow.cpp b/source/Gui/SimulationParametersWindow.cpp index 1eae6b6c8..e9d3a102a 100644 --- a/source/Gui/SimulationParametersWindow.cpp +++ b/source/Gui/SimulationParametersWindow.cpp @@ -1544,7 +1544,7 @@ void _SimulationParametersWindow::processBase() .max(20.0f) .format("%.1f") .defaultValue(origParameters.genomeComplexityNeuronFactor) - .tooltip(""), + .tooltip("This parameter takes into account the number of encoded neurons in the genome for the complexity value."), parameters.genomeComplexityNeuronFactor); AlienImGui::EndTreeNode(); } @@ -1554,14 +1554,17 @@ void _SimulationParametersWindow::processBase() * Addon: Legacy modes */ if (parameters.features.legacyModes) { - if (AlienImGui::BeginTreeNode(AlienImGui::TreeNodeParameters().text("Addon: Legacy modes"))) { + if (AlienImGui::BeginTreeNode(AlienImGui::TreeNodeParameters().text("Addon: Legacy features"))) { AlienImGui::Switcher( AlienImGui::SwitcherParameters() .name("Muscle movement modes") .textWidth(RightColumnWidth) .defaultValue(origParameters.legacyCellFunctionMuscleMovementMode) .values({"Unrestricted", "Fetch angle from sensor"}) - .tooltip(""), + .tooltip(ICON_FA_CHEVRON_RIGHT " Unrestricted: Muscle cells can move in all directions when set in 'Movement' mode. The relative " + "angle is provided in channel #3.\n\n" ICON_FA_CHEVRON_RIGHT + " Fetch angle from sensor: Muscle cells can move only if an adjacent sensor cell has previously " + "detected a target. The relative angle in relation to the target is provided in channel #3."), parameters.legacyCellFunctionMuscleMovementMode, ¶meters.legacyCellFunctionMuscleMovementModeActivated); AlienImGui::EndTreeNode(); @@ -2364,7 +2367,7 @@ void _SimulationParametersWindow::processAddonList() parameters.features.genomeComplexityMeasurement); AlienImGui::Checkbox( AlienImGui::CheckboxParameters() - .name("Legacy modes") + .name("Legacy features") .textWidth(0) .defaultValue(origFeatures.legacyModes) .tooltip("It contains features for compatibility with older versions."), @@ -2472,6 +2475,9 @@ void _SimulationParametersWindow::validationAndCorrection(SimulationParameters& std::max(0.0f, std::min(1.0f, parameters.baseValues.radiationAbsorptionLowGenomeComplexityPenalty[i])); parameters.baseValues.radiationAbsorptionLowVelocityPenalty[i] = std::max(0.0f, std::min(1.0f, parameters.baseValues.radiationAbsorptionLowVelocityPenalty[i])); + parameters.genomeComplexitySizeFactor[i] = std::max(0.0f, parameters.genomeComplexitySizeFactor[i]); + parameters.genomeComplexityRamificationFactor[i] = std::max(0.0f, parameters.genomeComplexityRamificationFactor[i]); + parameters.genomeComplexityNeuronFactor[i] = std::max(0.0f, parameters.genomeComplexityNeuronFactor[i]); } parameters.externalEnergy = std::max(0.0f, parameters.externalEnergy); parameters.baseValues.cellMaxBindingEnergy = std::max(10.0f, parameters.baseValues.cellMaxBindingEnergy);