![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <hudwidget.h>
Inheritance diagram for hud_unit_combat:
Collaboration diagram for hud_unit_combat:Public Member Functions | |
| hud_unit_combat (int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran, float scale, QWidget *parent) | |
| Hud unit combat contructor, prepares images to show as result. More... | |
| ~hud_unit_combat () override | |
| Hud unit combat destructor. More... | |
| bool | get_focus () |
| Returns true if widget has focus (used to prevent hiding parent) More... | |
| void | set_fading (float fade) |
| Sets widget fading. More... | |
| void | set_scale (float scale) |
| Sets scale for images. More... | |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
| Paint event for hud_unit combat. More... | |
| void | mousePressEvent (QMouseEvent *e) override |
| Mouse press event, centers on highlighted combat. More... | |
| void | leaveEvent (QEvent *event) override |
| Leave event for hud unit combat. More... | |
| void | enterEvent (QEvent *event) override |
| Leave event for hud unit combat. More... | |
Private Member Functions | |
| void | init_images (bool redraw=false) |
| Draws images of units to pixmaps for later use. More... | |
Private Attributes | |
| int | att_hp = 0 |
| int | def_hp = 0 |
| int | att_hp_loss = 0 |
| int | def_hp_loss = 0 |
| bool | att_veteran = false |
| bool | def_veteran = false |
| struct unit * | attacker = nullptr |
| struct unit * | defender = nullptr |
| const struct unit_type * | type_attacker = nullptr |
| const struct unit_type * | type_defender = nullptr |
| struct tile * | center_tile = nullptr |
| bool | focus = false |
| float | fading = 0.0f |
| float | hud_scale |
| QImage | dimg |
| QImage | aimg |
| bool | att_win = false |
| bool | def_win = false |
Definition at line 247 of file hudwidget.h.
| hud_unit_combat::hud_unit_combat | ( | int | attacker_unit_id, |
| int | defender_unit_id, | ||
| int | attacker_hp, | ||
| int | defender_hp, | ||
| bool | make_att_veteran, | ||
| bool | make_def_veteran, | ||
| float | scale, | ||
| QWidget * | parent | ||
| ) |
Hud unit combat contructor, prepares images to show as result.
Definition at line 1358 of file hudwidget.cpp.
|
overridedefault |
Hud unit combat destructor.
|
overrideprotected |
| bool hud_unit_combat::get_focus | ( | ) |
Returns true if widget has focus (used to prevent hiding parent)
Definition at line 1480 of file hudwidget.cpp.
|
private |
Draws images of units to pixmaps for later use.
Definition at line 1393 of file hudwidget.cpp.
Referenced by hud_unit_combat(), and set_scale().
|
overrideprotected |
Leave event for hud unit combat.
Stops showing highlight.
Definition at line 1568 of file hudwidget.cpp.
|
overrideprotected |
Mouse press event, centers on highlighted combat.
Definition at line 1560 of file hudwidget.cpp.
|
overrideprotected |
Paint event for hud_unit combat.
Definition at line 1485 of file hudwidget.cpp.
| void hud_unit_combat::set_fading | ( | float | fade | ) |
Sets widget fading.
Definition at line 1471 of file hudwidget.cpp.
Referenced by hud_battle_log::add_combat_info().
| void hud_unit_combat::set_scale | ( | float | scale | ) |
Sets scale for images.
Definition at line 1457 of file hudwidget.cpp.
|
private |
Definition at line 281 of file hudwidget.h.
Referenced by init_images(), and paintEvent().
|
private |
Definition at line 267 of file hudwidget.h.
Referenced by hud_unit_combat().
|
private |
Definition at line 269 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 271 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 282 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 273 of file hudwidget.h.
Referenced by hud_unit_combat(), and init_images().
|
private |
Definition at line 277 of file hudwidget.h.
Referenced by hud_unit_combat(), and mousePressEvent().
|
private |
Definition at line 268 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 270 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 272 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 283 of file hudwidget.h.
Referenced by hud_unit_combat(), and paintEvent().
|
private |
Definition at line 274 of file hudwidget.h.
Referenced by hud_unit_combat(), and init_images().
|
private |
Definition at line 281 of file hudwidget.h.
Referenced by init_images(), and paintEvent().
|
private |
Definition at line 279 of file hudwidget.h.
Referenced by paintEvent(), and set_fading().
|
private |
Definition at line 278 of file hudwidget.h.
Referenced by enterEvent(), get_focus(), init_images(), leaveEvent(), and paintEvent().
|
private |
Definition at line 280 of file hudwidget.h.
Referenced by hud_unit_combat(), init_images(), paintEvent(), and set_scale().
|
private |
Definition at line 275 of file hudwidget.h.
Referenced by hud_unit_combat(), and init_images().
|
private |
Definition at line 276 of file hudwidget.h.
Referenced by hud_unit_combat(), and init_images().