Add probability icon

This commit is contained in:
Serhii Snitsaruk 2023-09-26 16:12:10 +02:00
parent b5a44c0807
commit 953d98f89c
3 changed files with 4 additions and 1 deletions

View File

@ -271,7 +271,7 @@ void LimboAIEditor::_on_tree_rmb(const Vector2 &p_menu_pos) {
ERR_FAIL_COND_MSG(task.is_null(), "LimboAIEditor: get_selected() returned null");
if (task_tree->selected_has_probability()) {
menu->add_item(TTR("Edit Probability"), ACTION_EDIT_PROBABILITY);
menu->add_icon_item(theme_cache.percent_icon, TTR("Edit Probability"), ACTION_EDIT_PROBABILITY);
}
menu->add_icon_shortcut(theme_cache.rename_task_icon, ED_GET_SHORTCUT("limbo_ai/rename_task"), ACTION_RENAME);
menu->add_icon_item(theme_cache.edit_script_icon, TTR("Edit Script"), ACTION_EDIT_SCRIPT);
@ -799,6 +799,7 @@ void LimboAIEditor::_update_theme_item_cache() {
theme_cache.move_task_up_icon = get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons"));
theme_cache.open_debugger_icon = get_theme_icon(SNAME("Debug"), SNAME("EditorIcons"));
theme_cache.open_doc_icon = get_theme_icon(SNAME("Help"), SNAME("EditorIcons"));
theme_cache.percent_icon = get_theme_icon(SNAME("LimboPercent"), SNAME("EditorIcons"));
theme_cache.remove_task_icon = get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"));
theme_cache.rename_task_icon = get_theme_icon(SNAME("Rename"), SNAME("EditorIcons"));
}

View File

@ -66,6 +66,7 @@ private:
Ref<Texture2D> move_task_up_icon;
Ref<Texture2D> open_debugger_icon;
Ref<Texture2D> open_doc_icon;
Ref<Texture2D> percent_icon;
Ref<Texture2D> remove_task_icon;
Ref<Texture2D> rename_task_icon;
} theme_cache;

1
icons/LimboPercent.svg Normal file
View File

@ -0,0 +1 @@
<svg enable-background="new 0 0 16 16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="m7.82 4.9c0-1.6-1.3-2.9-2.9-2.9-1.61 0-2.92 1.3-2.92 2.89 0 1.64 1.29 2.93 2.93 2.93 1.6 0 2.89-1.31 2.89-2.92zm-2.89 2.19c-1.23 0-2.2-.97-2.2-2.2 0-1.2.98-2.17 2.19-2.17 1.2 0 2.17.98 2.17 2.17.01 1.22-.97 2.21-2.16 2.2z"/><path d="m14 11.08c0-1.6-1.3-2.9-2.9-2.9-1.61 0-2.93 1.3-2.92 2.89 0 1.64 1.29 2.93 2.93 2.93 1.6 0 2.89-1.31 2.89-2.92zm-2.89 2.19c-1.23 0-2.2-.97-2.2-2.2 0-1.2.98-2.17 2.19-2.17 1.2 0 2.17.98 2.17 2.17 0 1.22-.97 2.2-2.16 2.2z"/><path d="m.72 7.27h14.56v1.46h-14.56z" transform="matrix(.7071 -.7071 .7071 .7071 -3.3139 8.0001)"/></g></svg>

After

Width:  |  Height:  |  Size: 686 B