From 3498af6be9e29196a6a2ba3fb9867cebbe21b2f6 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 21 Apr 2025 21:53:27 +0300 Subject: [PATCH] cleanup --- res/layouts/pages/main.xml | 2 +- res/texts/ru_RU.txt | 2 +- src/graphics/ui/gui_xml.cpp | 8 ++++---- src/util/listutil.cpp | 18 ------------------ src/util/listutil.hpp | 2 -- 5 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 src/util/listutil.cpp diff --git a/res/layouts/pages/main.xml b/res/layouts/pages/main.xml index a3960666..b1fab2c9 100644 --- a/res/layouts/pages/main.xml +++ b/res/layouts/pages/main.xml @@ -2,6 +2,6 @@ - + diff --git a/res/texts/ru_RU.txt b/res/texts/ru_RU.txt index 65db4507..1836981d 100644 --- a/res/texts/ru_RU.txt +++ b/res/texts/ru_RU.txt @@ -24,6 +24,7 @@ Save=Сохранить Grant %{0} pack modification permission?=Выдать разрешение на модификацию пака %{0}? Error at line %{0}=Ошибка на строке %{0} Run=Запустить +Filter=Фильтр editor.info.tooltip=CTRL+S - Сохранить\nCTRL+R - Запустить\nCTRL+Z - Отменить\nCTRL+Y - Повторить devtools.traceback=Стек вызовов (от последнего) @@ -58,7 +59,6 @@ menu.Quit=Выход menu.Save and Quit to Menu=Сохранить и Выйти в Меню menu.Settings=Настройки menu.Reset settings=Сбросить настройки -menu.Contents Menu=Меню контентпаков menu.Open data folder=Открыть папку данных menu.Open content folder=Открыть папку [content] diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index 80512bc5..d76b76b7 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -619,7 +619,7 @@ static slotcallback read_slot_func( }; } -static void readSlot( +static void read_slot( InventoryView* view, UiXmlReader& reader, const xml::xmlelement& element ) { int index = element.attr("index", "0").asInt(); @@ -649,7 +649,7 @@ static void readSlot( view->add(slot); } -static void readSlotsGrid( +static void read_slots_grid( InventoryView* view, const UiXmlReader& reader, const xml::xmlelement& element @@ -726,9 +726,9 @@ static std::shared_ptr read_inventory( for (auto& sub : element.getElements()) { if (sub->getTag() == "slot") { - readSlot(view.get(), reader, *sub); + read_slot(view.get(), reader, *sub); } else if (sub->getTag() == "slots-grid") { - readSlotsGrid(view.get(), reader, *sub); + read_slots_grid(view.get(), reader, *sub); } } return view; diff --git a/src/util/listutil.cpp b/src/util/listutil.cpp deleted file mode 100644 index 97d24aa6..00000000 --- a/src/util/listutil.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "listutil.hpp" - -#include - -#include "stringutil.hpp" - -std::string util::to_string(const std::vector& vec) { - std::stringstream ss; - ss << "["; - for (size_t i = 0; i < vec.size(); i++) { - ss << util::quote(vec[1]); - if (i < vec.size() - 1) { - ss << ", "; - } - } - ss << "]"; - return ss.str(); -} diff --git a/src/util/listutil.hpp b/src/util/listutil.hpp index 9f2afe0c..609c1669 100644 --- a/src/util/listutil.hpp +++ b/src/util/listutil.hpp @@ -33,6 +33,4 @@ namespace util { a.reserve(a.size() + b.size()); a.insert(a.end(), b.begin(), b.end()); } - - std::string to_string(const std::vector& vec); }