Skip to content

Commit

Permalink
Added level properties menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Hume2 committed Jan 3, 2016
1 parent 26012c0 commit 2335e08
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 1 deletion.
50 changes: 50 additions & 0 deletions src/supertux/menu/editor_level_menu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SuperTux
// Copyright (C) 2016 Hume2 <[email protected]>
//
// This program 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.
//
// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.

#include "supertux/menu/editor_level_menu.hpp"

#include "gui/menu.hpp"
#include "gui/menu_item.hpp"
#include "gui/menu_manager.hpp"
#include "editor/editor.hpp"
#include "supertux/menu/menu_storage.hpp"
#include "supertux/menu/options_menu.hpp"
#include "supertux/level.hpp"
#include "supertux/screen_manager.hpp"
#include "util/gettext.hpp"
#include "video/color.hpp"

EditorLevelMenu::EditorLevelMenu()
{
add_label(_("Level properties"));
add_hl();
add_textfield(_("Name"), &(Editor::current()->level->name));
add_textfield(_("Author"), &(Editor::current()->level->author));
add_textfield(_("Contact"), &(Editor::current()->level->contact));
add_textfield(_("License"), &(Editor::current()->level->license));
add_textfield(_("On menukey script"), &(Editor::current()->level->on_menukey_script));
add_numfield(_("Target time"), &(Editor::current()->level->target_time));
add_hl();
add_back(_("OK"));
}

void
EditorLevelMenu::menu_action(MenuItem* item)
{

}

/* EOF */
37 changes: 37 additions & 0 deletions src/supertux/menu/editor_level_menu.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SuperTux
// Copyright (C) 2016 Hume2 <[email protected]>
//
// This program 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.
//
// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.

#ifndef HEADER_SUPERTUX_SUPERTUX_MENU_EDITOR_LEVEL_MENU_HPP
#define HEADER_SUPERTUX_SUPERTUX_MENU_EDITOR_LEVEL_MENU_HPP

#include "gui/menu.hpp"

class EditorLevelMenu : public Menu
{
private:
public:
EditorLevelMenu();

void menu_action(MenuItem* item) override;

private:
EditorLevelMenu(const EditorLevelMenu&);
EditorLevelMenu& operator=(const EditorLevelMenu&);
};

#endif //HEADER_SUPERTUX_SUPERTUX_MENU_EDITOR_LEVEL_MENU_HPP

/* EOF */
1 change: 1 addition & 0 deletions src/supertux/menu/editor_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EditorMenu::EditorMenu()
add_entry(MNID_SAVELEVEL, _("Save current level"));
add_entry(MNID_LEVELSEL, _("Edit another level"));
add_entry(MNID_LEVELSETSEL, _("Choose another level subset"));
add_submenu(_("Level properties"), MenuStorage::EDITOR_LEVEL_MENU);
add_hl();
add_entry(MNID_QUITEDITOR, _("Exit level editor"));
}
Expand Down
4 changes: 4 additions & 0 deletions src/supertux/menu/menu_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "supertux/menu/cheat_menu.hpp"
#include "supertux/menu/contrib_menu.hpp"
#include "supertux/menu/editor_menu.hpp"
#include "supertux/menu/editor_level_menu.hpp"
#include "supertux/menu/editor_level_select_menu.hpp"
#include "supertux/menu/editor_levelset_select_menu.hpp"
#include "supertux/menu/editor_objectgroup_menu.hpp"
Expand Down Expand Up @@ -135,6 +136,9 @@ MenuStorage::create(MenuId menu_id)
case EDITOR_SECTOR_MENU:
return std::unique_ptr<Menu>(new EditorSectorMenu);

case EDITOR_LEVEL_MENU:
return std::unique_ptr<Menu>(new EditorLevelMenu);

case NO_MENU:
return std::unique_ptr<Menu>();

Expand Down
3 changes: 2 additions & 1 deletion src/supertux/menu/menu_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class MenuStorage
EDITOR_TILEGROUP_MENU,
EDITOR_OBJECTGROUP_MENU,
EDITOR_SECTORS_MENU,
EDITOR_SECTOR_MENU
EDITOR_SECTOR_MENU,
EDITOR_LEVEL_MENU
};

public:
Expand Down

0 comments on commit 2335e08

Please sign in to comment.