mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Disable demo slice button while demo is being rendered
There is no reason to slice a demo while currently rendering it and it may cause issues because multiple demo players would access the same `IVideo` instance.
This commit is contained in:
parent
151394630f
commit
172f316a40
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue