May 09, 2021, 05:48:52 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1] 2 3 4

Author Topic: Custom HUD WarHUD (Drop shadows! Damage indicator compatibility!)  (Read 10906 times)

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --

Screenshots:
https://github.com/wareya/warhud/wiki

URL:
https://github.com/wareya/warhud

How to download:


How to install:
How to install warHUD-gg2 correctly

About:
----------------------------------------------------------
warHUD, an unoriginal Gang Garrison 2 HUD.
----------------------------------------------------------

Created by Wareya
Inspired by RevanXP's HUD

A (work in progress) full conversion HUD for Gang Garrison
2, designed to mimick RevanXP's TF2 HUD. Makes important
information as clear as possible and removes ugly design
noise entirely.

----------------------------------------------------------

TODO/Checklist:
  • Basic health

    - Consider icon outline change for being ubered
    - Changes color based on health (red 55 > orange 50% > white any)
    - Dropshadow options (NO outlines, too clunky)
[ ] Basic ammo
[ ] Charge bars and other counters
[ ] Timers
[ ] Fix up health/ammo design

Future:
So far I have the health. The number turns orange below/at 50% health, and red below/at 55 HP. I might replace the offwhite with a light green if you're being healed or ubered or something, I haven't decided on anything like that yet.
(Added dropshadow)

Next up is the ammo. I'm getting rid of the whole thing and leaving nothing but an ammo count in a large number like the health, and the reload bar underneath it. The hard part will be class specific things, like the # of stickies you have out or your ubercharge as medic. I want to put the charge bar (including mainly the ubercharge bar) right above the objective HUD (which is the last thing I'll fix, along with the timers) as a long fat strip, and put the sticky count right below where that would be if demoman had a charge bar.

Conflicts:
- Lorgan's Damage Indicator 2.0 (overrides next-to-health rolling damage display)
Solution: Use 2.1 or newer
« Last Edit: June 20, 2013, 11:45:34 pm by Phantom Brave »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: WIP HUD warhud
« Reply #1 on: June 19, 2012, 05:23:55 pm »

Is the bottom blackbar part of the design, or part of the map?
Logged
A CHALLENGER HAS ARRIVED.

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #2 on: June 19, 2012, 05:37:39 pm »

That's the map's void.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Unregistered Colt

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 243
  • MIA
Re: WIP HUD warhud
« Reply #3 on: June 19, 2012, 05:42:26 pm »

So far I have the health. The number turns orange below/at 50% health, and red below/at 55 HP.

So it never turns orange for scouts and spies?
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #4 on: June 19, 2012, 05:51:37 pm »

So far I have the health. The number turns orange below/at 50% health, and red below/at 55 HP.

So it never turns orange for scouts and spies?
Nope. It doesn't need to - orange is an indication you're taking too much heat for your class, red's an indication you can potentially die in a single hit. For scout and spy, 55 hp happens to be more than 50, so yeah. :p
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: WIP HUD warhud
« Reply #5 on: June 19, 2012, 06:03:10 pm »

I like it, it's a cleaner HUD.

Logged
A CHALLENGER HAS ARRIVED.

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12416
Re: WIP HUD warhud
« Reply #6 on: June 20, 2012, 04:59:33 am »

good good but where are the bitches at
Logged
Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  :nah:
Oh, well, you might as well pack up and stop now, because he doesn't like it
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #7 on: June 25, 2012, 07:54:38 am »

Added an option for a dropshadow (I'll make it non-black later, don't know what to use, though. Someone please advise.)
Code: [Select]
//Complete overhaul to GG2's HUD. Inspired by RevanXP's TF2 HUD.
global.warhud_namespace = "Plugins/warhud/";


//Set up first

ini_open("gg2.ini");
global.warhud_style = ini_read_real(global.warhud_namespace,"WarHUD_style",1);
ini_close();

//make a new menu for plugin options
if !variable_global_exists("pluginOptions") {
    global.pluginOptions = object_add();
    object_set_parent(global.pluginOptions,OptionsController); 
    object_set_depth(global.pluginOptions,-130000);
    object_event_add(global.pluginOptions,ev_create,0,'   
    menu_create(40, 140, 300, 200, 30);

    if room != Options {
        menu_setdimmed();
    }

    menu_addback("Back", "
        instance_destroy();
        if(room == Options)
            instance_create(0,0,MainMenuController);
        else
            instance_create(0,0,InGameMenuController);
    ");
    ');
   
    object_event_add(InGameMenuController,ev_create,0,'
        menu_addlink("Plugin Options", "
            instance_destroy();
            instance_create(0,0,global.pluginOptions);
        ");
    ');
}

//add menu option/s
object_event_add(global.pluginOptions,ev_create,0,'
    //very dumb workaround
    section = global.warhud_namespace;
    key1 = "WarHUD_style";
    //even dumber workaround
    quote = chr(39);

    menu_addedit_boolean("Dropshadow in WarHUD", "global.warhud_style", "
        gg2_write_ini(section, key1, argument0);
");

');

//HUD stuff now

object_event_add(HealthHud,ev_create,0,"
    sprite_index = sprite_add_sprite(global.warhud_namespace + 'CharacterHUD.gmspr');
    health_sprite = sprite_add_sprite(global.warhud_namespace + 'Healthbar.gmspr');
    offwhite = make_color_rgb(217,217,183);
");

object_event_clear(HealthHud,ev_draw,0);
object_event_add(HealthHud,ev_draw,0,"
    if(global.myself.object == -1)
    {
        instance_destroy();
        exit;
    }

    xpos = 45+24;
    ypos = 547+18;
    hp = global.myself.object.hp;
    maxHp = global.myself.object.maxHp;
    event_user(0);

    draw_sprite_ext(sprite_index, 0, view_xview[0]+11, view_yview[0]+525, 2, 2, 0, c_white, 1);
   
    draw_sprite_ext(health_sprite, 0, view_xview[0]+11, view_yview[0]+525, 2, 2, 0, c_black, 1);
    hppixels = hp/maxHp*17;
    draw_sprite_part_ext(health_sprite,0,0,(17-hppixels)+10,sprite_width,hppixels+1,view_xview[0]+11, view_yview[0]+545+(17-hppixels)*2,2,2,c_red,1);
    draw_sprite_part_ext(health_sprite,0,0,(17-hppixels)+10,sprite_width,hppixels+1,view_xview[0]+11, view_yview[0]+545+(17-hppixels)*2,2,2,c_green,hp/maxHp);

    if(hp <= 55)
        hpColor = c_red;
    else if(hp <= (maxHp/2))
        hpColor = c_orange;
    else
        hpColor = offwhite;

    draw_set_valign(fa_center);
    draw_set_halign(fa_left);
    hpText = string(ceil(max(hp,0)));
    size = 3;
   
    if(global.warhud_style)
        draw_text_transformed_color(view_xview[0]+xpos+size, view_yview[0]+ypos+size, hpText, size, size, 0, c_black, c_black, c_black, c_black, 1);
    draw_text_transformed_color(view_xview[0]+xpos, view_yview[0]+ypos, hpText, size, size, 0, hpColor, hpColor, hpColor, hpColor, 1);
");
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

trog

  • member of intel's squad of garbagemen against the yakuza
  • Veteran Member
  • ******
  • Karma: 27
  • Offline Offline
  • Posts: 10080
  • i am uberdeath
Re: WIP HUD warhud
« Reply #8 on: June 25, 2012, 09:07:55 am »

black
Logged

PM me your apps for my clan

92% of people who see this will not
have the guts to repost it. When Goku
died in the explosion Cell tied to destroy Earth with, he did it for you and me. If you're not ashamed to love Goku, post this as your status and show everyone. Thank you, Goku. I lifted up my arms for the spirit bomb every time you asked for my energy.

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #9 on: June 25, 2012, 09:23:51 am »

Black is too high contrast, I'll add team colors and make an option. Will update soon.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

trog

  • member of intel's squad of garbagemen against the yakuza
  • Veteran Member
  • ******
  • Karma: 27
  • Offline Offline
  • Posts: 10080
  • i am uberdeath
Re: WIP HUD warhud
« Reply #10 on: June 25, 2012, 09:51:24 am »

exactly, you want contrast so it stands out

team colours not a good idea because you have red as low health
Logged

PM me your apps for my clan

92% of people who see this will not
have the guts to repost it. When Goku
died in the explosion Cell tied to destroy Earth with, he did it for you and me. If you're not ashamed to love Goku, post this as your status and show everyone. Thank you, Goku. I lifted up my arms for the spirit bomb every time you asked for my energy.

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #11 on: June 25, 2012, 09:57:46 am »

Black was made slightly better too. The team colors are dark, don't worry.
PS too high contrast != normal good contrast

Code: [Select]
//Complete overhaul to GG2's HUD. Inspired by RevanXP's TF2 HUD.
//View/edit with a fixed width font. Some punctuation is vertically aligned.
global.warhud_namespace = "Plugins/warhud/";


//Set up first

ini_open("gg2.ini");
global.warhud_style = ini_read_real(global.warhud_namespace,"WarHUD_style",1);
ini_close();

//make a new menu for plugin options
if !variable_global_exists("pluginOptions") {
    global.pluginOptions = object_add();
    object_set_parent(global.pluginOptions,OptionsController); 
    object_set_depth(global.pluginOptions,-130000);
    object_event_add(global.pluginOptions,ev_create,0,'   
    menu_create(40, 140, 300, 200, 30);

    if room != Options {
        menu_setdimmed();
    }

    menu_addback("Back", "
        instance_destroy();
        if(room == Options)
            instance_create(0,0,MainMenuController);
        else
            instance_create(0,0,InGameMenuController);
    ");
    ');
   
    object_event_add(InGameMenuController,ev_create,0,'
        menu_addlink("Plugin Options", "
            instance_destroy();
            instance_create(0,0,global.pluginOptions);
        ");
    ');
}

//add menu option/s
object_event_add(global.pluginOptions,ev_create,0,'
    //very dumb workaround
    section = global.warhud_namespace;
    key1 = "WarHUD_style";
    //even dumber workaround
    quote = chr(39);

    menu_addedit_select("WarHUD dropshadow style", "global.warhud_style", "
        gg2_write_ini(section, key1, argument0);
    ");
    menu_add_option(0, "Off");
    menu_add_option(1, "Team colored");
    menu_add_option(2, "Black");
');

//HUD stuff now

object_event_add(HealthHud,ev_create,0,"
    sprite_index = sprite_add_sprite(global.warhud_namespace + 'CharacterHUD.gmspr');
    health_sprite = sprite_add_sprite(global.warhud_namespace + 'Healthbar.gmspr');
    offwhite  = make_color_rgb(217,217,183); // Old (too light) color values ripped from stock HUD:
    c_redteam = make_color_rgb( 64, 16,  0); // (165, 70, 64);
    c_bluteam = make_color_rgb( 16, 32, 64); // ( 73, 93,104); (They might be useful to someone.)
");

object_event_clear(HealthHud,ev_draw,0);
object_event_add(HealthHud,ev_draw,0,"
    if(global.myself.object == -1)
    {
        instance_destroy();
        exit;
    }

    text_xpos = 45+24;
    text_ypos = 547+18;
    sprite_xpos = 11;
    sprite_ypos = 525;
    icon_xpos = 11;
    icon_ypos = 545;
    hp = global.myself.object.hp;
    maxHp = global.myself.object.maxHp;
    event_user(0);
   
    //health icon outline and backing
    draw_sprite_ext(sprite_index , 0, view_xview[0]+sprite_xpos, view_yview[0]+sprite_ypos, 2, 2, 0, c_white, 1);
    draw_sprite_ext(health_sprite, 0, view_xview[0]+sprite_xpos, view_yview[0]+sprite_ypos, 2, 2, 0, c_black, 1);
   
    //draw dynamic colored health icon
    //TODO: Optimize to one sprite draw
    hppixels = hp/maxHp*17;
    draw_sprite_part_ext(health_sprite,0,0,(17-hppixels)+10,sprite_width,hppixels+1,view_xview[0]+icon_xpos, view_yview[0]+icon_ypos+(17-hppixels)*2,2,2,c_red,1);
    draw_sprite_part_ext(health_sprite,0,0,(17-hppixels)+10,sprite_width,hppixels+1,view_xview[0]+icon_xpos, view_yview[0]+icon_ypos+(17-hppixels)*2,2,2,c_green,hp/maxHp);
   
    //start picking HP # text colors
    if(global.myself.team == TEAM_RED)
        c_shadow = c_redteam;
    if(global.myself.team == TEAM_BLUE)
        c_shadow = c_bluteam;
    if(global.warhud_style == 2)
        c_shadow = $202020; //offblack
       
    //colors for HP # text, red = can die in one hit; orange = taking too much heat
    if(hp <= 55)
        hpColor = c_red;
    else if(hp <= (maxHp/2))
        hpColor = c_orange;
    else
        hpColor = offwhite;

    draw_set_valign(fa_center);
    draw_set_halign(fa_left);
    hpText = string(ceil(max(hp,0)));
    size = 3;
   
    if(global.warhud_style)
        draw_text_transformed_color(view_xview[0]+text_xpos+size, view_yview[0]+text_ypos+size, hpText, size, size, 0, c_shadow, c_shadow, c_shadow, c_shadow, 1);
    draw_text_transformed_color(view_xview[0]+text_xpos, view_yview[0]+text_ypos, hpText, size, size, 0, hpColor, hpColor, hpColor, hpColor, 1);
");
« Last Edit: June 25, 2012, 10:05:33 am by Chartreuse »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #12 on: June 25, 2012, 10:05:06 am »

someone give me a red color that matches the offwhite more qq
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: WIP HUD warhud
« Reply #13 on: June 25, 2012, 10:15:02 am »

thanks 4 nofasthelp nerds

Code: [Select]
//Complete overhaul to GG2's HUD. Inspired by RevanXP's TF2 HUD.
//View/edit with a fixed width font. Some punctuation is vertically aligned.
global.warhud_namespace = "Plugins/warhud/";


//Set up first

ini_open("gg2.ini");
global.warhud_style = ini_read_real(global.warhud_namespace,"WarHUD_style",1);
ini_close();

//make a new menu for plugin options
if !variable_global_exists("pluginOptions") {
    global.pluginOptions = object_add();
    object_set_parent(global.pluginOptions,OptionsController); 
    object_set_depth(global.pluginOptions,-130000);
    object_event_add(global.pluginOptions,ev_create,0,'   
    menu_create(40, 140, 300, 200, 30);

    if room != Options {
        menu_setdimmed();
    }

    menu_addback("Back", "
        instance_destroy();
        if(room == Options)
            instance_create(0,0,MainMenuController);
        else
            instance_create(0,0,InGameMenuController);
    ");
    ');
   
    object_event_add(InGameMenuController,ev_create,0,'
        menu_addlink("Plugin Options", "
            instance_destroy();
            instance_create(0,0,global.pluginOptions);
        ");
    ');
}

//add menu option/s
object_event_add(global.pluginOptions,ev_create,0,'
    //very dumb workaround
    section = global.warhud_namespace;
    key1 = "WarHUD_style";
    //even dumber workaround
    quote = chr(39);

    menu_addedit_select("WarHUD dropshadow style", "global.warhud_style", "
        gg2_write_ini(section, key1, argument0);
    ");
    menu_add_option(0, "Off");
    menu_add_option(1, "Team colored");
    menu_add_option(2, "Black");
');

//HUD stuff now

object_event_add(HealthHud,ev_create,0,"
    sprite_index = sprite_add_sprite(global.warhud_namespace + 'CharacterHUD.gmspr');
    health_sprite = sprite_add_sprite(global.warhud_namespace + 'Healthbar.gmspr');
    offwhite  = make_color_rgb(217,217,183); // Old (too light) color values ripped from stock HUD:
    c_redteam = make_color_rgb( 42, 24, 16); // (165, 70, 64);
    c_bluteam = make_color_rgb( 16, 32, 64); // ( 73, 93,104); (They might be useful to someone.)
");

object_event_clear(HealthHud,ev_draw,0);
object_event_add(HealthHud,ev_draw,0,"
    if(global.myself.object == -1)
    {
        instance_destroy();
        exit;
    }

    text_xpos = 45+24;
    text_ypos = 547+18;
    sprite_xpos = 11;
    sprite_ypos = 525;
    icon_xpos = 11;
    icon_ypos = 545;
    hp = global.myself.object.hp;
    maxHp = global.myself.object.maxHp;
    event_user(0);
   
    //health icon outline and backing
    draw_sprite_ext(sprite_index , 0, view_xview[0]+sprite_xpos, view_yview[0]+sprite_ypos, 2, 2, 0, c_white, 1);
    draw_sprite_ext(health_sprite, 0, view_xview[0]+sprite_xpos, view_yview[0]+sprite_ypos, 2, 2, 0, c_black, 1);
   
    //draw dynamic colored health icon
    //TODO: Optimize to one sprite draw
    hppixels = hp/maxHp*17;
    draw_sprite_part_ext(health_sprite,0,0,(17-hppixels)+10,sprite_width,hppixels+1,view_xview[0]+icon_xpos, view_yview[0]+icon_ypos+(17-hppixels)*2,2,2,c_red,1);
    draw_sprite_part_ext(health_sprite,0,0,(17-hppixels)+10,sprite_width,hppixels+1,view_xview[0]+icon_xpos, view_yview[0]+icon_ypos+(17-hppixels)*2,2,2,c_green,hp/maxHp);
   
    //start picking HP # text colors
    if(global.myself.team == TEAM_RED)
        c_shadow = c_redteam;
    if(global.myself.team == TEAM_BLUE)
        c_shadow = c_bluteam;
    if(global.warhud_style == 2)
        c_shadow = $202020; //offblack
       
    //colors for HP # text, red = can die in one hit; orange = taking too much heat
    if(hp <= 55)
        hpColor = c_red;
    else if(hp <= (maxHp/2))
        hpColor = c_orange;
    else
        hpColor = offwhite;

    draw_set_valign(fa_center);
    draw_set_halign(fa_left);
    hpText = string(ceil(max(hp,0)));
    size = 3;
   
    if(global.warhud_style)
        draw_text_transformed_color(view_xview[0]+text_xpos+size, view_yview[0]+text_ypos+size, hpText, size, size, 0, c_shadow, c_shadow, c_shadow, c_shadow, 1);
    draw_text_transformed_color(view_xview[0]+text_xpos, view_yview[0]+text_ypos, hpText, size, size, 0, hpColor, hpColor, hpColor, hpColor, 1);
");
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Machidro

  • 2013 Haxxy Award Winner
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 1675
  • Gardicolo time is over.
Re: WIP HUD warhud
« Reply #14 on: June 25, 2012, 10:28:19 am »

The code for loading your options will conflict with the damage indicator's, you both call the same key variable.
Logged
A CHALLENGER HAS ARRIVED.
Pages: [1] 2 3 4
 

Page created in 0.034 seconds with 37 queries.