With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Removing handicap from the menu

Postby Barto » Mon Jun 03, 2013 11:11 pm

The title pretty much says everything, should we remove any reference of the handicap option and keep the /handicap command in the console?

I have read what Biondo thought about this option and I fully agree with him. We should remove this option for few reason:
  • New player don't understand this option and set it wrongly
  • It is some heritage from quake 3 which should have been removed for a while
  • If players would want to play with handicap, most of them already know how to set it up with the console command /handicap

So... If yes, let's act...

I've spent few minutes and I was able to remove this option without requiring much code change. Here are the files I changed:
ui/ingame_player.menu
Code: Select all
#include "ui/menudef.h"

{
\\ SETUP MENU \\

menuDef {
      name "ingame_player"
      visible 0
      fullscreen 0
   outOfBoundsClick         // this closes the window if it gets a click out of the rectangle
      rect 128 0 256 140
      focusColor 1 .75 0 1
   onOpen  { uiScript update "ui_GetName" }
   onClose { uiScript update "ui_SetName" }

itemDef {
   name window
   rect 0 0 256 80
   ownerdraw UI_INGAME_RECT
   visible 1
   decoration
   cvarTest "g_gametype"
   hideCvar { "0" ; "1" }
}

itemDef {
   name window
   rect 0 0 256 140
   ownerdraw UI_INGAME_RECT
   visible 1
   decoration
   cvarTest "g_gametype"
   showCvar { "0" ; "1" }
}

itemDef {
   name namefield
   group "playersettinggroup"
   type ITEM_TYPE_EDITFIELD
   style 0
   text "Name:"
   cvar "ui_Name"
   maxchars 26
   rect 20 40 256 20
   textalign ITEM_ALIGN_LEFT      
   textalignx 10
   textaligny 18
   textscale .27       
   outlinecolor 1 .5 .5 .5
   backcolor 0 0 0 0
   forecolor 1 1 1 1
   border 0
   bordercolor 0 0 0 0
   visible 1
}

/*
itemDef {
   name handicapfield
   group "playersettinggroup"
   style 0   
   text "Handicap:"
   ownerdraw UI_HANDICAP
   rect 20 60 256 20
   textalign ITEM_ALIGN_LEFT      
   textalignx 10
   textaligny 18
   textscale .27   
   outlinecolor 1 .5 .5 .5
   backcolor 0 0 0 0
   forecolor 1 1 1 1
   border 0
   bordercolor 0 0 0 0
   visible 1
}

itemDef {
   name effectentry
   group "playersettinggroup"
   text "Effect:"
   type 1
   style 0   
   rect 20 65 256 20
   textalign ITEM_ALIGN_LEFT   
   textalignx 10
   textaligny 18
   textscale .25       
   outlinecolor 1 .5 .5 .5
   backcolor 0 0 0 0
   forecolor 1 1 1 1
   border 0
   bordercolor 0 0 0 0
   visible 1
   decoration
   mouseEnterText { setitemcolor effectentry forecolor 1 .75 0 1 ; setfocus effectfield ; show message_effect }
   mouseExitText { setitemcolor playersettinggroup forecolor 1 1 1 1 ; hide message_effect }
}

itemDef {
   name effectfield
   group "playersettinggroup"
   style 0   
   ownerdraw UI_EFFECTS
   rect 20 65 256 20
   textalign ITEM_ALIGN_LEFT      
   textalignx 50
   textaligny 25
   outlinecolor 1 .5 .5 .5
   backcolor 0 0 0 0
   forecolor 1 1 1 1
   border 0
   bordercolor 0 0 0 0
   visible 1     
}

itemDef {
   name headlist
   rect 15 100 260 50
   type ITEM_TYPE_LISTBOX
   style WINDOW_STYLE_FILLED
   elementwidth 32
   elementheight 32
   elementtype LISTBOX_IMAGE
   feeder FEEDER_HEADS
   horizontalscroll
   backcolor 0 0 0 1
   border 1
   bordercolor .5 .5 .5 1
   forecolor 1 1 1 1
   visible 1
   cvarTest "g_gametype"
   showCvar { "3" ; "4" ; "5" ; "6" ; "7" ; "8" }
   mouseenter { setitemcolor headlist bordercolor 1 0 0 1 }
   mouseexit { setitemcolor headlist bordercolor .5 .5 .5 1 }
}
*/

itemDef {
   name headlist
   rect 17 65 221 50
   type ITEM_TYPE_LISTBOX
   style WINDOW_STYLE_FILLED
   elementwidth 32
   elementheight 32
   elementtype LISTBOX_IMAGE
   feeder FEEDER_Q3HEADS
   horizontalscroll
   backcolor .5 .5 .5 .5
   border 1
   bordercolor .5 .5 .5 1
   forecolor 1 1 1 1
   visible 1
   cvarTest "g_gametype"
   showCvar { "0" ; "1" }
   mouseenter {  }
   mouseexit {  }
}

}
}


ui/settings_player.menu
Code: Select all
#include "ui/menudef.h"

{
\\ SETUP MENU \\

menuDef {
    name "player_menu"
    visible 0
    fullscreen 0
   rect 0 50 640 371
    focusColor 1 .75 0 1
    style 1
    border 1
   onClose {
      uiScript saveControls
   }
   onOpen { }
   onEsc { close player_menu ; close setup_menu ; open main }


itemDef {
   name window
   group grpControlbutton
   rect 2 2 632 371   
   style WINDOW_STYLE_FILLED
   border 1
   bordercolor .5 .5 .5 .5
   forecolor 1 1 1 1
   backcolor 0 0 0 .5
   visible 1
   decoration
}

itemDef {
   name namefield
   group "playersettinggroup"
   type ITEM_TYPE_EDITFIELD
   style 0
   text "Name:"
   cvar "name"
   maxchars 26
   rect 60 130 256 20
   textalign ITEM_ALIGN_LEFT
   textalignx 10
   textaligny 18
   textscale .27       
   outlinecolor 1 .5 .5 .5
   backcolor 0 0 0 0
   forecolor 1 1 1 1
   border 0
   bordercolor 0 0 0 0
   visible 1
}

/*
itemDef {
   name handicapfield
   group "playersettinggroup"
   style 0   
   text "Handicap:"
   ownerdraw UI_HANDICAP
   rect 100 120 256 20
   textalign ITEM_ALIGN_LEFT      
   textalignx 10
   textaligny 18
   textscale .27   
   outlinecolor 1 .5 .5 .5
   backcolor 0 0 0 0
   forecolor 1 1 1 1
   border 0
   bordercolor 0 0 0 0
   visible 1
}
*/

itemDef {
   name headlist
   rect 67 160 281 50
   type ITEM_TYPE_LISTBOX
   style WINDOW_STYLE_FILLED
   elementwidth 32
   elementheight 32
   elementtype LISTBOX_IMAGE
   feeder FEEDER_Q3HEADS
   horizontalscroll
   backcolor .5 .5 .5 .5
   border 1
   bordercolor .5 .5 .5 1
   forecolor 1 1 1 1
   visible 1
   mouseenter {  }
   mouseexit {  }
}

itemDef {
   name window
   group grpControlbutton
   rect 425 30 150 330   
   style WINDOW_STYLE_FILLED
   border 1
   bordercolor 1 1 1 .5
   forecolor 1 1 1 1
   backcolor 1 1 1 .2
   visible 1
   decoration
}

itemDef {
   name modelselection
   ownerdraw UI_PLAYERMODEL
   rect 350 50 330 330
   style 1
   decoration
   visible 1
}

}
}


And here is a small pk3 that will let you test the changes if needed: z_ui.pk3 (just put it in smokinguns/ with the other pk3 files)

Now few questions:
Is there anything I should change?
Should I fork SG on github and make a pull request?
"Chuck Norris had to shorten his beard in the presence of Richard Stallman because two beards that awesome, so close would segfault the universe (again)."
User avatar
Barto
Jeuxlinux Admin
 
Posts: 360
Joined: Fri Oct 23, 2009 5:08 pm
Location: Switzerland



Re: Removing handicap from the menu

Postby Biondo » Wed Jun 05, 2013 7:26 am

Great work, Barto. Thank you for the attention. I'm waiting to read the opinion of others.
User avatar
Biondo
SG Website Designer
 
Posts: 543
Joined: Thu Oct 15, 2009 4:35 pm



Re: Removing handicap from the menu

Postby Barto » Wed Jun 05, 2013 10:21 am

Thanks Biondo for your suggestion and your testing help too.

Oh, and one more thing:
- I am open to hear and do changes (at least try) for the user interface.
- And I've created a fork on GitHub since I don't have the rights to modify directly the source code. I haven't made a pull request on SG sources (and I probably won't). Téquila, I'm waiting for your move.
"Chuck Norris had to shorten his beard in the presence of Richard Stallman because two beards that awesome, so close would segfault the universe (again)."
User avatar
Barto
Jeuxlinux Admin
 
Posts: 360
Joined: Fri Oct 23, 2009 5:08 pm
Location: Switzerland



Re: Removing handicap from the menu

Postby TheDoctor » Wed Jun 05, 2013 1:33 pm

Barto wrote:I'm open to changes to the user interface.

Well, previously, there were requests regarding direct weapon switching.
Image
User avatar
TheDoctor
Smokin' Amigo!
 
Posts: 818
Joined: Sun Jun 06, 2010 3:31 am



Re: Removing handicap from the menu

Postby Biondo » Wed Jun 05, 2013 9:22 pm

TheDoctor wrote:there were requests regarding direct weapon.


That feature would be very interesting, but Barto's improvement about Handicap is still ready to be applied. Maybe one step at a time ...
User avatar
Biondo
SG Website Designer
 
Posts: 543
Joined: Thu Oct 15, 2009 4:35 pm



Re: Removing handicap from the menu

Postby TheDoctor » Wed Jun 05, 2013 10:39 pm

Biondo wrote:
TheDoctor wrote:there were requests regarding direct weapon.

That feature would be very interesting, but Barto's improvement about Handicap is still ready to be applied. Maybe one step at a time ...

Of course. no need for creating an artificial dependency.

The next official update is probably in form a small additional .pk3 file. Even so, I would not expect an official update within the next months, unless somebody steps up as a person in charge of packing.
Image
User avatar
TheDoctor
Smokin' Amigo!
 
Posts: 818
Joined: Sun Jun 06, 2010 3:31 am



Re: Removing handicap from the menu

Postby Biondo » Wed Jun 05, 2013 10:43 pm

OK, now your thoughts are more clear.
BTW, TheDoctor, I see your signature as a "Broken image" icon.
User avatar
Biondo
SG Website Designer
 
Posts: 543
Joined: Thu Oct 15, 2009 4:35 pm



Re: Removing handicap from the menu

Postby Barto » Fri Jun 07, 2013 4:30 pm

I had an eye on the direct weapon switching but I haven't succeeded at the task (damn!).
Anyway, it *seems* that the file to look at is in code/cgame/cg_draw.c in the CheckWeaponChange(void) function (around line 4347).
"Chuck Norris had to shorten his beard in the presence of Richard Stallman because two beards that awesome, so close would segfault the universe (again)."
User avatar
Barto
Jeuxlinux Admin
 
Posts: 360
Joined: Fri Oct 23, 2009 5:08 pm
Location: Switzerland




Return to Code

Show Sidebar
Show Sidebar

User Control Panel