diff --git a/CMakeLists.txt b/CMakeLists.txt index 0878477..472cc66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ add_executable(ezremote_client add_self(ezremote_client) -add_pkg(ezremote_client ${CMAKE_SOURCE_DIR}/data "RMTC00001" "ezRemote Client" "01.04" 32 0) +add_pkg(ezremote_client ${CMAKE_SOURCE_DIR}/data "RMTC00001" "ezRemote Client" "01.05" 32 0) target_link_libraries(ezremote_client c diff --git a/data/assets/fonts/OpenFontIcons.ttf b/data/assets/fonts/OpenFontIcons.ttf new file mode 100644 index 0000000..804fbc1 Binary files /dev/null and b/data/assets/fonts/OpenFontIcons.ttf differ diff --git a/data/assets/langs/English.ini b/data/assets/langs/English.ini index 8ec1f69..529d0f6 100644 --- a/data/assets/langs/English.ini +++ b/data/assets/langs/English.ini @@ -136,3 +136,5 @@ STR_CLIENT_ID=Client ID STR_CLIENT_SECRET=Client Secret STR_GLOBAL=Global STR_GOOGLE=Google +STR_COPY_LINE=Copy selected line +STR_PASTE_LINE=Paste into selected line diff --git a/source/OpenFontIcons.h b/source/OpenFontIcons.h new file mode 100644 index 0000000..a34455c --- /dev/null +++ b/source/OpenFontIcons.h @@ -0,0 +1,4 @@ +#pragma once + +#define ICON_OF_SQUARE "\xee\x83\x8b" // U+E0CB +#define ICON_OF_TRIANGLE "\xee\x83\x9e" // U+E0CB diff --git a/source/imgui/imgui_internal.h b/source/imgui/imgui_internal.h index 599b4e1..c8cb2c8 100644 --- a/source/imgui/imgui_internal.h +++ b/source/imgui/imgui_internal.h @@ -1200,7 +1200,7 @@ typedef ImBitArray ImBitAr #define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1 #define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown #define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight -#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft +#define ImGuiKey_NavGamepadMenu ImGuiKey_Keypad0 #define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp enum ImGuiInputEventType diff --git a/source/lang.cpp b/source/lang.cpp index 23b0925..a0a2231 100644 --- a/source/lang.cpp +++ b/source/lang.cpp @@ -150,6 +150,8 @@ char lang_strings[LANG_STRINGS_NUM][LANG_STR_SIZE] = { "Client Secret", // STR_CLIENT_SECRET "Global", // STR_GLOBAL "Google", // STR_GOOGLE + "Copy selected line", // STR_COPY_LINE + "Paste into selected line", // STR_PASTE_LINE }; bool needs_extended_font = false; diff --git a/source/lang.h b/source/lang.h index bf0a2aa..9c80513 100644 --- a/source/lang.h +++ b/source/lang.h @@ -141,7 +141,9 @@ FUNC(STR_CLIENT_ID) \ FUNC(STR_CLIENT_SECRET) \ FUNC(STR_GLOBAL) \ - FUNC(STR_GOOGLE) + FUNC(STR_GOOGLE) \ + FUNC(STR_COPY_LINE) \ + FUNC(STR_PASTE_LINE) #define GET_VALUE(x) x, #define GET_STRING(x) #x, @@ -151,7 +153,7 @@ enum FOREACH_STR(GET_VALUE) }; -#define LANG_STRINGS_NUM 138 +#define LANG_STRINGS_NUM 140 #define LANG_ID_SIZE 64 #define LANG_STR_SIZE 384 extern char lang_identifiers[LANG_STRINGS_NUM][LANG_ID_SIZE]; diff --git a/source/main.cpp b/source/main.cpp index 14c380a..62e58a0 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -99,7 +99,7 @@ void InitImgui() 0, }; - static const ImWchar icons[] { + static const ImWchar fa_icons[] { 0xF07B, 0xF07B, // folder 0xF65E, 0xF65E, // new folder 0xF15B, 0xF15B, // file @@ -127,6 +127,12 @@ void InitImgui() 0, }; + static const ImWchar of_icons[] { + 0xE0CB, 0xE0CB, // square + 0xE0DE, 0xE0DE, // triangle + 0, + }; + std::string lang = std::string(language); int32_t lang_idx; sceSystemServiceParamGetInt( ORBIS_SYSTEM_SERVICE_PARAM_ID_LANG, &lang_idx ); @@ -177,7 +183,8 @@ void InitImgui() ImFontConfig config; config.MergeMode = true; config.GlyphMinAdvanceX = 13.0f; // Use if you want to make the icon monospaced - io.Fonts->AddFontFromFileTTF("/app0/assets/fonts/fa-solid-900.ttf", 20.0f, &config, icons); + io.Fonts->AddFontFromFileTTF("/app0/assets/fonts/fa-solid-900.ttf", 20.0f, &config, fa_icons); + io.Fonts->AddFontFromFileTTF("/app0/assets/fonts/OpenFontIcons.ttf", 20.0f, &config, of_icons); io.Fonts->Flags |= ImFontAtlasFlags_NoPowerOfTwoHeight; io.Fonts->Build(); @@ -307,7 +314,6 @@ int main() ImGui_ImplSDL2_InitForSDLRenderer(window, renderer); ImGui_ImplSDLRenderer_Init(renderer); ImGui_ImplSDLRenderer_CreateFontsTexture(); - ImGui_ImplSDL2_DisableButton(SDL_CONTROLLER_BUTTON_X, true); if (!initialize_jbc()) { diff --git a/source/windows.cpp b/source/windows.cpp index 385174f..b244292 100644 --- a/source/windows.cpp +++ b/source/windows.cpp @@ -13,6 +13,7 @@ #include "lang.h" #include "ime_dialog.h" #include "IconsFontAwesome6.h" +#include "OpenFontIcons.h" #include "server/http_server.h" #include "clients/gdrive.h" @@ -77,6 +78,7 @@ char label[256]; bool editor_modified = false; char edit_file[256]; int edit_line_to_select = -1; +std::string copy_text; // Overwrite dialog variables bool dont_prompt_overwrite = false; @@ -1519,6 +1521,15 @@ namespace Windows editor_modified = true; edit_line_to_select = j; } + else if (ImGui::IsKeyPressed(ImGuiKey_GamepadFaceLeft, false)) + { + copy_text = std::string(it->c_str()); + } + else if (ImGui::IsKeyPressed(ImGuiKey_GamepadFaceUp, false)) + { + it->clear(); + it->append(copy_text); + } } j++; } @@ -1534,7 +1545,8 @@ namespace Windows ImGui::Text("%s%s", (editor_modified ? "**" : ""), edit_file); ImGui::Separator(); - ImGui::Text("L1 - %s R1 - %s", lang_strings[STR_DELETE_LINE], lang_strings[STR_INSERT_LINE]); + ImGui::Text("L1 - %s R1 - %s %s - %s %s - %s", lang_strings[STR_DELETE_LINE], lang_strings[STR_INSERT_LINE], + ICON_OF_SQUARE, lang_strings[STR_COPY_LINE], ICON_OF_TRIANGLE, lang_strings[STR_PASTE_LINE]); ImGui::EndPopup(); } }