Move tminimap_definition to a new file.
This commit is contained in:
parent
a7f49fe205
commit
7f0e000ae9
8 changed files with 93 additions and 38 deletions
|
@ -16,6 +16,7 @@ src/gui/auxiliary/widget_definition/image.cpp
|
|||
src/gui/auxiliary/widget_definition/label.cpp
|
||||
src/gui/auxiliary/widget_definition/listbox.cpp
|
||||
src/gui/auxiliary/widget_definition/menubar.cpp
|
||||
src/gui/auxiliary/widget_definition/minimap.cpp
|
||||
src/gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
src/gui/auxiliary/window_builder/button.cpp
|
||||
src/gui/auxiliary/window_builder/control.cpp
|
||||
|
|
|
@ -232,6 +232,7 @@ set(wesnoth-main_SRC
|
|||
gui/auxiliary/widget_definition/label.cpp
|
||||
gui/auxiliary/widget_definition/listbox.cpp
|
||||
gui/auxiliary/widget_definition/menubar.cpp
|
||||
gui/auxiliary/widget_definition/minimap.cpp
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
gui/auxiliary/window_builder/button.cpp
|
||||
gui/auxiliary/window_builder/control.cpp
|
||||
|
|
|
@ -112,6 +112,7 @@ wesnoth_source = \
|
|||
gui/auxiliary/widget_definition/label.cpp \
|
||||
gui/auxiliary/widget_definition/listbox.cpp \
|
||||
gui/auxiliary/widget_definition/menubar.cpp \
|
||||
gui/auxiliary/widget_definition/minimap.cpp \
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp \
|
||||
gui/auxiliary/window_builder/button.cpp \
|
||||
gui/auxiliary/window_builder/control.cpp \
|
||||
|
|
|
@ -272,6 +272,7 @@ wesnoth_sources = Split("""
|
|||
gui/auxiliary/widget_definition/label.cpp
|
||||
gui/auxiliary/widget_definition/listbox.cpp
|
||||
gui/auxiliary/widget_definition/menubar.cpp
|
||||
gui/auxiliary/widget_definition/minimap.cpp
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
gui/auxiliary/window_builder/button.cpp
|
||||
gui/auxiliary/window_builder/control.cpp
|
||||
|
|
51
src/gui/auxiliary/widget_definition/minimap.cpp
Normal file
51
src/gui/auxiliary/widget_definition/minimap.cpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2007 - 2010 by Mark de Wever <koraq@xs4all.nl>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "gui/auxiliary/widget_definition/minimap.hpp"
|
||||
|
||||
#include "gui/auxiliary/log.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tminimap_definition::tminimap_definition(const config& cfg)
|
||||
: tcontrol_definition(cfg)
|
||||
{
|
||||
DBG_GUI_P << "Parsing minimap " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
tminimap_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_minimap
|
||||
*
|
||||
* == Minimap ==
|
||||
*
|
||||
* @macro = minimap_description
|
||||
*
|
||||
* The following states exist:
|
||||
* * state_enabled, the minimap is enabled.
|
||||
*
|
||||
*/
|
||||
// Note the order should be the same as the enum tstate is minimap.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
}
|
||||
|
||||
} // namespace gui2
|
||||
|
37
src/gui/auxiliary/widget_definition/minimap.hpp
Normal file
37
src/gui/auxiliary/widget_definition/minimap.hpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2007 - 2010 by Mark de Wever <koraq@xs4all.nl>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#ifndef GUI_AUXILIARY_WIDGET_DEFINITION_MINIMAP_HPP_INCLUDED
|
||||
#define GUI_AUXILIARY_WIDGET_DEFINITION_MINIMAP_HPP_INCLUDED
|
||||
|
||||
#include "gui/auxiliary/widget_definition.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
struct tminimap_definition
|
||||
: public tcontrol_definition
|
||||
{
|
||||
explicit tminimap_definition(const config& cfg);
|
||||
|
||||
struct tresolution
|
||||
: public tresolution_definition_
|
||||
{
|
||||
explicit tresolution(const config& cfg);
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
#endif
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
#include "gui/auxiliary/widget_definition/label.hpp"
|
||||
#include "gui/auxiliary/widget_definition/listbox.hpp"
|
||||
#include "gui/auxiliary/widget_definition/menubar.hpp"
|
||||
#include "gui/auxiliary/widget_definition/minimap.hpp"
|
||||
#include "gui/auxiliary/widget_definition/vertical_scrollbar.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "serialization/parser.hpp"
|
||||
|
@ -447,33 +448,6 @@ tstate_definition::tstate_definition(const config &cfg) :
|
|||
canvas.set_cfg(draw);
|
||||
}
|
||||
|
||||
tminimap_definition::tminimap_definition(const config& cfg) :
|
||||
tcontrol_definition(cfg)
|
||||
{
|
||||
DBG_GUI_P << "Parsing minimap " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
tminimap_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_minimap
|
||||
*
|
||||
* == Minimap ==
|
||||
*
|
||||
* @macro = minimap_description
|
||||
*
|
||||
* The following states exist:
|
||||
* * state_enabled, the minimap is enabled.
|
||||
*
|
||||
*/
|
||||
// Note the order should be the same as the enum tstate is minimap.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
}
|
||||
|
||||
tpanel_definition::tpanel_definition(const config& cfg) :
|
||||
tcontrol_definition(cfg)
|
||||
{
|
||||
|
|
|
@ -85,17 +85,6 @@ enum twindow_type {
|
|||
|
||||
const std::string& get_id(const twindow_type window_type);
|
||||
|
||||
struct tminimap_definition : public tcontrol_definition
|
||||
{
|
||||
|
||||
tminimap_definition(const config& cfg);
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
tresolution(const config& cfg);
|
||||
};
|
||||
};
|
||||
|
||||
struct tmulti_page_definition
|
||||
: public tcontrol_definition
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue