main_gui.c
changeset 763 ced9fcae239d
parent 758 423ae0bcba07
child 774 bb9ec520a1b1
equal deleted inserted replaced
762:ef014856bd88 763:ced9fcae239d
   150 {
   150 {
   151 	_fast_forward ^= true;
   151 	_fast_forward ^= true;
   152 	SndPlayFx(SND_15_BEEP);
   152 	SndPlayFx(SND_15_BEEP);
   153 }
   153 }
   154 
   154 
   155 /* It is possible that a stickied window gets to a position where the 
       
   156  * 'close' button is outside the gaming area. You cannot close it then; except
       
   157  * with this function. It closes all windows calling the standard function,
       
   158  * then, does a little hacked loop of closing all stickied windows. Note
       
   159  * that standard windows (status bar, etc.) are not stickied, so these aren't affected */
       
   160 static void CloseEveryWindow(void)
       
   161 {
       
   162 	Window *w;
       
   163 	// Delete every window except for stickied ones
       
   164 	DeleteNonVitalWindows();
       
   165 	// Delete all sticked windows
       
   166 	for (w = _windows; w != _last_window;) {
       
   167 		if (w->flags4 & WF_STICKY) {
       
   168 			DeleteWindow(w);
       
   169 			w = _windows;
       
   170 		} else
       
   171 			w++;
       
   172 	}
       
   173 }
       
   174 
       
   175 typedef void MenuClickedProc(int index);
   155 typedef void MenuClickedProc(int index);
   176 
   156 
   177 
   157 
   178 static void MenuClickSettings(int index)
   158 static void MenuClickSettings(int index)
   179 {
   159 {
   181 	case 0: ShowGameOptions(); return;
   161 	case 0: ShowGameOptions(); return;
   182 	case 1: ShowGameDifficulty(); return;
   162 	case 1: ShowGameDifficulty(); return;
   183 	case 2: ShowPatchesSelection(); return;
   163 	case 2: ShowPatchesSelection(); return;
   184 	case 3: ShowNewgrf(); return;
   164 	case 3: ShowNewgrf(); return;
   185 
   165 
   186 	case 5: CloseEveryWindow(); return; 
   166 	case 5: DeleteAllNonVitalWindows(); return; 
   187 	case 6: _display_opt ^= DO_SHOW_TOWN_NAMES; MarkWholeScreenDirty(); return;
   167 	case 6: _display_opt ^= DO_SHOW_TOWN_NAMES; MarkWholeScreenDirty(); return;
   188 	case 7: _display_opt ^= DO_SHOW_STATION_NAMES; MarkWholeScreenDirty(); return;
   168 	case 7: _display_opt ^= DO_SHOW_STATION_NAMES; MarkWholeScreenDirty(); return;
   189 	case 8: _display_opt ^= DO_SHOW_SIGNS; MarkWholeScreenDirty(); return;
   169 	case 8: _display_opt ^= DO_SHOW_SIGNS; MarkWholeScreenDirty(); return;
   190 	case 9: _display_opt ^= DO_WAYPOINTS; MarkWholeScreenDirty(); return;
   170 	case 9: _display_opt ^= DO_WAYPOINTS; MarkWholeScreenDirty(); return;
   191 	case 10: _display_opt ^= DO_FULL_ANIMATION; MarkWholeScreenDirty(); return;
   171 	case 10: _display_opt ^= DO_FULL_ANIMATION; MarkWholeScreenDirty(); return;
  2328 			break;
  2308 			break;
  2329 		}
  2309 		}
  2330 
  2310 
  2331 		case WKC_ESC: ResetObjectToPlace(); break;
  2311 		case WKC_ESC: ResetObjectToPlace(); break;
  2332 		case WKC_DELETE: DeleteNonVitalWindows(); break;
  2312 		case WKC_DELETE: DeleteNonVitalWindows(); break;
       
  2313 		case WKC_DELETE | WKC_SHIFT: DeleteAllNonVitalWindows(); break;
  2333 		case 'Q' | WKC_CTRL: AskExitGame(); break;
  2314 		case 'Q' | WKC_CTRL: AskExitGame(); break;
  2334 		case 'Q' | WKC_META: AskExitGame(); break; // this enables command + Q on mac
  2315 		case 'Q' | WKC_META: AskExitGame(); break; // this enables command + Q on mac
  2335 		case 'R' | WKC_CTRL: MarkWholeScreenDirty(); break;
  2316 		case 'R' | WKC_CTRL: MarkWholeScreenDirty(); break;
  2336 		case '0' | WKC_ALT:
  2317 		case '0' | WKC_ALT:
  2337 		case '1' | WKC_ALT:
  2318 		case '1' | WKC_ALT: