Author: mordante
Date: Mon Aug 18 18:10:44 2008
New Revision: 28716
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28716&view=rev
Log:
Cleaned up the code for the new in game message dialogs.
Still contains some ugly hacks.
Modified:
trunk/data/gui/default/window/message.cfg
trunk/src/game_events.cpp
Modified: trunk/data/gui/default/window/message.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/window/message.cfg?rev=28716&r1=28715&r2=28716&view=diff
==============================================================================
--- trunk/data/gui/default/window/message.cfg (original)
+++ trunk/data/gui/default/window/message.cfg Mon Aug 18 18:10:44 2008
@@ -139,12 +139,10 @@
automatic_placement = "false"
- # NOTE the values will be overwritten in the game later on,
maybe we should allow
- # variables here as well...
x = 0
- y = 0
- width = 750
- height = 400
+ y = "(screen_height - " + {IMAGE_WIDTH} + ")"
+ width = "(screen_width - 142)"
+ height = {IMAGE_WIDTH}
[grid]
@@ -236,12 +234,10 @@
automatic_placement = "false"
- # NOTE the values will be overwritten in the game later on,
maybe we should allow
- # variables here as well...
x = 0
- y = 0
- width = 750
- height = 400
+ y = "(screen_height - " + {IMAGE_WIDTH} + ")"
+ width = "(screen_width - 142)"
+ height = {IMAGE_WIDTH}
[grid]
Modified: trunk/src/game_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=28716&r1=28715&r2=28716&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Mon Aug 18 18:10:44 2008
@@ -1926,10 +1926,8 @@
gui2::tspacer* spacer =
dynamic_cast<gui2::tspacer*>(window.find_widget("image_place_holder", false));
unsigned image_size = 200;
- unsigned window_height = 400;
if(spacer && spacer->get_best_size().x == 500) {
image_size = 400;
- window_height = 600;
}
const unit_map::iterator speaker = units->find(event_info.loc1);
@@ -1939,14 +1937,6 @@
const std::string image = portrait ? portrait->image : "";
const bool mirror = portrait ? portrait->mirror : false;
- /**
- * @todo FIXME these fixed sizes should depend on the map size
and maybe
- * let wml determine the height.
- */
- window.set_size(::create_rect(0,
- gui2::settings::screen_height - window_height,
- gui2::settings::screen_width - 142, window_height));
-
window.canvas(1).set_variable("portrait_image", variant(image));
window.canvas(1).set_variable("portrait_mirror",
variant(mirror));
@@ -1954,7 +1944,6 @@
assert(label);
label->set_label(message);
- window.recalculate_size();
window.show();
}
@@ -1969,10 +1958,8 @@
gui2::tspacer* spacer =
dynamic_cast<gui2::tspacer*>(window.find_widget("image_place_holder", false));
unsigned image_size = 200;
- unsigned window_height = 400;
if(spacer && spacer->get_best_size().x == 500) {
image_size = 400;
- window_height = 600;
}
const unit_map::iterator speaker = units->find(event_info.loc1);
@@ -1982,14 +1969,6 @@
const std::string image = portrait ? portrait->image : "";
const bool mirror = portrait ? portrait->mirror : false;
- /**
- * @todo FIXME these fixed sizes should depend on the map size
and maybe
- * let wml determine the height.
- */
- window.set_size(::create_rect(0,
- gui2::settings::screen_height - window_height,
- gui2::settings::screen_width - 142, window_height));
-
window.canvas(1).set_variable("portrait_image", variant(image));
window.canvas(1).set_variable("portrait_mirror",
variant(mirror));
@@ -1997,7 +1976,6 @@
assert(label);
label->set_label(message);
- window.recalculate_size();
window.show();
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits