Skip to content

Commit

Permalink
KOTOR: Add a stub menu to change the name
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Jun 26, 2017
1 parent 8d53801 commit fcb920b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/engines/kotor/gui/chargen/chargenname.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos 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.
*
* xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
*/

/** @file
* The menu for modifying the name of the character.
*/

#include "src/engines/kotor/gui/widgets/kotorwidget.h"
#include "src/engines/kotor/gui/widgets/label.h"

#include "src/engines/kotor/gui/chargen/chargenname.h"

namespace Engines {

namespace KotOR {

CharacterGenerationNameMenu::CharacterGenerationNameMenu(CharacterGenerationInfo &info, Console *console) :
CharacterGenerationBaseMenu(info, console) {

load("name");

addBackground(kBackgroundTypeMenu);

getLabel("NAME_BOX_EDIT")->setText("");
}

void CharacterGenerationNameMenu::callbackActive(Widget &widget) {
if (widget.getTag() == "BTN_BACK") {
_returnCode = 1;
return;
}

if (widget.getTag() == "END_BTN") {
_returnCode = 1;
accept();
return;
}
}

} // End of namespace KotOR

} // End of namespace Engines
48 changes: 48 additions & 0 deletions src/engines/kotor/gui/chargen/chargenname.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos 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.
*
* xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
*/

/** @file
* The menu for modifying the name of the character.
*/

#ifndef ENGINES_KOTOR_GUI_CHARGEN_CHARGENNAME_H
#define ENGINES_KOTOR_GUI_CHARGEN_CHARGENNAME_H

#include "src/engines/kotor/gui/gui.h"

#include "src/engines/kotor/gui/chargen/chargenbase.h"

namespace Engines {

namespace KotOR {

class CharacterGenerationNameMenu : public CharacterGenerationBaseMenu {
public:
CharacterGenerationNameMenu(CharacterGenerationInfo &info, ::Engines::Console *console = 0);

private:
void callbackActive(Widget &widget);
};

} // End of namespace KotOR

} // End of namespace Engines

#endif // ENGINES_KOTOR_GUI_CHARGEN_CHARGENNAME_H
2 changes: 2 additions & 0 deletions src/engines/kotor/gui/chargen/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ src_engines_kotor_libkotor_la_SOURCES += \
src/engines/kotor/gui/chargen/chargeninfo.h \
src/engines/kotor/gui/chargen/chargenbase.h \
src/engines/kotor/gui/chargen/chargenportrait.h \
src/engines/kotor/gui/chargen/chargenname.h \
$(EMPTY)

src_engines_kotor_libkotor_la_SOURCES += \
Expand All @@ -39,4 +40,5 @@ src_engines_kotor_libkotor_la_SOURCES += \
src/engines/kotor/gui/chargen/chargeninfo.cpp \
src/engines/kotor/gui/chargen/chargenbase.cpp \
src/engines/kotor/gui/chargen/chargenportrait.cpp \
src/engines/kotor/gui/chargen/chargenname.cpp \
$(EMPTY)

0 comments on commit fcb920b

Please sign in to comment.