diff --git a/Makefile.am b/Makefile.am index 6136a0fe54..2f75d26e9a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -178,8 +178,6 @@ openxcom_SOURCES = \ src/Battlescape/MiniMapView.h \ src/Battlescape/NextTurnState.cpp \ src/Battlescape/NextTurnState.h \ - src/Battlescape/NoContainmentState.cpp \ - src/Battlescape/NoContainmentState.h \ src/Battlescape/Particle.cpp \ src/Battlescape/Particle.h \ src/Battlescape/Pathfinding.cpp \ diff --git a/src/Battlescape/DebriefingState.cpp b/src/Battlescape/DebriefingState.cpp index 281d987710..850d2ab0d0 100644 --- a/src/Battlescape/DebriefingState.cpp +++ b/src/Battlescape/DebriefingState.cpp @@ -25,7 +25,6 @@ #include "../Interface/Text.h" #include "../Interface/TextList.h" #include "../Interface/Window.h" -#include "NoContainmentState.h" #include "PromotionsState.h" #include "CommendationState.h" #include "CommendationLateState.h" @@ -447,6 +446,11 @@ void DebriefingState::init() { _game->getMod()->playMusic(Mod::DEBRIEF_MUSIC_BAD); } + if (_noContainment) + { + _game->pushState(new ErrorMessageState(tr("STR_ALIEN_DIES_NO_ALIEN_CONTAINMENT_FACILITY"), _palette, _game->getMod()->getInterface("debriefing")->getElement("errorMessage")->color, "BACK01.SCR", _game->getMod()->getInterface("debriefing")->getElement("errorPalette")->color)); + _noContainment = false; + } } /** @@ -490,10 +494,6 @@ void DebriefingState::btnOkClick(Action *) { _game->pushState(new CannotReequipState(_missingItems)); } - if (_noContainment) - { - _game->pushState(new NoContainmentState); - } else if (_manageContainment) { _game->pushState(new ManageAlienContainmentState(_base, OPT_BATTLESCAPE)); @@ -1463,7 +1463,7 @@ void DebriefingState::recoverAlien(BattleUnit *from, Base *base) return; } std::string type = from->getType(); - if (base->getAvailableContainment() == 0) + if (base->getAvailableContainment() == 0/* && _game->getSavedGame()->getMonthsPassed() > -1*/) { _noContainment = true; addStat("STR_ALIEN_CORPSES_RECOVERED", 1, from->getValue()); diff --git a/src/Battlescape/NoContainmentState.cpp b/src/Battlescape/NoContainmentState.cpp deleted file mode 100644 index 5d357c04e1..0000000000 --- a/src/Battlescape/NoContainmentState.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2010-2016 OpenXcom Developers. - * - * This file is part of OpenXcom. - * - * OpenXcom is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * OpenXcom is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenXcom. If not, see . - */ -#include "NoContainmentState.h" -#include "../Engine/Game.h" -#include "../Mod/Mod.h" -#include "../Engine/LocalizedText.h" -#include "../Interface/TextButton.h" -#include "../Interface/Window.h" -#include "../Interface/Text.h" -#include "../Engine/Options.h" - -namespace OpenXcom -{ - -/** - * Initializes all the elements in the No Containment screen. - * @param game Pointer to the core game. - */ -NoContainmentState::NoContainmentState() -{ - // Create objects - _window = new Window(this, 320, 200, 0, 0); - _btnOk = new TextButton(120, 18, 100, 174); - _txtTitle = new Text(220, 64, 50, 8); - - // Set palette - setInterface("noContainment"); - - add(_window, "window", "noContainment"); - add(_btnOk, "button", "noContainment"); - add(_txtTitle, "text", "noContainment"); - - centerAllSurfaces(); - - // Set up objects - _window->setBackground(_game->getMod()->getSurface("BACK01.SCR")); - - _btnOk->setText(tr("STR_OK")); - _btnOk->onMouseClick((ActionHandler)&NoContainmentState::btnOkClick); - _btnOk->onKeyboardPress((ActionHandler)&NoContainmentState::btnOkClick, Options::keyOk); - _btnOk->onKeyboardPress((ActionHandler)&NoContainmentState::btnOkClick, Options::keyCancel); - - _txtTitle->setText(tr("STR_ALIEN_DIES_NO_ALIEN_CONTAINMENT_FACILITY")); - _txtTitle->setAlign(ALIGN_CENTER); - _txtTitle->setBig(); - _txtTitle->setWordWrap(true); -} - -/** - * - */ -NoContainmentState::~NoContainmentState() -{ -} - -/** - * Returns to the previous screen. - * @param action Pointer to an action. - */ -void NoContainmentState::btnOkClick(Action *) -{ - _game->popState(); -} - -} diff --git a/src/Battlescape/NoContainmentState.h b/src/Battlescape/NoContainmentState.h deleted file mode 100644 index cea220f9c2..0000000000 --- a/src/Battlescape/NoContainmentState.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once -/* - * Copyright 2010-2016 OpenXcom Developers. - * - * This file is part of OpenXcom. - * - * OpenXcom is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * OpenXcom is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with OpenXcom. If not, see . - */ -#include "../Engine/State.h" - -namespace OpenXcom -{ - -class TextButton; -class Window; -class Text; - -/** - * Screen shown when there's not enough containment - * to capture a live alien after a mission. - */ -class NoContainmentState : public State -{ -private: - TextButton *_btnOk; - Window *_window; - Text *_txtTitle; -public: - /// Creates the No Containment state. - NoContainmentState(); - /// Cleans up the No Containment state. - ~NoContainmentState(); - /// Handler for clicking the OK button. - void btnOkClick(Action *action); -}; - -} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 682a2ce90f..27d54a96cd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -153,8 +153,6 @@ set ( battlescape_src Battlescape/MiniMapView.h Battlescape/NextTurnState.cpp Battlescape/NextTurnState.h - Battlescape/NoContainmentState.cpp - Battlescape/NoContainmentState.h Battlescape/Particle.cpp Battlescape/Particle.h Battlescape/Pathfinding.cpp diff --git a/src/Engine/State.cpp b/src/Engine/State.cpp index 03813fcc81..6b4bf3f3b4 100644 --- a/src/Engine/State.cpp +++ b/src/Engine/State.cpp @@ -257,7 +257,7 @@ void State::init() Window* window = dynamic_cast(*i); if (window) { - window->invalidate(true); + window->invalidate(); } } if (_ruleInterface != 0 && !_ruleInterface->getMusic().empty()) diff --git a/src/OpenXcom.2010.vcxproj b/src/OpenXcom.2010.vcxproj index 9661aa75cc..8f9ff709d2 100644 --- a/src/OpenXcom.2010.vcxproj +++ b/src/OpenXcom.2010.vcxproj @@ -279,7 +279,6 @@ - @@ -601,7 +600,6 @@ - diff --git a/src/OpenXcom.2010.vcxproj.filters b/src/OpenXcom.2010.vcxproj.filters index 8ffb728e1a..d7bb5fc118 100644 --- a/src/OpenXcom.2010.vcxproj.filters +++ b/src/OpenXcom.2010.vcxproj.filters @@ -558,9 +558,6 @@ Geoscape - - Battlescape - Savegame @@ -1515,9 +1512,6 @@ Geoscape - - Battlescape - Savegame