Hide screenshot window when taking normal screesnhot
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "landscape.h"
|
||||
#include "smallmap_colours.h"
|
||||
#include "smallmap_gui.h"
|
||||
#include "screenshot_gui.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
@@ -920,8 +921,10 @@ bool MakeScreenshot(ScreenshotType t, const char *name)
|
||||
* of the screenshot. This way the screenshot will always show the name
|
||||
* of the previous screenshot in the 'successful' message instead of the
|
||||
* name of the new screenshot (or an empty name). */
|
||||
SetScreenshotWindowHidden(true);
|
||||
UndrawMouseCursor();
|
||||
DrawDirtyBlocks();
|
||||
SetScreenshotWindowHidden(false);
|
||||
}
|
||||
|
||||
_screenshot_name[0] = '\0';
|
||||
|
@@ -72,3 +72,17 @@ void ShowScreenshotWindow()
|
||||
DeleteWindowById(WC_SCREENSHOT, 0);
|
||||
new ScreenshotWindow(&_screenshot_window_desc);
|
||||
}
|
||||
|
||||
void SetScreenshotWindowHidden(bool hidden)
|
||||
{
|
||||
ScreenshotWindow *scw = (ScreenshotWindow *) FindWindowById(WC_SCREENSHOT, 0);
|
||||
if (scw != nullptr) {
|
||||
if (hidden) {
|
||||
scw->SetDirtyAsBlocks();
|
||||
SetBit(scw->left, 30);
|
||||
} else {
|
||||
ClrBit(scw->left, 30);
|
||||
scw->SetDirtyAsBlocks();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,5 +11,6 @@
|
||||
#define SCREENSHOT_GUI_H
|
||||
|
||||
void ShowScreenshotWindow();
|
||||
void SetScreenshotWindowHidden(bool hidden);
|
||||
|
||||
#endif /* SCREENSHOT_GUI_H */
|
||||
|
Reference in New Issue
Block a user