UIEngagement::UIEngagement( Engagement* e, Display* d, World* w ) : Actor( std::string("ui_engagement_bg"), d, w ){ name = std::string("UIEngagement"); eng = e; width = 32*4; height = 32*4; tex = display->get_empty_texture( width, height ); att = world->get_character_by_id( eng->attacker->id ); vic = world->get_character_by_id( eng->victim->id ); leftoffset = 0; topoffset = 0; tex10h = display->get_text_height( 10 ); tex20h = display->get_text_height( 20 ); int ay = _getmin( vic->gety(), att->gety() ) * display->th + world->camy; int ah = (_getmax( vic->gety(), att->gety() ) + 1) * display->th + world->camy - ay; x = display->width/2 - width/2; y = display->height/2 - height/2; if( ay >= y && ay <= y + height ){ y = offset_y_by_eng_position( ay, ah ); } else if( ay + ah > y && ay + ah < y + height ){ y = offset_y_by_eng_position( ay, ah ); } draw_bg(); draw_hp(); draw_hpbars(); }
void restore_room_after_quick_load() { int temp1 = curr_guard_color; int temp2 = next_level; reset_level_unused_fields(false); load_lev_spr(current_level); curr_guard_color = temp1; next_level = temp2; //need_full_redraw = 1; different_room = 1; next_room = drawn_room; load_room_links(); //draw_level_first(); //gen_palace_wall_colors(); draw_game_frame(); // for falling //redraw_screen(1); // for room_L hitp_delta = guardhp_delta = 1; // force HP redraw draw_hp(); loadkid_and_opp(); // Get rid of "press button" message if kid was dead before quickload. text_time_total = text_time_remaining = 0; //next_sound = current_sound = -1; exit_room_timer = 0; }
void Building::draw(){ draw_unit(); draw_hp(); draw_building(); }