From 69209c38968c6f4066a772e0a51a2928749217de Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 19:00:23 +0000 Subject: Re-indenting the code to use standard tabs. Yes, I know this is pretty pointless, but who cares? --- Stars45/OptDlg.cpp | 362 ++++++++++++++++++++++++++--------------------------- 1 file changed, 181 insertions(+), 181 deletions(-) (limited to 'Stars45/OptDlg.cpp') diff --git a/Stars45/OptDlg.cpp b/Stars45/OptDlg.cpp index e750a9b..8338233 100644 --- a/Stars45/OptDlg.cpp +++ b/Stars45/OptDlg.cpp @@ -1,15 +1,15 @@ /* Project Starshatter 4.5 - Destroyer Studios LLC - Copyright © 1997-2004. All Rights Reserved. + Destroyer Studios LLC + Copyright © 1997-2004. All Rights Reserved. - SUBSYSTEM: Stars.exe - FILE: OptDlg.cpp - AUTHOR: John DiCamillo + SUBSYSTEM: Stars.exe + FILE: OptDlg.cpp + AUTHOR: John DiCamillo - OVERVIEW - ======== - Main Menu Dialog Active Window class + OVERVIEW + ======== + Main Menu Dialog Active Window class */ #include "MemDebug.h" @@ -44,11 +44,11 @@ DEF_MAP_CLIENT(OptDlg, OnMod); // +--------------------------------------------------------------------+ OptDlg::OptDlg(Screen* s, FormDef& def, BaseScreen* mgr) - : FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr), - apply(0), cancel(0), vid_btn(0), aud_btn(0), ctl_btn(0), opt_btn(0), mod_btn(0), - closed(true) +: FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr), +apply(0), cancel(0), vid_btn(0), aud_btn(0), ctl_btn(0), opt_btn(0), mod_btn(0), +closed(true) { - Init(def); + Init(def); } OptDlg::~OptDlg() @@ -60,92 +60,92 @@ OptDlg::~OptDlg() void OptDlg::RegisterControls() { - if (apply) - return; - - flight_model = (ComboBox*) FindControl(201); - flying_start = (ComboBox*) FindControl(211); - landings = (ComboBox*) FindControl(202); - ai_difficulty = (ComboBox*) FindControl(203); - hud_mode = (ComboBox*) FindControl(204); - hud_color = (ComboBox*) FindControl(205); - ff_mode = (ComboBox*) FindControl(206); - grid_mode = (ComboBox*) FindControl(207); - gunsight = (ComboBox*) FindControl(208); - description = FindControl(500); - apply = (Button*) FindControl(1); - cancel = (Button*) FindControl(2); - vid_btn = (Button*) FindControl(901); - aud_btn = (Button*) FindControl(902); - ctl_btn = (Button*) FindControl(903); - opt_btn = (Button*) FindControl(904); - mod_btn = (Button*) FindControl(905); - - if (flight_model) { - REGISTER_CLIENT(EID_MOUSE_ENTER, flight_model, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, flight_model, OptDlg, OnExit); - } - - if (flying_start) { - REGISTER_CLIENT(EID_MOUSE_ENTER, flying_start, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, flying_start, OptDlg, OnExit); - } - - if (landings) { - REGISTER_CLIENT(EID_MOUSE_ENTER, landings, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, landings, OptDlg, OnExit); - } - - if (ai_difficulty) { - REGISTER_CLIENT(EID_MOUSE_ENTER, ai_difficulty, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, ai_difficulty, OptDlg, OnExit); - } - - if (hud_mode) { - REGISTER_CLIENT(EID_MOUSE_ENTER, hud_mode, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, hud_mode, OptDlg, OnExit); - } - - if (hud_color) { - REGISTER_CLIENT(EID_MOUSE_ENTER, hud_color, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, hud_color, OptDlg, OnExit); - } - - if (ff_mode) { - REGISTER_CLIENT(EID_MOUSE_ENTER, ff_mode, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, ff_mode, OptDlg, OnExit); - } - - if (grid_mode) { - REGISTER_CLIENT(EID_MOUSE_ENTER, grid_mode, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, grid_mode, OptDlg, OnExit); - } - - if (gunsight) { - REGISTER_CLIENT(EID_MOUSE_ENTER, gunsight, OptDlg, OnEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, gunsight, OptDlg, OnExit); - } - - if (apply) - REGISTER_CLIENT(EID_CLICK, apply, OptDlg, OnApply); - - if (cancel) - REGISTER_CLIENT(EID_CLICK, cancel, OptDlg, OnCancel); - - if (vid_btn) - REGISTER_CLIENT(EID_CLICK, vid_btn, OptDlg, OnVideo); - - if (aud_btn) - REGISTER_CLIENT(EID_CLICK, aud_btn, OptDlg, OnAudio); - - if (ctl_btn) - REGISTER_CLIENT(EID_CLICK, ctl_btn, OptDlg, OnControls); - - if (opt_btn) - REGISTER_CLIENT(EID_CLICK, opt_btn, OptDlg, OnOptions); - - if (mod_btn) - REGISTER_CLIENT(EID_CLICK, mod_btn, OptDlg, OnMod); + if (apply) + return; + + flight_model = (ComboBox*) FindControl(201); + flying_start = (ComboBox*) FindControl(211); + landings = (ComboBox*) FindControl(202); + ai_difficulty = (ComboBox*) FindControl(203); + hud_mode = (ComboBox*) FindControl(204); + hud_color = (ComboBox*) FindControl(205); + ff_mode = (ComboBox*) FindControl(206); + grid_mode = (ComboBox*) FindControl(207); + gunsight = (ComboBox*) FindControl(208); + description = FindControl(500); + apply = (Button*) FindControl(1); + cancel = (Button*) FindControl(2); + vid_btn = (Button*) FindControl(901); + aud_btn = (Button*) FindControl(902); + ctl_btn = (Button*) FindControl(903); + opt_btn = (Button*) FindControl(904); + mod_btn = (Button*) FindControl(905); + + if (flight_model) { + REGISTER_CLIENT(EID_MOUSE_ENTER, flight_model, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, flight_model, OptDlg, OnExit); + } + + if (flying_start) { + REGISTER_CLIENT(EID_MOUSE_ENTER, flying_start, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, flying_start, OptDlg, OnExit); + } + + if (landings) { + REGISTER_CLIENT(EID_MOUSE_ENTER, landings, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, landings, OptDlg, OnExit); + } + + if (ai_difficulty) { + REGISTER_CLIENT(EID_MOUSE_ENTER, ai_difficulty, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, ai_difficulty, OptDlg, OnExit); + } + + if (hud_mode) { + REGISTER_CLIENT(EID_MOUSE_ENTER, hud_mode, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, hud_mode, OptDlg, OnExit); + } + + if (hud_color) { + REGISTER_CLIENT(EID_MOUSE_ENTER, hud_color, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, hud_color, OptDlg, OnExit); + } + + if (ff_mode) { + REGISTER_CLIENT(EID_MOUSE_ENTER, ff_mode, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, ff_mode, OptDlg, OnExit); + } + + if (grid_mode) { + REGISTER_CLIENT(EID_MOUSE_ENTER, grid_mode, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, grid_mode, OptDlg, OnExit); + } + + if (gunsight) { + REGISTER_CLIENT(EID_MOUSE_ENTER, gunsight, OptDlg, OnEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, gunsight, OptDlg, OnExit); + } + + if (apply) + REGISTER_CLIENT(EID_CLICK, apply, OptDlg, OnApply); + + if (cancel) + REGISTER_CLIENT(EID_CLICK, cancel, OptDlg, OnCancel); + + if (vid_btn) + REGISTER_CLIENT(EID_CLICK, vid_btn, OptDlg, OnVideo); + + if (aud_btn) + REGISTER_CLIENT(EID_CLICK, aud_btn, OptDlg, OnAudio); + + if (ctl_btn) + REGISTER_CLIENT(EID_CLICK, ctl_btn, OptDlg, OnControls); + + if (opt_btn) + REGISTER_CLIENT(EID_CLICK, opt_btn, OptDlg, OnOptions); + + if (mod_btn) + REGISTER_CLIENT(EID_CLICK, mod_btn, OptDlg, OnMod); } // +--------------------------------------------------------------------+ @@ -153,51 +153,51 @@ OptDlg::RegisterControls() void OptDlg::Show() { - FormWindow::Show(); + FormWindow::Show(); - if (closed) { - Starshatter* stars = Starshatter::GetInstance(); + if (closed) { + Starshatter* stars = Starshatter::GetInstance(); - if (stars) { - if (flight_model) - flight_model->SetSelection(Ship::GetFlightModel()); + if (stars) { + if (flight_model) + flight_model->SetSelection(Ship::GetFlightModel()); - if (landings) - landings->SetSelection(Ship::GetLandingModel()); + if (landings) + landings->SetSelection(Ship::GetLandingModel()); - if (hud_mode) - hud_mode->SetSelection(HUDView::IsArcade() ? 1 : 0); + if (hud_mode) + hud_mode->SetSelection(HUDView::IsArcade() ? 1 : 0); - if (hud_color) - hud_color->SetSelection(HUDView::DefaultColorSet()); + if (hud_color) + hud_color->SetSelection(HUDView::DefaultColorSet()); - if (ff_mode) - ff_mode->SetSelection((int) (Ship::GetFriendlyFireLevel() * 4)); - } + if (ff_mode) + ff_mode->SetSelection((int) (Ship::GetFriendlyFireLevel() * 4)); + } - Player* player = Player::GetCurrentPlayer(); - if (player) { - if (flying_start) - flying_start->SetSelection(player->FlyingStart()); + Player* player = Player::GetCurrentPlayer(); + if (player) { + if (flying_start) + flying_start->SetSelection(player->FlyingStart()); - if (ai_difficulty) - ai_difficulty->SetSelection(ai_difficulty->NumItems() - player->AILevel() - 1); + if (ai_difficulty) + ai_difficulty->SetSelection(ai_difficulty->NumItems() - player->AILevel() - 1); - if (grid_mode) - grid_mode->SetSelection(player->GridMode()); + if (grid_mode) + grid_mode->SetSelection(player->GridMode()); - if (gunsight) - gunsight->SetSelection(player->Gunsight()); - } - } + if (gunsight) + gunsight->SetSelection(player->Gunsight()); + } + } - if (vid_btn) vid_btn->SetButtonState(0); - if (aud_btn) aud_btn->SetButtonState(0); - if (ctl_btn) ctl_btn->SetButtonState(0); - if (opt_btn) opt_btn->SetButtonState(1); - if (mod_btn) mod_btn->SetButtonState(0); + if (vid_btn) vid_btn->SetButtonState(0); + if (aud_btn) aud_btn->SetButtonState(0); + if (ctl_btn) ctl_btn->SetButtonState(0); + if (opt_btn) opt_btn->SetButtonState(1); + if (mod_btn) mod_btn->SetButtonState(0); - closed = false; + closed = false; } // +--------------------------------------------------------------------+ @@ -205,9 +205,9 @@ OptDlg::Show() void OptDlg::ExecFrame() { - if (Keyboard::KeyDown(VK_RETURN)) { - OnApply(0); - } + if (Keyboard::KeyDown(VK_RETURN)) { + OnApply(0); + } } // +--------------------------------------------------------------------+ @@ -223,13 +223,13 @@ void OptDlg::OnMod(AWEvent* event) { manager->ShowModDlg(); } void OptDlg::OnApply(AWEvent* event) { - manager->ApplyOptions(); + manager->ApplyOptions(); } void OptDlg::OnCancel(AWEvent* event) { - manager->CancelOptions(); + manager->CancelOptions(); } // +--------------------------------------------------------------------+ @@ -237,22 +237,22 @@ OptDlg::OnCancel(AWEvent* event) void OptDlg::OnEnter(AWEvent* event) { - ActiveWindow* src = event->window; + ActiveWindow* src = event->window; - if (src && description) - description->SetText(src->GetAltText()); + if (src && description) + description->SetText(src->GetAltText()); } void OptDlg::OnExit(AWEvent* event) { - ComboBox* cmb = (ComboBox*) event->window; + ComboBox* cmb = (ComboBox*) event->window; - if (!cmb || cmb->IsListShowing()) - return; + if (!cmb || cmb->IsListShowing()) + return; - if (description) - description->SetText(""); + if (description) + description->SetText(""); } // +--------------------------------------------------------------------+ @@ -260,63 +260,63 @@ OptDlg::OnExit(AWEvent* event) void OptDlg::Apply() { - if (closed) return; + if (closed) return; - Player* player = Player::GetCurrentPlayer(); - if (player) { - if (flight_model) - player->SetFlightModel(flight_model->GetSelectedIndex()); + Player* player = Player::GetCurrentPlayer(); + if (player) { + if (flight_model) + player->SetFlightModel(flight_model->GetSelectedIndex()); - if (flying_start) - player->SetFlyingStart(flying_start->GetSelectedIndex()); + if (flying_start) + player->SetFlyingStart(flying_start->GetSelectedIndex()); - if (landings) - player->SetLandingModel(landings->GetSelectedIndex()); + if (landings) + player->SetLandingModel(landings->GetSelectedIndex()); - if (ai_difficulty) - player->SetAILevel(ai_difficulty->NumItems() - ai_difficulty->GetSelectedIndex() - 1); + if (ai_difficulty) + player->SetAILevel(ai_difficulty->NumItems() - ai_difficulty->GetSelectedIndex() - 1); - if (hud_mode) - player->SetHUDMode(hud_mode->GetSelectedIndex()); + if (hud_mode) + player->SetHUDMode(hud_mode->GetSelectedIndex()); - if (hud_color) - player->SetHUDColor(hud_color->GetSelectedIndex()); + if (hud_color) + player->SetHUDColor(hud_color->GetSelectedIndex()); - if (ff_mode) - player->SetFriendlyFire(ff_mode->GetSelectedIndex()); + if (ff_mode) + player->SetFriendlyFire(ff_mode->GetSelectedIndex()); - if (grid_mode) - player->SetGridMode(grid_mode->GetSelectedIndex()); + if (grid_mode) + player->SetGridMode(grid_mode->GetSelectedIndex()); - if (gunsight) - player->SetGunsight(gunsight->GetSelectedIndex()); + if (gunsight) + player->SetGunsight(gunsight->GetSelectedIndex()); - Player::Save(); - } + Player::Save(); + } - if (flight_model) - Ship::SetFlightModel(flight_model->GetSelectedIndex()); + if (flight_model) + Ship::SetFlightModel(flight_model->GetSelectedIndex()); - if (landings) - Ship::SetLandingModel(landings->GetSelectedIndex()); + if (landings) + Ship::SetLandingModel(landings->GetSelectedIndex()); - if (hud_mode) - HUDView::SetArcade(hud_mode->GetSelectedIndex() > 0); + if (hud_mode) + HUDView::SetArcade(hud_mode->GetSelectedIndex() > 0); - if (hud_color) - HUDView::SetDefaultColorSet(hud_color->GetSelectedIndex()); + if (hud_color) + HUDView::SetDefaultColorSet(hud_color->GetSelectedIndex()); - if (ff_mode) - Ship::SetFriendlyFireLevel(ff_mode->GetSelectedIndex() / 4.0); + if (ff_mode) + Ship::SetFriendlyFireLevel(ff_mode->GetSelectedIndex() / 4.0); - HUDView* hud = HUDView::GetInstance(); - if (hud) hud->SetHUDColorSet(hud_color->GetSelectedIndex()); + HUDView* hud = HUDView::GetInstance(); + if (hud) hud->SetHUDColorSet(hud_color->GetSelectedIndex()); - closed = true; + closed = true; } void OptDlg::Cancel() { - closed = true; + closed = true; } -- cgit v1.1