Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release BF1942 Class Selection Menu Style
#1
Hello

I did this this morning and I thought of releasing, is just an update of something I did long time ago. Is cursor controlled, click on any of the 5 options and youll get a weapon, if you are going to add more things, add them in: CustomClasses(type). I just putted a small example.



Add on Init:

Code:
    precacheShader("ui_cursor");
    precacheShader("menu_setting_selection_bar");
    precacheShader("gradient_center");

Add on Onplayerspawned:

Code:
        self thread StartMenu();

Paste this anywhere:

Code:
CreateRectangle(align,relative,x,y,width,height,color)
{
    barElemBG = newClientHudElem( self );
    barElemBG.elemType = "bar";
    if ( !level.splitScreen )
    {
        barElemBG.x = -2;
        barElemBG.y = -2;
    }
    barElemBG.width = width;
    barElemBG.height = height;
    barElemBG.align = align;
    barElemBG.relative = relative;
    barElemBG.xOffset = 0;
    barElemBG.yOffset = 0;
    barElemBG.children = [];
    barElemBG.sort = 3;
    barElemBG.color = color;
    barElemBG.alpha = 0.9;
    barElemBG setParent( level.uiParent );
    barElemBG setShader( "gradient_center", width , height );
    barElemBG.hidden = false;
    barElemBG setPoint(align,relative,x,y);
    return barElemBG;
}

DestroyHUD(elem)
{
            self waittill("death");
            elem destroy();
}

StartMenu()
{
    self.moveSpeedScaler = 0;
    self allowJump(false);
    self allowADS(false);
    self takeAllWeapons();
    self _clearPerks();
    wait 0.1;
    self _disableWeapon();
    self _disableOffhandWeapons();
    self _disableWeaponSwitch();
    self _disableUsability();
    self.inMenu = 1;
    self.background = CreateRectangle("","",0,0,230,360,(0.1,0.1,0.1));
    self thread DestroyHUD("self.background");
    wait 0.05;
    self.mouse = createIcon("ui_cursor",30,30);
           self.mouse setPoint("","",0,0);  
    self.mouse.alpha = 1;
    self thread DestroyHUD("self.mouse");
    self thread MoveCursor();
    //self thread PositionMouse();
    self thread ClassesHUD();
    self thread MonitorClick();
    self waittill("death");
    self thread EndMenu();
}

MoveCursor()
{
    initialAngles = self getplayerangles();
    self setplayerangles((0,0,0));
    while(self.inMenu == 1)
    {
        angles1 = self getPlayerAngles();
        wait 0.05;
        angles2 = self getPlayerAngles();
        if(angles1 != angles2)
        {
            yplus = angles1[0] - angles2[0];
            xplus = angles1[1] - angles2[1];
            self.mouse setPoint("","",self.mouse.x+(xplus*2.1),self.mouse.y-(yplus*2.1));
            self setPlayerAngles(0,self.mouse.x,0);
        }
    }
}

ClassesHUD()
{
    self.info = self createFontString("default",2);
    self.info setPoint("","",0,-121);
              self.info setText("^7Select a Class");
    self.assault = self createFontString("default",1.8);
    self.assault setPoint("","",0,-72);
              self.assault setText("^7Assault");
    self.assaults = createIcon("menu_setting_selection_bar",220,25);
    self.assaults setPoint("","",0,-72);
    self.assaults.alpha = 0;
    self.sniper = self createFontString("default",1.8);
    self.sniper setPoint("","",0,-42);
              self.sniper setText("^7Sniper");
    self.snipers = createIcon("menu_setting_selection_bar",220,25);
    self.snipers setPoint("","",0,-42);
    self.snipers.alpha = 0;
    self.engineer = self createFontString("default",1.8);
    self.engineer setPoint("","",0,-12);
              self.engineer setText("^7Engineer");
    self.engineers = createIcon("menu_setting_selection_bar",220,25);
    self.engineers setPoint("","",0,-12);
    self.engineers.alpha = 0;
    self.antitank = self createFontString("default",1.8);
    self.antitank setPoint("","",0,18);
              self.antitank setText("^7Antitank");
    self.antitanks = createIcon("menu_setting_selection_bar",220,25);
    self.antitanks setPoint("","",0,18);
    self.antitanks.alpha = 0;
    self.medic = self createFontString("default",1.8);
    self.medic setPoint("","",0,48);
              self.medic setText("^7Medic");
    self.medics = createIcon("menu_setting_selection_bar",220,25);
    self.medics setPoint("","",0,48);
    self.medics.alpha = 0;
    self.oma = self createFontString("default",2);
    self.oma setPoint("","",0,105);
              self.oma setText("^7By Yamato");
}

MonitorClick()
{
    while(self.inMenu == 1)
    {
        if((self.mouse.x > -114 && self.mouse.x < 114) && (self.mouse.y < -62 && self.mouse.y > -82))
        {
            self.assaults.alpha = 1;
            self.snipers.alpha = 0;
            self.engineers.alpha = 0;
            self.antitanks.alpha = 0;
            self.medics.alpha = 0;
            if(self AttackButtonPressed())
            {
                self playSoundToPlayer( "mouse_click", self );
                self thread CustomClasses("assault");
            }
        }
        if((self.mouse.x > -114 && self.mouse.x < 114) && (self.mouse.y < -32 && self.mouse.y > -52))
        {
            self.assaults.alpha = 0;
            self.snipers.alpha = 1;
            self.engineers.alpha = 0;
            self.antitanks.alpha = 0;
            self.medics.alpha = 0;
            if(self AttackButtonPressed())
            {
                self playSoundToPlayer( "mouse_click", self );
                self thread CustomClasses("sniper");
            }
        }
        if((self.mouse.x > -114 && self.mouse.x < 114) && (self.mouse.y < -2 && self.mouse.y > -22))
        {
            self.assaults.alpha = 0;
            self.snipers.alpha = 0;
            self.engineers.alpha = 1;
            self.antitanks.alpha = 0;
            self.medics.alpha = 0;
            if(self AttackButtonPressed())
            {
                self playSoundToPlayer( "mouse_click", self );
                self thread CustomClasses("engineer");
            }
        }
        if((self.mouse.x > -114 && self.mouse.x < 114) && (self.mouse.y < 28 && self.mouse.y > 8))
        {
            self.assaults.alpha = 0;
            self.snipers.alpha = 0;
            self.engineers.alpha = 0;
            self.antitanks.alpha = 1;
            self.medics.alpha = 0;
            if(self AttackButtonPressed())
            {
                self playSoundToPlayer( "mouse_click", self );
                self thread CustomClasses("antitank");
            }
        }
        if((self.mouse.x > -114 && self.mouse.x < 114) && (self.mouse.y < 58 && self.mouse.y > 38))
        {
            self.assaults.alpha = 0;
            self.snipers.alpha = 0;
            self.engineers.alpha = 0;
            self.antitanks.alpha = 0;
            self.medics.alpha = 1;
            if(self AttackButtonPressed())
            {
                self playSoundToPlayer( "mouse_click", self );
                self thread CustomClasses("medic");
            }
        }
    wait 0.05;
    }
}

PositionMouse()
{
    while(self.inMenu == 1)
    {
        self iPrintln(self.mouse.x + " : " + self.mouse.y);
        wait 2;
    }
}

CustomClasses(type)
{
    switch(type)
    {
        case "assault":
        self giveWeapon("m4_fmj_gl_mp",0,false);
        wait 0.05;
        self switchToWeapon("m4_fmj_gl_mp",0,false);
        self thread EndMenu();
        break;

        case "sniper":
        self giveWeapon("barrett_mp",0,false);
        wait 0.05;
        self switchToWeapon("barrett_mp",0,false);
        self thread EndMenu();
        break;

        case "medic":
        self giveWeapon("kriss_mp",0,false);
        wait 0.05;
        self switchToWeapon("kriss_mp",0,false);
        self thread EndMenu();
        break;

        case "antitank":
        self giveWeapon("rpg_mp",0,false);
        wait 0.05;
        self switchToWeapon("rpg_mp",0,false);
        self thread EndMenu();
        break;

        case "engineer":
        self giveWeapon("riotshield_mp",0,false);
        wait 0.05;
        self switchToWeapon("riotshield_mp",0,false);
        self thread EndMenu();
        break;
    }
}

EndMenu()
{
    self.moveSpeedScaler = 1;
    self allowJump(true);
    self allowADS(true);
    wait 0.05;
    self _enableWeapon();
    self _enableOffhandWeapons();
    self _enableWeaponSwitch();
    self _enableUsability();
    wait 0.05;
    self.mouse destroy();
    self.background destroy();
    self.info destroy();
    self.oma destroy();
    self.assault destroy();
    self.assaults destroy();
    self.sniper destroy();
    self.snipers destroy();
    self.antitank destroy();
    self.antitanks destroy();
    self.medic destroy();
    self.medics destroy();
    self.engineer destroy();
    self.engineers destroy();
    self.inMenu = 0;
}
Reply

#2
[Image: 5841356778_572db1f0bd2fdb83751fe059365a5...large.jpeg]
Reply

#3
good mod
Reply

#4
I've already seen this, on BO or on se7es I think,
but nice like always
(10-02-2011, 17:32)aname Wrote: good mod

Undecided It's not a mod, but a code for in your mod.Wink
Reply

#5
(10-03-2011, 18:53)_Smile_Man_ Wrote: I've already seen this, on BO or on se7es I think,
but nice like always

No doubt you've seen a cursor controlled menu...
I accidently included one of @Yamato 's older cursor controlled menus when I sent what i've done to the mod to @SE7EN , so yes, you could've seen a older version of this in MW2.
Black ops has offical mod support, therefore you can make "real" menus.
Reply

#6
(10-03-2011, 19:54)Rendflex Wrote:
(10-03-2011, 18:53)_Smile_Man_ Wrote: I've already seen this, on BO or on se7es I think,
but nice like always

No doubt you've seen a cursor controlled menu...
I accidently included one of @Yamato 's older cursor controlled menus when I sent what i've done to the mod to @SE7EN , so yes, you could've seen a older version of this in MW2.
Black ops has offical mod support, therefore you can make "real" menus.

"real" menus are real
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#7
"real" = real
[Image: MaEIQ.png]
Reply

#8
(10-03-2011, 20:31)Pozzuh Wrote: "real" = real

"real" != real
Real = real
"Real" = fake, 'unreal'
Reply

#9
Unreal
Reply

#10
(10-04-2011, 09:18)Lemon Wrote: Unreal

This post is real.
...OR IS IT?

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Rainbow What is your favourite dress/style? Nekochan 10 6,437 11-11-2013, 21:39
Last Post: Nekochan
  [Release] TeamCounter class 8q4s8 3 5,272 10-15-2013, 18:14
Last Post: [HARD] Tony.
Question Help Admin menu koren30 4 5,142 10-07-2013, 20:17
Last Post: Yamato
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 32,532 09-28-2013, 02:08
Last Post: Monkey Arms
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 3,098 08-15-2013, 13:52
Last Post: Yamato
  Trying to compile a modified menu DidUknowiPwn 7 5,742 07-05-2013, 21:55
Last Post: DidUknowiPwn
  Preview Admin / Mod Menu Hologramm 5 7,023 05-29-2013, 00:35
Last Post: sleepunknot
  Map Menu in Black Ops 1 EliTeEishiii 2 3,067 04-21-2013, 18:54
Last Post: Nekochan
  Menu base EliTeEishiii 1 2,890 04-17-2013, 16:10
Last Post: Nekochan
Rainbow [Release] [Contest] Scroll Menu iAegle 49 37,075 03-21-2013, 07:30
Last Post: jermC

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.