diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 5d074e5d2..90de9ab6b 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1222,6 +1222,10 @@ int CMenus::Render() { pTitle = Localize("Render demo"); } + else if(m_Popup == POPUP_RENDER_DONE) + { + pTitle = Localize("Render complete"); + } #endif else if(m_Popup == POPUP_PASSWORD) { @@ -1677,6 +1681,50 @@ int CMenus::Render() UI()->DoLabel(&Label, Localize("Video name:"), 18.0f, TEXTALIGN_ML); UI()->DoEditBox(&m_DemoRenderInput, &TextBox, 12.0f); } + else if(m_Popup == POPUP_RENDER_DONE) + { + CUIRect TextBox, Ok, OpenFolder; + + char aFilePath[IO_MAX_PATH_LENGTH]; + char aSaveFolder[IO_MAX_PATH_LENGTH]; + Storage()->GetCompletePath(Storage()->TYPE_SAVE, "videos", aSaveFolder, sizeof(aSaveFolder)); + str_format(aFilePath, sizeof(aFilePath), "%s/%s.mp4", aSaveFolder, m_DemoRenderInput.GetString()); + + Box.HSplitBottom(20.f, &Box, &Part); + Box.HSplitBottom(24.f, &Box, &Part); + Part.VMargin(80.0f, &Part); + + Part.VSplitMid(&OpenFolder, &Ok); + + Ok.VMargin(20.0f, &Ok); + OpenFolder.VMargin(20.0f, &OpenFolder); + + static CButtonContainer s_ButtonOpenFolder; + if(DoButton_Menu(&s_ButtonOpenFolder, Localize("Videos directory"), 0, &OpenFolder)) + { + if(!open_file(aSaveFolder)) + { + dbg_msg("menus", "couldn't open file '%s'", aBuf); + } + } + + static CButtonContainer s_ButtonOk; + if(DoButton_Menu(&s_ButtonOk, Localize("Ok"), 0, &Ok) || UI()->ConsumeHotkey(CUI::HOTKEY_ENTER)) + { + m_Popup = POPUP_NONE; + m_DemoRenderInput.Clear(); + } + + Box.HSplitBottom(160.f, &Box, &Part); + + Part.VSplitLeft(60.0f, 0, &TextBox); + TextBox.VSplitLeft(20.0f, 0, &TextBox); + TextBox.VSplitRight(60.0f, &TextBox, 0); + + str_format(aBuf, sizeof(aBuf), Localize("Video was saved to '%s'"), aFilePath); + + UI()->DoLabel(&TextBox, aBuf, 18.0f, TEXTALIGN_LEFT); + } #endif else if(m_Popup == POPUP_FIRST_LAUNCH) { diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index dcf154d65..ee0a28f73 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -652,6 +652,7 @@ public: POPUP_LANGUAGE, POPUP_RENAME_DEMO, POPUP_RENDER_DEMO, + POPUP_RENDER_DONE, POPUP_PASSWORD, POPUP_QUIT, POPUP_WARNING, diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 87bb6caf4..102530882 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -986,6 +986,13 @@ void CMenus::RenderDemoList(CUIRect MainView) s_Inited = 1; } +#if defined(CONF_VIDEORECORDER) + if(m_DemoRenderInput.GetLength() > 0) + { + m_Popup = POPUP_RENDER_DONE; + } +#endif + char aFooterLabel[128] = {0}; if(m_DemolistSelectedIndex >= 0) {