summaryrefslogtreecommitdiffhomepage
path: root/Stars45/FirstTimeDlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/FirstTimeDlg.cpp')
-rw-r--r--Stars45/FirstTimeDlg.cpp130
1 files changed, 65 insertions, 65 deletions
diff --git a/Stars45/FirstTimeDlg.cpp b/Stars45/FirstTimeDlg.cpp
index 7fb5d10..c457e68 100644
--- a/Stars45/FirstTimeDlg.cpp
+++ b/Stars45/FirstTimeDlg.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: FirstTimeDlg.cpp
- AUTHOR: John DiCamillo
+ SUBSYSTEM: Stars.exe
+ FILE: FirstTimeDlg.cpp
+ AUTHOR: John DiCamillo
- OVERVIEW
- ========
- Main Menu Dialog Active Window class
+ OVERVIEW
+ ========
+ Main Menu Dialog Active Window class
*/
#include "MemDebug.h"
@@ -37,9 +37,9 @@ DEF_MAP_CLIENT(FirstTimeDlg, OnApply);
// +--------------------------------------------------------------------+
FirstTimeDlg::FirstTimeDlg(Screen* s, FormDef& def, MenuScreen* mgr)
- : FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr)
+: FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr)
{
- Init(def);
+ Init(def);
}
FirstTimeDlg::~FirstTimeDlg()
@@ -51,12 +51,12 @@ FirstTimeDlg::~FirstTimeDlg()
void
FirstTimeDlg::RegisterControls()
{
- edt_name = (EditBox*) FindControl(200);
- cmb_playstyle = (ComboBox*) FindControl(201);
- cmb_experience = (ComboBox*) FindControl(202);
+ edt_name = (EditBox*) FindControl(200);
+ cmb_playstyle = (ComboBox*) FindControl(201);
+ cmb_experience = (ComboBox*) FindControl(202);
- btn_apply = (Button*) FindControl(1);
- REGISTER_CLIENT(EID_CLICK, btn_apply, FirstTimeDlg, OnApply);
+ btn_apply = (Button*) FindControl(1);
+ REGISTER_CLIENT(EID_CLICK, btn_apply, FirstTimeDlg, OnApply);
}
// +--------------------------------------------------------------------+
@@ -64,11 +64,11 @@ FirstTimeDlg::RegisterControls()
void
FirstTimeDlg::Show()
{
- if (!IsShown())
- FormWindow::Show();
+ if (!IsShown())
+ FormWindow::Show();
- if (edt_name)
- edt_name->SetText("Noobie");
+ if (edt_name)
+ edt_name->SetText("Noobie");
}
// +--------------------------------------------------------------------+
@@ -83,65 +83,65 @@ FirstTimeDlg::ExecFrame()
void
FirstTimeDlg::OnApply(AWEvent* event)
{
- Starshatter* stars = Starshatter::GetInstance();
- Player* player = Player::GetCurrentPlayer();
+ Starshatter* stars = Starshatter::GetInstance();
+ Player* player = Player::GetCurrentPlayer();
- if (player) {
- if (edt_name) {
- char password[16];
- sprintf(password, "%08x", (DWORD) Random(0, 2e9));
+ if (player) {
+ if (edt_name) {
+ char password[16];
+ sprintf(password, "%08x", (DWORD) Random(0, 2e9));
- player->SetName(edt_name->GetText());
- player->SetPassword(password);
- }
+ player->SetName(edt_name->GetText());
+ player->SetPassword(password);
+ }
- if (cmb_playstyle) {
- // ARCADE:
- if (cmb_playstyle->GetSelectedIndex() == 0) {
- player->SetFlightModel(2);
- player->SetLandingModel(1);
- player->SetHUDMode(0);
- player->SetGunsight(1);
+ if (cmb_playstyle) {
+ // ARCADE:
+ if (cmb_playstyle->GetSelectedIndex() == 0) {
+ player->SetFlightModel(2);
+ player->SetLandingModel(1);
+ player->SetHUDMode(0);
+ player->SetGunsight(1);
- if (stars) {
- KeyMap& keymap = stars->GetKeyMap();
+ if (stars) {
+ KeyMap& keymap = stars->GetKeyMap();
- keymap.Bind(KEY_CONTROL_MODEL, 1, 0);
- keymap.SaveKeyMap("key.cfg", 256);
+ keymap.Bind(KEY_CONTROL_MODEL, 1, 0);
+ keymap.SaveKeyMap("key.cfg", 256);
- stars->MapKeys();
- }
+ stars->MapKeys();
+ }
- Ship::SetControlModel(1);
- }
+ Ship::SetControlModel(1);
+ }
- // HARDCORE:
- else {
- player->SetFlightModel(0);
- player->SetLandingModel(0);
- player->SetHUDMode(0);
- player->SetGunsight(0);
+ // HARDCORE:
+ else {
+ player->SetFlightModel(0);
+ player->SetLandingModel(0);
+ player->SetHUDMode(0);
+ player->SetGunsight(0);
- if (stars) {
- KeyMap& keymap = stars->GetKeyMap();
+ if (stars) {
+ KeyMap& keymap = stars->GetKeyMap();
- keymap.Bind(KEY_CONTROL_MODEL, 0, 0);
- keymap.SaveKeyMap("key.cfg", 256);
+ keymap.Bind(KEY_CONTROL_MODEL, 0, 0);
+ keymap.SaveKeyMap("key.cfg", 256);
- stars->MapKeys();
- }
+ stars->MapKeys();
+ }
- Ship::SetControlModel(0);
- }
- }
+ Ship::SetControlModel(0);
+ }
+ }
- if (cmb_experience && cmb_experience->GetSelectedIndex() > 0) {
- player->SetRank(2); // Lieutenant
- player->SetTrained(255); // Fully Trained
- }
+ if (cmb_experience && cmb_experience->GetSelectedIndex() > 0) {
+ player->SetRank(2); // Lieutenant
+ player->SetTrained(255); // Fully Trained
+ }
- Player::Save();
- }
+ Player::Save();
+ }
- manager->ShowMenuDlg();
+ manager->ShowMenuDlg();
}