Changeset - r8190:61d1e611ed9b
[Not reviewed]
master
0 1 0
belugas - 16 years ago 2008-01-04 03:11:36
belugas@openttd.org
(svn r11753) -Codechange: re-indent the switch case structures, as to be more code style oriented.
Hoping it makes the whole file easier to follow/read
1 file changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/settings_gui.cpp
Show inline comments
 
@@ -521,13 +521,12 @@ static void GameDifficultyWndProc(Window
 
			GDW_LVL_HARD,
 
			GDW_LVL_CUSTOM,
 
			WIDGET_LIST_END);
 
		w->SetWidgetDisabledState(GDW_HIGHSCORE, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
 
		w->SetWidgetDisabledState(GDW_ACCEPT, _networking && !_network_server); // Save-button in multiplayer (and if client)
 
		w->LowerWidget(GDW_LVL_EASY + _opt_mod_temp.diff_level);
 

	
 
		break;
 

	
 
	case WE_PAINT: {
 
		DrawWindowWidgets(w);
 

	
 
		/* XXX - Disabled buttons in normal gameplay or during muliplayer as non server.
 
@@ -929,14 +928,13 @@ static void PatchesSelectionWndProc(Wind
 
					SetDParam(1, value);
 
				}
 
			}
 
			DrawString(30, y, (sdb->str) + disabled, TC_FROMSTRING);
 
			y += 11;
 
		}
 
		break;
 
	}
 
		} break;
 

	
 
	case WE_CLICK:
 
		switch (e->we.click.widget) {
 
		case PATCHSEL_OPTIONSPANEL: {
 
			const PatchPage *page = &_patches_page[WP(w, def_d).data_1];
 
			const SettingDesc *sd;
 
@@ -1035,26 +1033,25 @@ static void PatchesSelectionWndProc(Wind
 

	
 
	case WE_TIMEOUT:
 
		WP(w, def_d).data_2 = 0;
 
		SetWindowDirty(w);
 
		break;
 

	
 
	case WE_ON_EDIT_TEXT: {
 
		case WE_ON_EDIT_TEXT:
 
		if (e->we.edittext.str != NULL) {
 
			const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w,def_d).data_3];
 
			const SettingDesc *sd = pe->setting;
 
			int32 value = atoi(e->we.edittext.str);
 

	
 
			/* Save the correct currency-translated value */
 
			if (sd->desc.flags & SGF_CURRENCY) value /= _currency->rate;
 

	
 
			SetPatchValue(pe->index, patches_ptr, value);
 
			SetWindowDirty(w);
 
		}
 
		break;
 
	}
 

	
 
	case WE_DESTROY:
 
		DeleteWindowById(WC_QUERY_STRING, 0);
 
		break;
 
	}
 
}
0 comments (0 inline, 0 general)