Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ScriptGL WeaponHUD by GreyHound / Hunden
- // based on Andrews original design in hudbot
- // slightly modified to draw a box around the mounted weapon by some other dude
- $WeaponHud::Texture["Undefined"] = "WeaponHUD.Undefined.tga";
- $WeaponHud::Texture["turret"] = "WeaponHUD.turret.tga";
- $WeaponHud::Texture["shieldpack"] = "WeaponHUD.shieldpack.tga";
- $WeaponHud::Texture["sensorjammerpack"] = "WeaponHUD.sensorjammerpack.tga";
- $WeaponHud::Texture["sensorjammer"] = "WeaponHUD.sensorjammer.tga";
- $WeaponHud::Texture["repairpack"] = "WeaponHUD.repairpack.tga";
- $WeaponHud::Texture["pulse"] = "WeaponHUD.pulse.tga";
- $WeaponHud::Texture["motion"] = "WeaponHUD.motion.tga";
- $WeaponHud::Texture["ammopack"] = "WeaponHUD.ammopack.tga";
- $WeaponHud::Texture["energypack"] = "WeaponHUD.energypack.tga";
- $WeaponHud::Texture["sniper"] = "WeaponHUD.sniper.tga";
- $WeaponHud::Texture["plasma"] = "WeaponHUD.plasma.tga";
- $WeaponHud::Texture["mortar"] = "WeaponHUD.mortar.tga";
- $WeaponHud::Texture["grenade"] = "WeaponHUD.grenade.tga";
- $WeaponHud::Texture["blaster"] = "WeaponHUD.blaster.tga";
- $WeaponHud::Texture["chaingun"] = "WeaponHUD.chaingun.tga";
- $WeaponHud::Texture["elf"] = "WeaponHUD.elf.tga";
- $WeaponHud::Texture["disc"] = "WeaponHUD.disc.png";
- $WeaponHud::Texture["TargetLaser"] = "WeaponHUD.TargetLaser.tga";
- $WeaponHud::Texture["camera"] = "WeaponHUD.camera.tga";
- $WeaponHud::Texture["inventory"] = "WeaponHUD.inventory.tga";
- $WeaponHud::Texture["deployable"] = "WeaponHUD.deployable.tga";
- $WeaponHud::Texture["ammostation"] = "WeaponHUD.ammostation.tga";
- function vhud::WeaponHud::onrender()
- {
- if(!Control::getVisible("ScriptGL::vWeaponHud"))
- return;
- if($Scriptgl::CurrentGui != "playGui")
- return;
- if($pref::vWeaponHUD::hide == "true")
- return;
- %pos = Control::getPosition("ScriptGL::vWeaponHud");
- %x = getWord(%pos, 0);
- %y = getWord(%pos, 1);
- glSetFont( "arial", 9, 0, 9 );
- %slot = -1;
- if(GetItemCount("Disc Launcher"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["disc"], GetItemCount("Disc"), "Disc Launcher");
- if(GetItemCount("Grenade Launcher"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["grenade"], GetItemCount("Grenade Ammo"), "Grenade Launcher");
- if(GetItemCount("Chaingun"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["chaingun"], GetItemCount("Bullet"), "Chaingun");
- if(GetItemCount("Laser Rifle"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["sniper"], "~", "Laser Rifle");
- if(GetItemCount("Mortar"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["mortar"], GetItemCount("Mortar Ammo"), "Mortar");
- if(GetItemCount("Blaster"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["blaster"], "~", "Blaster");
- if(GetItemCount("ELF Gun"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["elf"], "~", "ELF Gun");
- if(GetItemCount("Plasma Gun"))
- WeaponHud::Draw(%x + %slot++*80,%y + 1*40, $WeaponHud::Texture["plasma"], GetItemCount("Plasma Bolt"), "Plasma Gun");
- //if(GetItemCount("Targeting Laser"))
- // WeaponHud::Draw(10+%slot++*80,%y, $WeaponHud::Texture["TargetLaser"], "~");
- %slot = -1;
- //WeaponHud::Draw(10+%slot++*80,%y + 1*40, $WeaponHud::Texture["Undefined"], 0);
- if(GetItemCount("Turret"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["turret"]);
- if(GetItemCount("Shield Pack"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["shieldpack"], "", "nothing");
- if(GetItemCount("Sensor Jammer Pack"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["sensorjammerpack"], "", "nothing");
- if(GetItemCount("Sensor Jammer"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["sensorjammer"], "", "nothing");
- if(GetItemCount("Repair Pack"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["repairpack"], "", "nothing");
- if(GetItemCount("Pulse Sensor"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["pulse"], "", "nothing");
- if(GetItemCount("Motion Sensor"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["motion"], "", "nothing");
- if(GetItemCount("Ammo Pack"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["ammopack"], "", "nothing");
- if(GetItemCount("Energy Pack"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["energypack"], "", "nothing");
- %slot = -1;
- if(GetItemCount("Camera"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["camera"], "", "nothing");
- if(GetItemCount("Inventory Station"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["inventory"], "", "nothing");
- if(GetItemCount("Ammo Station"))
- WeaponHud::Draw(%x + %slot++*80,%y, $WeaponHud::Texture["ammostation"], "", "nothing");
- }
- function WeaponHud::Draw(%x,%y, %tex, %count, %Name)
- {
- glEnable($GL_TEXTURE_2D);
- glBindTexture($GL_TEXTURE_2D, %tex);
- glColor3f(1.0,1.0,1.0,1.0);
- glBegin($GL_QUADS);
- glTexCoord2f(0.0,1.0);
- glVertex2f(%x,%y);
- glTexCoord2f(1.0,1.0);
- glVertex2f(%x+60,%y);
- glTexCoord2f(1.0,0.0);
- glVertex2f(%x+60,%y+30);
- glTexCoord2f(0.0, 0.0);
- glVertex2f(%x,%y+30);
- glEnd();
- glDrawString(%x + 50,%y + 20, %count);
- glColor4ub(255,255,255,255);
- if(GetItemdesc(GetMountedItem(0)) == %Name)
- glDrawTexture("wephud_border.png", $GLEX_SCALED, %x, %y, 1, 1 );
- }
- function vhud::WeaponHud::create()
- {
- if ( $vhud::WeaponHud::Loaded )
- return;
- $vhud::WeaponHud::Loaded = true;
- vhud::create("ScriptGL::vWeaponHud", "0% 0%", "0% 0%", vhud::WeaponHud::onrender );
- HUD::New("ScriptGL::vWeaponHud", 200, 200, 330, 75, onMouseRMB, onMouseRMB);
- }
- vhud::WeaponHud::create();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement