Editor: Distinguish private variables in the inspector

This commit is contained in:
Serhii Snitsaruk 2024-01-28 21:58:18 +01:00
parent 87a1687c74
commit 011040e46f
5 changed files with 8 additions and 0 deletions

View File

@ -72,6 +72,9 @@ void EditorPropertyVariableName::_update_status() {
if (plan->has_var(name_edit->get_text())) {
BUTTON_SET_ICON(status_btn, theme_cache.var_exists_icon);
status_btn->set_tooltip_text(TTR("This variable exists in the blackboard plan.\n\nClick to open blackboard plan."));
} else if (name_edit->get_text().begins_with("_")) {
BUTTON_SET_ICON(status_btn, theme_cache.var_private_icon);
status_btn->set_tooltip_text(TTR("Variable is private and doesn't exist in the blackboard plan.\n\nClick to open blackboard plan."));
} else {
BUTTON_SET_ICON(status_btn, theme_cache.var_not_found_icon);
status_btn->set_tooltip_text(TTR("No such variable exists in the blackboard plan!\n\nClick to open blackboard plan."));
@ -142,6 +145,7 @@ void EditorPropertyVariableName::_notification(int p_what) {
theme_cache.var_add_icon = LimboUtility::get_singleton()->get_task_icon(LW_NAME(LimboVarAdd));
theme_cache.var_exists_icon = LimboUtility::get_singleton()->get_task_icon(LW_NAME(LimboVarExists));
theme_cache.var_not_found_icon = LimboUtility::get_singleton()->get_task_icon(LW_NAME(LimboVarNotFound));
theme_cache.var_private_icon = LimboUtility::get_singleton()->get_task_icon(LW_NAME(LimboVarPrivate));
} break;
}
}

View File

@ -36,6 +36,7 @@ private:
Ref<Texture2D> var_exists_icon;
Ref<Texture2D> var_not_found_icon;
Ref<Texture2D> var_add_icon;
Ref<Texture2D> var_private_icon;
};
ThemeCache theme_cache;

View File

@ -83,3 +83,4 @@ LimboState = "res://addons/limboai/icons/LimboState.svg"
LimboVarAdd = "res://addons/limboai/icons/LimboVarAdd.svg"
LimboVarExists = "res://addons/limboai/icons/LimboVarExists.svg"
LimboVarNotFound = "res://addons/limboai/icons/LimboVarNotFound.svg"
LimboVarPrivate = "res://addons/limboai/icons/LimboVarPrivate.svg"

View File

@ -98,6 +98,7 @@ LimboStringNames::LimboStringNames() {
LimboVarAdd = SN("LimboVarAdd");
LimboVarExists = SN("LimboVarExists");
LimboVarNotFound = SN("LimboVarNotFound");
LimboVarPrivate = SN("LimboVarPrivate");
LineEdit = SN("LineEdit");
Load = SN("Load");
managed = SN("managed");

View File

@ -113,6 +113,7 @@ public:
StringName LimboVarAdd;
StringName LimboVarExists;
StringName LimboVarNotFound;
StringName LimboVarPrivate;
StringName LineEdit;
StringName Load;
StringName managed;