[Freeciv-Dev] Re: (PR#10843) Fight animation
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=10843 >
Jason Short wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=10843 >
>
> Christian Knoke wrote:
>
>
>>fight animation is not displayed for my attacking unit (see unit loosing
>>hitpoints) when the unit icons blink phase is dark.
>
> The attached patch fixes this for 2.0.
And here's a patch for 2.1.
-jason
Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.183
diff -p -u -r1.183 control.c
--- client/control.c 21 Jul 2005 08:07:18 -0000 1.183
+++ client/control.c 25 Aug 2005 03:06:24 -0000
@@ -541,6 +541,14 @@ void set_units_in_combat(struct unit *pa
{
punit_attacking = pattacker;
punit_defending = pdefender;
+
+ if (punit_attacking == punit_focus || punit_defending == punit_focus) {
+ /* If one of the units is the focus unit, make sure hidden-focus is
+ * disabled. We don't just do this as a check later because then
+ * with a blinking unit it would just disappear again right after the
+ * battle. */
+ focus_unit_in_combat(tileset);
+ }
}
/**************************************************************************
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.321
diff -p -u -r1.321 tilespec.c
--- client/tilespec.c 2 Aug 2005 02:40:58 -0000 1.321
+++ client/tilespec.c 25 Aug 2005 03:06:26 -0000
@@ -4192,6 +4192,13 @@ void reset_focus_unit_state(struct tiles
focus_unit_state = 0;
}
+void focus_unit_in_combat(struct tileset *t)
+{
+ if (!t->sprites.unit.select[0]) {
+ reset_focus_unit_state(t);
+ }
+}
+
/****************************************************************************
Toggle/increment the focus unit state. This should be called once
every get_focus_unit_toggle_timeout() seconds.
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.158
diff -p -u -r1.158 tilespec.h
--- client/tilespec.h 2 Aug 2005 02:40:58 -0000 1.158
+++ client/tilespec.h 25 Aug 2005 03:06:26 -0000
@@ -135,6 +135,7 @@ int fill_sprite_array(struct tileset *t,
double get_focus_unit_toggle_timeout(const struct tileset *t);
void reset_focus_unit_state(struct tileset *t);
+void focus_unit_in_combat(struct tileset *t);
void toggle_focus_unit_state(struct tileset *t);
struct unit *get_drawable_unit(const struct tileset *t,
struct tile *ptile,
Index: data/trident/select.spec
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/trident/select.spec,v
retrieving revision 1.1
diff -p -u -r1.1 select.spec
--- data/trident/select.spec 13 Feb 2005 19:09:05 -0000 1.1
+++ data/trident/select.spec 25 Aug 2005 03:06:27 -0000
@@ -21,8 +21,8 @@ dy = 30
pixel_border = 0
tiles = { "row", "column", "tag"
- 0, 0, "unit.select0"
- 0, 1, "unit.select1"
- 0, 2, "unit.select2"
- 0, 3, "unit.select3"
+; 0, 0, "unit.select0"
+; 0, 1, "unit.select1"
+; 0, 2, "unit.select2"
+; 0, 3, "unit.select3"
}
|
|