Editor: Distinguish private variables in the inspector
This commit is contained in:
parent
87a1687c74
commit
011040e46f
|
@ -72,6 +72,9 @@ void EditorPropertyVariableName::_update_status() {
|
||||||
if (plan->has_var(name_edit->get_text())) {
|
if (plan->has_var(name_edit->get_text())) {
|
||||||
BUTTON_SET_ICON(status_btn, theme_cache.var_exists_icon);
|
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."));
|
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 {
|
} else {
|
||||||
BUTTON_SET_ICON(status_btn, theme_cache.var_not_found_icon);
|
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."));
|
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_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_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_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;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ private:
|
||||||
Ref<Texture2D> var_exists_icon;
|
Ref<Texture2D> var_exists_icon;
|
||||||
Ref<Texture2D> var_not_found_icon;
|
Ref<Texture2D> var_not_found_icon;
|
||||||
Ref<Texture2D> var_add_icon;
|
Ref<Texture2D> var_add_icon;
|
||||||
|
Ref<Texture2D> var_private_icon;
|
||||||
};
|
};
|
||||||
ThemeCache theme_cache;
|
ThemeCache theme_cache;
|
||||||
|
|
||||||
|
|
|
@ -83,3 +83,4 @@ LimboState = "res://addons/limboai/icons/LimboState.svg"
|
||||||
LimboVarAdd = "res://addons/limboai/icons/LimboVarAdd.svg"
|
LimboVarAdd = "res://addons/limboai/icons/LimboVarAdd.svg"
|
||||||
LimboVarExists = "res://addons/limboai/icons/LimboVarExists.svg"
|
LimboVarExists = "res://addons/limboai/icons/LimboVarExists.svg"
|
||||||
LimboVarNotFound = "res://addons/limboai/icons/LimboVarNotFound.svg"
|
LimboVarNotFound = "res://addons/limboai/icons/LimboVarNotFound.svg"
|
||||||
|
LimboVarPrivate = "res://addons/limboai/icons/LimboVarPrivate.svg"
|
||||||
|
|
|
@ -98,6 +98,7 @@ LimboStringNames::LimboStringNames() {
|
||||||
LimboVarAdd = SN("LimboVarAdd");
|
LimboVarAdd = SN("LimboVarAdd");
|
||||||
LimboVarExists = SN("LimboVarExists");
|
LimboVarExists = SN("LimboVarExists");
|
||||||
LimboVarNotFound = SN("LimboVarNotFound");
|
LimboVarNotFound = SN("LimboVarNotFound");
|
||||||
|
LimboVarPrivate = SN("LimboVarPrivate");
|
||||||
LineEdit = SN("LineEdit");
|
LineEdit = SN("LineEdit");
|
||||||
Load = SN("Load");
|
Load = SN("Load");
|
||||||
managed = SN("managed");
|
managed = SN("managed");
|
||||||
|
|
|
@ -113,6 +113,7 @@ public:
|
||||||
StringName LimboVarAdd;
|
StringName LimboVarAdd;
|
||||||
StringName LimboVarExists;
|
StringName LimboVarExists;
|
||||||
StringName LimboVarNotFound;
|
StringName LimboVarNotFound;
|
||||||
|
StringName LimboVarPrivate;
|
||||||
StringName LineEdit;
|
StringName LineEdit;
|
||||||
StringName Load;
|
StringName Load;
|
||||||
StringName managed;
|
StringName managed;
|
||||||
|
|
Loading…
Reference in New Issue