src/misc_gui.cpp
changeset 10426 4a77f7049b5e
parent 10310 ca2eb5811a07
equal deleted inserted replaced
10425:4a880a6ab2ac 10426:4a77f7049b5e
  1066 struct QueryStringWindow : public QueryStringBaseWindow
  1066 struct QueryStringWindow : public QueryStringBaseWindow
  1067 {
  1067 {
  1068 	QueryStringWindow(uint16 size, const WindowDesc *desc, Window *parent) : QueryStringBaseWindow(size, desc)
  1068 	QueryStringWindow(uint16 size, const WindowDesc *desc, Window *parent) : QueryStringBaseWindow(size, desc)
  1069 	{
  1069 	{
  1070 		this->parent = parent;
  1070 		this->parent = parent;
  1071 		SetBit(_no_scroll, SCROLL_EDIT);
       
  1072 
  1071 
  1073 		this->FindWindowPlacementAndResize(desc);
  1072 		this->FindWindowPlacementAndResize(desc);
  1074 	}
  1073 	}
  1075 
  1074 
  1076 	virtual void OnPaint()
  1075 	virtual void OnPaint()
  1140 		if (!this->handled && this->parent != NULL) {
  1139 		if (!this->handled && this->parent != NULL) {
  1141 			Window *parent = this->parent;
  1140 			Window *parent = this->parent;
  1142 			this->parent = NULL; // so parent doesn't try to delete us again
  1141 			this->parent = NULL; // so parent doesn't try to delete us again
  1143 			parent->OnQueryTextFinished(NULL);
  1142 			parent->OnQueryTextFinished(NULL);
  1144 		}
  1143 		}
  1145 		ClrBit(_no_scroll, SCROLL_EDIT);
       
  1146 	}
  1144 	}
  1147 };
  1145 };
  1148 
  1146 
  1149 static const Widget _query_string_widgets[] = {
  1147 static const Widget _query_string_widgets[] = {
  1150 {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,        STR_018B_CLOSE_WINDOW},
  1148 {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,        STR_018B_CLOSE_WINDOW},
  1441 			STR_0299_SAVE_SCENARIO,
  1439 			STR_0299_SAVE_SCENARIO,
  1442 			STR_LOAD_HEIGHTMAP,
  1440 			STR_LOAD_HEIGHTMAP,
  1443 		};
  1441 		};
  1444 
  1442 
  1445 		SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);
  1443 		SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);
  1446 		SetBit(_no_scroll, SCROLL_SAVE);
       
  1447 
  1444 
  1448 		/* Use an array to define what will be the current file type being handled
  1445 		/* Use an array to define what will be the current file type being handled
  1449 		 * by current file mode */
  1446 		 * by current file mode */
  1450 		switch (mode) {
  1447 		switch (mode) {
  1451 			case SLD_SAVE_GAME:     this->GenerateFileName(); break;
  1448 			case SLD_SAVE_GAME:     this->GenerateFileName(); break;
  1503 		/* pause is only used in single-player, non-editor mode, non menu mode */
  1500 		/* pause is only used in single-player, non-editor mode, non menu mode */
  1504 		if (!_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) {
  1501 		if (!_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) {
  1505 			if (_pause_game >= 0) DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
  1502 			if (_pause_game >= 0) DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
  1506 		}
  1503 		}
  1507 		FiosFreeSavegameList();
  1504 		FiosFreeSavegameList();
  1508 		ClrBit(_no_scroll, SCROLL_SAVE);
       
  1509 	}
  1505 	}
  1510 
  1506 
  1511 	virtual void OnPaint()
  1507 	virtual void OnPaint()
  1512 	{
  1508 	{
  1513 		int y;
  1509 		int y;