49
51
xml->get_widget("army_image", army_image);
52
if (army->getImageName() != "")
54
p = Playerlist::getActiveplayer();
55
armyset = p->getArmyset();
60
armyset = army->getArmyset();
62
GraphicsCache *gc = GraphicsCache::getInstance();
63
army_image->property_pixbuf() = to_pixbuf (gc->getArmyPic(armyset,
55
armyset = army->getArmyset();
56
GraphicsCache *gc = GraphicsCache::getInstance();
57
army_image->property_pixbuf() = to_pixbuf (gc->getArmyPic(armyset,
61
// fill in terrain image
62
Gtk::Image *terrain_image;
63
xml->get_widget("terrain_image", terrain_image);
64
SDL_Surface *terrain = gc->getMoveBonusPic(army->getMoveBonus(), false);
65
terrain_image->property_pixbuf() = to_pixbuf(terrain);
66
//terrain_image->hide();
69
Gtk::Label *info_label;
70
xml->get_widget("info_label", info_label);
74
// note to translators: %1 is ranged strength
75
s += String::ucompose(_("Strength: %1"),
76
army->getStat(Army::STRENGTH));
79
// note to translators: %1 is remaining moves, %2 is total moves
80
s += String::ucompose(_("Moves: %1/%2"),
81
army->getMoves(), army->getStat(Army::MOVES));
83
s += String::ucompose(_("Upkeep: %1"), army->getUpkeep());
84
info_label->set_text(s);
86
// move into correct position
87
window->get_child()->show();
88
Vector<int> pos(0, 0);
89
target->get_window()->get_origin(pos.x, pos.y);
90
if (target->has_no_window())
92
Gtk::Allocation a = target->get_allocation();
96
Vector<int> size(0, 0);
97
window->get_size(size.x, size.y);
98
window->set_gravity(Gdk::GRAVITY_SOUTH);
101
window->move(pos.x, pos.y);
105
ArmyInfoTip::ArmyInfoTip(Gtk::Widget *target, const ArmyProdBase *army)
107
Glib::RefPtr<Gnome::Glade::Xml> xml
108
= Gnome::Glade::Xml::create(get_glade_path()
109
+ "/army-info-window.glade");
112
xml->get_widget("window", w);
115
Gtk::Image *army_image;
116
xml->get_widget("army_image", army_image);
117
Player *p = Playerlist::getInstance()->getActiveplayer();
119
armyset = army->getArmyset();
120
GraphicsCache *gc = GraphicsCache::getInstance();
121
army_image->property_pixbuf() = to_pixbuf (gc->getArmyPic(armyset,
125
// fill in terrain image
126
Gtk::Image *terrain_image;
127
xml->get_widget("terrain_image", terrain_image);
128
SDL_Surface *terrain = gc->getMoveBonusPic(army->getMoveBonus(), false);
129
terrain_image->property_pixbuf() = to_pixbuf(terrain);
130
//terrain_image->hide();
133
Gtk::Label *info_label;
134
xml->get_widget("info_label", info_label);
136
s += army->getName();
138
// note to translators: %1 is melee strength
139
s += String::ucompose(_("Strength: %1"),
140
army->getStrength());
142
// note to translators: %1 is total moves
143
s += String::ucompose(_("Moves: %1"), army->getMaxMoves());
145
s += String::ucompose(_("Time: %1"), army->getProduction());
147
s += String::ucompose(_("Cost: %1"), army->getUpkeep());
148
info_label->set_text(s);
150
// move into correct position
151
window->get_child()->show();
152
Vector<int> pos(0, 0);
153
target->get_window()->get_origin(pos.x, pos.y);
154
if (target->has_no_window())
156
Gtk::Allocation a = target->get_allocation();
160
Vector<int> size(0, 0);
161
window->get_size(size.x, size.y);
162
window->set_gravity(Gdk::GRAVITY_SOUTH);
165
window->move(pos.x, pos.y);
169
ArmyInfoTip::ArmyInfoTip(Gtk::Widget *target, const ArmyProto *army)
171
Glib::RefPtr<Gnome::Glade::Xml> xml
172
= Gnome::Glade::Xml::create(get_glade_path()
173
+ "/army-info-window.glade");
176
xml->get_widget("window", w);
179
Gtk::Image *army_image;
180
xml->get_widget("army_image", army_image);
181
Player *p = Playerlist::getInstance()->getActiveplayer();
183
armyset = army->getArmyset();
184
GraphicsCache *gc = GraphicsCache::getInstance();
185
army_image->property_pixbuf() = to_pixbuf (gc->getArmyPic(armyset,
67
189
// fill in terrain image
80
202
// note to translators: %1 is melee strength, %2 is ranged strength
81
203
s += String::ucompose(_("Strength: %1"),
82
army->getStat(Army::STRENGTH));
84
if (type == ARMY_TYPE)
86
// note to translators: %1 is remaining moves, %2 is total moves
87
s += String::ucompose(_("Movement: %1"), army->getStat(Army::MOVES));
89
s += String::ucompose(_("Time: %1"), army->getProduction());
91
s += String::ucompose(_("Cost: %1"), army->getUpkeep());
93
else if (type == ARMY_INSTANCE)
95
// note to translators: %1 is remaining moves, %2 is total moves
96
s += String::ucompose(_("Moves: %1/%2"),
97
army->getMoves(), army->getStat(Army::MOVES));
99
s += String::ucompose(_("Upkeep: %1"), army->getUpkeep());
204
army->getStrength());
206
// note to translators: %1 is remaining moves, %2 is total moves
207
s += String::ucompose(_("Movement: %1"), army->getMaxMoves());
209
s += String::ucompose(_("Time: %1"), army->getProduction());
211
s += String::ucompose(_("Cost: %1"), army->getUpkeep());
101
212
info_label->set_text(s);
103
214
// move into correct position