equal
deleted
inserted
replaced
1 /* $Id$ */ |
1 /* $Id$ */ |
|
2 |
|
3 /** @file settings_gui.cpp */ |
2 |
4 |
3 #include "stdafx.h" |
5 #include "stdafx.h" |
4 #include "openttd.h" |
6 #include "openttd.h" |
5 #include "currency.h" |
7 #include "currency.h" |
6 #include "functions.h" |
8 #include "functions.h" |
395 enum { |
397 enum { |
396 GAMEDIFF_WND_TOP_OFFSET = 45, |
398 GAMEDIFF_WND_TOP_OFFSET = 45, |
397 GAMEDIFF_WND_ROWSIZE = 9 |
399 GAMEDIFF_WND_ROWSIZE = 9 |
398 }; |
400 }; |
399 |
401 |
400 // Temporary holding place of values in the difficulty window until 'Save' is clicked |
402 /* Temporary holding place of values in the difficulty window until 'Save' is clicked */ |
401 static GameOptions _opt_mod_temp; |
403 static GameOptions _opt_mod_temp; |
402 // 0x383E = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) |
404 // 0x383E = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) |
403 #define DIFF_INGAME_DISABLED_BUTTONS 0x383E |
405 #define DIFF_INGAME_DISABLED_BUTTONS 0x383E |
404 |
406 |
405 static void GameDifficultyWndProc(Window *w, WindowEvent *e) |
407 static void GameDifficultyWndProc(Window *w, WindowEvent *e) |
459 const GameSettingData *info; |
461 const GameSettingData *info; |
460 int x, y; |
462 int x, y; |
461 uint btn, dis; |
463 uint btn, dis; |
462 int16 val; |
464 int16 val; |
463 |
465 |
464 // Don't allow clients to make any changes |
466 /* Don't allow clients to make any changes */ |
465 if (_networking && !_network_server) |
467 if (_networking && !_network_server) |
466 return; |
468 return; |
467 |
469 |
468 x = e->we.click.pt.x - 5; |
470 x = e->we.click.pt.x - 5; |
469 if (!IS_INT_INSIDE(x, 0, 21)) // Button area |
471 if (!IS_INT_INSIDE(x, 0, 21)) // Button area |
471 |
473 |
472 y = e->we.click.pt.y - GAMEDIFF_WND_TOP_OFFSET; |
474 y = e->we.click.pt.y - GAMEDIFF_WND_TOP_OFFSET; |
473 if (y < 0) |
475 if (y < 0) |
474 return; |
476 return; |
475 |
477 |
476 // Get button from Y coord. |
478 /* Get button from Y coord. */ |
477 btn = y / (GAMEDIFF_WND_ROWSIZE + 2); |
479 btn = y / (GAMEDIFF_WND_ROWSIZE + 2); |
478 if (btn >= GAME_DIFFICULTY_NUM || y % (GAMEDIFF_WND_ROWSIZE + 2) >= 9) |
480 if (btn >= GAME_DIFFICULTY_NUM || y % (GAMEDIFF_WND_ROWSIZE + 2) >= 9) |
479 return; |
481 return; |
480 |
482 |
481 // Clicked disabled button? |
483 /* Clicked disabled button? */ |
482 dis = (_game_mode == GM_NORMAL) ? DIFF_INGAME_DISABLED_BUTTONS : 0; |
484 dis = (_game_mode == GM_NORMAL) ? DIFF_INGAME_DISABLED_BUTTONS : 0; |
483 |
485 |
484 if (HASBIT(dis, btn)) |
486 if (HASBIT(dis, btn)) |
485 return; |
487 return; |
486 |
488 |
637 "bribe", |
639 "bribe", |
638 "colored_news_year", |
640 "colored_news_year", |
639 "ending_year", |
641 "ending_year", |
640 "smooth_economy", |
642 "smooth_economy", |
641 "allow_shares", |
643 "allow_shares", |
|
644 "town_growth_rate", |
|
645 "larger_towns", |
642 }; |
646 }; |
643 |
647 |
644 static const char *_patches_ai[] = { |
648 static const char *_patches_ai[] = { |
645 "ainew_active", |
649 "ainew_active", |
646 "ai_in_multiplayer", |
650 "ai_in_multiplayer", |