Name the id-and-path label for what it is, and drop a duplicate declaration and an unused parameter

This commit is contained in:
shweet committed 2026-11-22 19:09:55 -05:00
1 parent 05de859879
commit 13bbd8f9c5
6 files changed
+10 -11

No files matched your search

+2 -2
View File
@@ -981,9 +981,9 @@ Choices Document::choices_get(SelectionKind kind, int layerId) const
if (kind == SelectionKind::SPRITESHEETS) if (kind == SelectionKind::SPRITESHEETS)
add(content.spritesheets, path_label_get(FORMAT_SPRITESHEET)); add(content.spritesheets, path_label_get(FORMAT_SPRITESHEET));
if (kind == SelectionKind::SOUNDS) if (kind == SelectionKind::SOUNDS)
add(content.sounds, path_label_get(FORMAT_SOUND)); add(content.sounds, path_label_get(FORMAT_ID_PATH));
if (kind == SelectionKind::LIBRARIES) if (kind == SelectionKind::LIBRARIES)
add(content.libraries, path_label_get(FORMAT_SOUND)); add(content.libraries, path_label_get(FORMAT_ID_PATH));
if (kind == SelectionKind::EVENTS) if (kind == SelectionKind::EVENTS)
add(content.events, name_get); add(content.events, name_get);
if (kind == SelectionKind::SHADERS) if (kind == SelectionKind::SHADERS)
+1 -1
View File
@@ -251,7 +251,7 @@ inline constexpr const char* LANGUAGE_STRINGS[LANGUAGE_COUNT] = {
X(FORMAT_SIZE, "Size: ({0}, {1})", "Tamaño: ({0}, {1})", "Размер: ({0}, {1})", "大小: ({0}, {1})", "크기: ({0}, {1})") \ X(FORMAT_SIZE, "Size: ({0}, {1})", "Tamaño: ({0}, {1})", "Размер: ({0}, {1})", "大小: ({0}, {1})", "크기: ({0}, {1})") \
X(FORMAT_SPRITESHEET, "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}") \ X(FORMAT_SPRITESHEET, "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}") \
X(FORMAT_SPRITESHEET_NOT_SAVED, "{0} (Not Saved)", "{0} (No guardado)", "{0} (Не сохранено)", "{0} (未保存)", "{0} (저장되지 않음)") \ X(FORMAT_SPRITESHEET_NOT_SAVED, "{0} (Not Saved)", "{0} (No guardado)", "{0} (Не сохранено)", "{0} (未保存)", "{0} (저장되지 않음)") \
X(FORMAT_SOUND, "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}") \ X(FORMAT_ID_PATH, "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}") \
X(FORMAT_SHADER, "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}") \ X(FORMAT_SHADER, "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}", "#{0} {1}") \
X(FORMAT_TRANSFORM, "Transform: {0}", "Transformar: {0}", "Трансформация: {0}", "变换: {0}", "변환: {0}") \ X(FORMAT_TRANSFORM, "Transform: {0}", "Transformar: {0}", "Трансформация: {0}", "变换: {0}", "변환: {0}") \
X(FORMAT_RECT, "Rect: {0}", "Rect: {0}", "Прямоугольник: {0}", "矩形: {0}", "사각형: {0}") \ X(FORMAT_RECT, "Rect: {0}", "Rect: {0}", "Прямоугольник: {0}", "矩形: {0}", "사각형: {0}") \
+1 -1
View File
@@ -68,7 +68,7 @@ void libraries_update(Panel& panel)
ListRows rows{.label_get = ListRows rows{.label_get =
[&](int id) { [&](int id) {
auto pathString = path_to_utf8(item_get(libraries, id)->path); auto pathString = path_to_utf8(item_get(libraries, id)->path);
return localize_format(FORMAT_SOUND, id, pathString); return localize_format(FORMAT_ID_PATH, id, pathString);
}, },
.tooltip_draw = .tooltip_draw =
[&](int id) { [&](int id) {
+5 -5
View File
@@ -26,7 +26,7 @@ void command_push(const Panel& panel, std::function<void(Document&)> run)
{panel.manager.selected, [run = std::move(run)](Manager&, Document& document) { run(document); }}); {panel.manager.selected, [run = std::move(run)](Manager&, Document& document) { run(document); }});
} }
static void row_select(std::set<int>&, int& focus, const ListRows& rows, int key) static void row_select(int& focus, const ListRows& rows, int key)
{ {
focus = key; focus = key;
if (rows.select) if (rows.select)
@@ -95,7 +95,7 @@ int list_select_begin(Panel& panel, std::set<int>& selection, int& focus, const
{ {
storage.clear(); storage.clear();
selection.clear(); selection.clear();
row_select(selection, focus, rows, -1); row_select(focus, rows, -1);
} }
return arrow_key_get(arrowKeys, selection, focus); return arrow_key_get(arrowKeys, selection, focus);
} }
@@ -109,7 +109,7 @@ void list_select_end(Panel& panel, std::set<int>& selection, int& focus, const L
if (arrowKey != -1) if (arrowKey != -1)
{ {
selection = {arrowKey}; selection = {arrowKey};
row_select(selection, focus, rows, arrowKey); row_select(focus, rows, arrowKey);
} }
if (shortcut(panel.manager.chords[SHORTCUT_CONFIRM], SCOPE_FOCUSED) && selection.size() == 1 && rows.activate) if (shortcut(panel.manager.chords[SHORTCUT_CONFIRM], SCOPE_FOCUSED) && selection.size() == 1 && rows.activate)
rows.activate(*selection.begin()); rows.activate(*selection.begin());
@@ -164,7 +164,7 @@ bool row_draw(Panel& panel, std::set<int>& selection, int& focus, const ListRows
isActivated = ImGui::Selectable(label.c_str(), isSelected); isActivated = ImGui::Selectable(label.c_str(), isSelected);
if (isActivated || ImGui::IsItemClicked(ImGuiMouseButton_Left) || ImGui::IsItemClicked(ImGuiMouseButton_Right)) if (isActivated || ImGui::IsItemClicked(ImGuiMouseButton_Left) || ImGui::IsItemClicked(ImGuiMouseButton_Right))
row_select(selection, focus, rows, key); row_select(focus, rows, key);
if (isInvalid) if (isInvalid)
ImGui::PopStyleColor(); ImGui::PopStyleColor();
if (font != FONT_REGULAR) if (font != FONT_REGULAR)
@@ -213,7 +213,7 @@ static void card_draw(Panel& panel, std::set<int>& selection, int& focus, const
ImGui::SetKeyboardFocusHere(); ImGui::SetKeyboardFocusHere();
if (ImGui::Selectable("##Card Selectable", isSelected, 0, cardSize) || if (ImGui::Selectable("##Card Selectable", isSelected, 0, cardSize) ||
ImGui::IsItemClicked(ImGuiMouseButton_Left) || ImGui::IsItemClicked(ImGuiMouseButton_Right)) ImGui::IsItemClicked(ImGuiMouseButton_Left) || ImGui::IsItemClicked(ImGuiMouseButton_Right))
row_select(selection, focus, rows, key); row_select(focus, rows, key);
if (rows.activate && ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) if (rows.activate && ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
rows.activate(key); rows.activate(key);
-1
View File
@@ -169,7 +169,6 @@ void events_update(Panel&);
void sounds_update(Panel&); void sounds_update(Panel&);
std::string layer_label_get(const Layer&); std::string layer_label_get(const Layer&);
void layer_source_tooltip_draw(const Document&, const Layer&); void layer_source_tooltip_draw(const Document&, const Layer&);
void layer_source_tooltip_draw(const Document&, const Layer&);
Layer item_edit_layer_get(const Manager::ItemEdit&); Layer item_edit_layer_get(const Manager::ItemEdit&);
Null item_edit_null_get(const Manager::ItemEdit&); Null item_edit_null_get(const Manager::ItemEdit&);
void layer_source_draw(Document&, Manager::ItemEdit&); void layer_source_draw(Document&, Manager::ItemEdit&);
+1 -1
View File
@@ -83,7 +83,7 @@ void sounds_update(Panel& panel)
ListRows rows{.label_get = ListRows rows{.label_get =
[&](int id) { [&](int id) {
auto pathString = path_to_utf8(item_get(sounds, id)->path); auto pathString = path_to_utf8(item_get(sounds, id)->path);
return localize_format(FORMAT_SOUND, id, pathString); return localize_format(FORMAT_ID_PATH, id, pathString);
}, },
.tooltip_draw = .tooltip_draw =
[&](int id) { [&](int id) {