Separate image for solar panel while charging

main
Cameron Murphy Reikes 2 years ago
parent f0fdd865d7
commit b5223ab09b

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

@ -102,6 +102,7 @@ static sg_image image_flag_taken;
static sg_image image_squad_invite; static sg_image image_squad_invite;
static sg_image image_check; static sg_image image_check;
static sg_image image_no; static sg_image image_no;
static sg_image image_solarpanel_charging;
static int cur_editing_boxtype = -1; static int cur_editing_boxtype = -1;
static int cur_editing_rotation = 0; static int cur_editing_rotation = 0;
@ -476,6 +477,7 @@ static void init(void)
image_squad_invite = load_image("loaded/squad_invite.png"); image_squad_invite = load_image("loaded/squad_invite.png");
image_check = load_image("loaded/check.png"); image_check = load_image("loaded/check.png");
image_no = load_image("loaded/no.png"); image_no = load_image("loaded/no.png");
image_solarpanel_charging = load_image("loaded/solarpanel_charging.png");
} }
// socket initialization // socket initialization
@ -1550,22 +1552,28 @@ static void frame(void)
if (get_entity(&gs, b->player_who_is_inside_of_me) != NULL) if (get_entity(&gs, b->player_who_is_inside_of_me) != NULL)
img = image_medbay_used; img = image_medbay_used;
} }
sgp_set_image(0, img); if (b->box_type == BoxSolarPanel)
if (b->indestructible)
{ {
sgp_set_color(0.2f, 0.2f, 0.2f, 1.0f); sgp_set_image(0, image_solarpanel_charging);
} sgp_set_color(1.0f, 1.0f, 1.0f, b->sun_amount);
draw_texture_centered(entity_pos(b), BOX_SIZE); draw_texture_centered(entity_pos(b), BOX_SIZE);
sgp_reset_image(0); sgp_reset_image(0);
sgp_set_color(1.0f, 1.0f, 1.0f, 1.0f - b->sun_amount);
if (b->box_type == BoxSolarPanel) /* Color to_set = colhexcode(0xeb9834);
{
Color to_set = colhexcode(0xeb9834);
to_set.a = b->sun_amount * 0.5f; to_set.a = b->sun_amount * 0.5f;
set_color(to_set); set_color(to_set);
draw_color_rect_centered(entity_pos(b), BOX_SIZE); draw_color_rect_centered(entity_pos(b), BOX_SIZE);
*/
} }
sgp_set_image(0, img);
if (b->indestructible)
{
sgp_set_color(0.2f, 0.2f, 0.2f, 1.0f);
}
draw_texture_centered(entity_pos(b), BOX_SIZE);
sgp_reset_image(0);
sgp_set_color(0.5f, 0.1f, 0.1f, b->damage); sgp_set_color(0.5f, 0.1f, 0.1f, b->damage);
draw_color_rect_centered(entity_pos(b), BOX_SIZE); draw_color_rect_centered(entity_pos(b), BOX_SIZE);
} }

Loading…
Cancel
Save