r4432 - in branches/nexuiz-2.0: . data/qcsrc/menu/nexuiz misc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Sep 9 03:35:49 EDT 2008


Author: div0
Date: 2008-09-09 03:35:42 -0400 (Tue, 09 Sep 2008)
New Revision: 4432

Added:
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_weapons.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/weaponslist.c
Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/changes-since-last-release
   branches/nexuiz-2.0/misc/makebuild.sh
Log:
r4429 | div0 | 2008-09-09 09:06:17 +0200 (Tue, 09 Sep 2008) | 2 lines
update the changes list
r4430 | div0 | 2008-09-09 09:07:44 +0200 (Tue, 09 Sep 2008) | 2 lines
oops in makebuild.sh
r4431 | div0 | 2008-09-09 09:35:18 +0200 (Tue, 09 Sep 2008) | 2 lines
the usual (forgot two files)

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-09-09 07:35:18 UTC (rev 4431)
+++ branches/nexuiz-2.0/.patchsets	2008-09-09 07:35:42 UTC (rev 4432)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-4427
+revisions_applied = 1-4431

Modified: branches/nexuiz-2.0/changes-since-last-release
===================================================================
--- branches/nexuiz-2.0/changes-since-last-release	2008-09-09 07:35:18 UTC (rev 4431)
+++ branches/nexuiz-2.0/changes-since-last-release	2008-09-09 07:35:42 UTC (rev 4432)
@@ -8,11 +8,13 @@
 game: command movetoteam_red, ...
 game: command nospectators
 game: command vlogin must be used instead of vdo login now
+game: command weapbest
 game: crylink bounce does half damage
 game: crylink primary does 2 cells
 game: crylink weakened
 game: ctf flag touching when dead bug fixed
 game: cvar cl_weaponpriority* (custom weapon orders)
+game: cvar cl_weaponpriority_useforcycling
 game: cvar g_instagib REMOVED (no demand)
 game: cvar g_jump_grunt
 game: cvar g_maxplayers
@@ -78,6 +80,7 @@
 menu: mouse fixed in -game pro
 menu: new playermodel previews (sev)
 menu: play button in map info
+menu: weapon priority dialog
 menuskins: big buttons as extra graphics
 menuskins: COLOR_SCROLLBAR_C
 menuskins: HEIGHT_DIALOGBORDER

Copied: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_weapons.c (from rev 4431, trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_weapons.c)
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_weapons.c	                        (rev 0)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_weapons.c	2008-09-09 07:35:42 UTC (rev 4432)
@@ -0,0 +1,47 @@
+#ifdef INTERFACE
+CLASS(NexuizWeaponsDialog) EXTENDS(NexuizDialog)
+	METHOD(NexuizWeaponsDialog, toString, string(entity))
+	METHOD(NexuizWeaponsDialog, fill, void(entity))
+	METHOD(NexuizWeaponsDialog, showNotify, void(entity))
+	ATTRIB(NexuizWeaponsDialog, title, string, "Weapon priority")
+	ATTRIB(NexuizWeaponsDialog, color, vector, SKINCOLOR_DIALOG_WEAPONS)
+	ATTRIB(NexuizWeaponsDialog, intendedWidth, float, 0.3)
+	ATTRIB(NexuizWeaponsDialog, rows, float, 9.5)
+	ATTRIB(NexuizWeaponsDialog, columns, float, 4)
+	ATTRIB(NexuizWeaponsDialog, weaponsList, entity, NULL)
+ENDCLASS(NexuizWeaponsDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void showNotifyNexuizWeaponsDialog(entity me)
+{
+        loadAllCvars(me);
+}
+string toStringNexuizWeaponsDialog(entity me)
+{
+	return me.weaponsList.toString(me.weaponsList);
+}
+void fillNexuizWeaponsDialog(entity me)
+{
+	entity e;
+	me.TR(me);
+		me.TD(me, 1, 4, makeNexuizTextLabel(0, "Weapon priority list:"));
+	me.TR(me);
+		me.TD(me, me.rows - 3, 3, e = me.weaponsList = makeNexuizWeaponsList());
+	me.gotoRC(me, (me.rows - 1) / 2 - 1, 3);
+		me.TD(me, 1, 1, e = makeNexuizButton("Up", '0 0 0'));
+			e.onClick = WeaponsList_MoveUp_Click;
+			e.onClickEntity = me.weaponsList;
+	me.gotoRC(me, (me.rows - 1) / 2, 3);
+		me.TD(me, 1, 1, e = makeNexuizButton("Down", '0 0 0'));
+			e.onClick = WeaponsList_MoveDown_Click;
+			e.onClickEntity = me.weaponsList;
+	me.gotoRC(me, me.rows - 2, 0);
+		me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "cl_weaponpriority_useforcycling", "Use for weapon cycling"));
+	me.TR(me);
+		me.TD(me, 1, me.columns, e = makeNexuizButton("OK", '0 0 0'));
+			e.onClick = Dialog_Close;
+			e.onClickEntity = me;
+}
+
+#endif

Copied: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/weaponslist.c (from rev 4431, trunk/data/qcsrc/menu/nexuiz/weaponslist.c)
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/weaponslist.c	                        (rev 0)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/weaponslist.c	2008-09-09 07:35:42 UTC (rev 4432)
@@ -0,0 +1,131 @@
+#ifdef INTERFACE
+CLASS(NexuizWeaponsList) EXTENDS(NexuizListBox)
+	METHOD(NexuizWeaponsList, configureNexuizWeaponsList, void(entity))
+	METHOD(NexuizWeaponsList, toString, string(entity))
+	ATTRIB(NexuizWeaponsList, rowsPerItem, float, 1)
+	METHOD(NexuizWeaponsList, draw, void(entity))
+	METHOD(NexuizWeaponsList, drawListBoxItem, void(entity, float, vector, float))
+	METHOD(NexuizWeaponsList, resizeNotify, void(entity, vector, vector, vector, vector))
+	METHOD(NexuizWeaponsList, keyDown, float(entity, float, float, float))
+	ATTRIB(NexuizWeaponsList, realFontSize, vector, '0 0 0')
+	ATTRIB(NexuizWeaponsList, realUpperMargin, float, 0)
+	METHOD(NexuizWeaponsList, mouseDrag, float(entity, vector))
+	ATTRIB(NexuizWeaponsList, scrollbarWidth, float, 0)
+ENDCLASS(NexuizWeaponsList)
+entity makeNexuizWeaponsList();
+void WeaponsList_MoveUp_Click(entity btn, entity me);
+void WeaponsList_MoveDown_Click(entity box, entity me);
+#endif
+
+#ifdef IMPLEMENTATION
+entity makeNexuizWeaponsList()
+{
+	entity me;
+	me = spawnNexuizWeaponsList();
+	me.configureNexuizWeaponsList(me);
+	return me;
+}
+void configureNexuizWeaponsListNexuizWeaponsList(entity me)
+{
+	me.configureNexuizListBox(me);
+}
+void drawNexuizWeaponsList(entity me)
+{
+	// read in cvar?
+	string s, t;
+	s = cvar_string("cl_weaponpriority");
+	t = fixPriorityList(s, WEP_FIRST, WEP_LAST, 1);
+	if(t != s)
+	{
+		print("AUTOFIXED\n");
+		cvar_set("cl_weaponpriority", t);
+	}
+	me.nItems = tokenize(t);
+	drawListBox(me);
+}
+void WeaponsList_MoveUp_Click(entity box, entity me)
+{
+	if(me.selectedItem > 0)
+	{
+		cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem - 1, me.selectedItem));
+		me.selectedItem -= 1;
+	}
+}
+void WeaponsList_MoveDown_Click(entity box, entity me)
+{
+	if(me.selectedItem < me.nItems - 1)
+	{
+		cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, me.selectedItem + 1));
+		me.selectedItem += 1;
+	}
+}
+void resizeNotifyNexuizWeaponsList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
+{
+	resizeNotifyNexuizListBox(me, relOrigin, relSize, absOrigin, absSize);
+
+	me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight);
+	me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth));
+	me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
+}
+float mouseDragNexuizWeaponsList(entity me, vector pos)
+{
+	float f, i;
+	i = me.selectedItem;
+	f = mouseDragListBox(me, pos);
+	if(me.selectedItem != i)
+		cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i));
+	return f;
+}
+string WeaponName(float w)
+{
+	switch(w)
+	{
+		//%weaponaddpoint
+		case WEP_LASER:            return "Laser";
+		case WEP_SHOTGUN:          return "Shotgun";
+		case WEP_UZI:              return "Machine Gun";
+		case WEP_GRENADE_LAUNCHER: return "Mortar";
+		case WEP_ELECTRO:          return "Electro";
+		case WEP_CRYLINK:          return "Crylink";
+		case WEP_NEX:              return "Nex";
+		case WEP_HAGAR:            return "Hagar";
+		case WEP_ROCKET_LAUNCHER:  return "Rocket Launcher";
+		case WEP_PORTO:            return "Port-O-Launch";
+		case WEP_MINSTANEX:        return "MinstaNex";
+		default:                   return "(fix qcsrc/menu/nexuiz/weaponslist.c)";
+	}
+}
+string toStringNexuizWeaponsList(entity me)
+{
+	float n, i;
+	string s;
+	n = tokenize(cvar_string("cl_weaponpriority"));
+	s = "";
+	for(i = 0; i < n; ++i)
+		s = strcat(s, WeaponName(stof(argv(i))), ", ");
+	return substring(s, 0, strlen(s) - 2);
+}
+void drawListBoxItemNexuizWeaponsList(entity me, float i, vector absSize, float isSelected)
+{
+	if(isSelected)
+		draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
+	draw_Text(me.realUpperMargin * eY, WeaponName(stof(argv(i))), me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
+}
+
+float keyDownNexuizWeaponsList(entity me, float scan, float ascii, float shift)
+{
+	if(ascii == 43) // +
+	{
+		WeaponsList_MoveUp_Click(NULL, me);
+		return 1;
+	}
+	else if(scan == 45) // -
+	{
+		WeaponsList_MoveDown_Click(NULL, me);
+		return 1;
+	}
+	else if(keyDownListBox(me, scan, ascii, shift))
+		return 1;
+	return 0;
+}
+#endif

Modified: branches/nexuiz-2.0/misc/makebuild.sh
===================================================================
--- branches/nexuiz-2.0/misc/makebuild.sh	2008-09-09 07:35:18 UTC (rev 4431)
+++ branches/nexuiz-2.0/misc/makebuild.sh	2008-09-09 07:35:42 UTC (rev 4432)
@@ -7,6 +7,8 @@
 #   version=2.5     make a FINAL build
 #   tag=FOO         insert FOO before the date in build names
 
+base=`pwd`
+
 # customizable specific stuff
 basepk3=$base/data20080229.pk3 # 2.4
 hotbasepk3= # hotfix
@@ -27,8 +29,6 @@
 aft="perl -I/chroot/debian-etch/usr/share/aft /chroot/debian-etch/usr/bin/aft"
 # end system specific stuff
 
-base=`pwd`
-
 case "$pw" in
 	'')
 		zipflags=




More information about the nexuiz-commits mailing list