Cleanup: Give `TakeScreenshot` a more sensible name

pull/167/head
TechGeekNZ 4 years ago committed by Charles Pigott
parent ed6f31f601
commit 3c8d0aa354

@ -845,12 +845,12 @@ static void ScreenshotConfirmationCallback(Window *w, bool confirmed)
} }
/** /**
* Take a screenshot. * Make a screenshot.
* Ask for confirmation if the screenshot will be huge. Delegates to \c MakeScreenshot to perform the action. * Ask for confirmation first if the screenshot will be huge.
* @param t Screenshot type: World, defaultzoom, heightmap or viewport screenshot * @param t Screenshot type: World, defaultzoom, heightmap or viewport screenshot
* @see MakeScreenshot * @see MakeScreenshot
*/ */
void TakeScreenshot(ScreenshotType t) void MakeScreenshotWithConfirm(ScreenshotType t)
{ {
ViewPort vp; ViewPort vp;
SetupScreenshotViewport(t, &vp); SetupScreenshotViewport(t, &vp);
@ -868,11 +868,11 @@ void TakeScreenshot(ScreenshotType t)
/** /**
* Make a screenshot. * Make a screenshot.
* No questions asked, just do it. * Unconditionally take a screenshot of the requested type.
* @param t the type of screenshot to make. * @param t the type of screenshot to make.
* @param name the name to give to the screenshot. * @param name the name to give to the screenshot.
* @return true iff the screenshot was made successfully * @return true iff the screenshot was made successfully
* @see TakeScreenshot * @see MakeScreenshotWithConfirm
*/ */
bool MakeScreenshot(ScreenshotType t, const char *name) bool MakeScreenshot(ScreenshotType t, const char *name)
{ {

@ -27,7 +27,7 @@ enum ScreenshotType {
void SetupScreenshotViewport(ScreenshotType t, struct ViewPort *vp); void SetupScreenshotViewport(ScreenshotType t, struct ViewPort *vp);
bool MakeHeightmapScreenshot(const char *filename); bool MakeHeightmapScreenshot(const char *filename);
void TakeScreenshot(ScreenshotType t); void MakeScreenshotWithConfirm(ScreenshotType t);
bool MakeScreenshot(ScreenshotType t, const char *name); bool MakeScreenshot(ScreenshotType t, const char *name);
bool MakeMinimapWorldScreenshot(); bool MakeMinimapWorldScreenshot();

@ -39,7 +39,7 @@ struct ScreenshotWindow : Window {
case WID_SC_TAKE_HEIGHTMAP: st = SC_HEIGHTMAP; break; case WID_SC_TAKE_HEIGHTMAP: st = SC_HEIGHTMAP; break;
case WID_SC_TAKE_MINIMAP: st = SC_MINIMAP; break; case WID_SC_TAKE_MINIMAP: st = SC_MINIMAP; break;
} }
TakeScreenshot(st); MakeScreenshotWithConfirm(st);
} }
}; };

@ -2086,10 +2086,10 @@ struct MainToolbarWindow : Window {
case MTHK_BUILD_TREES: ShowBuildTreesToolbar(); break; case MTHK_BUILD_TREES: ShowBuildTreesToolbar(); break;
case MTHK_MUSIC: ShowMusicWindow(); break; case MTHK_MUSIC: ShowMusicWindow(); break;
case MTHK_AI_DEBUG: ShowAIDebugWindow(); break; case MTHK_AI_DEBUG: ShowAIDebugWindow(); break;
case MTHK_SMALL_SCREENSHOT: TakeScreenshot(SC_VIEWPORT); break; case MTHK_SMALL_SCREENSHOT: MakeScreenshotWithConfirm(SC_VIEWPORT); break;
case MTHK_ZOOMEDIN_SCREENSHOT: TakeScreenshot(SC_ZOOMEDIN); break; case MTHK_ZOOMEDIN_SCREENSHOT: MakeScreenshotWithConfirm(SC_ZOOMEDIN); break;
case MTHK_DEFAULTZOOM_SCREENSHOT: TakeScreenshot(SC_DEFAULTZOOM); break; case MTHK_DEFAULTZOOM_SCREENSHOT: MakeScreenshotWithConfirm(SC_DEFAULTZOOM); break;
case MTHK_GIANT_SCREENSHOT: TakeScreenshot(SC_WORLD); break; case MTHK_GIANT_SCREENSHOT: MakeScreenshotWithConfirm(SC_WORLD); break;
case MTHK_CHEATS: if (!_networking) ShowCheatWindow(); break; case MTHK_CHEATS: if (!_networking) ShowCheatWindow(); break;
case MTHK_TERRAFORM: ShowTerraformToolbar(); break; case MTHK_TERRAFORM: ShowTerraformToolbar(); break;
case MTHK_EXTRA_VIEWPORT: ShowExtraViewPortWindowForTileUnderCursor(); break; case MTHK_EXTRA_VIEWPORT: ShowExtraViewPortWindowForTileUnderCursor(); break;
@ -2461,10 +2461,10 @@ struct ScenarioEditorToolbarWindow : Window {
case MTEHK_SIGN: cbf = ToolbarScenPlaceSign(this); break; case MTEHK_SIGN: cbf = ToolbarScenPlaceSign(this); break;
case MTEHK_MUSIC: ShowMusicWindow(); break; case MTEHK_MUSIC: ShowMusicWindow(); break;
case MTEHK_LANDINFO: cbf = PlaceLandBlockInfo(); break; case MTEHK_LANDINFO: cbf = PlaceLandBlockInfo(); break;
case MTEHK_SMALL_SCREENSHOT: TakeScreenshot(SC_VIEWPORT); break; case MTEHK_SMALL_SCREENSHOT: MakeScreenshotWithConfirm(SC_VIEWPORT); break;
case MTEHK_ZOOMEDIN_SCREENSHOT: TakeScreenshot(SC_ZOOMEDIN); break; case MTEHK_ZOOMEDIN_SCREENSHOT: MakeScreenshotWithConfirm(SC_ZOOMEDIN); break;
case MTEHK_DEFAULTZOOM_SCREENSHOT: TakeScreenshot(SC_DEFAULTZOOM); break; case MTEHK_DEFAULTZOOM_SCREENSHOT: MakeScreenshotWithConfirm(SC_DEFAULTZOOM); break;
case MTEHK_GIANT_SCREENSHOT: TakeScreenshot(SC_WORLD); break; case MTEHK_GIANT_SCREENSHOT: MakeScreenshotWithConfirm(SC_WORLD); break;
case MTEHK_ZOOM_IN: ToolbarZoomInClick(this); break; case MTEHK_ZOOM_IN: ToolbarZoomInClick(this); break;
case MTEHK_ZOOM_OUT: ToolbarZoomOutClick(this); break; case MTEHK_ZOOM_OUT: ToolbarZoomOutClick(this); break;
case MTEHK_TERRAFORM: ShowEditorTerraformToolbar(); break; case MTEHK_TERRAFORM: ShowEditorTerraformToolbar(); break;

Loading…
Cancel
Save