Skip to content

Commit

Permalink
Removed unused node references
Browse files Browse the repository at this point in the history
  • Loading branch information
adammikulis committed May 30, 2024
1 parent 5ea6cf1 commit 95e54a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion addons/mind_game/scenes/examples/ChatExample.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ layout_mode = 2
[node name="JsonLabel" type="Label" parent="ChatController/MarginContainer/GridContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Json:"
text = "
"

[node name="SpacerLabel3" type="Label" parent="ChatController/MarginContainer/GridContainer"]
layout_mode = 2
Expand Down
13 changes: 9 additions & 4 deletions addons/mind_game/scripts/examples/ChatExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public partial class ChatExample : Node

private readonly string _configListResourcePath = "res://addons/mind_game/assets/resources/custom_resources/ConfigListResource.tres";


/// <summary>
/// Function that is called when node and all children are initialized
/// </summary>
public override void _Ready()
{
InitializeNodeRefs();
Expand Down Expand Up @@ -54,9 +56,6 @@ private void InitializeNodeRefs()
{
_mindManager = GetNode<MindGame.MindManager>("/root/MindManager");
_mindAgent3D = GetNode<MindAgent3D>("%MindAgent3D");
_modelConfigController = GetNode<MindGame.ModelConfigController>("%ModelConfigController");
_inferenceConfigController = GetNode<MindGame.InferenceConfigController>("%InferenceConfigController");

_modelInputLineEdit = GetNode<LineEdit>("%ModelInputLineEdit");

_configAndLoadModelsButton = GetNode<Button>("%ConfigAndLoadModelsButton");
Expand All @@ -66,6 +65,9 @@ private void InitializeNodeRefs()
_jsonLabel = GetNode<Label>("%JsonLabel");
}

/// <summary>
/// Function that is called to create a ConfigListResource if it does not exist
/// </summary>
private void EnsureConfigListResourceExists()
{
_configListResource = GD.Load<ConfigListResource>(_configListResourcePath);
Expand All @@ -76,6 +78,9 @@ private void EnsureConfigListResourceExists()
}
}

/// <summary>
/// Function to save configuration list
/// </summary>
private void SaveConfigList()
{
Error saveError = ResourceSaver.Save(_configListResource, _configListResourcePath);
Expand Down

0 comments on commit 95e54a9

Please sign in to comment.