The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
HealthFix
Posted by: JekJek | April 3, 2010 @ 12:22am
Text Code
[
Download
]
Index: view.c =================================================================== --- view.c (revision 2574) +++ view.c (working copy) @@ -3613,7 +3613,11 @@ // tweak as needed, this alters the transparency c1.a = 140; - drawIsoEnergyBar(Z_DIR, x, y, 1, 5, 5, w, PercentageDone, &c1, &c2); + if (PercentageDone > 0.05){ + drawIsoEnergyBar(Z_DIR, x, y, 1, 5, 5, w, PercentageDone, &c1, &c2); + }else{ + drawIsoEnergyBar(Z_DIR, x, y, 1, 5, 5, w, 0.05, &c1, &c2); + } } #endif Index: hud.c =================================================================== --- hud.c (revision 2574) +++ hud.c (working copy) @@ -599,7 +599,7 @@ 2.5 * FontHeight(BFont_to_use); // Width of bars - bar_width = (text_length) * (cur_enemy->energy / Druidmap[cur_enemy->type].maxenergy); + bar_width = (text_length); barc_width = (text_length) * (1.0 - cur_enemy->energy / Druidmap[cur_enemy->type].maxenergy); if (bar_width < 0) bar_width = 0; @@ -618,11 +618,17 @@ } // Draw the energy bar complement - rect.x = bar_x + bar_width; + rect.x = bar_x; rect.y = bar_y; rect.w = barc_width; - our_SDL_fill_rect_wrapper(Screen, &rect, SDL_MapRGB(Screen->format, 0x000, 0x000, 0x000)); + if (barc_width < (bar_width*0.995)){ + our_SDL_fill_rect_wrapper(Screen, &rect, SDL_MapRGB(Screen->format, 0x000, 0x000, 0x000)); + }else{ + rect.w = bar_width*0.005; + our_SDL_fill_rect_wrapper(Screen, &rect, SDL_MapRGB(Screen->format, 0x000, 0x000, 0x000)); + } + // Display droid's short description text rect.x = translate_map_point_to_screen_pixel_x(description_pos->x, description_pos->y) - text_length / 2; PutStringFont(Screen, BFont_to_use, rect.x, rect.y, cur_enemy->short_description_text);
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.57 / 8
70 Votes