UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Choose which icons are displayed over eachother?

broken avatar :(
Created 11 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
1,278 views
broken avatar :(
  • Exofile
  • Deleted Member
×
broken avatar :(
Exofile
This user is deleted :(
So I'm editing Dukip's MOTD Hud, and have run into a small bump I'd like to see what the best way to solve is.
Basically, when the player holds 2 grenades, I need "offhandFragIcon2" to be behind "offhandFragIcon1", but because Icon2 is drawn after Icon1, it's going to put Icon2 infront of Icon1. If you're wondering, I want the images to overlap eachother a small bit for my HUD. But how can I make Icon 2 be behind Icon1 when there is 2 grenades, and 3 behind 2 & 1 in the same sense?

Code Snippet
Plaintext
// Grenades
itemDef
{
name "offhandFragIcon1"
type ITEM_TYPE_OWNERDRAW
rect GRENADE_X_START (WEAPINFO_Y-40) 15 15
forecolor 1 1 1 1
exp forecolor A (1/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 1)
decoration
}
//if 2 nades
itemDef
{
name "offhandFragIcon2"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START+(GRENADE_X_SPACE*1)) (WEAPINFO_Y-42.5) 15 15
forecolor 1 1 1 1
exp forecolor A (2/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 2)
decoration
}
// if 3 nades
itemDef
{
name "offhandFragIcon3"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*2)) (WEAPINFO_Y-45) 15 15
forecolor 1 1 1 1
exp forecolor A (3/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 3)
decoration
}
// if 4 nades
itemDef
{
name "offhandFragIcon4"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*3)) (WEAPINFO_Y-47.5) 15 15
forecolor 1 1 1 1
exp forecolor A (4/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 4)
decoration
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
They get drawn in the order they show up, so just put the one you want on the bottom first.

Code Snippet
Plaintext
		// if 4 nades
itemDef
{
name "offhandFragIcon4"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*3)) (WEAPINFO_Y-47.5) 15 15
forecolor 1 1 1 1
exp forecolor A (4/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 4)
decoration
}
// if 3 nades
itemDef
{
name "offhandFragIcon3"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*2)) (WEAPINFO_Y-45) 15 15
forecolor 1 1 1 1
exp forecolor A (3/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 3)
decoration
}
//if 2 nades
itemDef
{
name "offhandFragIcon2"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START+(GRENADE_X_SPACE*1)) (WEAPINFO_Y-42.5) 15 15
forecolor 1 1 1 1
exp forecolor A (2/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 2)
decoration
}
itemDef
{
name "offhandFragIcon1"
type ITEM_TYPE_OWNERDRAW
rect GRENADE_X_START (WEAPINFO_Y-40) 15 15
forecolor 1 1 1 1
exp forecolor A (1/dvarInt("hud_player_ammo_grenade_primary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_FRAG
background "the_giant_grenadeicon" // default texture
visible when(dvarInt("hud_player_ammo_grenade_primary") = 1)
decoration
}

Last Edit: December 10, 2015, 03:03:16 pm by MakeCents
broken avatar :(
  • Exofile
  • Deleted Member
×
broken avatar :(
Exofile
This user is deleted :(
They get drawn in the order they show up, so just put the one you want on the bottom first.

I see, thank you for the help.  :)

 
Loading ...