Merge pull request #7342 from Robyt3/Demo-Render-Slice-Disable

Disable demo slice button while demo is being rendered
This commit is contained in:
Dennis Felsing 2023-10-13 21:58:19 +00:00 committed by GitHub
commit c4a6955fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -678,10 +678,15 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
GameClient()->m_Tooltips.DoToolTip(&s_SliceEndButton, &Button, Localize("Mark the end of a cut (right click to reset)"));
// slice save button
#if defined(CONF_VIDEORECORDER)
const bool SliceEnabled = IVideo::Current() == nullptr;
#else
const bool SliceEnabled = true;
#endif
ButtonBar.VSplitLeft(Margins, nullptr, &ButtonBar);
ButtonBar.VSplitLeft(ButtonbarHeight, &Button, &ButtonBar);
static CButtonContainer s_SliceSaveButton;
if(DoButton_FontIcon(&s_SliceSaveButton, FONT_ICON_ARROW_UP_RIGHT_FROM_SQUARE, 0, &Button, IGraphics::CORNER_ALL))
if(DoButton_FontIcon(&s_SliceSaveButton, FONT_ICON_ARROW_UP_RIGHT_FROM_SQUARE, 0, &Button, IGraphics::CORNER_ALL, SliceEnabled) && SliceEnabled)
{
char aDemoName[IO_MAX_PATH_LENGTH];
DemoPlayer()->GetDemoName(aDemoName, sizeof(aDemoName));