diff options
| -rw-r--r-- | data/languages/bosnian.txt | 14 | ||||
| -rw-r--r-- | data/languages/czech.txt | 14 | ||||
| -rw-r--r-- | data/languages/dutch.txt | 16 | ||||
| -rw-r--r-- | data/languages/finnish.txt | 14 | ||||
| -rw-r--r-- | data/languages/french.txt | 16 | ||||
| -rw-r--r-- | data/languages/german.txt | 16 | ||||
| -rw-r--r-- | data/languages/italian.txt | 14 | ||||
| -rw-r--r-- | data/languages/polish.txt | 14 | ||||
| -rw-r--r-- | data/languages/portuguese.txt | 14 | ||||
| -rw-r--r-- | data/languages/romanian.txt | 16 | ||||
| -rw-r--r-- | data/languages/russian.txt | 14 | ||||
| -rw-r--r-- | data/languages/serbian.txt | 14 | ||||
| -rw-r--r-- | data/languages/spanish.txt | 16 | ||||
| -rw-r--r-- | data/languages/swedish.txt | 14 | ||||
| -rw-r--r-- | data/languages/ukrainian.txt | 14 | ||||
| -rw-r--r-- | src/game/client/components/menus.cpp | 55 | ||||
| -rw-r--r-- | src/game/client/components/menus.h | 2 | ||||
| -rw-r--r-- | src/game/client/components/menus_demo.cpp | 19 |
18 files changed, 274 insertions, 22 deletions
diff --git a/data/languages/bosnian.txt b/data/languages/bosnian.txt index 8aae808d..fb75624b 100644 --- a/data/languages/bosnian.txt +++ b/data/languages/bosnian.txt @@ -759,6 +759,9 @@ New New folder == +New name: +== + Next Envelope == @@ -810,7 +813,7 @@ Proof Quads == -REC +REC %3d:%02d == Reason: @@ -834,6 +837,12 @@ Removes the image from the map Removes the image from the map file. == +Rename +== + +Rename demo +== + Replace == @@ -918,6 +927,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/czech.txt b/data/languages/czech.txt index 82261d31..c2b4937f 100644 --- a/data/languages/czech.txt +++ b/data/languages/czech.txt @@ -735,6 +735,9 @@ New New folder == +New name: +== + Next Envelope == @@ -795,7 +798,7 @@ Proof Quads == -REC +REC %3d:%02d == Reason: @@ -822,6 +825,12 @@ Removes the image from the map Removes the image from the map file. == +Rename +== + +Rename demo +== + Replace == @@ -915,6 +924,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/dutch.txt b/data/languages/dutch.txt index c2101702..5368bca5 100644 --- a/data/languages/dutch.txt +++ b/data/languages/dutch.txt @@ -616,8 +616,8 @@ Quick search: Quit == Afsluiten -REC -== REC +REC %3d:%02d +== REC %3d:%02d Reason: == Reden: @@ -984,9 +984,21 @@ Free-View Game tiles == +New name: +== + Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/finnish.txt b/data/languages/finnish.txt index 49dad994..657e54c1 100644 --- a/data/languages/finnish.txt +++ b/data/languages/finnish.txt @@ -747,6 +747,9 @@ New New folder == +New name: +== + Next Envelope == @@ -804,7 +807,7 @@ Proof Quads == -REC +REC %3d:%02d == Reason: @@ -831,6 +834,12 @@ Removes the image from the map Removes the image from the map file. == +Rename +== + +Rename demo +== + Replace == @@ -918,6 +927,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/french.txt b/data/languages/french.txt index 4716a74c..1e5a00a4 100644 --- a/data/languages/french.txt +++ b/data/languages/french.txt @@ -547,8 +547,8 @@ Quick search: Quit == Quitter -REC -== REC +REC %3d:%02d +== REC %3d:%02d Reason: == Raison : @@ -888,6 +888,9 @@ Left mouse to drag. Hold ctrl to be more precise. Hold shift to alter time point Name plates size == +New name: +== + Para X == @@ -912,6 +915,12 @@ Refocus Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + Resizes the current Quad based on the aspect ratio of the image == @@ -951,6 +960,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/german.txt b/data/languages/german.txt index d19093ad..7c234037 100644 --- a/data/languages/german.txt +++ b/data/languages/german.txt @@ -616,8 +616,8 @@ Quick search: Quit == Beenden -REC -== REC +REC %3d:%02d +== REC %3d:%02d Reason: == Grund @@ -984,9 +984,21 @@ Free-View Game tiles == +New name: +== + Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/italian.txt b/data/languages/italian.txt index 29888ba2..0619f505 100644 --- a/data/languages/italian.txt +++ b/data/languages/italian.txt @@ -969,12 +969,21 @@ Max Screenshots Max demos == -REC +New name: +== + +REC %3d:%02d == Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + Shift == @@ -984,6 +993,9 @@ Sound error Sudden Death == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/polish.txt b/data/languages/polish.txt index 866ed591..033cea1d 100644 --- a/data/languages/polish.txt +++ b/data/languages/polish.txt @@ -894,6 +894,9 @@ Name plates size New folder == +New name: +== + Para X == @@ -912,7 +915,7 @@ Pos Y Quads == -REC +REC %3d:%02d == Reason: @@ -930,6 +933,12 @@ Refocus Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + Resizes the current Quad based on the aspect ratio of the image == @@ -963,6 +972,9 @@ Time limit: %d min Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/portuguese.txt b/data/languages/portuguese.txt index 8793929e..d15a0912 100644 --- a/data/languages/portuguese.txt +++ b/data/languages/portuguese.txt @@ -747,6 +747,9 @@ New New folder == +New name: +== + Next Envelope == @@ -804,7 +807,7 @@ Proof Quads == -REC +REC %3d:%02d == Reason: @@ -831,6 +834,12 @@ Removes the image from the map Removes the image from the map file. == +Rename +== + +Rename demo +== + Replace == @@ -918,6 +927,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/romanian.txt b/data/languages/romanian.txt index 5834cbd6..66393c90 100644 --- a/data/languages/romanian.txt +++ b/data/languages/romanian.txt @@ -616,8 +616,8 @@ Quick search: Quit == Ieșire -REC -== REC +REC %3d:%02d +== REC %3d:%02d Reason: == Motiv: @@ -984,9 +984,21 @@ Free-View Game tiles == +New name: +== + Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/russian.txt b/data/languages/russian.txt index fb44bf76..d5239cce 100644 --- a/data/languages/russian.txt +++ b/data/languages/russian.txt @@ -900,6 +900,9 @@ Name plates size New folder == +New name: +== + Para X == @@ -918,7 +921,7 @@ Pos Y Quads == -REC +REC %3d:%02d == Record demo @@ -930,6 +933,12 @@ Red value of the envelope Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + Resizes the current Quad based on the aspect ratio of the image == @@ -963,6 +972,9 @@ Time limit: %d min Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/serbian.txt b/data/languages/serbian.txt index 2a3b9e59..694dd4ce 100644 --- a/data/languages/serbian.txt +++ b/data/languages/serbian.txt @@ -747,6 +747,9 @@ New New folder == +New name: +== + Next Envelope == @@ -804,7 +807,7 @@ Proof Quads == -REC +REC %3d:%02d == Reason: @@ -831,6 +834,12 @@ Removes the image from the map Removes the image from the map file. == +Rename +== + +Rename demo +== + Replace == @@ -918,6 +927,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/spanish.txt b/data/languages/spanish.txt index 3bb4ea26..c7ef0cc6 100644 --- a/data/languages/spanish.txt +++ b/data/languages/spanish.txt @@ -616,8 +616,8 @@ Quick search: Quit == Salir -REC -== REC +REC %3d:%02d +== REC %3d:%02d Reason: == Razón: @@ -984,9 +984,21 @@ Free-View Game tiles == +New name: +== + Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/swedish.txt b/data/languages/swedish.txt index bebbfb45..b1d10fe8 100644 --- a/data/languages/swedish.txt +++ b/data/languages/swedish.txt @@ -732,6 +732,9 @@ New New folder == +New name: +== + Next Envelope == @@ -792,7 +795,7 @@ Proof Quads == -REC +REC %3d:%02d == Reason: @@ -819,6 +822,12 @@ Removes the image from the map Removes the image from the map file. == +Rename +== + +Rename demo +== + Replace == @@ -912,6 +921,9 @@ Toggles the envelope editor. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/data/languages/ukrainian.txt b/data/languages/ukrainian.txt index f70cc9c9..f080df59 100644 --- a/data/languages/ukrainian.txt +++ b/data/languages/ukrainian.txt @@ -927,6 +927,9 @@ Max demos Name plates size == +New name: +== + Para X == @@ -945,7 +948,7 @@ Pos Y Quads == -REC +REC %3d:%02d == Red value of the envelope @@ -954,6 +957,12 @@ Red value of the envelope Removes game tiles that aren't based on a layer == +Rename +== + +Rename demo +== + Rotation of the envelope == @@ -969,6 +978,9 @@ The audio device couldn't be initialised. Unable to delete the demo == +Unable to rename the demo +== + Unhookable == diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index ed49f8b1..068d7451 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -855,6 +855,12 @@ int CMenus::Render() pExtraText = Localize("Are you sure that you want to delete the demo?"); ExtraAlign = -1; } + else if(m_Popup == POPUP_RENAME_DEMO) + { + pTitle = Localize("Rename demo"); + pExtraText = ""; + ExtraAlign = -1; + } else if(m_Popup == POPUP_SOUNDERROR) { pTitle = Localize("Sound error"); @@ -1070,6 +1076,55 @@ int CMenus::Render() } } } + else if(m_Popup == POPUP_RENAME_DEMO) + { + CUIRect Label, TextBox, Ok, Abort; + + Box.HSplitBottom(20.f, &Box, &Part); + Box.HSplitBottom(24.f, &Box, &Part); + Part.VMargin(80.0f, &Part); + + Part.VSplitMid(&Abort, &Ok); + + Ok.VMargin(20.0f, &Ok); + Abort.VMargin(20.0f, &Abort); + + static int s_ButtonAbort = 0; + if(DoButton_Menu(&s_ButtonAbort, Localize("Abort"), 0, &Abort) || m_EscapePressed) + m_Popup = POPUP_NONE; + + static int s_ButtonOk = 0; + if(DoButton_Menu(&s_ButtonOk, Localize("Ok"), 0, &Ok) || m_EnterPressed) + { + m_Popup = POPUP_NONE; + // rename demo + if(m_DemolistSelectedIndex >= 0 && !m_DemolistSelectedIsDir) + { + char aBufOld[512]; + str_format(aBufOld, sizeof(aBufOld), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); + char aBufNew[512]; + str_format(aBufNew, sizeof(aBufNew), "%s/%s", m_aCurrentDemoFolder, m_aCurrentDemoFile); + if(Storage()->RenameFile(aBufOld, aBufNew, m_lDemos[m_DemolistSelectedIndex].m_StorageType)) + { + DemolistPopulate(); + DemolistOnUpdate(false); + } + else + PopupMessage(Localize("Error"), Localize("Unable to rename the demo"), Localize("Ok")); + } + } + + Box.HSplitBottom(60.f, &Box, &Part); + Box.HSplitBottom(24.f, &Box, &Part); + + Part.VSplitLeft(60.0f, 0, &Label); + Label.VSplitLeft(120.0f, 0, &TextBox); + TextBox.VSplitLeft(20.0f, 0, &TextBox); + TextBox.VSplitRight(60.0f, &TextBox, 0); + UI()->DoLabel(&Label, Localize("New name:"), 18.0f, -1); + static float Offset = 0.0f; + DoEditBox(&Offset, &TextBox, m_aCurrentDemoFile, sizeof(m_aCurrentDemoFile), 12.0f, &Offset); + } else if(m_Popup == POPUP_FIRST_LAUNCH) { CUIRect Label, TextBox; diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 8bdd75ee..1a2e5cf5 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -97,6 +97,7 @@ class CMenus : public CComponent POPUP_PURE, POPUP_LANGUAGE, POPUP_DELETE_DEMO, + POPUP_RENAME_DEMO, POPUP_SOUNDERROR, POPUP_PASSWORD, POPUP_QUIT, @@ -185,6 +186,7 @@ class CMenus : public CComponent sorted_array<CDemoItem> m_lDemos; char m_aCurrentDemoFolder[256]; + char m_aCurrentDemoFile[64]; int m_DemolistSelectedIndex; bool m_DemolistSelectedIsDir; int m_DemolistStorageType; diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 068d9c32..d489b8db 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -509,13 +509,15 @@ void CMenus::RenderDemoList(CUIRect MainView) RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_ALL, 10.0f); MainView.Margin(10.0f, &MainView); - CUIRect ButtonBar, RefreshRect, PlayRect, DeleteRect, FileIcon; + CUIRect ButtonBar, RefreshRect, PlayRect, DeleteRect, RenameRect, FileIcon; MainView.HSplitBottom(ms_ButtonHeight+5.0f, &MainView, &ButtonBar); ButtonBar.HSplitTop(5.0f, 0, &ButtonBar); ButtonBar.VSplitRight(130.0f, &ButtonBar, &PlayRect); ButtonBar.VSplitLeft(130.0f, &RefreshRect, &ButtonBar); - ButtonBar.VSplitLeft(10.0f, &DeleteRect, &ButtonBar); + ButtonBar.VSplitLeft(10.0f, 0, &ButtonBar); ButtonBar.VSplitLeft(120.0f, &DeleteRect, &ButtonBar); + ButtonBar.VSplitLeft(10.0f, 0, &ButtonBar); + ButtonBar.VSplitLeft(120.0f, &RenameRect, &ButtonBar); static int s_DemoListId = 0; static float s_ScrollValue = 0; @@ -586,6 +588,19 @@ void CMenus::RenderDemoList(CUIRect MainView) { UI()->SetActiveItem(0); m_Popup = POPUP_DELETE_DEMO; + return; + } + } + + static int s_RenameButton = 0; + if(DoButton_Menu(&s_RenameButton, Localize("Rename"), 0, &RenameRect)) + { + if(m_DemolistSelectedIndex >= 0) + { + UI()->SetActiveItem(0); + m_Popup = POPUP_RENAME_DEMO; + str_copy(m_aCurrentDemoFile, m_lDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); + return; } } } |