@@ -24,6 +24,14 @@ namespace RTE {
2424
2525 AbstractClassInfo (EditorActivity, Activity);
2626
27+ EditorActivity::EditorActivity () {
28+ Clear ();
29+ }
30+
31+ EditorActivity::~EditorActivity () {
32+ Destroy (true );
33+ }
34+
2735 void EditorActivity::Clear () {
2836 // Most editors are single player affairs
2937 m_MaxPlayerSupport = 1 ;
@@ -275,20 +283,20 @@ namespace RTE {
275283 ////////////////////////////////////////////////////////
276284 // Handle events for mouse input on the controls
277285
278- GUIEvent anEvent;
279- while(m_pGUIController->GetEvent(&anEvent))
286+ GUIEvent anEvent;
287+ while(m_pGUIController->GetEvent(&anEvent))
280288 {
281289 // If we're not supposed to have mouse control, then ignore these messages
282290 // Uh this is not right, editor always has mouse control so far
283291 // if (!m_PlayerController[0].IsMouseControlled())
284292 // break;
285293
286- if (anEvent.GetType() == GUIEvent::Command)
294+ if (anEvent.GetType() == GUIEvent::Command)
287295 {
288296 //////////////////////////////////////////////////////////
289- // NEW button pressed; create a new scene
297+ // NEW button pressed; create a new scene
290298
291- if (anEvent.GetControl() == m_pNewButton)
299+ if (anEvent.GetControl() == m_pNewButton)
292300 {
293301 // Get the selected Module
294302 GUIListPanel::Item *pItem = m_pNewModuleCombo->GetItem(m_pNewModuleCombo->GetSelectedIndex());
@@ -345,9 +353,9 @@ namespace RTE {
345353 }
346354
347355 //////////////////////////////////////////////////////////
348- // LOAD button pressed; load the selected Scene
356+ // LOAD button pressed; load the selected Scene
349357
350- if (anEvent.GetControl() == m_pLoadButton)
358+ if (anEvent.GetControl() == m_pLoadButton)
351359 {
352360 GUIListPanel::Item *pItem = m_pLoadNameCombo->GetItem(m_pLoadNameCombo->GetSelectedIndex());
353361 if (pItem && !pItem->m_Name.empty())
@@ -371,9 +379,9 @@ namespace RTE {
371379 }
372380
373381 //////////////////////////////////////////////////////////
374- // SAVE button pressed; save the selected Scene
382+ // SAVE button pressed; save the selected Scene
375383
376- if (anEvent.GetControl() == m_pSaveButton)
384+ if (anEvent.GetControl() == m_pSaveButton)
377385 {
378386 if (!m_pSaveNameBox->GetText().empty())
379387 {
@@ -396,9 +404,9 @@ namespace RTE {
396404 }
397405
398406 ///////////////////////////////////////////////////////////////
399- // Save Changes YES pressed
407+ // Save Changes YES pressed
400408
401- if (anEvent.GetControl() == m_pChangesYesButton)
409+ if (anEvent.GetControl() == m_pChangesYesButton)
402410 {
403411 if (m_HasEverBeenSaved)
404412 {
@@ -422,9 +430,9 @@ namespace RTE {
422430 }
423431
424432 ///////////////////////////////////////////////////////////////
425- // Save Changes NO pressed
433+ // Save Changes NO pressed
426434
427- if (anEvent.GetControl() == m_pChangesNoButton)
435+ if (anEvent.GetControl() == m_pChangesNoButton)
428436 {
429437 // Just go back to previous mode
430438 m_EditorMode = m_PreviousMode;
@@ -433,9 +441,9 @@ namespace RTE {
433441 }
434442
435443 ///////////////////////////////////////////////////////////////
436- // Overwrite Scene YES pressed
444+ // Overwrite Scene YES pressed
437445
438- if (anEvent.GetControl() == m_pOverwriteYesButton)
446+ if (anEvent.GetControl() == m_pOverwriteYesButton)
439447 {
440448 // Force overwrite
441449 if (SaveScene(g_SceneMan.GetScene()->GetPresetName(), true))
@@ -451,19 +459,19 @@ namespace RTE {
451459 }
452460
453461 ///////////////////////////////////////////////////////////////
454- // Overwrite Scene NO pressed
462+ // Overwrite Scene NO pressed
455463
456- if (anEvent.GetControl() == m_pOverwriteNoButton)
464+ if (anEvent.GetControl() == m_pOverwriteNoButton)
457465 {
458466 // Just go back to previous mode
459467 m_EditorMode = m_PreviousMode;
460468 m_ModeChange = true;
461469 }
462470
463471 ///////////////////////////////////////////////////////////////
464- // CANCEL button pressed; exit any active dialog box
472+ // CANCEL button pressed; exit any active dialog box
465473
466- if (anEvent.GetControl() == m_pNewCancel || anEvent.GetControl() == m_pLoadCancel || anEvent.GetControl() == m_pSaveCancel)
474+ if (anEvent.GetControl() == m_pNewCancel || anEvent.GetControl() == m_pLoadCancel || anEvent.GetControl() == m_pSaveCancel)
467475 {
468476 m_EditorMode = m_PreviousMode = EDITINGOBJECT;
469477 m_ModeChange = true;
@@ -476,7 +484,7 @@ namespace RTE {
476484 ///////////////////////////////////////
477485 // Clicks on the New Scene Module combo
478486
479- if (anEvent.GetControl() == m_pNewModuleCombo)
487+ if (anEvent.GetControl() == m_pNewModuleCombo)
480488 {
481489 // Closed it, IE selected somehting
482490 if(anEvent.GetMsg() == GUIComboBox::Closed)
0 commit comments