Author: fendrin
Date: Sat Mar 12 13:51:56 2011
New Revision: 48861
URL: http://svn.gna.org/viewcvs/wesnoth?rev=48861&view=rev
Log:
New gui elements enabled.
Modified:
branches/editor/data/themes/editor.cfg
branches/editor/src/display.cpp
branches/editor/src/editor/editor_display.cpp
branches/editor/src/game_display.cpp
branches/editor/src/game_display.hpp
branches/editor/src/reports.cpp
Modified: branches/editor/data/themes/editor.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/editor/data/themes/editor.cfg?rev=48861&r1=48860&r2=48861&view=diff
==============================================================================
--- branches/editor/data/themes/editor.cfg (original)
+++ branches/editor/data/themes/editor.cfg Sat Mar 12 13:51:56 2011
@@ -177,6 +177,16 @@
xanchor=fixed
yanchor=fixed
[/menu]
+
+ [panel]
+ #TODO rename since we don't display turns, only flags
+ id=turn-panel
+ image=themes/status-bg.png
+ ref=menu-editor-side
+ rect="+5,=+1,+80,+19"
+ xanchor=fixed
+ yanchor=fixed
+ [/panel]
[menu]
id=menu-editor-paste-context
@@ -329,7 +339,7 @@
[panel]
id=villages-panel
image=themes/status-bg.png
- ref=menu-editor-side
+ ref=turn-panel
rect="+5,=+1,+71,+19"
xanchor=fixed
yanchor=fixed
@@ -364,6 +374,24 @@
yanchor=fixed
[/label]
+ [side_playing]
+ id=icon-sideplaying
+#TODO clean up
+#icon=themes/units.png
+ ref=turn-panel
+ rect="=+3,=+2,+25,+17"
+ xanchor=fixed
+ yanchor=fixed
+ [/side_playing]
+ [turn]
+ id=turn
+ font_size={DEFAULT_FONT_SMALL}
+ rect="+4,=,+55,+16"
+ xanchor=fixed
+ yanchor=fixed
+ prefix="a" #wmllint: ignore
+ prefix_literal=""
+ [/turn]
[status]
Modified: branches/editor/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/editor/src/display.cpp?rev=48861&r1=48860&r2=48861&view=diff
==============================================================================
--- branches/editor/src/display.cpp (original)
+++ branches/editor/src/display.cpp Sat Mar 12 13:51:56 2011
@@ -137,15 +137,14 @@
{
}
+//TODO sort to the right place
void display::load_flags() {
- //TODO sort to the right place
+ //TODO move to hpp
// Inits the flag list and the team colors used by ~TC
flags_.clear();
- //flags_.reserve(2);
-
- ERR_DP << get_teams().size();
- //TODO
+ //TODO remove debug output
+ ERR_DP << "size of teams: " << get_teams().size() << "\n";
flags_.reserve(get_teams().size());
std::vector<std::string> side_colors;
Modified: branches/editor/src/editor/editor_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/editor/src/editor/editor_display.cpp?rev=48861&r1=48860&r2=48861&view=diff
==============================================================================
--- branches/editor/src/editor/editor_display.cpp (original)
+++ branches/editor/src/editor/editor_display.cpp Sat Mar 12 13:51:56 2011
@@ -16,6 +16,7 @@
#include "editor_display.hpp"
#include "builder.hpp"
+#include "reports.hpp"
namespace editor {
@@ -120,31 +121,28 @@
village_report <<
lexical_cast<std::string>(map().get_teams()[playing_team()
-1].villages().size())
<< "/" <<
lexical_cast<std::string>(get_map().villages().size());
text = village_report.str();
+ //TODO remove debug output
+ ERR_ED << reports::generate_report("side_playing") << "\n";
+ //TODO this is not working
+ refresh_report("side_playing",
reports::generate_report("side_playing"));
}
refresh_report("villages", element);
text = toolbar_hint_;
refresh_report("editor_tool_hint", element);
- //TODO port to new system
-//
-// refresh_report(reports::VILLAGES,
reports::report(village_report.str()));
-//
-// std::ostringstream unit_report;
-//
-// unit_report << lexical_cast<std::string>(side_units(map().get_units(),
viewing_side()))
-// << "/" << lexical_cast<std::string>(map().get_units().size());
-//
-////TODO cleanup.
-//// case NUM_UNITS: {
-//// if (current_side != playing_side)
-//// str << span_color(font::GRAY_COLOUR);
-//// str << side_units(units, current_side);
-//// if (current_side != playing_side)
-//// str << naps;
-//// break;
-// refresh_report(reports::NUM_UNITS, reports::report(unit_report.str()));
-// refresh_report(reports::EDITOR_TOOL_HINT,
reports::report(toolbar_hint_));
+ //TODO turn report is not working
+ text = "abc";
+ refresh_report("turn", element);
+ if (playing_team() != 0) {
+ std::ostringstream unit_report;
+ unit_report << lexical_cast<std::string>(side_units(playing_team() -1))
+ << "/" << lexical_cast<std::string>(map().get_const_units().size());
+ text = unit_report.str();
+ refresh_report("num_units", element);
+ }
+ //TODO do we still need that?
+ // refresh_report(reports::EDITOR_TOOL_HINT,
reports::report(toolbar_hint_));
}
} //end namespace editor
Modified: branches/editor/src/game_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/editor/src/game_display.cpp?rev=48861&r1=48860&r2=48861&view=diff
==============================================================================
--- branches/editor/src/game_display.cpp (original)
+++ branches/editor/src/game_display.cpp Sat Mar 12 13:51:56 2011
@@ -719,6 +719,7 @@
return res;
}
+//TODO this was moved to display, delete here
surface game_display::get_flag(const map_location& loc)
{
t_translation::t_terrain terrain = get_map().get_terrain(loc);
Modified: branches/editor/src/game_display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/editor/src/game_display.hpp?rev=48861&r1=48860&r2=48861&view=diff
==============================================================================
--- branches/editor/src/game_display.hpp (original)
+++ branches/editor/src/game_display.hpp Sat Mar 12 13:51:56 2011
@@ -167,6 +167,7 @@
/**
* Extra game per-location invalidation (village ownership)
*/
+ //TODO clean up.
// void invalidate_animations_location(const map_location& loc);
virtual void draw_minimap_units();
Modified: branches/editor/src/reports.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/editor/src/reports.cpp?rev=48861&r1=48860&r2=48861&view=diff
==============================================================================
--- branches/editor/src/reports.cpp (original)
+++ branches/editor/src/reports.cpp Sat Mar 12 13:51:56 2011
@@ -781,10 +781,12 @@
REPORT_GENERATOR(side_playing)
{
- const team &active_team =
(*resources::teams)[resources::screen->playing_team()];
+ //TODO remove debug output
+ ERR_WB << "Number of the playing team through the resources interface:
" << resources::gui->playing_team() << "\n";
+ const team &active_team =
(*resources::teams)[resources::gui->playing_team()];
std::string flag_icon = active_team.flag_icon();
std::string old_rgb = game_config::flag_rgb;
- std::string new_rgb =
team::get_side_color_index(resources::screen->playing_side());
+ std::string new_rgb =
team::get_side_color_index(resources::gui->playing_team() );
std::string mods = "~RC(" + old_rgb + ">" + new_rgb + ")";
if (flag_icon.empty())
flag_icon = game_config::images::flag_icon;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits