Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/general/base_stage/IEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,6 @@ public interface IEditor : ISaveLoadedTracked
/// </summary>
/// <returns>Predicted next <see cref="GameWorld.TotalPassedTime"/></returns>
public double CalculateNextGenerationTimePoint();

public void DirtyMutationPointsCache();
}
3 changes: 2 additions & 1 deletion src/microbe_stage/editor/MicrobeEditor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ offset_top = -54.0
offset_right = 154.0
grow_vertical = 0

[node name="MicrobeEditorCheatMenu" parent="MicrobeEditorGUI" unique_id=1037789443 instance=ExtResource("39")]
[node name="MicrobeEditorCheatMenu" parent="MicrobeEditorGUI" unique_id=1037789443 node_paths=PackedStringArray("editorNode") instance=ExtResource("39")]
layout_mode = 0
offset_left = 10.0
offset_top = 30.0
editorNode = NodePath("../..")

[node name="TutorialGUI" parent="." unique_id=1480772500 instance=ExtResource("85")]
visible = false
Expand Down
14 changes: 13 additions & 1 deletion src/microbe_stage/editor/MicrobeEditorCheatMenu.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Godot;
using Arch.Core;
using Godot;

/// <summary>
/// Cheat menu for the <see cref="MicrobeEditor"/>
Expand All @@ -8,6 +9,9 @@ public partial class MicrobeEditorCheatMenu : CheatMenu
#pragma warning disable CA2213
[Export]
private CheckBox infiniteMp = null!;

[Export]
private NodeWithInput editorNode = null!;
#pragma warning restore CA2213

public override void ReloadGUI()
Expand All @@ -24,4 +28,12 @@ private void OnUnlockAllOrganellesPressed()
{
CheatManager.UnlockAllOrganelles();
}

private void InfiniteMPToggled(bool value)
{
SetInfiniteMP(value);

if (editorNode is IEditor editor)
editor.DirtyMutationPointsCache();
}
}
2 changes: 1 addition & 1 deletion src/microbe_stage/editor/MicrobeEditorCheatMenu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ layout_mode = 2
theme_override_font_sizes/font_size = 14
text = "UNLOCK_ALL_ORGANELLES"

[connection signal="toggled" from="VBoxContainer/InfiniteMP" to="." method="SetInfiniteMP"]
[connection signal="toggled" from="VBoxContainer/InfiniteMP" to="." method="InfiniteMPToggled"]
[connection signal="toggled" from="VBoxContainer/MoveToAnyPatch" to="." method="SetMoveToAnyPatch"]
[connection signal="pressed" from="VBoxContainer/RevealAllPatches" to="." method="OnRevealAllPatchesPressed"]
[connection signal="pressed" from="VBoxContainer/UnlockAllOrganelles" to="." method="OnUnlockAllOrganellesPressed"]
3 changes: 2 additions & 1 deletion src/multicellular_stage/editor/MulticellularEditor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ layout_mode = 2
text = "SELECT_CELL_TYPE_FROM_EDITOR"
horizontal_alignment = 1

[node name="MicrobeEditorCheatMenu" parent="EarlyMulticellularEditorGUI" unique_id=966094592 instance=ExtResource("10_xy0bv")]
[node name="MicrobeEditorCheatMenu" parent="EarlyMulticellularEditorGUI" unique_id=966094592 node_paths=PackedStringArray("editorNode") instance=ExtResource("10_xy0bv")]
layout_mode = 0
offset_left = 10.0
offset_top = 30.0
offset_right = 10.0
offset_bottom = 30.0
editorNode = NodePath("../..")

[connection signal="OnCellTypeToEditSelected" from="EarlyMulticellularEditorGUI/CellBodyPlanEditorComponent" to="." method="OnStartEditingCellType"]
[connection signal="OnTabSelected" from="EarlyMulticellularEditorGUI/MicrobeEditorTabButtons" to="." method="SetEditorTab"]
Expand Down