r94 - in trunk: . basezym basezym/menu basezym/menu/creategame basezym/menu/data basezym/menu/options basezym/menuqc basezym/menuqc/base basezym/menuqc/control basezym/menuqc/custom basezym/menuqc/system basezym/menuqc/util basezym/progsqc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Dec 31 14:49:16 EST 2007


Author: KadaverJack
Date: 2007-12-31 14:49:12 -0500 (Mon, 31 Dec 2007)
New Revision: 94

Modified:
   trunk/HowToSetup.txt
   trunk/basezym/
   trunk/basezym/menu/constants.menu
   trunk/basezym/menu/creategame.menu
   trunk/basezym/menu/creategame/basic.menu
   trunk/basezym/menu/creategame/game.menu
   trunk/basezym/menu/creategame/management.menu
   trunk/basezym/menu/creategame/maplist.menu
   trunk/basezym/menu/creategame/weapon.menu
   trunk/basezym/menu/credits.menu
   trunk/basezym/menu/data.menu
   trunk/basezym/menu/data/color.menu
   trunk/basezym/menu/data/effects.menu
   trunk/basezym/menu/data/game.menu
   trunk/basezym/menu/data/input.menu
   trunk/basezym/menu/data/key.menu
   trunk/basezym/menu/data/management.menu
   trunk/basezym/menu/data/player.menu
   trunk/basezym/menu/data/server.menu
   trunk/basezym/menu/data/serverlist.menu
   trunk/basezym/menu/data/sound.menu
   trunk/basezym/menu/data/video.menu
   trunk/basezym/menu/data/weapon.menu
   trunk/basezym/menu/ingame.menu
   trunk/basezym/menu/joingame.menu
   trunk/basezym/menu/main.menu
   trunk/basezym/menu/messagebox.menu
   trunk/basezym/menu/mission.menu
   trunk/basezym/menu/normal.menu
   trunk/basezym/menu/options.menu
   trunk/basezym/menu/options/color.menu
   trunk/basezym/menu/options/effects.menu
   trunk/basezym/menu/options/game.menu
   trunk/basezym/menu/options/input.menu
   trunk/basezym/menu/options/key.menu
   trunk/basezym/menu/options/player.menu
   trunk/basezym/menu/options/sound.menu
   trunk/basezym/menu/options/video.menu
   trunk/basezym/menu/quit.menu
   trunk/basezym/menu/templates.menu
   trunk/basezym/menu/test.menu
   trunk/basezym/menuqc/base/cursor.qc
   trunk/basezym/menuqc/base/cursor.qh
   trunk/basezym/menuqc/base/gfx.qc
   trunk/basezym/menuqc/base/gfx.qh
   trunk/basezym/menuqc/base/hostcache.qc
   trunk/basezym/menuqc/base/hostcache.qh
   trunk/basezym/menuqc/base/key.qc
   trunk/basezym/menuqc/base/key.qh
   trunk/basezym/menuqc/base/snd.qc
   trunk/basezym/menuqc/base/snd.qh
   trunk/basezym/menuqc/base/timer.qc
   trunk/basezym/menuqc/base/timer.qh
   trunk/basezym/menuqc/control/cinematic.qc
   trunk/basezym/menuqc/control/constants.qh
   trunk/basezym/menuqc/control/container.qc
   trunk/basezym/menuqc/control/custom.qc
   trunk/basezym/menuqc/control/items.qh
   trunk/basezym/menuqc/control/link.qc
   trunk/basezym/menuqc/custom/credits.qc
   trunk/basezym/menuqc/custom/credits.qh
   trunk/basezym/menuqc/custom/custom.qh
   trunk/basezym/menuqc/custom/joingame.qc
   trunk/basezym/menuqc/custom/joingame.qh
   trunk/basezym/menuqc/custom/key.qc
   trunk/basezym/menuqc/custom/key.qh
   trunk/basezym/menuqc/custom/messagebox.qc
   trunk/basezym/menuqc/custom/messagebox.qh
   trunk/basezym/menuqc/custom/video.qc
   trunk/basezym/menuqc/custom/video.qh
   trunk/basezym/menuqc/custom/visible.qc
   trunk/basezym/menuqc/mbuiltin.qc
   trunk/basezym/menuqc/menu.qc
   trunk/basezym/menuqc/menu.qh
   trunk/basezym/menuqc/msys.qc
   trunk/basezym/menuqc/progs.src
   trunk/basezym/menuqc/system/debug.qc
   trunk/basezym/menuqc/system/debug.qh
   trunk/basezym/menuqc/system/event_helper.qc
   trunk/basezym/menuqc/system/events.qc
   trunk/basezym/menuqc/system/events.qh
   trunk/basezym/menuqc/system/events_.qc
   trunk/basezym/menuqc/system/gc.qc
   trunk/basezym/menuqc/system/gc.qh
   trunk/basezym/menuqc/system/history.qc
   trunk/basezym/menuqc/system/history.qh
   trunk/basezym/menuqc/system/isframe.qc
   trunk/basezym/menuqc/system/isframe.qh
   trunk/basezym/menuqc/system/item.qh
   trunk/basezym/menuqc/system/mgfx.qc
   trunk/basezym/menuqc/system/mgfx.qh
   trunk/basezym/menuqc/system/parser.qc
   trunk/basezym/menuqc/system/parser.qh
   trunk/basezym/menuqc/system/structure.qc
   trunk/basezym/menuqc/system/structure.qh
   trunk/basezym/menuqc/todo
   trunk/basezym/menuqc/util/altstring.qc
   trunk/basezym/menuqc/util/altstring.qh
   trunk/basezym/menuqc/util/nfunction.qc
   trunk/basezym/menuqc/util/property.qc
   trunk/basezym/menuqc/util/property.qh
   trunk/basezym/menuqc/util/rect.qc
   trunk/basezym/menuqc/util/rect.qh
   trunk/basezym/menuqc/util/string.qc
   trunk/basezym/menuqc/util/string.qh
   trunk/basezym/menuqc/util/text.qc
   trunk/basezym/menuqc/util/text.qh
   trunk/basezym/menuqc/util/uid.qc
   trunk/basezym/menuqc/util/uid.qh
   trunk/basezym/menuqc/util/util.qh
   trunk/basezym/progsqc/actor.qc
   trunk/basezym/progsqc/bots.qc
   trunk/basezym/progsqc/damage.qc
   trunk/basezym/progsqc/decors.qc
   trunk/basezym/progsqc/defs.qc
   trunk/basezym/progsqc/dpextensions.qc
   trunk/basezym/progsqc/gamedefs.qc
   trunk/basezym/progsqc/inventory.qc
   trunk/basezym/progsqc/jumppads.qc
   trunk/basezym/progsqc/mapentities.qc
   trunk/basezym/progsqc/notes.txt
   trunk/basezym/progsqc/player.qc
   trunk/basezym/progsqc/progs.src
   trunk/basezym/progsqc/server.qc
   trunk/basezym/progsqc/structures.qc
   trunk/basezym/progsqc/util.qc
   trunk/basezym/progsqc/violence.qc
Log:
set svn:eol-style native on all text files



Property changes on: trunk/HowToSetup.txt
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/basezym
___________________________________________________________________
Name: svn:ignore
   + progs.dat
progs.lno


Modified: trunk/basezym/menu/constants.menu
===================================================================
--- trunk/basezym/menu/constants.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/constants.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,94 +1,94 @@
-// Property of Alientrap
-//
-// Constants
-
-// Item flags
-// TODO: keep this always in sync with its control/items.qh counterpart
-#define FlagTemplate		"1" 	// this is a template do not touch, do not draw - actually dont do anything with it
-#define	FlagEmbedded		"2" 	// the item cant be selected and all its children are embedded into its parent
-#define FlagHidden		"4" 	// events wont be called and it wont be drawn, etc.
-#define	FlagNoSelect		"8"	// cant be selected (but events will be called)
-#define	FlagConnected 		"16"	// only if connected (i.e. playing)
-#define	FlagServer		"32"	// only displayed if server
-#define	FlagDeveloper		"64"	// only displayed if developer
-#define	FlagDraw		"128"	// only the draw event will be called
-#define	FlagChildDraw		"256"	// used to make the children only drawable
-#define	FlagDrawUpdate		"512"	// only the draw and update event get called
-#define FlagChildDrawUpdate	"1024"	// only the draw and refresh events are called for children
-#define FlagSealOffMouse	"2048" 	// used to seal all items under the item with this flag off from mouse events
-
-#define InfiniteFloat		"10000000.0"
-#define InfiniteVector		"10000000.0 10000000.0 10000000.0"
-
-// Alignment constants
-#define AlignLeft	"0"
-#define AlignCenter	"1"
-#define	AlignRight	"2"
-#define AlignFixLeft 	"4"	// |text - actually this isnt necessary
-#define AlignFixCenter 	"8"	// te|xt
-#define AlignFixRight	"16"	// text|
-#define AlignFirst	"32"	// for layouts: item| ... | being the origin
-
-// DrawFlag constants
-#define DrawFlagNormal		"0"
-#define DrawFlagAdditive 	"1"
-#define DrawFlagModulate	"2"
-#define DrawFlag2xModulate	"3"
-
-// Item constants
-#define DefaultFontSize 	"11 11 0"
-
-//  Text constants
-#define DefaultTextColor 	"0 0 0"
-#define DefaultTextAlpha	"1"
-#define DefaultTextDrawFlag	[DrawFlagNormal]
-
-#define	DefaultSelTextColor	"0 0 1"
-#define DefaultSelTextAlpha	"1"
-#define DefaultSelTextDrawFlag	[DrawFlagNormal]
-
-#define DefaultPreTextColor	"1 0 0"
-#define DefaultPreTextAlpha	"1"
-#define DefaultPreTextDrawFlag	[DrawFlagNormal]
-
-#define DefaultInaTextColor	"0.1 0.1 0.5"
-#define DefaultInaTextAlpha	"1"
-#define DefaultInaTextDrawFlag	[DrawFlagNormal]
-
-//  Picture constants
-#define DefaultPicColor		"1 1 1"
-#define DefaultPicAlpha		"1"
-#define DefaultPicDrawFlag	[DrawFlagNormal]
-
-#define DefaultSelPicColor	"0.2 0.2 1"
-#define DefaultSelPicAlpha	"1"
-#define DefaultSelPicDrawFlag	[DrawFlagNormal]
-
-#define DefaultPrePicColor	"1 0.2 0.2"
-#define DefaultPrePicAlpha	"1"
-#define DefaultPrePicDrawFlag	[DrawFlagNormal]
-
-// Sound constants
-#define DefaultSelectSound	"misc/menu1.wav"
-#define DefaultPressSound	"misc/mouseclick.wav"
-
-#define DefaultIncreaseSound	"misc/increasevalue.wav"
-#define DefaultDecreaseSound	"misc/decreasevalue.wav"
-
-#define DefaultStartSound	"misc/startgame.wav"
-#define DefaultEndSound		"misc/endgame.wav"
-
-// Slider
-#define DefaultSliderBar	"gfx/scroll_backtilt"
-#define DefaultSlider		"gfx/scroll_mover"
-#define DefaultSliderBarSize	"144 12"
-#define DefaultSliderSize	"12 12"
-#define DefaultProportions	"0.073107 0.853785 0.073107"
-#define DefaultDirection	"0.5 0.5"
-
-// EditBoxs
-#define DefaultCursorSize	"1.375 12 0"
-#define DefaultCursorFlashSize	"1.375 12 0"
-#define DefaultCursorColor	"0 0 0"
-#define DefaultCursorFlashColor "0 0 0"
-
+// Property of Alientrap
+//
+// Constants
+
+// Item flags
+// TODO: keep this always in sync with its control/items.qh counterpart
+#define FlagTemplate		"1" 	// this is a template do not touch, do not draw - actually dont do anything with it
+#define	FlagEmbedded		"2" 	// the item cant be selected and all its children are embedded into its parent
+#define FlagHidden		"4" 	// events wont be called and it wont be drawn, etc.
+#define	FlagNoSelect		"8"	// cant be selected (but events will be called)
+#define	FlagConnected 		"16"	// only if connected (i.e. playing)
+#define	FlagServer		"32"	// only displayed if server
+#define	FlagDeveloper		"64"	// only displayed if developer
+#define	FlagDraw		"128"	// only the draw event will be called
+#define	FlagChildDraw		"256"	// used to make the children only drawable
+#define	FlagDrawUpdate		"512"	// only the draw and update event get called
+#define FlagChildDrawUpdate	"1024"	// only the draw and refresh events are called for children
+#define FlagSealOffMouse	"2048" 	// used to seal all items under the item with this flag off from mouse events
+
+#define InfiniteFloat		"10000000.0"
+#define InfiniteVector		"10000000.0 10000000.0 10000000.0"
+
+// Alignment constants
+#define AlignLeft	"0"
+#define AlignCenter	"1"
+#define	AlignRight	"2"
+#define AlignFixLeft 	"4"	// |text - actually this isnt necessary
+#define AlignFixCenter 	"8"	// te|xt
+#define AlignFixRight	"16"	// text|
+#define AlignFirst	"32"	// for layouts: item| ... | being the origin
+
+// DrawFlag constants
+#define DrawFlagNormal		"0"
+#define DrawFlagAdditive 	"1"
+#define DrawFlagModulate	"2"
+#define DrawFlag2xModulate	"3"
+
+// Item constants
+#define DefaultFontSize 	"11 11 0"
+
+//  Text constants
+#define DefaultTextColor 	"0 0 0"
+#define DefaultTextAlpha	"1"
+#define DefaultTextDrawFlag	[DrawFlagNormal]
+
+#define	DefaultSelTextColor	"0 0 1"
+#define DefaultSelTextAlpha	"1"
+#define DefaultSelTextDrawFlag	[DrawFlagNormal]
+
+#define DefaultPreTextColor	"1 0 0"
+#define DefaultPreTextAlpha	"1"
+#define DefaultPreTextDrawFlag	[DrawFlagNormal]
+
+#define DefaultInaTextColor	"0.1 0.1 0.5"
+#define DefaultInaTextAlpha	"1"
+#define DefaultInaTextDrawFlag	[DrawFlagNormal]
+
+//  Picture constants
+#define DefaultPicColor		"1 1 1"
+#define DefaultPicAlpha		"1"
+#define DefaultPicDrawFlag	[DrawFlagNormal]
+
+#define DefaultSelPicColor	"0.2 0.2 1"
+#define DefaultSelPicAlpha	"1"
+#define DefaultSelPicDrawFlag	[DrawFlagNormal]
+
+#define DefaultPrePicColor	"1 0.2 0.2"
+#define DefaultPrePicAlpha	"1"
+#define DefaultPrePicDrawFlag	[DrawFlagNormal]
+
+// Sound constants
+#define DefaultSelectSound	"misc/menu1.wav"
+#define DefaultPressSound	"misc/mouseclick.wav"
+
+#define DefaultIncreaseSound	"misc/increasevalue.wav"
+#define DefaultDecreaseSound	"misc/decreasevalue.wav"
+
+#define DefaultStartSound	"misc/startgame.wav"
+#define DefaultEndSound		"misc/endgame.wav"
+
+// Slider
+#define DefaultSliderBar	"gfx/scroll_backtilt"
+#define DefaultSlider		"gfx/scroll_mover"
+#define DefaultSliderBarSize	"144 12"
+#define DefaultSliderSize	"12 12"
+#define DefaultProportions	"0.073107 0.853785 0.073107"
+#define DefaultDirection	"0.5 0.5"
+
+// EditBoxs
+#define DefaultCursorSize	"1.375 12 0"
+#define DefaultCursorFlashSize	"1.375 12 0"
+#define DefaultCursorColor	"0 0 0"
+#define DefaultCursorFlashColor "0 0 0"
+


Property changes on: trunk/basezym/menu/constants.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/creategame/basic.menu
===================================================================
--- trunk/basezym/menu/creategame/basic.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/creategame/basic.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,59 +1,59 @@
-// Property of Alientrap/AK
-//
-// mission/basic.menu
-Item Window Basic
-{
-	//size	'600 600'
-	//size '900 585'
-
-	Item Layout Layout
-	//Item Window Map
-	{
-		size '400 585'
-		flag [FlagEmbedded]
-
-//		Derive Picture Picture
-//		{
-//			picture "gfx/sub_background"
-//			size	'350 300'
-//			pos	'50 20'
-//		}
-//		Derive MultiLabel Description
-//		{
-//			pos	'50 320'
-//			size	'350 50'
-//			wrap	31
-//			fontSize '11 11 0'
-//		}
-//		Derive TextButton Prev
-//		{
-//			normal	"<<"
-//			pos	'50 5'
-//			action	Nex_Action_MapSelector_Prev
-//		}
-//		Derive Label Name
-//		{
-//			alignment	[AlignCenter]
-//			size		'306 14'
-//			pos		'44 4'
-//		}
-//		Derive TextButton Next
-//		{
-//			normal	">>"
-//			pos	'378 5'
-//
-//			action	Nex_Action_MapSelector_Next
-//		}
-//		Derive TextButton Start
-//		{
-//			pos	'225 370'
-//			normal		"Start"
-//
-//			action	Nex_Action_Map_Start
-//		}
-//		Item Task_Job UpdateJob
-//		{
-//			update 	Nex_MapSelector_UpdateMap
-//		}
-	}
-}
+// Property of Alientrap/AK
+//
+// mission/basic.menu
+Item Window Basic
+{
+	//size	'600 600'
+	//size '900 585'
+
+	Item Layout Layout
+	//Item Window Map
+	{
+		size '400 585'
+		flag [FlagEmbedded]
+
+//		Derive Picture Picture
+//		{
+//			picture "gfx/sub_background"
+//			size	'350 300'
+//			pos	'50 20'
+//		}
+//		Derive MultiLabel Description
+//		{
+//			pos	'50 320'
+//			size	'350 50'
+//			wrap	31
+//			fontSize '11 11 0'
+//		}
+//		Derive TextButton Prev
+//		{
+//			normal	"<<"
+//			pos	'50 5'
+//			action	Nex_Action_MapSelector_Prev
+//		}
+//		Derive Label Name
+//		{
+//			alignment	[AlignCenter]
+//			size		'306 14'
+//			pos		'44 4'
+//		}
+//		Derive TextButton Next
+//		{
+//			normal	">>"
+//			pos	'378 5'
+//
+//			action	Nex_Action_MapSelector_Next
+//		}
+//		Derive TextButton Start
+//		{
+//			pos	'225 370'
+//			normal		"Start"
+//
+//			action	Nex_Action_Map_Start
+//		}
+//		Item Task_Job UpdateJob
+//		{
+//			update 	Nex_MapSelector_UpdateMap
+//		}
+	}
+}


Property changes on: trunk/basezym/menu/creategame/basic.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/creategame/game.menu
===================================================================
--- trunk/basezym/menu/creategame/game.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/creategame/game.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,138 +1,138 @@
-// Property of Alientrap/AK
-//
-// mission/game.menu
-Item Layout Game
-{
-	direction	[Nex_DefaultVertDirection]
-	size 		'900 585'
-	origin		'450 0'
-	alignment	[AlignFirst]
-
-	DeriveTemplate Nex_Composition Nex_Option_EditBox
-	{
-		DeriveTemplate Nex_Automation_Option_EditBox Automation
-		{}
-		DeriveTemplate TextButton Description
-		{}
-		DeriveTemplate EditBox EditBox
-		{
-			size 	'260 12'
-			action  Nex_Action_TestOnChange
-			select  Nex_Action_TestOnSelect
-		}
-	}
-
-	Derive Nex_Option_Switch Instagib
-	{
-		text	"Instagib"
-		target	"::Data::Game::Instagib::Switch"
-	}
-	Derive Nex_Option_Switch Rocketarena
-	{
-		text	"Rocket Arena"
-		target	"::Data::Game::RocketArena::Switch"
-	}
-	Derive Nex_Option_Switch Vampire
-	{
-		text	"Vampire Mode"
-		target	"::Data::Game::Vampire::Switch"
-	}
-	Derive Nex_Option_Switch Casings
-	{
-		text	"Bullet Casings"
-		target	"::Data::Game::Casings::Switch"
-	}
-	Derive Nex_Option_EditBox HealthStart
-	{
-		text	"Starting Health"
-		target	"Data::Game::HealthStart::Text"
-	}
-	Derive Nex_Option_EditBox HealthRot
-	{
-		text	"Health Rot"
-		target	"Data::Game::HealthRot::Text"
-	}
-	Derive Nex_Option_EditBox HealthStable
-	{
-		text	"Health Stable"
-		target	"Data::Game::HealthStable::Text"
-	}
-	Derive Nex_Option_EditBox Gravity
-	{
-		text	"Level Gravity"
-		target	"Data::Game::Gravity::Text"
-	}
-	Derive Nex_Option_EditBox Maxspeed
-	{
-		text	"Player Maxspeed"
-		target	"Data::Game::MaxSpeed::Text"
-	}
-	Derive Nex_Option_EditBox Gamespeed
-	{
-		text	"Game Speed"
-		target	"Data::Game::GameSpeed::Text"
-	}
-	Derive Nex_Option_EditBox Maxairspeed
-	{
-		text	"Max Air Speed"
-		target	"Data::Game::MaxAirSpeed::Text"
-	}
-	Derive Nex_Option_EditBox JumpHeight
-	{
-		text	"Jump height"
-		target	"Data::Game::JumpHeight::Text"
-	}
-	Derive Nex_Option_EditBox HealthRegeneration
-	{
-		text	"Health Regeneration Speed"
-		target	"Data::Game::HealthRegeneration::Text"
-	}
-	Derive Nex_Option_EditBox ArmorRott
-	{
-		text	"Armor Rot Speed"
-		target	"Data::Game::ArmorRott::Text"
-	}
-	Derive Nex_Option_EditBox ArmorRegen
-	{
-		text	"Armor Regeneration Speed"
-		target	"Data::Game::ArmorRegen::Text"
-	}
-	Derive Nex_Option_EditBox ArmorStable
-	{
-		text	"Armor Stable"
-		target	"Data::Game::ArmorStable::Text"
-	}
-	Derive Nex_Option_EditBox ArmorStart
-	{
-		text	"Armor Start"
-		target	"Data::Game::ArmorStart::Text"
-	}
-	Derive Nex_Option_EditBox SelfDamagePercent
-	{
-		text	"Self Damage Percent"
-		target	"Data::Game::SelfDamagePercent::Text"
-	}
-	Derive Nex_Option_EditBox WeaponSwitchDelay
-	{
-		text	"Weapon Switch Delay"
-		target	"Data::Game::WeaponSwitchDelay::Text"
-	}
-	Derive Nex_Option_EditBox Friction
-	{
-		text	"Player Friction"
-		target	"Data::Game::Friction::Text"
-	}
-	Derive Nex_Option_EditBox Accelerate
-	{
-		text	"Player Accelerate"
-		target	"Data::Game::Accelerate::Text"
-	}
-	Derive Nex_Line	Seperator
-	{}
-	Derive TextButton Reset
-	{
-		normal	"Reset to default"
-		init	Nex_Action_ResetData
-		target	"::Data::Game"
-	}
-}
+// Property of Alientrap/AK
+//
+// mission/game.menu
+Item Layout Game
+{
+	direction	[Nex_DefaultVertDirection]
+	size 		'900 585'
+	origin		'450 0'
+	alignment	[AlignFirst]
+
+	DeriveTemplate Nex_Composition Nex_Option_EditBox
+	{
+		DeriveTemplate Nex_Automation_Option_EditBox Automation
+		{}
+		DeriveTemplate TextButton Description
+		{}
+		DeriveTemplate EditBox EditBox
+		{
+			size 	'260 12'
+			action  Nex_Action_TestOnChange
+			select  Nex_Action_TestOnSelect
+		}
+	}
+
+	Derive Nex_Option_Switch Instagib
+	{
+		text	"Instagib"
+		target	"::Data::Game::Instagib::Switch"
+	}
+	Derive Nex_Option_Switch Rocketarena
+	{
+		text	"Rocket Arena"
+		target	"::Data::Game::RocketArena::Switch"
+	}
+	Derive Nex_Option_Switch Vampire
+	{
+		text	"Vampire Mode"
+		target	"::Data::Game::Vampire::Switch"
+	}
+	Derive Nex_Option_Switch Casings
+	{
+		text	"Bullet Casings"
+		target	"::Data::Game::Casings::Switch"
+	}
+	Derive Nex_Option_EditBox HealthStart
+	{
+		text	"Starting Health"
+		target	"Data::Game::HealthStart::Text"
+	}
+	Derive Nex_Option_EditBox HealthRot
+	{
+		text	"Health Rot"
+		target	"Data::Game::HealthRot::Text"
+	}
+	Derive Nex_Option_EditBox HealthStable
+	{
+		text	"Health Stable"
+		target	"Data::Game::HealthStable::Text"
+	}
+	Derive Nex_Option_EditBox Gravity
+	{
+		text	"Level Gravity"
+		target	"Data::Game::Gravity::Text"
+	}
+	Derive Nex_Option_EditBox Maxspeed
+	{
+		text	"Player Maxspeed"
+		target	"Data::Game::MaxSpeed::Text"
+	}
+	Derive Nex_Option_EditBox Gamespeed
+	{
+		text	"Game Speed"
+		target	"Data::Game::GameSpeed::Text"
+	}
+	Derive Nex_Option_EditBox Maxairspeed
+	{
+		text	"Max Air Speed"
+		target	"Data::Game::MaxAirSpeed::Text"
+	}
+	Derive Nex_Option_EditBox JumpHeight
+	{
+		text	"Jump height"
+		target	"Data::Game::JumpHeight::Text"
+	}
+	Derive Nex_Option_EditBox HealthRegeneration
+	{
+		text	"Health Regeneration Speed"
+		target	"Data::Game::HealthRegeneration::Text"
+	}
+	Derive Nex_Option_EditBox ArmorRott
+	{
+		text	"Armor Rot Speed"
+		target	"Data::Game::ArmorRott::Text"
+	}
+	Derive Nex_Option_EditBox ArmorRegen
+	{
+		text	"Armor Regeneration Speed"
+		target	"Data::Game::ArmorRegen::Text"
+	}
+	Derive Nex_Option_EditBox ArmorStable
+	{
+		text	"Armor Stable"
+		target	"Data::Game::ArmorStable::Text"
+	}
+	Derive Nex_Option_EditBox ArmorStart
+	{
+		text	"Armor Start"
+		target	"Data::Game::ArmorStart::Text"
+	}
+	Derive Nex_Option_EditBox SelfDamagePercent
+	{
+		text	"Self Damage Percent"
+		target	"Data::Game::SelfDamagePercent::Text"
+	}
+	Derive Nex_Option_EditBox WeaponSwitchDelay
+	{
+		text	"Weapon Switch Delay"
+		target	"Data::Game::WeaponSwitchDelay::Text"
+	}
+	Derive Nex_Option_EditBox Friction
+	{
+		text	"Player Friction"
+		target	"Data::Game::Friction::Text"
+	}
+	Derive Nex_Option_EditBox Accelerate
+	{
+		text	"Player Accelerate"
+		target	"Data::Game::Accelerate::Text"
+	}
+	Derive Nex_Line	Seperator
+	{}
+	Derive TextButton Reset
+	{
+		normal	"Reset to default"
+		init	Nex_Action_ResetData
+		target	"::Data::Game"
+	}
+}


Property changes on: trunk/basezym/menu/creategame/game.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/creategame/management.menu
===================================================================
--- trunk/basezym/menu/creategame/management.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/creategame/management.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,90 +1,90 @@
-// Property of Alientrap/AK
-//
-// mission/management.menu
-Item Layout Management
-{
-	size		'900 585'
-	flag		[FlagEmbedded]
-	alignment 	[AlignCenter]
-	direction 	'0 20'
-	origin		'450 0'
-
-	Item Arrangement ConfigType
-	{
-		flag 		[FlagEmbedded]
-		direction 	'20 0'
-
-		Derive TextButton WeaponConfigs
-		{
-			normal	"Weapons"
-			action  Nex_Action_Management_TypeWeapon
-		}
-		Derive TextButton GameConfigs
-		{
-			normal	"Game"
-			action  Nex_Action_Management_TypeGame
-		}
-		Derive TextButton Maplists
-		{
-			normal	"Maplists"
-			action  Nex_Action_Management_TypeMapList
-		}
-	}
-
-	Item Task_Job SyncCategory
-	{
-		update 	Nex_Update_Management_SyncData
-	}
-
-	Derive List FileList
-	{
-		size	'300 340'
-		target	"::Data::Management::FileList::Weapon"
-
-		action 	Nex_Action_CopyToFilename
-	}
-
-	Item Arrangement Filename
-	{
-		flag		[FlagEmbedded]
-		direction	[Nex_DefaultHorzDirection]
-
-		Derive TextButton Label
-		{
-			normal	"Config Name :"
-			link	"##next"
-		}
-		Derive EditBox Name
-		{
-			//size	'260 11'
-			target	"::Data::Management::Filename::Text"
-
-			action  Nex_Action_TestOnChange
-			select  Nex_Action_TestOnSelect
-		}
-	}
-
-	Item Arrangement Controls
-	{
-		flag		[FlagEmbedded]
-		direction	[Nex_DefaultHorzDirection]
-
-		Derive TextButton Save
-		{
-			normal	"Save"
-			action	Nex_Action_Management_Save
-		}
-
-		Derive TextButton Load
-		{
-			normal 	"Load"
-			action 	Nex_Action_Management_Load
-		}
-
-		Derive TextButton Refresh
-		{
-			normal 	"Refresh"
-			action	Nex_Action_Management_Refresh
-		}
-	}
-}
+// Property of Alientrap/AK
+//
+// mission/management.menu
+Item Layout Management
+{
+	size		'900 585'
+	flag		[FlagEmbedded]
+	alignment 	[AlignCenter]
+	direction 	'0 20'
+	origin		'450 0'
+
+	Item Arrangement ConfigType
+	{
+		flag 		[FlagEmbedded]
+		direction 	'20 0'
+
+		Derive TextButton WeaponConfigs
+		{
+			normal	"Weapons"
+			action  Nex_Action_Management_TypeWeapon
+		}
+		Derive TextButton GameConfigs
+		{
+			normal	"Game"
+			action  Nex_Action_Management_TypeGame
+		}
+		Derive TextButton Maplists
+		{
+			normal	"Maplists"
+			action  Nex_Action_Management_TypeMapList
+		}
+	}
+
+	Item Task_Job SyncCategory
+	{
+		update 	Nex_Update_Management_SyncData
+	}
+
+	Derive List FileList
+	{
+		size	'300 340'
+		target	"::Data::Management::FileList::Weapon"
+
+		action 	Nex_Action_CopyToFilename
+	}
+
+	Item Arrangement Filename
+	{
+		flag		[FlagEmbedded]
+		direction	[Nex_DefaultHorzDirection]
+
+		Derive TextButton Label
+		{
+			normal	"Config Name :"
+			link	"##next"
+		}
+		Derive EditBox Name
+		{
+			//size	'260 11'
+			target	"::Data::Management::Filename::Text"
+
+			action  Nex_Action_TestOnChange
+			select  Nex_Action_TestOnSelect
+		}
+	}
+
+	Item Arrangement Controls
+	{
+		flag		[FlagEmbedded]
+		direction	[Nex_DefaultHorzDirection]
+
+		Derive TextButton Save
+		{
+			normal	"Save"
+			action	Nex_Action_Management_Save
+		}
+
+		Derive TextButton Load
+		{
+			normal 	"Load"
+			action 	Nex_Action_Management_Load
+		}
+
+		Derive TextButton Refresh
+		{
+			normal 	"Refresh"
+			action	Nex_Action_Management_Refresh
+		}
+	}
+}


Property changes on: trunk/basezym/menu/creategame/management.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/creategame/maplist.menu
===================================================================
--- trunk/basezym/menu/creategame/maplist.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/creategame/maplist.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,72 +1,72 @@
-// Property of Alientrap/AK
-//
-// mission/maplist.menu
-Item Window MapList
-{
-	size '900 585'
-
-	Derive Label MapsLabel
-	{
-		pos	'0 0'
-		text	"Map List:"
-	}
-	Derive List Maps
-	{
-		pos	'0 20'
-		size	'425 500'
-
-		target	"::Data::Server::Map::List"
-		action	Nex_Action_Cycle_Add
-	}
-	Derive Label CycleLabel
-	{
-		pos	'475 0'
-		text	"Cycle List:"
-	}
-	Derive List Cycle
-	{
-		pos	'475 20'
-		size	'425 450'
-
-		target	"::Data::Server::Map::Cycle"
-		action	Nex_Action_Cycle_Remove
-	}
-	Item Layout Panel
-	{
-		pos	'475 470'
-		size	'425 30'
-		direction	[Nex_DefaultHorzDirection]
-		flag 		[FlagEmbedded]
-
-		Derive TextButton Add
-		{
-			normal 	"Add"
-
-			action	Nex_Action_Cycle_Add
-		}
-		Derive TextButton Remove
-		{
-			normal 	"Remove"
-
-			action	Nex_Action_Cycle_Remove
-		}
-		Derive TextButton MoveUp
-		{
-			normal 	"Move Up"
-
-			action	Nex_Action_Cycle_MoveUp
-		}
-		Derive TextButton MoveDown
-		{
-			normal 	"Move Down"
-
-			action	Nex_Action_Cycle_MoveDown
-		}
-		Derive TextButton Clear
-		{
-			normal	"Clear"
-
-			action	Nex_Action_Cycle_Clear
-		}
-	}
-}
+// Property of Alientrap/AK
+//
+// mission/maplist.menu
+Item Window MapList
+{
+	size '900 585'
+
+	Derive Label MapsLabel
+	{
+		pos	'0 0'
+		text	"Map List:"
+	}
+	Derive List Maps
+	{
+		pos	'0 20'
+		size	'425 500'
+
+		target	"::Data::Server::Map::List"
+		action	Nex_Action_Cycle_Add
+	}
+	Derive Label CycleLabel
+	{
+		pos	'475 0'
+		text	"Cycle List:"
+	}
+	Derive List Cycle
+	{
+		pos	'475 20'
+		size	'425 450'
+
+		target	"::Data::Server::Map::Cycle"
+		action	Nex_Action_Cycle_Remove
+	}
+	Item Layout Panel
+	{
+		pos	'475 470'
+		size	'425 30'
+		direction	[Nex_DefaultHorzDirection]
+		flag 		[FlagEmbedded]
+
+		Derive TextButton Add
+		{
+			normal 	"Add"
+
+			action	Nex_Action_Cycle_Add
+		}
+		Derive TextButton Remove
+		{
+			normal 	"Remove"
+
+			action	Nex_Action_Cycle_Remove
+		}
+		Derive TextButton MoveUp
+		{
+			normal 	"Move Up"
+
+			action	Nex_Action_Cycle_MoveUp
+		}
+		Derive TextButton MoveDown
+		{
+			normal 	"Move Down"
+
+			action	Nex_Action_Cycle_MoveDown
+		}
+		Derive TextButton Clear
+		{
+			normal	"Clear"
+
+			action	Nex_Action_Cycle_Clear
+		}
+	}
+}


Property changes on: trunk/basezym/menu/creategame/maplist.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/creategame/weapon.menu
===================================================================
--- trunk/basezym/menu/creategame/weapon.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/creategame/weapon.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,396 +1,396 @@
-// Property of Alientrap/AK
-//
-// mission/weapon.menu
-Item Window Weapon
-{
-	size	'900 585'
-	flag	[FlagEmbedded]
-
-	Item ScrollWindow ScrollWindow
-	{
-		size 	'880 585'
-		flag	[FlagEmbedded]
-
-		Item Arrangement Arrangement
-		{
-			direction	[Nex_DefaultVertDirection]
-			alignment	[AlignFirst]
-			flag		[FlagEmbedded]
-
-			// hack to make the arrangement have a set width
-			Item Window FixWidth
-			{
-				size	'900 0'
-				Derive Nex_Void Left
-				{
-					pos	'0 0'
-					size	'450 0'
-				}
-				Derive Nex_Void Right
-				{
-					pos	'450 0'
-					size	'450 0'
-				}
-			}
-
-			DeriveTemplate Nex_Composition Nex_Option_EditBox
-			{
-				DeriveTemplate Nex_Automation_Option_EditBox Automation
-				{}
-				DeriveTemplate TextButton Description
-				{}
-				DeriveTemplate EditBox EditBox
-				{
-					size 	'260 12'
-					action  Nex_Action_TestOnChange
-					select  Nex_Action_TestOnSelect
-				}
-			}
-
-			Derive Nex_Option_EditBox InvincibleTakeDamage
-			{
-				text	"Invincible Take Damage"
-				target	"Data::Weapon::InvincibleTakeDamage::Text"
-			}
-			Derive Nex_Option_EditBox InvincibleTime
-			{
-				text	"Invincible Time"
-				target	"Data::Weapon::InvincibleTime::Text"
-			}
-			Derive Nex_Option_EditBox StrengthDamage
-			{
-				text	"Strength Damage"
-				target	"Data::Weapon::StrengthDamage::Text"
-			}
-			Derive Nex_Option_EditBox StrengthForce
-			{
-				text	"Strength Force"
-				target	"Data::Weapon::StrengthForce::Text"
-			}
-			Derive Nex_Option_EditBox StrengthTime
-			{
-				text	"Strength Time"
-				target	"Data::Weapon::StrengthTime::Text"
-			}
-			Derive Nex_Option_EditBox LaserDamage
-			{
-				text	"Laser Damage"
-				target	"Data::Weapon::LaserDamage::Text"
-			}
-			Derive Nex_Option_EditBox LaserEdgeDamage
-			{
-				text	"Laser edge damage"
-				target	"Data::Weapon::LaserEdgeDamage::Text"
-			}
-			Derive Nex_Option_EditBox LaserForce
-			{
-				text	"Laser Push Force"
-				target	"Data::Weapon::LaserForce::Text"
-			}
-			Derive Nex_Option_EditBox LaserRadius
-			{
-				text	"Laser Radius"
-				target	"Data::Weapon::LaserRadius::Text"
-			}
-			Derive Nex_Option_EditBox LaserSpeed
-			{
-				text	"Laser Speed"
-				target	"Data::Weapon::LaserSpeed::Text"
-			}
-			Derive Nex_Option_EditBox Laserrefire
-			{
-				text	"Laser Refire"
-				target	"Data::Weapon::Laserrefire::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunDamage
-			{
-				text	"Shotgun Damage"
-				target	"Data::Weapon::ShotgunDamage::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunDamage2
-			{
-				text	"Shotgun Damage 2"
-				target	"Data::Weapon::ShotgunDamage2::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunBullets
-			{
-				text	"Shotgun Bullets"
-				target	"Data::Weapon::ShotgunBullets::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunSpread
-			{
-				text	"Shotgun Spread"
-				target	"Data::Weapon::ShotgunSpread::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunRefire
-			{
-				text	"Shotgun Refire"
-				target	"Data::Weapon::ShotgunRefire::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunRefire2
-			{
-				text	"Shotgun Refire2"
-				target	"Data::Weapon::ShotgunRefire2::Text"
-			}
-			Derive Nex_Option_EditBox ShotgunRefire3
-			{
-				text	"Shotgun Refire3"
-				target	"Data::Weapon::ShotgunRefire3::Text"
-			}
-			Derive Nex_Option_EditBox UziDamage
-			{
-				text	"Uzi Damage"
-				target	"Data::Weapon::UziDamage::Text"
-			}
-			Derive Nex_Option_EditBox UziSpread
-			{
-				text	"Uzi Spread"
-				target	"Data::Weapon::UziSpread::Text"
-			}
-			Derive Nex_Option_EditBox UziSpread2
-			{
-				text	"Uzi Spread2"
-				target	"Data::Weapon::UziSpread2::Text"
-			}
-			Derive Nex_Option_EditBox UziRefire
-			{
-				text	"Uzi Refire"
-				target	"Data::Weapon::UziRefire::Text"
-			}
-			Derive Nex_Option_EditBox UziRefire2
-			{
-				text	"Uzi Refire2"
-				target	"Data::Weapon::UziRefire2::Text"
-			}
-			Derive Nex_Option_EditBox UziDamage2
-			{
-				text	"Uzi Damage2"
-				target	"Data::Weapon::UziDamage2::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherDamage
-			{
-				text	"Grenade Launcher Damage"
-				target	"Data::Weapon::GrenadeLauncherDamage::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherEdgeDamage
-			{
-				text	"GL Edge Damage"
-				target	"Data::Weapon::GrenadeLauncherEdgeDamage::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherForce
-			{
-				text	"Grenade Launcher Force"
-				target	"Data::Weapon::GrenadeLauncherForce::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherRadius
-			{
-				text	"Grenade Launcher Radius"
-				target	"Data::Weapon::GrenadeLauncherRadius::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherSpeed
-			{
-				text	"Grenade Launcher Speed"
-				target	"Data::Weapon::GrenadeLauncherSpeed::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherSpeedUp
-			{
-				text	"Grenade Launcher Speedup"
-				target	"Data::Weapon::GrenadeLauncherSpeedUp::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherSpeed2
-			{
-				text	"Grenade Launcher Speed2"
-				target	"Data::Weapon::GrenadeLauncherSpeed2::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherSpeed2Up
-			{
-				text	"Grenade Launcher Speed2up"
-				target	"Data::Weapon::GrenadeLauncherSpeed2Up::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherRefire
-			{
-				text	"Grenade Launcher Refire"
-				target	"Data::Weapon::GrenadeLauncherRefire::Text"
-			}
-			Derive Nex_Option_EditBox GrenadeLauncherRefire2
-			{
-				text	"Grenade Launcher Refire2"
-				target	"Data::Weapon::GrenadeLauncherRefire2::Text"
-			}
-			Derive Nex_Option_EditBox ElectroDamage
-			{
-				text	"Electro Damage"
-				target	"Data::Weapon::ElectroDamage::Text"
-			}
-			Derive Nex_Option_EditBox ElectroEdgeDamage
-			{
-				text	"Electro Edgedamage"
-				target	"Data::Weapon::ElectroEdgeDamage::Text"
-			}
-			Derive Nex_Option_EditBox ElectroForce
-			{
-				text	"Electro Force"
-				target	"Data::Weapon::ElectroForce::Text"
-			}
-			Derive Nex_Option_EditBox ElectroRadius
-			{
-				text	"Electro Radius"
-				target	"Data::Weapon::ElectroRadius::Text"
-			}
-			Derive Nex_Option_EditBox ElectroRefire
-			{
-				text	"Electro Refire"
-				target	"Data::Weapon::ElectroRefire::Text"
-			}
-			Derive Nex_Option_EditBox ElectroSpeed
-			{
-				text	"Electro Speed"
-				target	"Data::Weapon::ElectroSpeed::Text"
-			}
-			Derive Nex_Option_EditBox ElectroBallSpeed
-			{
-				text	"Electroball Speed"
-				target	"Data::Weapon::ElectroBallSpeed::Text"
-			}
-			Derive Nex_Option_EditBox ElectroBallSpeedUp
-			{
-				text	"Electroball Speed up"
-				target	"Data::Weapon::ElectroBallSpeedUp::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkDamage
-			{
-				text	"CryLink Damage"
-				target	"Data::Weapon::CryLinkDamage::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkEdgeDamage
-			{
-				text	"CryLink Edgedamage"
-				target	"Data::Weapon::CryLinkEdgeDamage::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkForce
-			{
-				text	"CryLink Force"
-				target	"Data::Weapon::CryLinkForce::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkRadius
-			{
-				text	"CryLink Radius"
-				target	"Data::Weapon::CryLinkRadius::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkSpeed
-			{
-				text	"CryLink Speed"
-				target	"Data::Weapon::CryLinkSpeed::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkSpread
-			{
-				text	"CryLink Spread"
-				target	"Data::Weapon::CryLinkSpread::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkRefire
-			{
-				text	"CryLink Refire"
-				target	"Data::Weapon::CryLinkRefire::Text"
-			}
-			Derive Nex_Option_EditBox CryLinkShots
-			{
-				text	"CryLink Shots"
-				target	"Data::Weapon::CryLinkShots::Text"
-			}
-			Derive Nex_Option_EditBox NexDamage
-			{
-				text	"Nex Damage"
-				target	"Data::Weapon::NexDamage::Text"
-			}
-			Derive Nex_Option_EditBox NexRefire
-			{
-				text	"Nex Refire"
-				target	"Data::Weapon::Nexrefire::Text"
-			}
-			Derive Nex_Option_EditBox HagarDamage
-			{
-				text	"Hagar Damage"
-				target	"Data::Weapon::HagarDamage::Text"
-			}
-			Derive Nex_Option_EditBox HagarEdgeDamage
-			{
-				text	"Hagar Edge Damage"
-				target	"Data::Weapon::HagarEdgeDamage::Text"
-			}
-			Derive Nex_Option_EditBox HagarForce
-			{
-				text	"Hagar Force"
-				target	"Data::Weapon::HagarForce::Text"
-			}
-			Derive Nex_Option_EditBox HagarRadius
-			{
-				text	"Hagar Radius"
-				target	"Data::Weapon::HagarRadius::Text"
-			}
-			Derive Nex_Option_EditBox HagarSpeed
-			{
-				text	"Hagar Speed"
-				target	"Data::Weapon::HagarSpeed::Text"
-			}
-			Derive Nex_Option_EditBox HagarSpeed2
-			{
-				text	"Hagar Speed2"
-				target	"Data::Weapon::HagarSpeed2::Text"
-			}
-			Derive Nex_Option_EditBox HagarSpeed2Up
-			{
-				text	"Hagar Speed2 up"
-				target	"Data::Weapon::HagarSpeed2Up::Text"
-			}
-			Derive Nex_Option_EditBox HagarSpread
-			{
-				text	"Hagar Spread"
-				target	"Data::Weapon::HagarSpread::Text"
-			}
-			Derive Nex_Option_EditBox RocketLauncherDamage
-			{
-				text	"Rocket Launcher Damage"
-				target	"Data::Weapon::RocketLauncherDamage::Text"
-			}
-			Derive Nex_Option_EditBox RocketLauncherEdgeDamage
-			{
-				text	"RL Edge Damage"
-				target	"Data::Weapon::RocketLauncherEdgeDamage::Text"
-			}
-			Derive Nex_Option_EditBox RocketLauncherForce
-			{
-				text	"Rocket Launcher Force"
-				target	"Data::Weapon::RocketLauncherForce::Text"
-			}
-			Derive Nex_Option_EditBox RocketLauncherRadius
-			{
-				text	"Rocket Launcher Radius"
-				target	"Data::Weapon::RocketLauncherRadius::Text"
-			}
-			Derive Nex_Option_EditBox RocketLauncherSpeed
-			{
-				text	"Rocket Launcher Speed"
-				target	"Data::Weapon::RocketLauncherSpeed::Text"
-			}
-			Derive Nex_Option_EditBox RocketLauncherRefire
-			{
-				text	"Rocket Launcher Refire"
-				target	"Data::Weapon::RocketLauncherrefire::Text"
-			}
-			Derive Nex_Line	Seperator
-			{}
-			Derive TextButton Reset
-			{
-				normal	"Reset to default"
-				init	Nex_Action_ResetData
-				target	"::Data::Weapon"
-			}
-		}
-	}
-	Item VScrollBar Scroller
-	{
-		pos	'880 0'
-		size	'20 100'
-		target	"##prev"
-	}
-}
+// Property of Alientrap/AK
+//
+// mission/weapon.menu
+Item Window Weapon
+{
+	size	'900 585'
+	flag	[FlagEmbedded]
+
+	Item ScrollWindow ScrollWindow
+	{
+		size 	'880 585'
+		flag	[FlagEmbedded]
+
+		Item Arrangement Arrangement
+		{
+			direction	[Nex_DefaultVertDirection]
+			alignment	[AlignFirst]
+			flag		[FlagEmbedded]
+
+			// hack to make the arrangement have a set width
+			Item Window FixWidth
+			{
+				size	'900 0'
+				Derive Nex_Void Left
+				{
+					pos	'0 0'
+					size	'450 0'
+				}
+				Derive Nex_Void Right
+				{
+					pos	'450 0'
+					size	'450 0'
+				}
+			}
+
+			DeriveTemplate Nex_Composition Nex_Option_EditBox
+			{
+				DeriveTemplate Nex_Automation_Option_EditBox Automation
+				{}
+				DeriveTemplate TextButton Description
+				{}
+				DeriveTemplate EditBox EditBox
+				{
+					size 	'260 12'
+					action  Nex_Action_TestOnChange
+					select  Nex_Action_TestOnSelect
+				}
+			}
+
+			Derive Nex_Option_EditBox InvincibleTakeDamage
+			{
+				text	"Invincible Take Damage"
+				target	"Data::Weapon::InvincibleTakeDamage::Text"
+			}
+			Derive Nex_Option_EditBox InvincibleTime
+			{
+				text	"Invincible Time"
+				target	"Data::Weapon::InvincibleTime::Text"
+			}
+			Derive Nex_Option_EditBox StrengthDamage
+			{
+				text	"Strength Damage"
+				target	"Data::Weapon::StrengthDamage::Text"
+			}
+			Derive Nex_Option_EditBox StrengthForce
+			{
+				text	"Strength Force"
+				target	"Data::Weapon::StrengthForce::Text"
+			}
+			Derive Nex_Option_EditBox StrengthTime
+			{
+				text	"Strength Time"
+				target	"Data::Weapon::StrengthTime::Text"
+			}
+			Derive Nex_Option_EditBox LaserDamage
+			{
+				text	"Laser Damage"
+				target	"Data::Weapon::LaserDamage::Text"
+			}
+			Derive Nex_Option_EditBox LaserEdgeDamage
+			{
+				text	"Laser edge damage"
+				target	"Data::Weapon::LaserEdgeDamage::Text"
+			}
+			Derive Nex_Option_EditBox LaserForce
+			{
+				text	"Laser Push Force"
+				target	"Data::Weapon::LaserForce::Text"
+			}
+			Derive Nex_Option_EditBox LaserRadius
+			{
+				text	"Laser Radius"
+				target	"Data::Weapon::LaserRadius::Text"
+			}
+			Derive Nex_Option_EditBox LaserSpeed
+			{
+				text	"Laser Speed"
+				target	"Data::Weapon::LaserSpeed::Text"
+			}
+			Derive Nex_Option_EditBox Laserrefire
+			{
+				text	"Laser Refire"
+				target	"Data::Weapon::Laserrefire::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunDamage
+			{
+				text	"Shotgun Damage"
+				target	"Data::Weapon::ShotgunDamage::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunDamage2
+			{
+				text	"Shotgun Damage 2"
+				target	"Data::Weapon::ShotgunDamage2::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunBullets
+			{
+				text	"Shotgun Bullets"
+				target	"Data::Weapon::ShotgunBullets::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunSpread
+			{
+				text	"Shotgun Spread"
+				target	"Data::Weapon::ShotgunSpread::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunRefire
+			{
+				text	"Shotgun Refire"
+				target	"Data::Weapon::ShotgunRefire::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunRefire2
+			{
+				text	"Shotgun Refire2"
+				target	"Data::Weapon::ShotgunRefire2::Text"
+			}
+			Derive Nex_Option_EditBox ShotgunRefire3
+			{
+				text	"Shotgun Refire3"
+				target	"Data::Weapon::ShotgunRefire3::Text"
+			}
+			Derive Nex_Option_EditBox UziDamage
+			{
+				text	"Uzi Damage"
+				target	"Data::Weapon::UziDamage::Text"
+			}
+			Derive Nex_Option_EditBox UziSpread
+			{
+				text	"Uzi Spread"
+				target	"Data::Weapon::UziSpread::Text"
+			}
+			Derive Nex_Option_EditBox UziSpread2
+			{
+				text	"Uzi Spread2"
+				target	"Data::Weapon::UziSpread2::Text"
+			}
+			Derive Nex_Option_EditBox UziRefire
+			{
+				text	"Uzi Refire"
+				target	"Data::Weapon::UziRefire::Text"
+			}
+			Derive Nex_Option_EditBox UziRefire2
+			{
+				text	"Uzi Refire2"
+				target	"Data::Weapon::UziRefire2::Text"
+			}
+			Derive Nex_Option_EditBox UziDamage2
+			{
+				text	"Uzi Damage2"
+				target	"Data::Weapon::UziDamage2::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherDamage
+			{
+				text	"Grenade Launcher Damage"
+				target	"Data::Weapon::GrenadeLauncherDamage::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherEdgeDamage
+			{
+				text	"GL Edge Damage"
+				target	"Data::Weapon::GrenadeLauncherEdgeDamage::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherForce
+			{
+				text	"Grenade Launcher Force"
+				target	"Data::Weapon::GrenadeLauncherForce::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherRadius
+			{
+				text	"Grenade Launcher Radius"
+				target	"Data::Weapon::GrenadeLauncherRadius::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherSpeed
+			{
+				text	"Grenade Launcher Speed"
+				target	"Data::Weapon::GrenadeLauncherSpeed::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherSpeedUp
+			{
+				text	"Grenade Launcher Speedup"
+				target	"Data::Weapon::GrenadeLauncherSpeedUp::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherSpeed2
+			{
+				text	"Grenade Launcher Speed2"
+				target	"Data::Weapon::GrenadeLauncherSpeed2::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherSpeed2Up
+			{
+				text	"Grenade Launcher Speed2up"
+				target	"Data::Weapon::GrenadeLauncherSpeed2Up::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherRefire
+			{
+				text	"Grenade Launcher Refire"
+				target	"Data::Weapon::GrenadeLauncherRefire::Text"
+			}
+			Derive Nex_Option_EditBox GrenadeLauncherRefire2
+			{
+				text	"Grenade Launcher Refire2"
+				target	"Data::Weapon::GrenadeLauncherRefire2::Text"
+			}
+			Derive Nex_Option_EditBox ElectroDamage
+			{
+				text	"Electro Damage"
+				target	"Data::Weapon::ElectroDamage::Text"
+			}
+			Derive Nex_Option_EditBox ElectroEdgeDamage
+			{
+				text	"Electro Edgedamage"
+				target	"Data::Weapon::ElectroEdgeDamage::Text"
+			}
+			Derive Nex_Option_EditBox ElectroForce
+			{
+				text	"Electro Force"
+				target	"Data::Weapon::ElectroForce::Text"
+			}
+			Derive Nex_Option_EditBox ElectroRadius
+			{
+				text	"Electro Radius"
+				target	"Data::Weapon::ElectroRadius::Text"
+			}
+			Derive Nex_Option_EditBox ElectroRefire
+			{
+				text	"Electro Refire"
+				target	"Data::Weapon::ElectroRefire::Text"
+			}
+			Derive Nex_Option_EditBox ElectroSpeed
+			{
+				text	"Electro Speed"
+				target	"Data::Weapon::ElectroSpeed::Text"
+			}
+			Derive Nex_Option_EditBox ElectroBallSpeed
+			{
+				text	"Electroball Speed"
+				target	"Data::Weapon::ElectroBallSpeed::Text"
+			}
+			Derive Nex_Option_EditBox ElectroBallSpeedUp
+			{
+				text	"Electroball Speed up"
+				target	"Data::Weapon::ElectroBallSpeedUp::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkDamage
+			{
+				text	"CryLink Damage"
+				target	"Data::Weapon::CryLinkDamage::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkEdgeDamage
+			{
+				text	"CryLink Edgedamage"
+				target	"Data::Weapon::CryLinkEdgeDamage::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkForce
+			{
+				text	"CryLink Force"
+				target	"Data::Weapon::CryLinkForce::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkRadius
+			{
+				text	"CryLink Radius"
+				target	"Data::Weapon::CryLinkRadius::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkSpeed
+			{
+				text	"CryLink Speed"
+				target	"Data::Weapon::CryLinkSpeed::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkSpread
+			{
+				text	"CryLink Spread"
+				target	"Data::Weapon::CryLinkSpread::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkRefire
+			{
+				text	"CryLink Refire"
+				target	"Data::Weapon::CryLinkRefire::Text"
+			}
+			Derive Nex_Option_EditBox CryLinkShots
+			{
+				text	"CryLink Shots"
+				target	"Data::Weapon::CryLinkShots::Text"
+			}
+			Derive Nex_Option_EditBox NexDamage
+			{
+				text	"Nex Damage"
+				target	"Data::Weapon::NexDamage::Text"
+			}
+			Derive Nex_Option_EditBox NexRefire
+			{
+				text	"Nex Refire"
+				target	"Data::Weapon::Nexrefire::Text"
+			}
+			Derive Nex_Option_EditBox HagarDamage
+			{
+				text	"Hagar Damage"
+				target	"Data::Weapon::HagarDamage::Text"
+			}
+			Derive Nex_Option_EditBox HagarEdgeDamage
+			{
+				text	"Hagar Edge Damage"
+				target	"Data::Weapon::HagarEdgeDamage::Text"
+			}
+			Derive Nex_Option_EditBox HagarForce
+			{
+				text	"Hagar Force"
+				target	"Data::Weapon::HagarForce::Text"
+			}
+			Derive Nex_Option_EditBox HagarRadius
+			{
+				text	"Hagar Radius"
+				target	"Data::Weapon::HagarRadius::Text"
+			}
+			Derive Nex_Option_EditBox HagarSpeed
+			{
+				text	"Hagar Speed"
+				target	"Data::Weapon::HagarSpeed::Text"
+			}
+			Derive Nex_Option_EditBox HagarSpeed2
+			{
+				text	"Hagar Speed2"
+				target	"Data::Weapon::HagarSpeed2::Text"
+			}
+			Derive Nex_Option_EditBox HagarSpeed2Up
+			{
+				text	"Hagar Speed2 up"
+				target	"Data::Weapon::HagarSpeed2Up::Text"
+			}
+			Derive Nex_Option_EditBox HagarSpread
+			{
+				text	"Hagar Spread"
+				target	"Data::Weapon::HagarSpread::Text"
+			}
+			Derive Nex_Option_EditBox RocketLauncherDamage
+			{
+				text	"Rocket Launcher Damage"
+				target	"Data::Weapon::RocketLauncherDamage::Text"
+			}
+			Derive Nex_Option_EditBox RocketLauncherEdgeDamage
+			{
+				text	"RL Edge Damage"
+				target	"Data::Weapon::RocketLauncherEdgeDamage::Text"
+			}
+			Derive Nex_Option_EditBox RocketLauncherForce
+			{
+				text	"Rocket Launcher Force"
+				target	"Data::Weapon::RocketLauncherForce::Text"
+			}
+			Derive Nex_Option_EditBox RocketLauncherRadius
+			{
+				text	"Rocket Launcher Radius"
+				target	"Data::Weapon::RocketLauncherRadius::Text"
+			}
+			Derive Nex_Option_EditBox RocketLauncherSpeed
+			{
+				text	"Rocket Launcher Speed"
+				target	"Data::Weapon::RocketLauncherSpeed::Text"
+			}
+			Derive Nex_Option_EditBox RocketLauncherRefire
+			{
+				text	"Rocket Launcher Refire"
+				target	"Data::Weapon::RocketLauncherrefire::Text"
+			}
+			Derive Nex_Line	Seperator
+			{}
+			Derive TextButton Reset
+			{
+				normal	"Reset to default"
+				init	Nex_Action_ResetData
+				target	"::Data::Weapon"
+			}
+		}
+	}
+	Item VScrollBar Scroller
+	{
+		pos	'880 0'
+		size	'20 100'
+		target	"##prev"
+	}
+}


Property changes on: trunk/basezym/menu/creategame/weapon.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/creategame.menu
===================================================================
--- trunk/basezym/menu/creategame.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/creategame.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,24 +1,24 @@
-// Property of Alientrap/AK
-//
-// creategame.menu
-Item Layout CreateGame
-{
-	size	'900 630'
-	alignment [AlignLeft]
-	direction [Nex_DefaultVertDirection]
-
-	Item Layout Bar
-	{
-		size	  '900 20'
-		alignment [AlignLeft]
-		direction '32 0 0'
-
-	}
-	Item EventWindow Panel
-	{
-		size '900 585'
-		reinit	Nex_Action_MakeFirstVisible
-
-		#include "menu/creategame/basic.menu"
-	}
-}
+// Property of Alientrap/AK
+//
+// creategame.menu
+Item Layout CreateGame
+{
+	size	'900 630'
+	alignment [AlignLeft]
+	direction [Nex_DefaultVertDirection]
+
+	Item Layout Bar
+	{
+		size	  '900 20'
+		alignment [AlignLeft]
+		direction '32 0 0'
+
+	}
+	Item EventWindow Panel
+	{
+		size '900 585'
+		reinit	Nex_Action_MakeFirstVisible
+
+		#include "menu/creategame/basic.menu"
+	}
+}


Property changes on: trunk/basezym/menu/creategame.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/credits.menu
===================================================================
--- trunk/basezym/menu/credits.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/credits.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,85 +1,85 @@
-// Property of Alientrap/AK
-//
-// credits.menu
-Item Window CreditsWnd
-{
-	pos 	'300 300'
-	size	'400 400'
-	flag	[FlagHidden]
-
-	Derive Rect Background
-	{
-		flag		[FlagSealOffMouse]
-		color		'0.0 0.0 0.0'
-		alpha		0.8
-		Ignore
-		{
-			color		'0.1 0.1 0.1'
-			drawFlag 	[DrawFlagModulate]
-
-			Derive Rect Layer
-			{
-				color		'0.3 0.3 0.3'
-				drawFlag	[DrawFlagAdditive]
-			}
-		}
-	}
-	Item Layout Layout
-	{
-		origin		'200 0'
-		direction 	[Nex_DefaultVertDirection]
-		flag		[FlagEmbedded]
-		alignment 	[AlignCenter]
-
-		Item FloatingArea Title
-		{
-			size		'400 13'
-			target		"##up up"
-			Derive Rect Background
-			{
-				//color		'0.5 0.5 0.5'
-				color		'0.05 0.05 0.05'
-			}
-			Derive TextButton Caption
-			{
-				color		'1.0 1.0 1.0'
-				size		'400 11'
-				alignment 	[AlignCenter]
-				normal		"Credits"
-				link		"##up"
-			}
-		}
-		Item Arrangement Items
-		{
-			direction 	[Nex_DefaultVertDirection]
-			key		Nex_Credits_Key
-			alignment 	[AlignCenter]
-
-			Item Window Scroller
-			{
-				size		'400 350'
-
-				Item Task_Job Job
-				{
-					direction	'0 50'
-					reinit		Nex_Credits_SetSizeX
-					update		Nex_Credits_Scroll
-				}
-
-				Derive Nex_Credits Credits
-				{
-					color		'1.0 1.0 1.0'
-					alignment	[AlignCenter]
-					target		"betacredits.txt"
-				}
-			}
-
-			Derive TextButton Close
-			{
-				color	'1.0 1.0 1.0'
-				normal	"Close"
-				action	Nex_Credits_Toggle
-			}
-		}
-	}
-}
+// Property of Alientrap/AK
+//
+// credits.menu
+Item Window CreditsWnd
+{
+	pos 	'300 300'
+	size	'400 400'
+	flag	[FlagHidden]
+
+	Derive Rect Background
+	{
+		flag		[FlagSealOffMouse]
+		color		'0.0 0.0 0.0'
+		alpha		0.8
+		Ignore
+		{
+			color		'0.1 0.1 0.1'
+			drawFlag 	[DrawFlagModulate]
+
+			Derive Rect Layer
+			{
+				color		'0.3 0.3 0.3'
+				drawFlag	[DrawFlagAdditive]
+			}
+		}
+	}
+	Item Layout Layout
+	{
+		origin		'200 0'
+		direction 	[Nex_DefaultVertDirection]
+		flag		[FlagEmbedded]
+		alignment 	[AlignCenter]
+
+		Item FloatingArea Title
+		{
+			size		'400 13'
+			target		"##up up"
+			Derive Rect Background
+			{
+				//color		'0.5 0.5 0.5'
+				color		'0.05 0.05 0.05'
+			}
+			Derive TextButton Caption
+			{
+				color		'1.0 1.0 1.0'
+				size		'400 11'
+				alignment 	[AlignCenter]
+				normal		"Credits"
+				link		"##up"
+			}
+		}
+		Item Arrangement Items
+		{
+			direction 	[Nex_DefaultVertDirection]
+			key		Nex_Credits_Key
+			alignment 	[AlignCenter]
+
+			Item Window Scroller
+			{
+				size		'400 350'
+
+				Item Task_Job Job
+				{
+					direction	'0 50'
+					reinit		Nex_Credits_SetSizeX
+					update		Nex_Credits_Scroll
+				}
+
+				Derive Nex_Credits Credits
+				{
+					color		'1.0 1.0 1.0'
+					alignment	[AlignCenter]
+					target		"betacredits.txt"
+				}
+			}
+
+			Derive TextButton Close
+			{
+				color	'1.0 1.0 1.0'
+				normal	"Close"
+				action	Nex_Credits_Toggle
+			}
+		}
+	}
+}


Property changes on: trunk/basezym/menu/credits.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/color.menu
===================================================================
--- trunk/basezym/menu/data/color.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/color.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,124 +1,124 @@
-// Property of Alientrap
-//
-// data/color.menu
-
-// v_color prefix and other color controlling cvars
-Item DataContainer Color
-{
-	// normal options
-	Item Data_Cvar Gamma
-	{
-		cvarName 	"v_gamma"
-		defValue 	1.0
-		Item DataLink_Value Value
-		{
-			minValue	0.0
-			maxValue	4.0
-			stepValue	0.05
-			link		"##up"
-		}
-	}
-	Item Data_Cvar Brightness
-	{
-		cvarName	"v_brightness"
-		defValue	0.0
-		Item DataLink_Value Value
-		{
-			minValue	0.0
-			maxValue	3.0
-			stepValue	0.05
-			link		"##up"
-		}
-	}
-	Item Data_Cvar Contrast
-	{
-		cvarName	"v_contrast"
-		defValue	1.0
-		Item DataLink_Value Value
-		{
-			minValue	0.0
-			maxValue	3.0
-			stepValue	0.05
-			link		"##up"
-		}
-	}
-	Item Data_Cvar HWGamma // read-only
-	{
-		cvarName	"v_hwgamma"
-		defValue	1.0
-		[DataLink_OnOffSwitch]
-	}
-	// extended options
-	Item DataContainer Extended
-	{
-		Item Data_Cvar Active
-		{
-			cvarName	"v_color_enable"
-			defValue	0.0
-			[DataLink_OnOffSwitch]
-		}
-		Item Container Low
-		{
-			Item Data_Cvar Red
-			{
-				cvarName  	"v_color_black_r"
-				defValue 	0.0
-				[DataLink_ZeroOneValue]
-			}
-			Item Data_Cvar Green
-			{
-				cvarName  	"v_color_black_g"
-				defValue 	0.0
-				[DataLink_ZeroOneValue]
-			}
-			Item Data_Cvar Blue
-			{
-				cvarName  	"v_color_black_b"
-				defValue 	0.0
-				[DataLink_ZeroOneValue]
-			}
-		}
-		Item Container Mid
-		{
-			Item Data_Cvar Red
-			{
-				cvarName  	"v_color_grey_r"
-				defValue 	0.5
-				[DataLink_ZeroOneValue]
-			}
-			Item Data_Cvar Green
-			{
-				cvarName  	"v_color_grey_g"
-				defValue 	0.5
-				[DataLink_ZeroOneValue]
-			}
-			Item Data_Cvar Blue
-			{
-				cvarName  	"v_color_grey_b"
-				defValue 	0.5
-				[DataLink_ZeroOneValue]
-			}
-		}
-		Item Container High
-		{
-			Item Data_Cvar Red
-			{
-				cvarName  	"v_color_white_r"
-				defValue 	1.0
-				[DataLink_ZeroOneValue]
-			}
-			Item Data_Cvar Green
-			{
-				cvarName  	"v_color_white_g"
-				defValue 	1.0
-				[DataLink_ZeroOneValue]
-			}
-			Item Data_Cvar Blue
-			{
-				cvarName  	"v_color_white_b"
-				defValue 	1.0
-				[DataLink_ZeroOneValue]
-			}
-		}
-	}
-}
+// Property of Alientrap
+//
+// data/color.menu
+
+// v_color prefix and other color controlling cvars
+Item DataContainer Color
+{
+	// normal options
+	Item Data_Cvar Gamma
+	{
+		cvarName 	"v_gamma"
+		defValue 	1.0
+		Item DataLink_Value Value
+		{
+			minValue	0.0
+			maxValue	4.0
+			stepValue	0.05
+			link		"##up"
+		}
+	}
+	Item Data_Cvar Brightness
+	{
+		cvarName	"v_brightness"
+		defValue	0.0
+		Item DataLink_Value Value
+		{
+			minValue	0.0
+			maxValue	3.0
+			stepValue	0.05
+			link		"##up"
+		}
+	}
+	Item Data_Cvar Contrast
+	{
+		cvarName	"v_contrast"
+		defValue	1.0
+		Item DataLink_Value Value
+		{
+			minValue	0.0
+			maxValue	3.0
+			stepValue	0.05
+			link		"##up"
+		}
+	}
+	Item Data_Cvar HWGamma // read-only
+	{
+		cvarName	"v_hwgamma"
+		defValue	1.0
+		[DataLink_OnOffSwitch]
+	}
+	// extended options
+	Item DataContainer Extended
+	{
+		Item Data_Cvar Active
+		{
+			cvarName	"v_color_enable"
+			defValue	0.0
+			[DataLink_OnOffSwitch]
+		}
+		Item Container Low
+		{
+			Item Data_Cvar Red
+			{
+				cvarName  	"v_color_black_r"
+				defValue 	0.0
+				[DataLink_ZeroOneValue]
+			}
+			Item Data_Cvar Green
+			{
+				cvarName  	"v_color_black_g"
+				defValue 	0.0
+				[DataLink_ZeroOneValue]
+			}
+			Item Data_Cvar Blue
+			{
+				cvarName  	"v_color_black_b"
+				defValue 	0.0
+				[DataLink_ZeroOneValue]
+			}
+		}
+		Item Container Mid
+		{
+			Item Data_Cvar Red
+			{
+				cvarName  	"v_color_grey_r"
+				defValue 	0.5
+				[DataLink_ZeroOneValue]
+			}
+			Item Data_Cvar Green
+			{
+				cvarName  	"v_color_grey_g"
+				defValue 	0.5
+				[DataLink_ZeroOneValue]
+			}
+			Item Data_Cvar Blue
+			{
+				cvarName  	"v_color_grey_b"
+				defValue 	0.5
+				[DataLink_ZeroOneValue]
+			}
+		}
+		Item Container High
+		{
+			Item Data_Cvar Red
+			{
+				cvarName  	"v_color_white_r"
+				defValue 	1.0
+				[DataLink_ZeroOneValue]
+			}
+			Item Data_Cvar Green
+			{
+				cvarName  	"v_color_white_g"
+				defValue 	1.0
+				[DataLink_ZeroOneValue]
+			}
+			Item Data_Cvar Blue
+			{
+				cvarName  	"v_color_white_b"
+				defValue 	1.0
+				[DataLink_ZeroOneValue]
+			}
+		}
+	}
+}


Property changes on: trunk/basezym/menu/data/color.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/effects.menu
===================================================================
--- trunk/basezym/menu/data/effects.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/effects.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,95 +1,95 @@
-// Property of Alientrap/AK
-//
-// data/effects.menu
-
-Item DataContainer Effects
-{
-	Item Data_Cvar Particles
-	{
-		cvarName	"cl_particles"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar ParticleQuality
-	{
-		cvarName	"cl_particles_quality"
-		defValue	1
-		Item DataLink_Value Value
-		{
-			minValue	0.0
-			maxValue	4.0
-			stepValue	1
-			link		"##up"
-		}
-	}
-	Item Data_Cvar Decals
-	{
-		cvarName	"cl_decals"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar Bloom
-	{
-		cvarName	"r_bloom"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar Coronas
-	{
-		cvarName	"r_coronas"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar RealtimeLights
-	{
-		cvarName	"r_shadow_realtime_world"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar RealtimeDLights
-	{
-		cvarName	"r_shadow_realtime_dlight"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar RealtimeShadows
-	{
-		cvarName	"r_shadow_realtime_world_shadows"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar RealtimeDLightShadows
-	{
-		cvarName	"r_shadow_realtime_dlight_shadows"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}	
-	Item Data_Cvar GLSL
-	{
-		cvarName	"r_shadow_glsl"
-		defValue	1
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar Gloss
-	{
-		cvarName	"r_shadow_gloss"
-		defValue	1
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar ShowFPS
-	{
-		cvarName	"showfps"
-		defValue	"0"
-
-		[DataLink_OnOffSwitch]
-	}
-}
+// Property of Alientrap/AK
+//
+// data/effects.menu
+
+Item DataContainer Effects
+{
+	Item Data_Cvar Particles
+	{
+		cvarName	"cl_particles"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar ParticleQuality
+	{
+		cvarName	"cl_particles_quality"
+		defValue	1
+		Item DataLink_Value Value
+		{
+			minValue	0.0
+			maxValue	4.0
+			stepValue	1
+			link		"##up"
+		}
+	}
+	Item Data_Cvar Decals
+	{
+		cvarName	"cl_decals"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar Bloom
+	{
+		cvarName	"r_bloom"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar Coronas
+	{
+		cvarName	"r_coronas"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar RealtimeLights
+	{
+		cvarName	"r_shadow_realtime_world"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar RealtimeDLights
+	{
+		cvarName	"r_shadow_realtime_dlight"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar RealtimeShadows
+	{
+		cvarName	"r_shadow_realtime_world_shadows"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar RealtimeDLightShadows
+	{
+		cvarName	"r_shadow_realtime_dlight_shadows"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}	
+	Item Data_Cvar GLSL
+	{
+		cvarName	"r_shadow_glsl"
+		defValue	1
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar Gloss
+	{
+		cvarName	"r_shadow_gloss"
+		defValue	1
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar ShowFPS
+	{
+		cvarName	"showfps"
+		defValue	"0"
+
+		[DataLink_OnOffSwitch]
+	}
+}


Property changes on: trunk/basezym/menu/data/effects.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/game.menu
===================================================================
--- trunk/basezym/menu/data/game.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/game.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,154 +1,154 @@
-// Property of Alientrap
-//
-// data/game.menu
-
-Item DataContainer Game
-{
-	Item Data_Cvar Instagib
-	{
-		cvarName	"g_instagib"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar RocketArena
-	{
-		cvarName	"g_rocketarena"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar Vampire
-	{
-		cvarName	"g_vampire"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}	
-	Item Data_Cvar Casings
-	{
-		cvarName	"g_casings"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}
-	Item Data_Cvar HealthStart
-	{
-		cvarName	"g_balance_health_start"
-		defValue	150
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HealthRot
-	{
-		cvarName	"g_balance_health_rot"
-		defValue	0.1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HealthStable
-	{
-		cvarName	"g_balance_health_stable"
-		defValue	100
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar Gravity
-	{
-		cvarName	"sv_gravity"
-		defValue	800
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar MaxSpeed
-	{
-		cvarName	"sv_maxspeed"
-		defValue	400
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GameSpeed
-	{
-		cvarName	"slowmo"
-		defValue	1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar MaxAirSpeed
-	{
-		cvarName	"sv_maxairspeed"
-		defValue	50
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar JumpHeight
-	{
-		cvarName	"g_balance_jumpheight"
-		defValue	300
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HealthRegeneration
-	{
-		cvarName	"g_balance_health_regen"
-		defValue	0.1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ArmorRott
-	{
-		cvarName	"g_balance_armor_rot"
-		defValue	0.1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ArmorRegen
-	{
-		cvarName	"g_balance_armor_regen"
-		defValue	0
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ArmorStable
-	{
-		cvarName	"g_balance_armor_stable"
-		defValue	100
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ArmorStart
-	{
-		cvarName	"g_balance_armor_start"
-		defValue	0
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar SelfDamagePercent
-	{
-		cvarName	"g_balance_selfdamagepercent"
-		defValue	0.6
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar WeaponSwitchDelay
-	{
-		cvarName	"g_balance_weaponswitchdelay"
-		defValue	0.3
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar Friction
-	{
-		cvarName	"sv_friction"
-		defValue	5
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar Accelerate
-	{
-		cvarName	"sv_accelerate"
-		defValue	5.5
-
-		[DataLink_Setting]
-	}
-}
+// Property of Alientrap
+//
+// data/game.menu
+
+Item DataContainer Game
+{
+	Item Data_Cvar Instagib
+	{
+		cvarName	"g_instagib"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar RocketArena
+	{
+		cvarName	"g_rocketarena"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar Vampire
+	{
+		cvarName	"g_vampire"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}	
+	Item Data_Cvar Casings
+	{
+		cvarName	"g_casings"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}
+	Item Data_Cvar HealthStart
+	{
+		cvarName	"g_balance_health_start"
+		defValue	150
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HealthRot
+	{
+		cvarName	"g_balance_health_rot"
+		defValue	0.1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HealthStable
+	{
+		cvarName	"g_balance_health_stable"
+		defValue	100
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar Gravity
+	{
+		cvarName	"sv_gravity"
+		defValue	800
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar MaxSpeed
+	{
+		cvarName	"sv_maxspeed"
+		defValue	400
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GameSpeed
+	{
+		cvarName	"slowmo"
+		defValue	1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar MaxAirSpeed
+	{
+		cvarName	"sv_maxairspeed"
+		defValue	50
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar JumpHeight
+	{
+		cvarName	"g_balance_jumpheight"
+		defValue	300
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HealthRegeneration
+	{
+		cvarName	"g_balance_health_regen"
+		defValue	0.1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ArmorRott
+	{
+		cvarName	"g_balance_armor_rot"
+		defValue	0.1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ArmorRegen
+	{
+		cvarName	"g_balance_armor_regen"
+		defValue	0
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ArmorStable
+	{
+		cvarName	"g_balance_armor_stable"
+		defValue	100
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ArmorStart
+	{
+		cvarName	"g_balance_armor_start"
+		defValue	0
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar SelfDamagePercent
+	{
+		cvarName	"g_balance_selfdamagepercent"
+		defValue	0.6
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar WeaponSwitchDelay
+	{
+		cvarName	"g_balance_weaponswitchdelay"
+		defValue	0.3
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar Friction
+	{
+		cvarName	"sv_friction"
+		defValue	5
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar Accelerate
+	{
+		cvarName	"sv_accelerate"
+		defValue	5.5
+
+		[DataLink_Setting]
+	}
+}


Property changes on: trunk/basezym/menu/data/game.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/input.menu
===================================================================
--- trunk/basezym/menu/data/input.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/input.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,37 +1,37 @@
-// Property of Alientrap
-//
-// data/input.menu
-Item DataContainer Input
-{
-	Item Data_Cvar Sensitivity
-	{
-		cvarName 	"sensitivity"
-		defValue 	6.0
-		Item DataLink_Value Value
-		{
-			minValue	0.0
-			maxValue	20.0
-			stepValue	1
-			link		"##up"
-		}
-	}
-	Item Data_Cvar InvertMouse
-	{
-		cvarName 	"m_pitch"
-		defValue 	'Off'
-		Item DataLink_ValueSwitch Switch
-		{
-			minValue	-0.022
-			maxValue	0.022
-			descList	"'On' 'Off'"
-			link		"##up"
-		}
-	}
-	Item Data_Cvar MouseFilter
-	{
-		cvarName	"m_filter"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}	
-}
+// Property of Alientrap
+//
+// data/input.menu
+Item DataContainer Input
+{
+	Item Data_Cvar Sensitivity
+	{
+		cvarName 	"sensitivity"
+		defValue 	6.0
+		Item DataLink_Value Value
+		{
+			minValue	0.0
+			maxValue	20.0
+			stepValue	1
+			link		"##up"
+		}
+	}
+	Item Data_Cvar InvertMouse
+	{
+		cvarName 	"m_pitch"
+		defValue 	'Off'
+		Item DataLink_ValueSwitch Switch
+		{
+			minValue	-0.022
+			maxValue	0.022
+			descList	"'On' 'Off'"
+			link		"##up"
+		}
+	}
+	Item Data_Cvar MouseFilter
+	{
+		cvarName	"m_filter"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}	
+}


Property changes on: trunk/basezym/menu/data/input.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/key.menu
===================================================================
--- trunk/basezym/menu/data/key.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/key.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,156 +1,156 @@
-// Property of Alientrap
-//
-// data/key.menu
-
-Item DataContainer Key
-{
-	Item Data_Nex_Key Forward
-	{
-		target		"+forward"
-		defValue	"'W' 'UpArrow'"
-	}
-	Item Data_Nex_Key Backward
-	{
-		target		"+back"
-		defValue	"'S' 'DownArrow'"
-	}
-	Item Data_Nex_Key StrafeLeft
-	{
-		target		"+moveleft"
-		defValue	"'A'"
-	}
-	Item Data_Nex_Key StrafeRight
-	{
-		target		"+moveright"
-		defValue	"'D'"
-	}
-	Item Data_Nex_Key Jump
-	{
-		target		"+jump"
-		defValue	"'Enter' 'Space'"
-	}
-	Item Data_Nex_Key Crouch
-	{
-		target		"+crouch"
-		defValue	"'Shift'"
-
-	}
-	Item Data_Nex_Key FirePrimary
-	{
-		target		"+attack"
-		defValue	"'Ctrl' 'Mouse1'"
-	}
-	Item Data_Nex_Key FireSecondary
-	{
-		target		"+button3"
-		defValue	"'Mouse2'"
-	}
-	Item Data_Nex_Key PrevWeapon
-	{
-		target		"impulse 12"
-		defValue	"'MWHEELDOWN'"
-	}
-	Item Data_Nex_Key NextWeapon
-	{
-		target		"impulse 10"
-		defValue	"'MWHEELUP'"
-	}
-	Item Data_Nex_Key Zoom
-	{
-		target		"+zoom"
-		defValue	"'Mouse3'"
-	}
-	Item DataContainer Weapon
-	{
-		Item Data_Nex_Key Laser
-		{
-			target		"impulse 1"
-			defValue	"'1'"
-		}
-		Item Data_Nex_Key Shotgun
-		{
-			target		"impulse 2"
-			defValue	"'2'"
-		}
-		Item Data_Nex_Key Machinegun
-		{
-			target		"impulse 3"
-			defValue	"'3'"
-		}
-		Item Data_Nex_Key Mortar
-		{
-			target		"impulse 4"
-			defValue	"'4'"
-		}
-		Item Data_Nex_Key Electro
-		{
-			target		"impulse 5"
-			defValue	"'5'"
-		}
-		Item Data_Nex_Key CryLink
-		{
-			target		"impulse 6"
-			defValue	"'6'"
-		}
-		Item Data_Nex_Key NexGun
-		{
-			target		"impulse 7"
-			defValue	"'7' 'CapsLock'"
-		}
-		Item Data_Nex_Key Hagar
-		{
-			target		"impulse 8"
-			defValue	"'8'"
-		}
-		Item Data_Nex_Key Rocket
-		{
-			target		"impulse 9"
-			defValue	"'9'"
-		}
-	}
-	Item Data_Nex_Key ShowScores
-	{
-		target		"+showscores"
-		defValue	"'Tab'"
-	}
-	Item Data_Nex_Key ToggleConsole
-	{
-		target		"toggleconsole"
-		defValue	""
-	}
-	Item Data_Nex_Key Message
-	{
-		target		"messagemode"
-		defValue	"'T'"
-	}
-	Item Data_Nex_Key TeamMessage
-	{
-		target		"messagemode2"
-		defValue	"'R' 'Y'"
-	}
-	Item Data_Nex_Key Pause
-	{
-		target		"pause"
-		defValue	"'Pause'"
-	}
-	Item Data_Nex_Key Screenshot
-	{
-		target		"screenshot"
-		defValue	"'F12'"
-	}
-	Item Data_Nex_Key Quit
-	{
-		target		"quit"
-		defValue 	"'F10'"
-	}
-	Item Data_Nex_Key ViewSmaller
-	{
-		target		"sizedown"
-		defValue	"'-'"
-	}
-	Item Data_Nex_Key ViewBigger
-	{
-		target		"sizeup"
-		defValue	"'='"
-	}
-}
+// Property of Alientrap
+//
+// data/key.menu
+
+Item DataContainer Key
+{
+	Item Data_Nex_Key Forward
+	{
+		target		"+forward"
+		defValue	"'W' 'UpArrow'"
+	}
+	Item Data_Nex_Key Backward
+	{
+		target		"+back"
+		defValue	"'S' 'DownArrow'"
+	}
+	Item Data_Nex_Key StrafeLeft
+	{
+		target		"+moveleft"
+		defValue	"'A'"
+	}
+	Item Data_Nex_Key StrafeRight
+	{
+		target		"+moveright"
+		defValue	"'D'"
+	}
+	Item Data_Nex_Key Jump
+	{
+		target		"+jump"
+		defValue	"'Enter' 'Space'"
+	}
+	Item Data_Nex_Key Crouch
+	{
+		target		"+crouch"
+		defValue	"'Shift'"
+
+	}
+	Item Data_Nex_Key FirePrimary
+	{
+		target		"+attack"
+		defValue	"'Ctrl' 'Mouse1'"
+	}
+	Item Data_Nex_Key FireSecondary
+	{
+		target		"+button3"
+		defValue	"'Mouse2'"
+	}
+	Item Data_Nex_Key PrevWeapon
+	{
+		target		"impulse 12"
+		defValue	"'MWHEELDOWN'"
+	}
+	Item Data_Nex_Key NextWeapon
+	{
+		target		"impulse 10"
+		defValue	"'MWHEELUP'"
+	}
+	Item Data_Nex_Key Zoom
+	{
+		target		"+zoom"
+		defValue	"'Mouse3'"
+	}
+	Item DataContainer Weapon
+	{
+		Item Data_Nex_Key Laser
+		{
+			target		"impulse 1"
+			defValue	"'1'"
+		}
+		Item Data_Nex_Key Shotgun
+		{
+			target		"impulse 2"
+			defValue	"'2'"
+		}
+		Item Data_Nex_Key Machinegun
+		{
+			target		"impulse 3"
+			defValue	"'3'"
+		}
+		Item Data_Nex_Key Mortar
+		{
+			target		"impulse 4"
+			defValue	"'4'"
+		}
+		Item Data_Nex_Key Electro
+		{
+			target		"impulse 5"
+			defValue	"'5'"
+		}
+		Item Data_Nex_Key CryLink
+		{
+			target		"impulse 6"
+			defValue	"'6'"
+		}
+		Item Data_Nex_Key NexGun
+		{
+			target		"impulse 7"
+			defValue	"'7' 'CapsLock'"
+		}
+		Item Data_Nex_Key Hagar
+		{
+			target		"impulse 8"
+			defValue	"'8'"
+		}
+		Item Data_Nex_Key Rocket
+		{
+			target		"impulse 9"
+			defValue	"'9'"
+		}
+	}
+	Item Data_Nex_Key ShowScores
+	{
+		target		"+showscores"
+		defValue	"'Tab'"
+	}
+	Item Data_Nex_Key ToggleConsole
+	{
+		target		"toggleconsole"
+		defValue	""
+	}
+	Item Data_Nex_Key Message
+	{
+		target		"messagemode"
+		defValue	"'T'"
+	}
+	Item Data_Nex_Key TeamMessage
+	{
+		target		"messagemode2"
+		defValue	"'R' 'Y'"
+	}
+	Item Data_Nex_Key Pause
+	{
+		target		"pause"
+		defValue	"'Pause'"
+	}
+	Item Data_Nex_Key Screenshot
+	{
+		target		"screenshot"
+		defValue	"'F12'"
+	}
+	Item Data_Nex_Key Quit
+	{
+		target		"quit"
+		defValue 	"'F10'"
+	}
+	Item Data_Nex_Key ViewSmaller
+	{
+		target		"sizedown"
+		defValue	"'-'"
+	}
+	Item Data_Nex_Key ViewBigger
+	{
+		target		"sizeup"
+		defValue	"'='"
+	}
+}


Property changes on: trunk/basezym/menu/data/key.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/management.menu
===================================================================
--- trunk/basezym/menu/data/management.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/management.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,46 +1,46 @@
-// Property of Alientrap
-//
-// data/management.menu
-
-Item DataContainer Management
-{
-	Item Data_Container Filename
-	{
-		Item DataLink_Text Text
-		{
-			maxValue	26
-			link		"##up"
-		}
-	}
-
-	Item Data_Container ConfigType
-	{
-		Item DataLink_ValueSwitch Switch
-		{
-			descList	"'Weapon Config' 'Game Config' 'Maplist'"
-			link		"##up"
-		}
-	}
-
-	Item DataContainer FileList
-	{
-		Item DataLink_Nex_FileList Weapon
-		{
-			normal		"cfg"
-			selected	"data/config/weapon/"
-		}
-
-		Item DataLink_Nex_FileList Game
-		{
-			normal		"cfg"
-			selected	"data/config/game/"
-		}
-
-		Item DataLink_Nex_FileList MapList
-		{
-			normal		"cfg"
-			selected	"data/config/maplist/"
-		}
-	}
-}
-
+// Property of Alientrap
+//
+// data/management.menu
+
+Item DataContainer Management
+{
+	Item Data_Container Filename
+	{
+		Item DataLink_Text Text
+		{
+			maxValue	26
+			link		"##up"
+		}
+	}
+
+	Item Data_Container ConfigType
+	{
+		Item DataLink_ValueSwitch Switch
+		{
+			descList	"'Weapon Config' 'Game Config' 'Maplist'"
+			link		"##up"
+		}
+	}
+
+	Item DataContainer FileList
+	{
+		Item DataLink_Nex_FileList Weapon
+		{
+			normal		"cfg"
+			selected	"data/config/weapon/"
+		}
+
+		Item DataLink_Nex_FileList Game
+		{
+			normal		"cfg"
+			selected	"data/config/game/"
+		}
+
+		Item DataLink_Nex_FileList MapList
+		{
+			normal		"cfg"
+			selected	"data/config/maplist/"
+		}
+	}
+}
+


Property changes on: trunk/basezym/menu/data/management.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/player.menu
===================================================================
--- trunk/basezym/menu/data/player.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/player.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,91 +1,91 @@
-// Property of Alientrap
-//
-// data/player.menu
-
-Item DataContainer Player
-{
-	Item Data_Nex_Name Name
-	{
-		defValue	"NexPlayer"
-		Item DataLink_Text Text
-		{
-			maxValue	32
-			link		"##up"
-		}
-	}
-	Item Data_Nex_Avatar Avatar
-	{
-	}
-	Item Data_Nex_Color TeamColor
-	{
-		defValue	"4"	// Red
-
-		Item DataLink_TextSwitch TextSwitch
-		{
-			// Red Blue Green Yellow
-			valueList 	"'4' '13' '3' '12'"
-			descList	"'$gfx/m_redsquare' '$gfx/m_bluesquare' '$gfx/m_greensquare' '$gfx/m_yellowsquare'"
-
-			link		"##up"
-		}
-	}
-	Item Data_Cvar FOV
-	{
-		cvarName	"FOV"
-		defValue	"90"
-
-		Item DataLink_Value Value
-		{
-			minValue	60.0
-			maxValue	150.0
-			stepValue	1.0
-			link		"##up"
-		}
-	}
-	Item Data_Cvar ViewSize
-	{
-		cvarName	"viewsize"
-		defValue	"110"
-
-		Item DataLink_Value Value
-		{
-			minValue	30.0
-			maxValue	120.0
-			stepValue	10
-			link		"##up"
-		}
-	}
-	Item DataContainer Crosshair
-	{
-		Item Data_Cvar Type
-		{
-			cvarName	"crosshair"
-			defValue	"1"
-
-			Item DataLink_ValueSwitch Switch
-			{
-				minValue 0
-				stepValue 1
-				maxValue 5
-
-				descList	"'' '$gfx/crosshair1.tga' '$gfx/crosshair2.tga' '$gfx/crosshair3.tga' '$gfx/crosshair4.tga' '$gfx/crosshair5.tga'"
-
-				link		"##up"
-			}
-		}
-		Item Data_Cvar	Size
-		{
-			cvarName	"crosshair_size"
-			defValue	"1"
-
-			Item DataLink_Value Value
-			{
-				minValue	1.0
-				maxValue	5.0
-				stepValue	0.25
-
-				link		"##up"
-			}
-		}
-	}
-}
+// Property of Alientrap
+//
+// data/player.menu
+
+Item DataContainer Player
+{
+	Item Data_Nex_Name Name
+	{
+		defValue	"NexPlayer"
+		Item DataLink_Text Text
+		{
+			maxValue	32
+			link		"##up"
+		}
+	}
+	Item Data_Nex_Avatar Avatar
+	{
+	}
+	Item Data_Nex_Color TeamColor
+	{
+		defValue	"4"	// Red
+
+		Item DataLink_TextSwitch TextSwitch
+		{
+			// Red Blue Green Yellow
+			valueList 	"'4' '13' '3' '12'"
+			descList	"'$gfx/m_redsquare' '$gfx/m_bluesquare' '$gfx/m_greensquare' '$gfx/m_yellowsquare'"
+
+			link		"##up"
+		}
+	}
+	Item Data_Cvar FOV
+	{
+		cvarName	"FOV"
+		defValue	"90"
+
+		Item DataLink_Value Value
+		{
+			minValue	60.0
+			maxValue	150.0
+			stepValue	1.0
+			link		"##up"
+		}
+	}
+	Item Data_Cvar ViewSize
+	{
+		cvarName	"viewsize"
+		defValue	"110"
+
+		Item DataLink_Value Value
+		{
+			minValue	30.0
+			maxValue	120.0
+			stepValue	10
+			link		"##up"
+		}
+	}
+	Item DataContainer Crosshair
+	{
+		Item Data_Cvar Type
+		{
+			cvarName	"crosshair"
+			defValue	"1"
+
+			Item DataLink_ValueSwitch Switch
+			{
+				minValue 0
+				stepValue 1
+				maxValue 5
+
+				descList	"'' '$gfx/crosshair1.tga' '$gfx/crosshair2.tga' '$gfx/crosshair3.tga' '$gfx/crosshair4.tga' '$gfx/crosshair5.tga'"
+
+				link		"##up"
+			}
+		}
+		Item Data_Cvar	Size
+		{
+			cvarName	"crosshair_size"
+			defValue	"1"
+
+			Item DataLink_Value Value
+			{
+				minValue	1.0
+				maxValue	5.0
+				stepValue	0.25
+
+				link		"##up"
+			}
+		}
+	}
+}


Property changes on: trunk/basezym/menu/data/player.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/server.menu
===================================================================
--- trunk/basezym/menu/data/server.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/server.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,217 +1,217 @@
-// Property of Alientrap
-//
-// data/server.menu
-
-Item DataContainer Server
-{
-	Item DataContainer Map
-	{
-		Item Nex_MapDB DataBase
-		{
-		}
-		// for the < > map selection in the basic options
-		Item DataLink_Nex_MapList Selector
-		{
-			init	Item_DataLink_Nex_MapList_InitWithMapList
-		}
-		// for the map list in map cycle
-		Item DataLink_Nex_MapList List
-		{
-			init 	Item_DataLink_Nex_MapList_InitWithMapList
-		}
-		Item DataLink_Nex_MapList Cycle
-		{
-			// creates x and x_index (CVAR_SAVE)
-			cvarName	"g_maplist"
-		}
-	}
-
-	Item Data_Cvar Hostname
-	{
-		cvarName	"hostname"
-		defValue	"Nexuiz Server"
-
-		Item DataLink_Text Text
-		{
-			link		"##up"
-			maxValue	64
-		}
-	}
-	Item Data_CvarCreateSave MaxPlayers
-	{
-		cvarName	"_nex_maxplayers"
-		defValue	8
-
-		Item DataLink_Value Value
-		{
-			link		"##up"
-			minValue	1
-			stepValue	1
-			maxValue	32
-		}
-		Item DataLink_Text Text
-		{
-			link		"##down"
-			maxValue	5
-
-			Item DataLink_TextValue TextValue
-			{
-				link	"##up prev"
-			}
-		}
-	}
-	Item Data_Cvar TimeLimit
-	{
-		cvarName	"timelimit"
-		defValue	0
-
-		Item DataLink_Value Value
-		{
-			maxValue	86400
-			link 		"##up"
-		}
-		Item DataLink_Text Text
-		{
-			maxValue	8
-			link		"##down"
-
-			Item DataLink_TextTime TextTime
-			{
-				link	"##up prev"
-			}
-		}
-	}
-	Item Data_Cvar FragLimit
-	{
-		cvarName	"fraglimit"
-		defValue	20
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ServerProgs
-	{
-		cvarName 	"sv_progs"
-		defValue	"progs.dat"
-
-		Item DataLink_Nex_ModSwitch Switch
-		{
-			link	"##up"
-		}
-	}
-	Item Data_CvarCreateSave NumBots
-	{
-		cvarName	"bot_number"
-		defValue	0
-
-		Item DataLink_Value Value
-		{
-			minValue	0
-			stepValue	1
-			maxValue 	64
-
-			link		"##up"
-		}
-		Item DataLink_Text Text
-		{
-			maxValue	5
-			link		"##down"
-
-			Item DataLink_TextValue TextValue
-			{
-				link	"##up prev"
-			}
-		}
-	}
-	Item Data_CvarCreateSave BotSkill
-	{
-		// TODO: add support for this in FrikQcc
-		cvarName	"skill"
-		// from 0 to 10
-		defValue	5
-
-		Item DataLink_ValueSwitch Switch
-		{
-			minValue	0
-			stepValue	1
-			maxValue	10
-			descList	"'Dumb, very''You will win''You can win''You might win''Beginner''Intermediate''Advanced''Expert''Assassin''Godlike'"
-
-			link		"##up"
-		}
-	}
-	Item Data_Cvar PublicServer
-	{
-		cvarName	"sv_public"
-		defValue 	1
-
-		Item DataLink_ValueSwitch Switch
-		{
-			maxValue 	1
-			descList	"'Disabled''Enabled'"
-
-			link		"##up"
-		}
-	}
-	Item Data_Cvar TeamPlay
-	{
-		cvarName	"teamplay"
-		defValue	0
-
-		Item DataLink_ValueSwitch Switch
-		{
-			minValue	0
-			stepValue	1
-			maxValue	3
-			descList	"'Off' 'No Friendly/Self Fire' 'Friendly Fire' 'No Friendly Fire'"
-
-			link		"##up"
-		}
-	}
-	Item Data_Cvar ServerFrameTime
-	{
-		cvarName	"sys_ticrate"
-		defValue	"0.05"
-
-		Item DataLink_Value Value
-		{
-			minValue	0.01	// 100 fps
-			maxValue	0.10	// 10 fps
-			stepValue	0.005
-			link		"##up"
-		}
-		Item DataLink_Text Text
-		{
-			maxValue	5
-			link		"##down"
-
-			Item DataLink_TextValue TextValue
-			{
-				link	"##up prev"
-			}
-		}
-	}
-	Item Data_Cvar ServerMaxRate
-	{
-		cvarName	"sv_maxrate"
-		defValue	"10000"
-
-		Item DataLink_Value Value
-		{
-			minValue	1000.0
-			maxValue	25000.0
-			stepValue	1000.0
-
-			link		"##up"
-		}
-		Item DataLink_Text Text
-		{
-			maxValue	5
-			link		"##down"
-
-			Item DataLink_TextValue TextValue
-			{
-				link	"##up prev"
-			}
-		}
-	}
-}
+// Property of Alientrap
+//
+// data/server.menu
+
+Item DataContainer Server
+{
+	Item DataContainer Map
+	{
+		Item Nex_MapDB DataBase
+		{
+		}
+		// for the < > map selection in the basic options
+		Item DataLink_Nex_MapList Selector
+		{
+			init	Item_DataLink_Nex_MapList_InitWithMapList
+		}
+		// for the map list in map cycle
+		Item DataLink_Nex_MapList List
+		{
+			init 	Item_DataLink_Nex_MapList_InitWithMapList
+		}
+		Item DataLink_Nex_MapList Cycle
+		{
+			// creates x and x_index (CVAR_SAVE)
+			cvarName	"g_maplist"
+		}
+	}
+
+	Item Data_Cvar Hostname
+	{
+		cvarName	"hostname"
+		defValue	"Nexuiz Server"
+
+		Item DataLink_Text Text
+		{
+			link		"##up"
+			maxValue	64
+		}
+	}
+	Item Data_CvarCreateSave MaxPlayers
+	{
+		cvarName	"_nex_maxplayers"
+		defValue	8
+
+		Item DataLink_Value Value
+		{
+			link		"##up"
+			minValue	1
+			stepValue	1
+			maxValue	32
+		}
+		Item DataLink_Text Text
+		{
+			link		"##down"
+			maxValue	5
+
+			Item DataLink_TextValue TextValue
+			{
+				link	"##up prev"
+			}
+		}
+	}
+	Item Data_Cvar TimeLimit
+	{
+		cvarName	"timelimit"
+		defValue	0
+
+		Item DataLink_Value Value
+		{
+			maxValue	86400
+			link 		"##up"
+		}
+		Item DataLink_Text Text
+		{
+			maxValue	8
+			link		"##down"
+
+			Item DataLink_TextTime TextTime
+			{
+				link	"##up prev"
+			}
+		}
+	}
+	Item Data_Cvar FragLimit
+	{
+		cvarName	"fraglimit"
+		defValue	20
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ServerProgs
+	{
+		cvarName 	"sv_progs"
+		defValue	"progs.dat"
+
+		Item DataLink_Nex_ModSwitch Switch
+		{
+			link	"##up"
+		}
+	}
+	Item Data_CvarCreateSave NumBots
+	{
+		cvarName	"bot_number"
+		defValue	0
+
+		Item DataLink_Value Value
+		{
+			minValue	0
+			stepValue	1
+			maxValue 	64
+
+			link		"##up"
+		}
+		Item DataLink_Text Text
+		{
+			maxValue	5
+			link		"##down"
+
+			Item DataLink_TextValue TextValue
+			{
+				link	"##up prev"
+			}
+		}
+	}
+	Item Data_CvarCreateSave BotSkill
+	{
+		// TODO: add support for this in FrikQcc
+		cvarName	"skill"
+		// from 0 to 10
+		defValue	5
+
+		Item DataLink_ValueSwitch Switch
+		{
+			minValue	0
+			stepValue	1
+			maxValue	10
+			descList	"'Dumb, very''You will win''You can win''You might win''Beginner''Intermediate''Advanced''Expert''Assassin''Godlike'"
+
+			link		"##up"
+		}
+	}
+	Item Data_Cvar PublicServer
+	{
+		cvarName	"sv_public"
+		defValue 	1
+
+		Item DataLink_ValueSwitch Switch
+		{
+			maxValue 	1
+			descList	"'Disabled''Enabled'"
+
+			link		"##up"
+		}
+	}
+	Item Data_Cvar TeamPlay
+	{
+		cvarName	"teamplay"
+		defValue	0
+
+		Item DataLink_ValueSwitch Switch
+		{
+			minValue	0
+			stepValue	1
+			maxValue	3
+			descList	"'Off' 'No Friendly/Self Fire' 'Friendly Fire' 'No Friendly Fire'"
+
+			link		"##up"
+		}
+	}
+	Item Data_Cvar ServerFrameTime
+	{
+		cvarName	"sys_ticrate"
+		defValue	"0.05"
+
+		Item DataLink_Value Value
+		{
+			minValue	0.01	// 100 fps
+			maxValue	0.10	// 10 fps
+			stepValue	0.005
+			link		"##up"
+		}
+		Item DataLink_Text Text
+		{
+			maxValue	5
+			link		"##down"
+
+			Item DataLink_TextValue TextValue
+			{
+				link	"##up prev"
+			}
+		}
+	}
+	Item Data_Cvar ServerMaxRate
+	{
+		cvarName	"sv_maxrate"
+		defValue	"10000"
+
+		Item DataLink_Value Value
+		{
+			minValue	1000.0
+			maxValue	25000.0
+			stepValue	1000.0
+
+			link		"##up"
+		}
+		Item DataLink_Text Text
+		{
+			maxValue	5
+			link		"##down"
+
+			Item DataLink_TextValue TextValue
+			{
+				link	"##up prev"
+			}
+		}
+	}
+}


Property changes on: trunk/basezym/menu/data/server.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/serverlist.menu
===================================================================
--- trunk/basezym/menu/data/serverlist.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/serverlist.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,17 +1,17 @@
-// Property of Alientrap
-//
-// data/serverlist.menu
-
-Item DataContainer ServerList
-{
-	Item Data_CvarCreateSave QueryString
-	{
-		cvarName	"scmenu_querystring"
-
-		Item DataLink_Text Text
-		{
-			maxValue	1024
-			link		"##up"
-		}
-	}
-}
+// Property of Alientrap
+//
+// data/serverlist.menu
+
+Item DataContainer ServerList
+{
+	Item Data_CvarCreateSave QueryString
+	{
+		cvarName	"scmenu_querystring"
+
+		Item DataLink_Text Text
+		{
+			maxValue	1024
+			link		"##up"
+		}
+	}
+}


Property changes on: trunk/basezym/menu/data/serverlist.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/sound.menu
===================================================================
--- trunk/basezym/menu/data/sound.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/sound.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,34 +1,34 @@
-// Property of Alientrap
-//
-// data/sound.menu
-Item DataContainer Sound
-{
-	Item Data_Cvar CDVolume
-	{
-		cvarName	"bgmvolume"
-		defValue	1
-
-		[DataLink_ZeroOneValue]
-	}
-	Item Data_Cvar GameVolume
-	{
-		cvarName	"volume"
-		defValue	1
-
-		[DataLink_ZeroOneValue]
-	}
-	Item Data_Cvar AmbientVolume
-	{
-		cvarName	"snd_staticvolume"
-		defValue	0.5
-
-		[DataLink_ZeroOneValue]
-	}
-	Item Data_Cvar SwapStereo
-	{
-		cvarName	"snd_swapstereo"
-		defValue	0
-
-		[DataLink_OnOffSwitch]
-	}
-}
+// Property of Alientrap
+//
+// data/sound.menu
+Item DataContainer Sound
+{
+	Item Data_Cvar CDVolume
+	{
+		cvarName	"bgmvolume"
+		defValue	1
+
+		[DataLink_ZeroOneValue]
+	}
+	Item Data_Cvar GameVolume
+	{
+		cvarName	"volume"
+		defValue	1
+
+		[DataLink_ZeroOneValue]
+	}
+	Item Data_Cvar AmbientVolume
+	{
+		cvarName	"snd_staticvolume"
+		defValue	0.5
+
+		[DataLink_ZeroOneValue]
+	}
+	Item Data_Cvar SwapStereo
+	{
+		cvarName	"snd_swapstereo"
+		defValue	0
+
+		[DataLink_OnOffSwitch]
+	}
+}


Property changes on: trunk/basezym/menu/data/sound.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/video.menu
===================================================================
--- trunk/basezym/menu/data/video.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/video.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,35 +1,35 @@
-// Property of Alientrap
-//
-// data/video.menu
-Item DataContainer Video
-{
-	Item Data_Nex_Resolution Resolution
-	{
-		defValue	"800 600"
-
-		Item DataLink_TextSwitch Switch
-		{
-			valueList	"'320 240' '640 480' '800 600' '1024 768' '1280 960' '1280 1024' '1600 900' '1600 1200' '2048 1536'"
-			descList	"'320x240' '640x480' '800x600' '1024x768' '1280x960' '1280x1024' '1600x900' '1600x1200' '2048x1536' 'Custom'"
-			link		"##up"
-		}
-	}
-	Item Data_Cvar BPP
-	{
-		cvarName	"vid_bitsperpixel"
-		defValue	"32"
-
-		Item DataLink_TextSwitch Switch
-		{
-			valueList	"'16' '32'"
-			descList	"'16-bit' '32-bit'"
-			link		"##up"
-		}
-	}
-	Item Data_Cvar Fullscreen
-	{
-		cvarName	"vid_fullscreen"
-
-		[DataLink_OnOffSwitch]
-	}
-}
+// Property of Alientrap
+//
+// data/video.menu
+Item DataContainer Video
+{
+	Item Data_Nex_Resolution Resolution
+	{
+		defValue	"800 600"
+
+		Item DataLink_TextSwitch Switch
+		{
+			valueList	"'320 240' '640 480' '800 600' '1024 768' '1280 960' '1280 1024' '1600 900' '1600 1200' '2048 1536'"
+			descList	"'320x240' '640x480' '800x600' '1024x768' '1280x960' '1280x1024' '1600x900' '1600x1200' '2048x1536' 'Custom'"
+			link		"##up"
+		}
+	}
+	Item Data_Cvar BPP
+	{
+		cvarName	"vid_bitsperpixel"
+		defValue	"32"
+
+		Item DataLink_TextSwitch Switch
+		{
+			valueList	"'16' '32'"
+			descList	"'16-bit' '32-bit'"
+			link		"##up"
+		}
+	}
+	Item Data_Cvar Fullscreen
+	{
+		cvarName	"vid_fullscreen"
+
+		[DataLink_OnOffSwitch]
+	}
+}


Property changes on: trunk/basezym/menu/data/video.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data/weapon.menu
===================================================================
--- trunk/basezym/menu/data/weapon.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data/weapon.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,469 +1,469 @@
-// Property of Alientrap
-//
-// data/weapon.menu
-
-Item DataContainer Weapon
-{
-	Item Data_Cvar InvincibleTakeDamage
-	{
-		cvarName	"g_balance_powerup_invincible_takedamage"
-		defValue	0.2
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar InvincibleTime
-	{
-		cvarName	"g_balance_powerup_invincible_time"
-		defValue	30
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar StrengthDamage
-	{
-		cvarName	"g_balance_powerup_strength_damage"
-		defValue	3
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar StrengthForce
-	{
-		cvarName	"g_balance_powerup_strength_force"
-		defValue	4
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar StrengthTime
-	{
-		cvarName	"g_balance_powerup_strength_time"
-		defValue	30
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar LaserDamage
-	{
-		cvarName	"g_balance_laser_damage"
-		defValue	15
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar LaserEdgeDamage
-	{
-		cvarName	"g_balance_laser_edgedamage"
-		defValue	15
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar LaserForce
-	{
-		cvarName	"g_balance_laser_force"
-		defValue	200
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar LaserRadius
-	{
-		cvarName	"g_balance_laser_radius"
-		defValue	50
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar LaserSpeed
-	{
-		cvarName	"g_balance_laser_speed"
-		defValue	1000
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar Laserrefire
-	{
-		cvarName	"g_balance_laser_refire"
-		defValue	0.3
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunDamage
-	{
-		cvarName	"g_balance_shotgun_damage"
-		defValue	3.5
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunDamage2
-	{
-		cvarName	"g_balance_shotgun_damage2"
-		defValue	6
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunBullets
-	{
-		cvarName	"g_balance_shotgun_bullets"
-		defValue	10
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunSpread
-	{
-		cvarName	"g_balance_shotgun_spread"
-		defValue	0.07
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunRefire
-	{
-		cvarName	"g_balance_shotgun_refire"
-		defValue	0.7
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunRefire2
-	{
-		cvarName	"g_balance_shotgun_refire2"
-		defValue	1.3
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ShotgunRefire3
-	{
-		cvarName	"g_balance_shotgun_refire3"
-		defValue	0.2
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar UziDamage
-	{
-		cvarName	"g_balance_uzi_damage"
-		defValue	4
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar UziSpread
-	{
-		cvarName	"g_balance_uzi_spread"
-		defValue	0.1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar UziSpread2
-	{
-		cvarName	"g_balance_uzi_spread2"
-		defValue	0.01
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar UziRefire
-	{
-		cvarName	"g_balance_uzi_refire"
-		defValue	0.05
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar UziDamage2
-	{
-		cvarName	"g_balance_uzi_damage2"
-		defValue	15
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar UziRefire2
-	{
-		cvarName	"g_balance_uzi_refire2"
-		defValue	0.2
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherDamage
-	{
-		cvarName	"g_balance_grenadelauncher_damage"
-		defValue	65
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherEdgeDamage
-	{
-		cvarName	"g_balance_grenadelauncher_edgedamage"
-		defValue	45
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherForce
-	{
-		cvarName	"g_balance_grenadelauncher_force"
-		defValue	400
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherRadius
-	{
-		cvarName	"g_balance_grenadelauncher_radius"
-		defValue	140
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherSpeed
-	{
-		cvarName	"g_balance_grenadelauncher_speed"
-		defValue	2000
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherSpeedUp
-	{
-		cvarName	"g_balance_grenadelauncher_speed_up"
-		defValue	200
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherSpeed2
-	{
-		cvarName	"g_balance_grenadelauncher_speed2"
-		defValue	900
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherSpeed2Up
-	{
-		cvarName	"g_balance_grenadelauncher_speed2_up"
-		defValue	200
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherRefire
-	{
-		cvarName	"g_balance_grenadelauncher_refire"
-		defValue	0.8
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar GrenadeLauncherRefire2
-	{
-		cvarName	"g_balance_grenadelauncher_refire2"
-		defValue	0.6
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroDamage
-	{
-		cvarName	"g_balance_electro_damage"
-		defValue	90
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroEdgeDamage
-	{
-		cvarName	"g_balance_electro_edgedamage"
-		defValue	45
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroForce
-	{
-		cvarName	"g_balance_electro_force"
-		defValue	200
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroRadius
-	{
-		cvarName	"g_balance_electro_radius"
-		defValue	100
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroRefire
-	{
-		cvarName	"g_balance_electro_refire"
-		defValue	1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroSpeed
-	{
-		cvarName	"g_balance_electro_speed"
-		defValue	2000
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroBallSpeed
-	{
-		cvarName	"g_balance_electro_ballspeed"
-		defValue	900
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar ElectroBallSpeedUp
-	{
-		cvarName	"g_balance_electro_ballspeed_up"
-		defValue	200
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkDamage
-	{
-		cvarName	"g_balance_crylink_damage"
-		defValue	20
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkEdgeDamage
-	{
-		cvarName	"g_balance_crylink_edgedamage"
-		defValue	0
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkForce
-	{
-		cvarName	"g_balance_crylink_force"
-		defValue	55
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkRadius
-	{
-		cvarName	"g_balance_crylink_radius"
-		defValue	3
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkSpeed
-	{
-		cvarName	"g_balance_crylink_speed"
-		defValue	1800
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkSpread
-	{
-		cvarName	"g_balance_crylink_spread"
-		defValue	0.15
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkRefire
-	{
-		cvarName	"g_balance_crylink_refire"
-		defValue	0.4
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar CryLinkShots
-	{
-		cvarName	"g_balance_crylink_shots"
-		defValue	7
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar NexDamage
-	{
-		cvarName	"g_balance_nex_damage"
-		defValue	200
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar Nexrefire
-	{
-		cvarName	"g_balance_nex_refire"
-		defValue	1
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarDamage
-	{
-		cvarName	"g_balance_hagar_damage"
-		defValue	40
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarEdgeDamage
-	{
-		cvarName	"g_balance_hagar_edgedamage"
-		defValue	15
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarForce
-	{
-		cvarName	"g_balance_hagar_force"
-		defValue	100
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarRadius
-	{
-		cvarName	"g_balance_hagar_radius"
-		defValue	70
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarSpeed
-	{
-		cvarName	"g_balance_hagar_speed"
-		defValue	3000
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarSpeed2
-	{
-		cvarName	"g_balance_hagar_speed2"
-		defValue	1400
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarSpeed2Up
-	{
-		cvarName	"g_balance_hagar_speed2_up"
-		defValue	100
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar HagarSpread
-	{
-		cvarName	"g_balance_hagar_spread"
-		defValue	0
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar RocketLauncherDamage
-	{
-		cvarName	"g_balance_rocketlauncher_damage"
-		defValue	130
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar RocketLauncherEdgeDamage
-	{
-		cvarName	"g_balance_rocketlauncher_edgedamage"
-		defValue	50
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar RocketLauncherForce
-	{
-		cvarName	"g_balance_rocketlauncher_force"
-		defValue	600
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar RocketLauncherRadius
-	{
-		cvarName	"g_balance_rocketlauncher_radius"
-		defValue	170
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar RocketLauncherSpeed
-	{
-		cvarName	"g_balance_rocketlauncher_speed"
-		defValue	850
-
-		[DataLink_Setting]
-	}
-	Item Data_Cvar RocketLauncherrefire
-	{
-		cvarName	"g_balance_rocketlauncher_refire"
-		defValue	1.2
-
-		[DataLink_Setting]
-	}
-}
+// Property of Alientrap
+//
+// data/weapon.menu
+
+Item DataContainer Weapon
+{
+	Item Data_Cvar InvincibleTakeDamage
+	{
+		cvarName	"g_balance_powerup_invincible_takedamage"
+		defValue	0.2
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar InvincibleTime
+	{
+		cvarName	"g_balance_powerup_invincible_time"
+		defValue	30
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar StrengthDamage
+	{
+		cvarName	"g_balance_powerup_strength_damage"
+		defValue	3
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar StrengthForce
+	{
+		cvarName	"g_balance_powerup_strength_force"
+		defValue	4
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar StrengthTime
+	{
+		cvarName	"g_balance_powerup_strength_time"
+		defValue	30
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar LaserDamage
+	{
+		cvarName	"g_balance_laser_damage"
+		defValue	15
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar LaserEdgeDamage
+	{
+		cvarName	"g_balance_laser_edgedamage"
+		defValue	15
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar LaserForce
+	{
+		cvarName	"g_balance_laser_force"
+		defValue	200
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar LaserRadius
+	{
+		cvarName	"g_balance_laser_radius"
+		defValue	50
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar LaserSpeed
+	{
+		cvarName	"g_balance_laser_speed"
+		defValue	1000
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar Laserrefire
+	{
+		cvarName	"g_balance_laser_refire"
+		defValue	0.3
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunDamage
+	{
+		cvarName	"g_balance_shotgun_damage"
+		defValue	3.5
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunDamage2
+	{
+		cvarName	"g_balance_shotgun_damage2"
+		defValue	6
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunBullets
+	{
+		cvarName	"g_balance_shotgun_bullets"
+		defValue	10
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunSpread
+	{
+		cvarName	"g_balance_shotgun_spread"
+		defValue	0.07
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunRefire
+	{
+		cvarName	"g_balance_shotgun_refire"
+		defValue	0.7
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunRefire2
+	{
+		cvarName	"g_balance_shotgun_refire2"
+		defValue	1.3
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ShotgunRefire3
+	{
+		cvarName	"g_balance_shotgun_refire3"
+		defValue	0.2
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar UziDamage
+	{
+		cvarName	"g_balance_uzi_damage"
+		defValue	4
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar UziSpread
+	{
+		cvarName	"g_balance_uzi_spread"
+		defValue	0.1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar UziSpread2
+	{
+		cvarName	"g_balance_uzi_spread2"
+		defValue	0.01
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar UziRefire
+	{
+		cvarName	"g_balance_uzi_refire"
+		defValue	0.05
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar UziDamage2
+	{
+		cvarName	"g_balance_uzi_damage2"
+		defValue	15
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar UziRefire2
+	{
+		cvarName	"g_balance_uzi_refire2"
+		defValue	0.2
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherDamage
+	{
+		cvarName	"g_balance_grenadelauncher_damage"
+		defValue	65
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherEdgeDamage
+	{
+		cvarName	"g_balance_grenadelauncher_edgedamage"
+		defValue	45
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherForce
+	{
+		cvarName	"g_balance_grenadelauncher_force"
+		defValue	400
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherRadius
+	{
+		cvarName	"g_balance_grenadelauncher_radius"
+		defValue	140
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherSpeed
+	{
+		cvarName	"g_balance_grenadelauncher_speed"
+		defValue	2000
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherSpeedUp
+	{
+		cvarName	"g_balance_grenadelauncher_speed_up"
+		defValue	200
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherSpeed2
+	{
+		cvarName	"g_balance_grenadelauncher_speed2"
+		defValue	900
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherSpeed2Up
+	{
+		cvarName	"g_balance_grenadelauncher_speed2_up"
+		defValue	200
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherRefire
+	{
+		cvarName	"g_balance_grenadelauncher_refire"
+		defValue	0.8
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar GrenadeLauncherRefire2
+	{
+		cvarName	"g_balance_grenadelauncher_refire2"
+		defValue	0.6
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroDamage
+	{
+		cvarName	"g_balance_electro_damage"
+		defValue	90
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroEdgeDamage
+	{
+		cvarName	"g_balance_electro_edgedamage"
+		defValue	45
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroForce
+	{
+		cvarName	"g_balance_electro_force"
+		defValue	200
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroRadius
+	{
+		cvarName	"g_balance_electro_radius"
+		defValue	100
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroRefire
+	{
+		cvarName	"g_balance_electro_refire"
+		defValue	1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroSpeed
+	{
+		cvarName	"g_balance_electro_speed"
+		defValue	2000
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroBallSpeed
+	{
+		cvarName	"g_balance_electro_ballspeed"
+		defValue	900
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar ElectroBallSpeedUp
+	{
+		cvarName	"g_balance_electro_ballspeed_up"
+		defValue	200
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkDamage
+	{
+		cvarName	"g_balance_crylink_damage"
+		defValue	20
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkEdgeDamage
+	{
+		cvarName	"g_balance_crylink_edgedamage"
+		defValue	0
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkForce
+	{
+		cvarName	"g_balance_crylink_force"
+		defValue	55
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkRadius
+	{
+		cvarName	"g_balance_crylink_radius"
+		defValue	3
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkSpeed
+	{
+		cvarName	"g_balance_crylink_speed"
+		defValue	1800
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkSpread
+	{
+		cvarName	"g_balance_crylink_spread"
+		defValue	0.15
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkRefire
+	{
+		cvarName	"g_balance_crylink_refire"
+		defValue	0.4
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar CryLinkShots
+	{
+		cvarName	"g_balance_crylink_shots"
+		defValue	7
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar NexDamage
+	{
+		cvarName	"g_balance_nex_damage"
+		defValue	200
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar Nexrefire
+	{
+		cvarName	"g_balance_nex_refire"
+		defValue	1
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarDamage
+	{
+		cvarName	"g_balance_hagar_damage"
+		defValue	40
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarEdgeDamage
+	{
+		cvarName	"g_balance_hagar_edgedamage"
+		defValue	15
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarForce
+	{
+		cvarName	"g_balance_hagar_force"
+		defValue	100
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarRadius
+	{
+		cvarName	"g_balance_hagar_radius"
+		defValue	70
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarSpeed
+	{
+		cvarName	"g_balance_hagar_speed"
+		defValue	3000
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarSpeed2
+	{
+		cvarName	"g_balance_hagar_speed2"
+		defValue	1400
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarSpeed2Up
+	{
+		cvarName	"g_balance_hagar_speed2_up"
+		defValue	100
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar HagarSpread
+	{
+		cvarName	"g_balance_hagar_spread"
+		defValue	0
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar RocketLauncherDamage
+	{
+		cvarName	"g_balance_rocketlauncher_damage"
+		defValue	130
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar RocketLauncherEdgeDamage
+	{
+		cvarName	"g_balance_rocketlauncher_edgedamage"
+		defValue	50
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar RocketLauncherForce
+	{
+		cvarName	"g_balance_rocketlauncher_force"
+		defValue	600
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar RocketLauncherRadius
+	{
+		cvarName	"g_balance_rocketlauncher_radius"
+		defValue	170
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar RocketLauncherSpeed
+	{
+		cvarName	"g_balance_rocketlauncher_speed"
+		defValue	850
+
+		[DataLink_Setting]
+	}
+	Item Data_Cvar RocketLauncherrefire
+	{
+		cvarName	"g_balance_rocketlauncher_refire"
+		defValue	1.2
+
+		[DataLink_Setting]
+	}
+}


Property changes on: trunk/basezym/menu/data/weapon.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/data.menu
===================================================================
--- trunk/basezym/menu/data.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/data.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,25 +1,25 @@
-// Property of Alientrap
-//
-// Cvar Definitions
-Item DataContainer Data
-{
-#define DataLink_ZeroOneValue	Derive "::DataLink_ZeroOneValue" Value {}
-#define DataLink_OnOffSwitch	Derive "::DataLink_OnOffSwitch" Switch {}
-#define DataLink_Setting	Derive "::DataLink_SettingValue" Value {} \
-				Derive "::DataLink_SettingText" Text {}
-
-	#include "menu/data/player.menu"
-	#include "menu/data/color.menu"
-	#include "menu/data/video.menu"
-	#include "menu/data/effects.menu"
-	#include "menu/data/input.menu"
-	#include "menu/data/key.menu"
-	#include "menu/data/sound.menu"
-
-	#include "menu/data/serverlist.menu"
-
-	#include "menu/data/server.menu"
-	#include "menu/data/game.menu"
-	#include "menu/data/weapon.menu"
-	#include "menu/data/management.menu"
-}
+// Property of Alientrap
+//
+// Cvar Definitions
+Item DataContainer Data
+{
+#define DataLink_ZeroOneValue	Derive "::DataLink_ZeroOneValue" Value {}
+#define DataLink_OnOffSwitch	Derive "::DataLink_OnOffSwitch" Switch {}
+#define DataLink_Setting	Derive "::DataLink_SettingValue" Value {} \
+				Derive "::DataLink_SettingText" Text {}
+
+	#include "menu/data/player.menu"
+	#include "menu/data/color.menu"
+	#include "menu/data/video.menu"
+	#include "menu/data/effects.menu"
+	#include "menu/data/input.menu"
+	#include "menu/data/key.menu"
+	#include "menu/data/sound.menu"
+
+	#include "menu/data/serverlist.menu"
+
+	#include "menu/data/server.menu"
+	#include "menu/data/game.menu"
+	#include "menu/data/weapon.menu"
+	#include "menu/data/management.menu"
+}


Property changes on: trunk/basezym/menu/data.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/ingame.menu
===================================================================
--- trunk/basezym/menu/ingame.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/ingame.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,4 +1,4 @@
-// Property of Alientrap
-//
-// Ingame main menu
-
+// Property of Alientrap
+//
+// Ingame main menu
+


Property changes on: trunk/basezym/menu/ingame.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/joingame.menu
===================================================================
--- trunk/basezym/menu/joingame.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/joingame.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,200 +1,200 @@
-// Property of Alientrap/AK
-//
-// joingame.menu
-
-Item Window JoinGame
-{
-	Derive Picture Table3
-	{
-		picture "gfx/table3"
-		pos	'0 0'
-		size	'900 555'
-	}
-	Item Layout JoinGame
-	{
-		size		'900 650'
-		direction	'0 10'
-		alignment	[AlignCenter]
-		origin		'450 0'
-#define SList_Ping	'50 15'
-#define SList_Name	'492 15'
-#define SList_Map	'120 15'
-#define SList_Players	'60 15'
-#define SList_Mod	'120 15'
-#define SList_Direction '2 0'
-
-		Derive Nex_Composition Query
-		{
-			Derive TextButton Description
-			{
-				normal		"Query String:"
-
-				link		"##next"
-			}
-			Derive EditBox EditBox
-			{
-				size	'700 12'
-				target	"::Data::ServerList::QueryString::Text"
-
-				action	Nex_Action_ExecuteQuery
-			}
-		}
-
-		Item Layout TableDesc
-		{
-			direction	[SList_Direction]
-			flag		[FlagEmbedded]
-			size		'900 15'
-
-			DeriveTemplate Rect Theme
-			{
-				color	'0.5 0.5 0.5'
-				alpha	0.5
-				flag	[FlagEmbedded]
-			}
-			Derive Theme Ping
-			{
-				size	[SList_Ping]
-				Derive TextButton Text
-				{
-					normal		"Ping"
-
-					init 		Nex_Action_JoinGame_SortBy
-					target		"ping"
-				}
-			}
-			Derive Theme Name
-			{
-				size	[SList_Name]
-				Derive TextButton Text
-				{
-					normal		"Server Name"
-
-					init 		Nex_Action_JoinGame_SortBy
-					target		"name"
-				}
-			}
-			Derive Theme Map
-			{
-				size	[SList_Map]
-				Derive TextButton Text
-				{
-					normal		"Map Name"
-
-					init 		Nex_Action_JoinGame_SortBy
-					target		"map"
-				}
-			}
-			Derive Theme Players
-			{
-				size	[SList_Players]
-				Item Arrangement Glue
-				{
-					direction	'0.001 0 0'
-					flag		[FlagEmbedded]
-
-					Derive TextButton NumPlayers
-					{
-						normal		"NP"
-
-						init 		Nex_Action_JoinGame_SortBy
-						target		"numplayers"
-					}
-					Derive Label	Slash
-					{
-						text		"/"
-					}
-					Derive TextButton MaxPlayers
-					{
-						normal		"MP"
-
-						init 		Nex_Action_JoinGame_SortBy
-						target		"maxplayers"
-					}
-				}
-			}
-			Derive Theme Mod
-			{
-				size	[SList_Mod]
-				Derive TextButton Text
-				{
-					normal		"Mod Name"
-
-					init 		Nex_Action_JoinGame_SortBy
-					target		"mod"
-				}
-			}
-		}
-		Item Window Scroll
-		{
-			flag	[FlagEmbedded]
-			size	'900 500'
-
-			Item ScrollWindow ScrollArea
-			{
-				flag	[FlagEmbedded]
-				size 	'870 500'
-
-				Item Arrangement Slist
-				{
-					direction	'0 1 0'
-					flag		[FlagEmbedded]
-
-					DeriveTemplate Nex_HostCache_Entry Entry
-					{
-						size		'852 15'
-						action		Nex_Action_EntryConnect
-
-						DeriveTemplate Nex_HostCache_ValueField Ping
-						{
-							pos		'0 0'
-							size		[SList_Ping]
-							target		"ping"
-							alignment	[AlignRight]
-						}
-						DeriveTemplate Nex_HostCache_StringField Name
-						{
-							pos		'52 0'
-							size		[SList_Name]
-							target		"name"
-						}
-						DeriveTemplate Nex_HostCache_StringField Map
-						{
-							pos		'546 0'
-							size		[SList_Map]
-							target		"map"
-						}
-						DeriveTemplate Nex_HostCache_Players Players
-						{
-							pos		'668 0'
-							size		[SList_Players]
-							alignment	[AlignRight]
-						}
-						DeriveTemplate Nex_HostCache_StringField Mod
-						{
-							pos		'730 0'
-							size		[SList_Mod]
-							target		"mod"
-						}
-					}
-					Item Automation_Job Generator
-					{
-						action Nex_Automation_CreateEntries
-					}
-				}
-			}
-			Item VScrollBar Scroller
-			{
-				pos	'870 0'
-				size	'20 100'
-				target	"##prev"
-			}
-		}
-		Derive PictureButton Refresh
-		{
-			normal		"$gfx/m_refresh"
-
-			action 	Nex_Action_RefreshSlist
-		}
-	}
+// Property of Alientrap/AK
+//
+// joingame.menu
+
+Item Window JoinGame
+{
+	Derive Picture Table3
+	{
+		picture "gfx/table3"
+		pos	'0 0'
+		size	'900 555'
+	}
+	Item Layout JoinGame
+	{
+		size		'900 650'
+		direction	'0 10'
+		alignment	[AlignCenter]
+		origin		'450 0'
+#define SList_Ping	'50 15'
+#define SList_Name	'492 15'
+#define SList_Map	'120 15'
+#define SList_Players	'60 15'
+#define SList_Mod	'120 15'
+#define SList_Direction '2 0'
+
+		Derive Nex_Composition Query
+		{
+			Derive TextButton Description
+			{
+				normal		"Query String:"
+
+				link		"##next"
+			}
+			Derive EditBox EditBox
+			{
+				size	'700 12'
+				target	"::Data::ServerList::QueryString::Text"
+
+				action	Nex_Action_ExecuteQuery
+			}
+		}
+
+		Item Layout TableDesc
+		{
+			direction	[SList_Direction]
+			flag		[FlagEmbedded]
+			size		'900 15'
+
+			DeriveTemplate Rect Theme
+			{
+				color	'0.5 0.5 0.5'
+				alpha	0.5
+				flag	[FlagEmbedded]
+			}
+			Derive Theme Ping
+			{
+				size	[SList_Ping]
+				Derive TextButton Text
+				{
+					normal		"Ping"
+
+					init 		Nex_Action_JoinGame_SortBy
+					target		"ping"
+				}
+			}
+			Derive Theme Name
+			{
+				size	[SList_Name]
+				Derive TextButton Text
+				{
+					normal		"Server Name"
+
+					init 		Nex_Action_JoinGame_SortBy
+					target		"name"
+				}
+			}
+			Derive Theme Map
+			{
+				size	[SList_Map]
+				Derive TextButton Text
+				{
+					normal		"Map Name"
+
+					init 		Nex_Action_JoinGame_SortBy
+					target		"map"
+				}
+			}
+			Derive Theme Players
+			{
+				size	[SList_Players]
+				Item Arrangement Glue
+				{
+					direction	'0.001 0 0'
+					flag		[FlagEmbedded]
+
+					Derive TextButton NumPlayers
+					{
+						normal		"NP"
+
+						init 		Nex_Action_JoinGame_SortBy
+						target		"numplayers"
+					}
+					Derive Label	Slash
+					{
+						text		"/"
+					}
+					Derive TextButton MaxPlayers
+					{
+						normal		"MP"
+
+						init 		Nex_Action_JoinGame_SortBy
+						target		"maxplayers"
+					}
+				}
+			}
+			Derive Theme Mod
+			{
+				size	[SList_Mod]
+				Derive TextButton Text
+				{
+					normal		"Mod Name"
+
+					init 		Nex_Action_JoinGame_SortBy
+					target		"mod"
+				}
+			}
+		}
+		Item Window Scroll
+		{
+			flag	[FlagEmbedded]
+			size	'900 500'
+
+			Item ScrollWindow ScrollArea
+			{
+				flag	[FlagEmbedded]
+				size 	'870 500'
+
+				Item Arrangement Slist
+				{
+					direction	'0 1 0'
+					flag		[FlagEmbedded]
+
+					DeriveTemplate Nex_HostCache_Entry Entry
+					{
+						size		'852 15'
+						action		Nex_Action_EntryConnect
+
+						DeriveTemplate Nex_HostCache_ValueField Ping
+						{
+							pos		'0 0'
+							size		[SList_Ping]
+							target		"ping"
+							alignment	[AlignRight]
+						}
+						DeriveTemplate Nex_HostCache_StringField Name
+						{
+							pos		'52 0'
+							size		[SList_Name]
+							target		"name"
+						}
+						DeriveTemplate Nex_HostCache_StringField Map
+						{
+							pos		'546 0'
+							size		[SList_Map]
+							target		"map"
+						}
+						DeriveTemplate Nex_HostCache_Players Players
+						{
+							pos		'668 0'
+							size		[SList_Players]
+							alignment	[AlignRight]
+						}
+						DeriveTemplate Nex_HostCache_StringField Mod
+						{
+							pos		'730 0'
+							size		[SList_Mod]
+							target		"mod"
+						}
+					}
+					Item Automation_Job Generator
+					{
+						action Nex_Automation_CreateEntries
+					}
+				}
+			}
+			Item VScrollBar Scroller
+			{
+				pos	'870 0'
+				size	'20 100'
+				target	"##prev"
+			}
+		}
+		Derive PictureButton Refresh
+		{
+			normal		"$gfx/m_refresh"
+
+			action 	Nex_Action_RefreshSlist
+		}
+	}
 }
\ No newline at end of file


Property changes on: trunk/basezym/menu/joingame.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/main.menu
===================================================================
--- trunk/basezym/menu/main.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/main.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,66 +1,66 @@
-// Property of Alientrap
-//
-// Main menu
-Item Layout Main
-{
-	Item Layout MainBar
-	{
-		origin		'29 160'
-		direction 	'13 0'
-
-		DeriveTemplate PictureButton MainButton
-		{
-			soundPressed 	"misc/menu2.wav"
-		}
-
-		Derive MainButton Mission
-		{
-			normal		"$gfx/b_miss"
-			selected	"$gfx/bd_miss"
-
-			target 	"Mission"
-			init	Nex_Action_SetNormalPanelLink
-		}
-		Derive MainButton Join
-		{
-			normal		"$gfx/b_mult"
-			selected	"$gfx/bd_mult"
-
-			target	"JoinGame"
-			action	Nex_Action_JumpToJoinGame
-		}
-		Derive MainButton Options
-		{
-			normal		"$gfx/b_opti"
-			selected	"$gfx/bd_opti"
-
-			target	"Options"
-			init	Nex_Action_SetNormalPanelLink
-		}
-		Derive MainButton Credits
-		{
-			normal		"$gfx/b_cred"
-			selected	"$gfx/bd_cred"
-
-			action		Nex_Credits_Action
-		}
-	}
-
-	Item Layout MainQuit
-	{
-		origin		'965 10'
-
-		DeriveTemplate PictureButton MainButton
-		{
-			soundPressed 	"misc/menu2.wav"
-		}
-
-		Derive MainButton Quit
-		{
-			normal		"$gfx/b_quit"
-			selected	"$gfx/bd_quit"
-
-			action		Nex_Quit_Action
-		}
-	}
-}
+// Property of Alientrap
+//
+// Main menu
+Item Layout Main
+{
+	Item Layout MainBar
+	{
+		origin		'29 160'
+		direction 	'13 0'
+
+		DeriveTemplate PictureButton MainButton
+		{
+			soundPressed 	"misc/menu2.wav"
+		}
+
+		Derive MainButton Mission
+		{
+			normal		"$gfx/b_miss"
+			selected	"$gfx/bd_miss"
+
+			target 	"Mission"
+			init	Nex_Action_SetNormalPanelLink
+		}
+		Derive MainButton Join
+		{
+			normal		"$gfx/b_mult"
+			selected	"$gfx/bd_mult"
+
+			target	"JoinGame"
+			action	Nex_Action_JumpToJoinGame
+		}
+		Derive MainButton Options
+		{
+			normal		"$gfx/b_opti"
+			selected	"$gfx/bd_opti"
+
+			target	"Options"
+			init	Nex_Action_SetNormalPanelLink
+		}
+		Derive MainButton Credits
+		{
+			normal		"$gfx/b_cred"
+			selected	"$gfx/bd_cred"
+
+			action		Nex_Credits_Action
+		}
+	}
+
+	Item Layout MainQuit
+	{
+		origin		'965 10'
+
+		DeriveTemplate PictureButton MainButton
+		{
+			soundPressed 	"misc/menu2.wav"
+		}
+
+		Derive MainButton Quit
+		{
+			normal		"$gfx/b_quit"
+			selected	"$gfx/bd_quit"
+
+			action		Nex_Quit_Action
+		}
+	}
+}


Property changes on: trunk/basezym/menu/main.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/messagebox.menu
===================================================================
--- trunk/basezym/menu/messagebox.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/messagebox.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,82 +1,82 @@
-// Property of Alientrap
-//
-// message box window
-// messagebox.menu
-
-// MessageBoxWnd::Layout::Title::Caption
-// MessageBoxWnd::Layout::Text
-// MessageBoxWnd::Layout::Buttons::Left
-// MessageBoxWnd::Layout::Buttons::Right
-Item Window MessageBoxWnd
-{
-	pos 	'300 300'
-	size	'400 80'
-	flag	[FlagHidden]
-
-	Derive Rect Background
-	{
-		flag		[FlagSealOffMouse]
-		color		'0 0 0'
-		alpha		0.8
-		Ignore {
-			color		'0.1 0.1 0.1'
-			drawFlag 	[DrawFlagModulate]
-
-
-			Derive Rect Layer
-			{
-				color		'0.3 0.3 0.3'
-				drawFlag	[DrawFlagAdditive]
-			}
-		}
-	}
-	Item Layout Layout
-	{
-		origin		'200 0'
-		direction 	'0.0 10'
-		flag		[FlagEmbedded]
-		alignment 	[AlignCenter]
-
-		Item FloatingArea Title
-		{
-			size		'400 13'
-			target		"##up up"
-			Derive Rect Background
-			{
-				//color		'0.5 0.5 0.5'
-				color		'0.05 0.05 0.05'
-			}
-			Derive TextButton Caption
-			{
-				color		'1.0 1.0 1.0'
-				size		'400 11'
-				alignment 	[AlignCenter]
-				//normal	"Message Box Window"
-				link		"##up"
-			}
-		}
-		Derive Label Text
-		{
-			color		'1.0 1.0 1.0'
-			//text		"MessageBox Text"
-		}
-		Item Arrangement Buttons
-		{
-			direction	'40 0'
-			key		Nex_MessageBox_Key
-
-			Derive TextButton Left
-			{
-				color	'1.0 1.0 1.0'
-				//normal "Left"
-				action	Nex_MessageBox_LeftButton
-			}
-			Derive TextButton Right
-			{
-				color	'1.0 1.0 1.0'
-				//normal "Right"
-				action	Nex_MessageBox_RightButton
-			}
-		}
-	}
-}
+// Property of Alientrap
+//
+// message box window
+// messagebox.menu
+
+// MessageBoxWnd::Layout::Title::Caption
+// MessageBoxWnd::Layout::Text
+// MessageBoxWnd::Layout::Buttons::Left
+// MessageBoxWnd::Layout::Buttons::Right
+Item Window MessageBoxWnd
+{
+	pos 	'300 300'
+	size	'400 80'
+	flag	[FlagHidden]
+
+	Derive Rect Background
+	{
+		flag		[FlagSealOffMouse]
+		color		'0 0 0'
+		alpha		0.8
+		Ignore {
+			color		'0.1 0.1 0.1'
+			drawFlag 	[DrawFlagModulate]
+
+
+			Derive Rect Layer
+			{
+				color		'0.3 0.3 0.3'
+				drawFlag	[DrawFlagAdditive]
+			}
+		}
+	}
+	Item Layout Layout
+	{
+		origin		'200 0'
+		direction 	'0.0 10'
+		flag		[FlagEmbedded]
+		alignment 	[AlignCenter]
+
+		Item FloatingArea Title
+		{
+			size		'400 13'
+			target		"##up up"
+			Derive Rect Background
+			{
+				//color		'0.5 0.5 0.5'
+				color		'0.05 0.05 0.05'
+			}
+			Derive TextButton Caption
+			{
+				color		'1.0 1.0 1.0'
+				size		'400 11'
+				alignment 	[AlignCenter]
+				//normal	"Message Box Window"
+				link		"##up"
+			}
+		}
+		Derive Label Text
+		{
+			color		'1.0 1.0 1.0'
+			//text		"MessageBox Text"
+		}
+		Item Arrangement Buttons
+		{
+			direction	'40 0'
+			key		Nex_MessageBox_Key
+
+			Derive TextButton Left
+			{
+				color	'1.0 1.0 1.0'
+				//normal "Left"
+				action	Nex_MessageBox_LeftButton
+			}
+			Derive TextButton Right
+			{
+				color	'1.0 1.0 1.0'
+				//normal "Right"
+				action	Nex_MessageBox_RightButton
+			}
+		}
+	}
+}


Property changes on: trunk/basezym/menu/messagebox.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/mission.menu
===================================================================
--- trunk/basezym/menu/mission.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/mission.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,101 +1,101 @@
-// Property of Alientrap/AK
-//
-// mission.menu
-Item Layout Mission
-{
-	Derive Picture Table3
-	{
-		picture	"gfx/sub_background"
-		pos	'0 0'
-		origin	'0 0'
-		size	'1024 477'
-	}
-
-	Item Layout MissionLayout
-	{
-		direction	'10 0'
-		origin		'100 44'
-
-		Item Layout LeftPart
-		{
-			direction	'0 1'
-			size		'400 400'
-	
-			Derive Picture MapSelect
-			{
-				picture	"gfx/miss_mapselect"
-				size	'400 195'
-			}
-			Derive Picture MissDesc
-			{
-				picture	"gfx/miss_desc"
-				size	'400 195'
-			}
-		}
-		Derive Picture MissOpt
-		{
-			picture	"gfx/miss_opt"
-			size	'410 393'
-		}
-		Derive TextButton Controls
-		{
-			normal	""
-
-			init	Nex_Action_JumpToPage
-			target	"Panel::KeyControl"
-		}
-	}
-	Item Window MissionItems
-	{
-		origin		'100 44'
-		flag [FlagEmbedded]
-
-		Derive MultiLabel Description
-		{
-			pos	'20 200'
-			size	'380 175'
-			wrap	31
-			fontSize '11 11 0'
-		}
-		Derive Picture Picture
-		{
-			picture "gfx/sub_background"
-			size	'265 133'
-			pos	'67 15'
-		}
-		Derive PictureButton Prev
-		{
-			normal		"$gfx/miss_mapbl"
-			selected	"$gfx/miss_mapbld"
-			size		'45 145'
-			pos		'10 25'
-			action	Nex_Action_MapSelector_Prev
-		}
-		Derive Label Name
-		{
-			alignment	[AlignCenter]
-			size		'306 14'
-			pos		'50 166'
-		}
-		Derive PictureButton Next
-		{
-			normal		"$gfx/miss_mapbr"
-			selected	"$gfx/miss_mapbrd"
-			pos		'348 25'
-			size		'45 145'
-			action	Nex_Action_MapSelector_Next
-		}
-		Derive PictureButton Start
-		{
-			normal		"$gfx/start"
-			selected	"$gfx/startd"
-			pos		'550 330'
-			size		'145 45'
-			action	Nex_Action_Map_Start
-		}
-		Item Task_Job UpdateJob
-		{
-			update 	Nex_MapSelector_UpdateMap
-		}
-	}
-}
+// Property of Alientrap/AK
+//
+// mission.menu
+Item Layout Mission
+{
+	Derive Picture Table3
+	{
+		picture	"gfx/sub_background"
+		pos	'0 0'
+		origin	'0 0'
+		size	'1024 477'
+	}
+
+	Item Layout MissionLayout
+	{
+		direction	'10 0'
+		origin		'100 44'
+
+		Item Layout LeftPart
+		{
+			direction	'0 1'
+			size		'400 400'
+	
+			Derive Picture MapSelect
+			{
+				picture	"gfx/miss_mapselect"
+				size	'400 195'
+			}
+			Derive Picture MissDesc
+			{
+				picture	"gfx/miss_desc"
+				size	'400 195'
+			}
+		}
+		Derive Picture MissOpt
+		{
+			picture	"gfx/miss_opt"
+			size	'410 393'
+		}
+		Derive TextButton Controls
+		{
+			normal	""
+
+			init	Nex_Action_JumpToPage
+			target	"Panel::KeyControl"
+		}
+	}
+	Item Window MissionItems
+	{
+		origin		'100 44'
+		flag [FlagEmbedded]
+
+		Derive MultiLabel Description
+		{
+			pos	'20 200'
+			size	'380 175'
+			wrap	31
+			fontSize '11 11 0'
+		}
+		Derive Picture Picture
+		{
+			picture "gfx/sub_background"
+			size	'265 133'
+			pos	'67 15'
+		}
+		Derive PictureButton Prev
+		{
+			normal		"$gfx/miss_mapbl"
+			selected	"$gfx/miss_mapbld"
+			size		'45 145'
+			pos		'10 25'
+			action	Nex_Action_MapSelector_Prev
+		}
+		Derive Label Name
+		{
+			alignment	[AlignCenter]
+			size		'306 14'
+			pos		'50 166'
+		}
+		Derive PictureButton Next
+		{
+			normal		"$gfx/miss_mapbr"
+			selected	"$gfx/miss_mapbrd"
+			pos		'348 25'
+			size		'45 145'
+			action	Nex_Action_MapSelector_Next
+		}
+		Derive PictureButton Start
+		{
+			normal		"$gfx/start"
+			selected	"$gfx/startd"
+			pos		'550 330'
+			size		'145 45'
+			action	Nex_Action_Map_Start
+		}
+		Item Task_Job UpdateJob
+		{
+			update 	Nex_MapSelector_UpdateMap
+		}
+	}
+}


Property changes on: trunk/basezym/menu/mission.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/normal.menu
===================================================================
--- trunk/basezym/menu/normal.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/normal.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,81 +1,81 @@
-// Property of Alientrap
-//
-// Normal main menu
-Item Task_Job WelcomeSound
-{
-	target	"announcer/welcometonexuiz.wav"
-	reinit	Nex_Action_PlaySoundOnce
-}
-Item Window Normal
-{
-	key	Nex_Global_Key
-	size	'1024 768'
-
-	Derive Rect Modulate
-	{
-		color		'0.6 0.6 0.7'
-		drawFlag	[DrawFlagModulate]
-	}
-	Derive Rect AddLevel
-	{
-		color		'0.3 0.3 0.3'
-		drawFlag	[DrawFlagAdditive]
-	}
-	Derive Picture NexuizLogo
-	{
-		picture	 	"gfx/background"
-		pos		'0 0'
-		size		'1024 768'
-		alpha		0.8
-
-Ignore
-{
-		Item Effect_Float AlphaPulse
-		{
-			targetFloat 	 alpha
-			startFloat	 0.8
-			endFloat	 0.4
-			time		 '2 2 -1'
-			interpolForward  FX_SquareInterpolation
-			interpolBackward FX_SquareInterpolation
-		}
-		Item Effect_Vector ColorPulse
-		{
-			targetVector 	color
-			startVector	"0 0 0"
-			endVector	"0.1 0 0.05"
-			time		'2 2 -1'
-			interpolForward FX_SquareInterpolation
-			interpolBackward FX_SquareInterpolation
-		}
-}
-	}
-
-	// Include the main menu as first sub window
-	#include "menu/main.menu"
-
-	Item Task_Job PanelReinit
-	{
-		// this is a automation init function (dont change this to reinit!)
-		init 	Nex_Action_SetLinkOnReinit
-		target	"Panel::NexuizLogo"
-	}
-	Item Reference Panel
-	{
-		pos	'0 257'
-		size	'1024 477'
-
-		Derive MultiLabel NexuizLogo
-		{
-			size 	'600 100'
-			pos	'400 80'
-			text
-		"\n\n Zymotic build \n See Readme file"
-		}
-	}
-
-// global floating windows
-#include "menu/credits.menu"
-#include "menu/messagebox.menu"
-#include "menu/quit.menu"
-}
+// Property of Alientrap
+//
+// Normal main menu
+Item Task_Job WelcomeSound
+{
+	target	"announcer/welcometonexuiz.wav"
+	reinit	Nex_Action_PlaySoundOnce
+}
+Item Window Normal
+{
+	key	Nex_Global_Key
+	size	'1024 768'
+
+	Derive Rect Modulate
+	{
+		color		'0.6 0.6 0.7'
+		drawFlag	[DrawFlagModulate]
+	}
+	Derive Rect AddLevel
+	{
+		color		'0.3 0.3 0.3'
+		drawFlag	[DrawFlagAdditive]
+	}
+	Derive Picture NexuizLogo
+	{
+		picture	 	"gfx/background"
+		pos		'0 0'
+		size		'1024 768'
+		alpha		0.8
+
+Ignore
+{
+		Item Effect_Float AlphaPulse
+		{
+			targetFloat 	 alpha
+			startFloat	 0.8
+			endFloat	 0.4
+			time		 '2 2 -1'
+			interpolForward  FX_SquareInterpolation
+			interpolBackward FX_SquareInterpolation
+		}
+		Item Effect_Vector ColorPulse
+		{
+			targetVector 	color
+			startVector	"0 0 0"
+			endVector	"0.1 0 0.05"
+			time		'2 2 -1'
+			interpolForward FX_SquareInterpolation
+			interpolBackward FX_SquareInterpolation
+		}
+}
+	}
+
+	// Include the main menu as first sub window
+	#include "menu/main.menu"
+
+	Item Task_Job PanelReinit
+	{
+		// this is a automation init function (dont change this to reinit!)
+		init 	Nex_Action_SetLinkOnReinit
+		target	"Panel::NexuizLogo"
+	}
+	Item Reference Panel
+	{
+		pos	'0 257'
+		size	'1024 477'
+
+		Derive MultiLabel NexuizLogo
+		{
+			size 	'600 100'
+			pos	'400 80'
+			text
+		"\n\n Zymotic build \n See Readme file"
+		}
+	}
+
+// global floating windows
+#include "menu/credits.menu"
+#include "menu/messagebox.menu"
+#include "menu/quit.menu"
+}


Property changes on: trunk/basezym/menu/normal.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/color.menu
===================================================================
--- trunk/basezym/menu/options/color.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/color.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,100 +1,100 @@
-// Property of Alientrap/AK
-// options/color.menu
-Item Window ColorControl
-{
-//	size	  '600 600'
-	Item Layout Layout
-	{
-		direction [Nex_DefaultVertDirection]
-		origin		'600 63'
-		alignment [AlignFirst]
-
-		Derive Nex_Option_Slider Brightness
-		{
-			text	"Brightness"
-			target	"::Data::Color::Brightness::Value"
-		}
-		Derive Nex_Option_Slider Contrast
-		{
-			text	"Contrast"
-			target	"::Data::Color::Contrast::Value"
-		}
-		Derive Nex_Option_Slider HWGamma
-		{
-			text	"HW Gamma Support"
-			target	"::Data::Color::HWGamma::Switch"
-		}
-		Derive Nex_Option_Slider Gamma
-		{
-			text	"Gamma"
-			target	"::Data::Color::Gamma::Value"
-		}
-		Derive Nex_Line	Seperator1
-		{}
-		Derive Nex_Option_Slider ExtendedControl
-		{
-			text	"Color Control"
-			target	"::Data::Color::Extended::Active::Switch"
-		}
-		// Low part
-		Derive Nex_Option_Slider DarkRed
-		{
-			text	"Dark Red"
-			target	"::Data::Color::Extended::Low::Red::Value"
-		}
-		Derive Nex_Option_Slider DarkGreen
-		{
-			text	"Dark Green"
-			target	"::Data::Color::Extended::Low::Green::Value"
-		}
-		Derive Nex_Option_Slider DarkBlue
-		{
-			text	"Dark Blue"
-			target	"::Data::Color::Extended::Low::Blue::Value"
-		}
-		// Mid part
-		Derive Nex_Option_Slider MidRed
-		{
-			text	"Grey Red"
-			target	"::Data::Color::Extended::Mid::Red::Value"
-		}
-		Derive Nex_Option_Slider MidGreen
-		{
-			text	"Grey Green"
-			target	"::Data::Color::Extended::Mid::Green::Value"
-		}
-		Derive Nex_Option_Slider MidBlue
-		{
-			text	"Grey Blue"
-			target	"::Data::Color::Extended::Mid::Blue::Value"
-		}
-		// High part
-		Derive Nex_Option_Slider HighRed
-		{
-			text	"White Red"
-			target	"::Data::Color::Extended::High::Red::Value"
-		}
-		Derive Nex_Option_Slider HighGreen
-		{
-			text	"White Green"
-			target	"::Data::Color::Extended::High::Green::Value"
-		}
-		Derive Nex_Option_Slider HighBlue
-		{
-			text	"White Blue"
-			target	"::Data::Color::Extended::High::Blue::Value"
-		}
-		Derive Nex_Line	Seperator2
-		{}
-		Derive TextButton Cancel
-		{
-			normal	"Cancel changes"
-			action 	Nex_Action_Color_Cancel
-		}
-		Derive TextButton Reset
-		{
-			normal	"Reset to default"
-			action	Nex_Action_Color_Reset
-		}
-	}
-}
+// Property of Alientrap/AK
+// options/color.menu
+Item Window ColorControl
+{
+//	size	  '600 600'
+	Item Layout Layout
+	{
+		direction [Nex_DefaultVertDirection]
+		origin		'600 63'
+		alignment [AlignFirst]
+
+		Derive Nex_Option_Slider Brightness
+		{
+			text	"Brightness"
+			target	"::Data::Color::Brightness::Value"
+		}
+		Derive Nex_Option_Slider Contrast
+		{
+			text	"Contrast"
+			target	"::Data::Color::Contrast::Value"
+		}
+		Derive Nex_Option_Slider HWGamma
+		{
+			text	"HW Gamma Support"
+			target	"::Data::Color::HWGamma::Switch"
+		}
+		Derive Nex_Option_Slider Gamma
+		{
+			text	"Gamma"
+			target	"::Data::Color::Gamma::Value"
+		}
+		Derive Nex_Line	Seperator1
+		{}
+		Derive Nex_Option_Slider ExtendedControl
+		{
+			text	"Color Control"
+			target	"::Data::Color::Extended::Active::Switch"
+		}
+		// Low part
+		Derive Nex_Option_Slider DarkRed
+		{
+			text	"Dark Red"
+			target	"::Data::Color::Extended::Low::Red::Value"
+		}
+		Derive Nex_Option_Slider DarkGreen
+		{
+			text	"Dark Green"
+			target	"::Data::Color::Extended::Low::Green::Value"
+		}
+		Derive Nex_Option_Slider DarkBlue
+		{
+			text	"Dark Blue"
+			target	"::Data::Color::Extended::Low::Blue::Value"
+		}
+		// Mid part
+		Derive Nex_Option_Slider MidRed
+		{
+			text	"Grey Red"
+			target	"::Data::Color::Extended::Mid::Red::Value"
+		}
+		Derive Nex_Option_Slider MidGreen
+		{
+			text	"Grey Green"
+			target	"::Data::Color::Extended::Mid::Green::Value"
+		}
+		Derive Nex_Option_Slider MidBlue
+		{
+			text	"Grey Blue"
+			target	"::Data::Color::Extended::Mid::Blue::Value"
+		}
+		// High part
+		Derive Nex_Option_Slider HighRed
+		{
+			text	"White Red"
+			target	"::Data::Color::Extended::High::Red::Value"
+		}
+		Derive Nex_Option_Slider HighGreen
+		{
+			text	"White Green"
+			target	"::Data::Color::Extended::High::Green::Value"
+		}
+		Derive Nex_Option_Slider HighBlue
+		{
+			text	"White Blue"
+			target	"::Data::Color::Extended::High::Blue::Value"
+		}
+		Derive Nex_Line	Seperator2
+		{}
+		Derive TextButton Cancel
+		{
+			normal	"Cancel changes"
+			action 	Nex_Action_Color_Cancel
+		}
+		Derive TextButton Reset
+		{
+			normal	"Reset to default"
+			action	Nex_Action_Color_Reset
+		}
+	}
+}


Property changes on: trunk/basezym/menu/options/color.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/effects.menu
===================================================================
--- trunk/basezym/menu/options/effects.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/effects.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,89 +1,89 @@
-// Property of Alientrap/AK
-// options/key.menu
-Item Window Effects
-{
-//	size	'600 600'
-
-
-	Item Layout Layout
-	{
-		direction	[Nex_DefaultVertDirection]
-		origin		'600 63'
-		alignment	[AlignFirst]
-
-		Derive Nex_Option_Switch Particles
-		{
-			text	"Particles"
-			target	"::Data::Effects::Particles::Switch"
-		}
-		Derive Nex_Option_Slider ParticleQuality
-		{
-			text	"Particle Quality"
-			target	"::Data::Effects::ParticleQuality::Value"
-		}
-		Derive Nex_Option_Switch Decals
-		{
-			text	"Decals"
-			target	"::Data::Effects::Decals::Switch"
-		}
-		Derive Nex_Option_Switch Bloom
-		{
-			text	"Bloom"
-			target	"::Data::Effects::Bloom::Switch"
-		}
-		Derive Nex_Option_Switch Coronas
-		{
-			text	"Coronas"
-			target	"::Data::Effects::Coronas::Switch"
-		}
-
-		Derive Nex_Line	SeperatorRTLights
-		{}		
-		Derive Nex_Option_Switch RealtimeLights
-		{
-			text	"Realtime World Lights"
-			target	"::Data::Effects::RealtimeLights::Switch"
-		}
-		Derive Nex_Option_Switch RealtimeShadows
-		{
-			text	"Realtime World Shadows"
-			target	"::Data::Effects::RealtimeShadows::Switch"
-		}
-		Derive Nex_Option_Switch RealtimeDLights
-		{
-			text	"Realtime Dynamic Lights"
-			target	"::Data::Effects::RealtimeDLights::Switch"
-		}
-		Derive Nex_Option_Switch RealtimeDLightShadows
-		{
-			text	"Realt. Dyn. Lights Shad."
-			target	"::Data::Effects::RealtimeDLightShadows::Switch"
-		}
-
-		Derive Nex_Line	SeperatorGFXFeatures
-		{}		
-		Derive Nex_Option_Switch GLSL
-		{
-			text	"OpenGL 2.0 Shaders"
-			target	"::Data::Effects::GLSL::Switch"
-		}
-		Derive Nex_Option_Switch Gloss
-		{
-			text	"Gloss"
-			target	"::Data::Effects::Gloss::Switch"
-		}
-		Derive Nex_Option_Switch ShowFPS
-		{
-			text	"Show FPS"
-			target	"::Data::Effects::ShowFPS::Switch"
-		}
-		Derive Nex_Line	SeperatorReset
-		{}
-		Derive TextButton Reset
-		{
-			normal	"Reset to default"
-			init	Nex_Action_ResetData
-			target	"::Data::Effects"
-		}
-	}
-}
+// Property of Alientrap/AK
+// options/key.menu
+Item Window Effects
+{
+//	size	'600 600'
+
+
+	Item Layout Layout
+	{
+		direction	[Nex_DefaultVertDirection]
+		origin		'600 63'
+		alignment	[AlignFirst]
+
+		Derive Nex_Option_Switch Particles
+		{
+			text	"Particles"
+			target	"::Data::Effects::Particles::Switch"
+		}
+		Derive Nex_Option_Slider ParticleQuality
+		{
+			text	"Particle Quality"
+			target	"::Data::Effects::ParticleQuality::Value"
+		}
+		Derive Nex_Option_Switch Decals
+		{
+			text	"Decals"
+			target	"::Data::Effects::Decals::Switch"
+		}
+		Derive Nex_Option_Switch Bloom
+		{
+			text	"Bloom"
+			target	"::Data::Effects::Bloom::Switch"
+		}
+		Derive Nex_Option_Switch Coronas
+		{
+			text	"Coronas"
+			target	"::Data::Effects::Coronas::Switch"
+		}
+
+		Derive Nex_Line	SeperatorRTLights
+		{}		
+		Derive Nex_Option_Switch RealtimeLights
+		{
+			text	"Realtime World Lights"
+			target	"::Data::Effects::RealtimeLights::Switch"
+		}
+		Derive Nex_Option_Switch RealtimeShadows
+		{
+			text	"Realtime World Shadows"
+			target	"::Data::Effects::RealtimeShadows::Switch"
+		}
+		Derive Nex_Option_Switch RealtimeDLights
+		{
+			text	"Realtime Dynamic Lights"
+			target	"::Data::Effects::RealtimeDLights::Switch"
+		}
+		Derive Nex_Option_Switch RealtimeDLightShadows
+		{
+			text	"Realt. Dyn. Lights Shad."
+			target	"::Data::Effects::RealtimeDLightShadows::Switch"
+		}
+
+		Derive Nex_Line	SeperatorGFXFeatures
+		{}		
+		Derive Nex_Option_Switch GLSL
+		{
+			text	"OpenGL 2.0 Shaders"
+			target	"::Data::Effects::GLSL::Switch"
+		}
+		Derive Nex_Option_Switch Gloss
+		{
+			text	"Gloss"
+			target	"::Data::Effects::Gloss::Switch"
+		}
+		Derive Nex_Option_Switch ShowFPS
+		{
+			text	"Show FPS"
+			target	"::Data::Effects::ShowFPS::Switch"
+		}
+		Derive Nex_Line	SeperatorReset
+		{}
+		Derive TextButton Reset
+		{
+			normal	"Reset to default"
+			init	Nex_Action_ResetData
+			target	"::Data::Effects"
+		}
+	}
+}


Property changes on: trunk/basezym/menu/options/effects.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/game.menu
===================================================================
--- trunk/basezym/menu/options/game.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/game.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,9 +1,9 @@
-// Property of Alientrap/AK
-// options/game.menu
-Item Window Game
-{
-	direction	[Nex_DefaultVertDirection]
-	size		'600 600'
-	origin		'300 0'
-	alignment	[AlignFirst]
-}
+// Property of Alientrap/AK
+// options/game.menu
+Item Window Game
+{
+	direction	[Nex_DefaultVertDirection]
+	size		'600 600'
+	origin		'300 0'
+	alignment	[AlignFirst]
+}


Property changes on: trunk/basezym/menu/options/game.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/input.menu
===================================================================
--- trunk/basezym/menu/options/input.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/input.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,38 +1,38 @@
-// Property of Alientrap/AK
-// options/input.menu
-Item Window Input
-{
-//	size	'600 600'
-
-	Item Layout Layout
-	{
-		direction	[Nex_DefaultVertDirection]
-		origin		'600 63'
-		alignment	[AlignFirst]
-
-
-		Derive Nex_Option_Slider Sensitivity
-		{
-			text	"Sensitivity"
-			target	"::Data::Input::Sensitivity::Value"
-		}
-		Derive Nex_Option_Switch InvertMouse
-		{
-			text	"Invert Mouse"
-			target	"::Data::Input::InvertMouse::Switch"
-		}
-		Derive Nex_Option_Switch MouseFilter
-		{
-			text	"Mouse Filter"
-			target	"::Data::Input::MouseFilter::Switch"
-		}		
-		Derive Nex_Line	Seperator
-		{}
-		Derive TextButton Reset
-		{
-			normal	"Reset to default"
-			init	Nex_Action_ResetData
-			target	"::Data::Input"
-		}
-	}
-}
+// Property of Alientrap/AK
+// options/input.menu
+Item Window Input
+{
+//	size	'600 600'
+
+	Item Layout Layout
+	{
+		direction	[Nex_DefaultVertDirection]
+		origin		'600 63'
+		alignment	[AlignFirst]
+
+
+		Derive Nex_Option_Slider Sensitivity
+		{
+			text	"Sensitivity"
+			target	"::Data::Input::Sensitivity::Value"
+		}
+		Derive Nex_Option_Switch InvertMouse
+		{
+			text	"Invert Mouse"
+			target	"::Data::Input::InvertMouse::Switch"
+		}
+		Derive Nex_Option_Switch MouseFilter
+		{
+			text	"Mouse Filter"
+			target	"::Data::Input::MouseFilter::Switch"
+		}		
+		Derive Nex_Line	Seperator
+		{}
+		Derive TextButton Reset
+		{
+			normal	"Reset to default"
+			init	Nex_Action_ResetData
+			target	"::Data::Input"
+		}
+	}
+}


Property changes on: trunk/basezym/menu/options/input.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/key.menu
===================================================================
--- trunk/basezym/menu/options/key.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/key.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,362 +1,362 @@
-// Property of Alientrap/AK
-// options/key.menu
-Item Window KeyControl
-{
-	size	'700 600'
-
-	Item Layout Layout
-	{
-		pos		'30 0'
-		size	 	'700 600'
-		direction 	[Nex_DefaultVertDirection]
-		flag	  	[FlagEmbedded]
-
-		Derive MultiLabel Description
-		{
-			pos	'0 50'
-			size 	'600 24'
-			text
-	"Press [Enter] or [Mouse1] to change a key binding.\nPress [Delete] to remove the binding."
-		}
-
-		// table: name key1 key2
-		Item Layout TableDesc
-		{
-			pos	'0 0'
-			size	'600 15'
-			direction '10 0'
-
-			Derive Rect Action
-			{
-				size	'200 15'
-				color	'0.5 0.5 0.5'
-				alpha	0.5
-
-				Derive Label Label
-				{
-					text	"Action"
-				}
-			}
-			Derive Rect Key1
-			{
-				pos 	'210 0'
-				size	'190 15'
-				color	'0.5 0.5 0.5'
-				alpha	0.5
-
-				Derive Label Label
-				{
-					text	"Key/Button 1"
-				}
-			}
-			Derive Rect Key2
-			{
-				pos 	'410 0'
-				size	'190 15'
-				color	'0.5 0.5 0.5'
-				alpha	0.5
-
-				Derive Label Label
-				{
-					text	"Key/Button 2"
-				}
-			}
-		}
-		Item Window Temp
-		{
-			size 	'700 500'
-			flag	[FlagEmbedded]
-
-			Item ScrollWindow Scroll
-			{
-				size	'600 500'
-				flag	[FlagEmbedded]
-
-				Item Arrangement Keys
-				{
-					direction 	[Nex_DefaultVertDirection]
-					flag		[FlagEmbedded]
-
-					Template Layout Nex_Key_Template
-					{
-						size	'600 12'
-						flag	[FlagEmbedded]
-						direction '10 0'
-
-						Template Automation_Job Job
-						{
-							action Nex_Automation_Key
-						}
-						Derive Label Action
-						{
-							size	'200 12'
-						}
-						Template DataLink_AltString Link1
-						{
-							flag		[FlagHidden]
-							stepValue 	0
-						}
-						DeriveTemplate Nex_KeyButton Key1
-						{
-							pos	'210 0'
-							size	'190 12'
-							target	"##down"
-							action	Nex_Action_KeyButton
-
-							Item DataLink_FastResync Resync
-							{
-								link	"Link1"
-							}
-						}
-						Template DataLink_AltString Link2
-						{
-							flag		[FlagHidden]
-							stepValue 	1
-						}
-						DeriveTemplate Nex_KeyButton Key2
-						{
-							pos	'410 0'
-							size	'190 12'
-							target	"##down"
-							action	Nex_Action_KeyButton
-
-							Item DataLink_FastResync Resync
-							{
-								link	"Link2"
-							}
-						}
-					}
-					DeriveTemplate Label Title
-					{
-						fontSize '13 13'
-						color	 '0.5 0.3 0.3'
-					}
-					Derive Title GroupMovement
-					{
-						text	"[Movement]"
-					}
-					Derive Nex_Key_Template Forward
-					{
-						text	"Move Forward"
-						target	"Data::Key::Forward"
-					}
-					Derive Nex_Key_Template Backward
-					{
-						text	"Move Backward"
-						target 	"Data::Key::Backward"
-					}
-					Derive Nex_Key_Template Left
-					{
-						text	"Strafe Left"
-						target	"Data::Key::StrafeLeft"
-					}
-					Derive Nex_Key_Template Right
-					{
-						text	"Strafe Right"
-						target	"Data::Key::StrafeRight"
-					}
-					Derive Nex_Key_Template Jump
-					{
-						text	"Jump"
-						target	"Data::Key::Jump"
-					}
-					Derive Nex_Key_Template Crouch
-					{
-						text	"Crouch"
-						target	"Data::Key::Crouch"
-					}
-					Derive Nex_Void Seperator1
-					{}
-					Derive Title GroupFight
-					{
-						text	"[Fight]"
-					}
-					Derive Nex_Key_Template Primary
-					{
-						text	"Primary Attack"
-						target	"Data::Key::FirePrimary"
-					}
-					Derive Nex_Key_Template	Secondary
-					{
-						text	"Secondary Attack"
-						target 	"Data::Key::FireSecondary"
-					}
-					Derive Nex_Key_Template PrevWeapon
-					{
-						text	"Previous Weapon"
-						target	"Data::Key::PrevWeapon"
-					}
-					Derive Nex_Key_Template NextWeapon
-					{
-						text 	"Next Weapon"
-						target	"Data::Key::NextWeapon"
-					}
-					Derive Nex_Key_Template Zoom
-					{
-						text 	"Zoom"
-						target	"Data::Key::Zoom"
-					}
-					Derive Nex_Void Seperator2
-					{}
-					Derive Title Weapons
-					{
-						text 	"[Weapon]"
-					}
-					Derive Nex_Key_Template Laser
-					{
-						text	"Laser"
-						target	"Data::Key::Weapon::Laser"
-					}
-					Derive Nex_Key_Template Shotgun
-					{
-						text	"Shotgun"
-						target	"Data::Key::Weapon::Shotgun"
-					}
-					Derive Nex_Key_Template Machingun
-					{
-						text	"Machinegun"
-						target	"Data::Key::Weapon::Machinegun"
-					}
-
-					Derive Nex_Key_Template Mortar
-					{
-						text	"Mortar"
-						target	"Data::Key::Weapon::Mortar"
-					}
-					Derive Nex_Key_Template Electro
-					{
-						text	"Electro"
-						target	"Data::Key::Weapon::Electro"
-					}
-					Derive Nex_Key_Template CryLink
-					{
-						text	"CryLink"
-						target	"Data::Key::Weapon::CryLink"
-					}
-					Derive Nex_Key_Template NexGun
-					{
-						text	"NexGun"
-						target	"Data::Key::Weapon::NexGun"
-					}
-					Derive Nex_Key_Template Hagar
-					{
-						text	"Hagar"
-						target	"Data::Key::Weapon::Hagar"
-					}
-					Derive Nex_Key_Template Rocket
-					{
-						text	"Rocket"
-						target	"Data::Key::Weapon::Rocket"
-					}
-					Derive Nex_Void Seperator3
-					{}
-					Derive Title Misc
-					{
-						text 	"[Miscellaneous]"
-					}
-					Derive Nex_Key_Template ShowScores
-					{
-						text	"Show Scores"
-						target	"Data::Key::ShowScores"
-					}
-					Derive Nex_Key_Template ToggleConsole
-					{
-						text	"Toggle Console"
-						target	"Data::Key::ToggleConsole"
-					}
-					Derive Nex_Key_Template Message
-					{
-						text	"Message"
-						target	"Data::Key::Message"
-					}
-					Derive Nex_Key_Template TeamMessage
-					{
-						text	"Team Message"
-						target	"Data::Key::TeamMessage"
-					}
-					Derive Nex_Key_Template Pause
-					{
-						text	"Pause"
-						target	"Data::Key::Pause"
-					}
-					Derive Nex_Key_Template Screenshot
-					{
-						text	"Screenshot"
-						target	"Data::Key::Screenshot"
-					}
-					Derive Nex_Key_Template Quit
-					{
-						text	"Quit Nexuiz"
-						target	"Data::Key::Quit"
-					}
-					Derive Nex_Key_Template ViewSmaller
-					{
-						text	"Decrease Viewsize"
-						target	"Data::Key::ViewSmaller"
-					}
-					Derive Nex_Key_Template ViewBigger
-					{
-						text	"Increase Viewsize"
-						target	"Data::Key::ViewBigger"
-					}
-				}
-			}
-			Item VScrollBar Scroller
-			{
-				pos	'610 0'
-				size	'20 100'
-				target 	"##prev"
-			}
-		}
-
-		Item Arrangement Buttons
-		{
-			flag	[FlagEmbedded]
-			Derive TextButton Reset
-			{
-				normal	"Reset to default"
-				init	Nex_Action_ResetData
-				target	"::Data::Key"
-			}
-		}
-	}
-
-	// info window
-	Item Window InfoWindow
-	{
-		size	'300 50'
-		pos	'150 200'
-		flag	[FlagHidden]
-
-		Derive Rect Background
-		{
-			color		'0.1 0.1 0.1'
-			drawFlag 	[DrawFlagModulate]
-			flag		[FlagSealOffMouse]
-
-			Derive Rect Layer
-			{
-				color		'0.2 0.2 0.2'
-				drawFlag	[DrawFlagAdditive]
-			}
-		}
-		Item Window TextContainer
-		{
-			pos	'2 2'
-			size	'296 46'
-			Derive Rect Background
-			{
-				color		'0.1 0.1 0.1'
-				drawFlag	[DrawFlagAdditive]
-			}
-			Derive MultiLabel Info
-			{
-				pos	'3 3'
-				wrap 	24
-				text	"Now press the key you want to bind or press [Escape] to abort."
-			}
-		}
-	}
-}
-
-
+// Property of Alientrap/AK
+// options/key.menu
+Item Window KeyControl
+{
+	size	'700 600'
+
+	Item Layout Layout
+	{
+		pos		'30 0'
+		size	 	'700 600'
+		direction 	[Nex_DefaultVertDirection]
+		flag	  	[FlagEmbedded]
+
+		Derive MultiLabel Description
+		{
+			pos	'0 50'
+			size 	'600 24'
+			text
+	"Press [Enter] or [Mouse1] to change a key binding.\nPress [Delete] to remove the binding."
+		}
+
+		// table: name key1 key2
+		Item Layout TableDesc
+		{
+			pos	'0 0'
+			size	'600 15'
+			direction '10 0'
+
+			Derive Rect Action
+			{
+				size	'200 15'
+				color	'0.5 0.5 0.5'
+				alpha	0.5
+
+				Derive Label Label
+				{
+					text	"Action"
+				}
+			}
+			Derive Rect Key1
+			{
+				pos 	'210 0'
+				size	'190 15'
+				color	'0.5 0.5 0.5'
+				alpha	0.5
+
+				Derive Label Label
+				{
+					text	"Key/Button 1"
+				}
+			}
+			Derive Rect Key2
+			{
+				pos 	'410 0'
+				size	'190 15'
+				color	'0.5 0.5 0.5'
+				alpha	0.5
+
+				Derive Label Label
+				{
+					text	"Key/Button 2"
+				}
+			}
+		}
+		Item Window Temp
+		{
+			size 	'700 500'
+			flag	[FlagEmbedded]
+
+			Item ScrollWindow Scroll
+			{
+				size	'600 500'
+				flag	[FlagEmbedded]
+
+				Item Arrangement Keys
+				{
+					direction 	[Nex_DefaultVertDirection]
+					flag		[FlagEmbedded]
+
+					Template Layout Nex_Key_Template
+					{
+						size	'600 12'
+						flag	[FlagEmbedded]
+						direction '10 0'
+
+						Template Automation_Job Job
+						{
+							action Nex_Automation_Key
+						}
+						Derive Label Action
+						{
+							size	'200 12'
+						}
+						Template DataLink_AltString Link1
+						{
+							flag		[FlagHidden]
+							stepValue 	0
+						}
+						DeriveTemplate Nex_KeyButton Key1
+						{
+							pos	'210 0'
+							size	'190 12'
+							target	"##down"
+							action	Nex_Action_KeyButton
+
+							Item DataLink_FastResync Resync
+							{
+								link	"Link1"
+							}
+						}
+						Template DataLink_AltString Link2
+						{
+							flag		[FlagHidden]
+							stepValue 	1
+						}
+						DeriveTemplate Nex_KeyButton Key2
+						{
+							pos	'410 0'
+							size	'190 12'
+							target	"##down"
+							action	Nex_Action_KeyButton
+
+							Item DataLink_FastResync Resync
+							{
+								link	"Link2"
+							}
+						}
+					}
+					DeriveTemplate Label Title
+					{
+						fontSize '13 13'
+						color	 '0.5 0.3 0.3'
+					}
+					Derive Title GroupMovement
+					{
+						text	"[Movement]"
+					}
+					Derive Nex_Key_Template Forward
+					{
+						text	"Move Forward"
+						target	"Data::Key::Forward"
+					}
+					Derive Nex_Key_Template Backward
+					{
+						text	"Move Backward"
+						target 	"Data::Key::Backward"
+					}
+					Derive Nex_Key_Template Left
+					{
+						text	"Strafe Left"
+						target	"Data::Key::StrafeLeft"
+					}
+					Derive Nex_Key_Template Right
+					{
+						text	"Strafe Right"
+						target	"Data::Key::StrafeRight"
+					}
+					Derive Nex_Key_Template Jump
+					{
+						text	"Jump"
+						target	"Data::Key::Jump"
+					}
+					Derive Nex_Key_Template Crouch
+					{
+						text	"Crouch"
+						target	"Data::Key::Crouch"
+					}
+					Derive Nex_Void Seperator1
+					{}
+					Derive Title GroupFight
+					{
+						text	"[Fight]"
+					}
+					Derive Nex_Key_Template Primary
+					{
+						text	"Primary Attack"
+						target	"Data::Key::FirePrimary"
+					}
+					Derive Nex_Key_Template	Secondary
+					{
+						text	"Secondary Attack"
+						target 	"Data::Key::FireSecondary"
+					}
+					Derive Nex_Key_Template PrevWeapon
+					{
+						text	"Previous Weapon"
+						target	"Data::Key::PrevWeapon"
+					}
+					Derive Nex_Key_Template NextWeapon
+					{
+						text 	"Next Weapon"
+						target	"Data::Key::NextWeapon"
+					}
+					Derive Nex_Key_Template Zoom
+					{
+						text 	"Zoom"
+						target	"Data::Key::Zoom"
+					}
+					Derive Nex_Void Seperator2
+					{}
+					Derive Title Weapons
+					{
+						text 	"[Weapon]"
+					}
+					Derive Nex_Key_Template Laser
+					{
+						text	"Laser"
+						target	"Data::Key::Weapon::Laser"
+					}
+					Derive Nex_Key_Template Shotgun
+					{
+						text	"Shotgun"
+						target	"Data::Key::Weapon::Shotgun"
+					}
+					Derive Nex_Key_Template Machingun
+					{
+						text	"Machinegun"
+						target	"Data::Key::Weapon::Machinegun"
+					}
+
+					Derive Nex_Key_Template Mortar
+					{
+						text	"Mortar"
+						target	"Data::Key::Weapon::Mortar"
+					}
+					Derive Nex_Key_Template Electro
+					{
+						text	"Electro"
+						target	"Data::Key::Weapon::Electro"
+					}
+					Derive Nex_Key_Template CryLink
+					{
+						text	"CryLink"
+						target	"Data::Key::Weapon::CryLink"
+					}
+					Derive Nex_Key_Template NexGun
+					{
+						text	"NexGun"
+						target	"Data::Key::Weapon::NexGun"
+					}
+					Derive Nex_Key_Template Hagar
+					{
+						text	"Hagar"
+						target	"Data::Key::Weapon::Hagar"
+					}
+					Derive Nex_Key_Template Rocket
+					{
+						text	"Rocket"
+						target	"Data::Key::Weapon::Rocket"
+					}
+					Derive Nex_Void Seperator3
+					{}
+					Derive Title Misc
+					{
+						text 	"[Miscellaneous]"
+					}
+					Derive Nex_Key_Template ShowScores
+					{
+						text	"Show Scores"
+						target	"Data::Key::ShowScores"
+					}
+					Derive Nex_Key_Template ToggleConsole
+					{
+						text	"Toggle Console"
+						target	"Data::Key::ToggleConsole"
+					}
+					Derive Nex_Key_Template Message
+					{
+						text	"Message"
+						target	"Data::Key::Message"
+					}
+					Derive Nex_Key_Template TeamMessage
+					{
+						text	"Team Message"
+						target	"Data::Key::TeamMessage"
+					}
+					Derive Nex_Key_Template Pause
+					{
+						text	"Pause"
+						target	"Data::Key::Pause"
+					}
+					Derive Nex_Key_Template Screenshot
+					{
+						text	"Screenshot"
+						target	"Data::Key::Screenshot"
+					}
+					Derive Nex_Key_Template Quit
+					{
+						text	"Quit Nexuiz"
+						target	"Data::Key::Quit"
+					}
+					Derive Nex_Key_Template ViewSmaller
+					{
+						text	"Decrease Viewsize"
+						target	"Data::Key::ViewSmaller"
+					}
+					Derive Nex_Key_Template ViewBigger
+					{
+						text	"Increase Viewsize"
+						target	"Data::Key::ViewBigger"
+					}
+				}
+			}
+			Item VScrollBar Scroller
+			{
+				pos	'610 0'
+				size	'20 100'
+				target 	"##prev"
+			}
+		}
+
+		Item Arrangement Buttons
+		{
+			flag	[FlagEmbedded]
+			Derive TextButton Reset
+			{
+				normal	"Reset to default"
+				init	Nex_Action_ResetData
+				target	"::Data::Key"
+			}
+		}
+	}
+
+	// info window
+	Item Window InfoWindow
+	{
+		size	'300 50'
+		pos	'150 200'
+		flag	[FlagHidden]
+
+		Derive Rect Background
+		{
+			color		'0.1 0.1 0.1'
+			drawFlag 	[DrawFlagModulate]
+			flag		[FlagSealOffMouse]
+
+			Derive Rect Layer
+			{
+				color		'0.2 0.2 0.2'
+				drawFlag	[DrawFlagAdditive]
+			}
+		}
+		Item Window TextContainer
+		{
+			pos	'2 2'
+			size	'296 46'
+			Derive Rect Background
+			{
+				color		'0.1 0.1 0.1'
+				drawFlag	[DrawFlagAdditive]
+			}
+			Derive MultiLabel Info
+			{
+				pos	'3 3'
+				wrap 	24
+				text	"Now press the key you want to bind or press [Escape] to abort."
+			}
+		}
+	}
+}
+
+


Property changes on: trunk/basezym/menu/options/key.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/player.menu
===================================================================
--- trunk/basezym/menu/options/player.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/player.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,132 +1,132 @@
-// Property of Alientrap/AK
-// options/player.menu
-Item Window Player
-{
-	size	  '760 600'
-
-	Item Window Avatar
-	{
-		size	'300 600'
-		pos	'20 20'
-		flag	[FlagEmbedded]
-
-		Derive Picture Picture
-		{
-			size	'300 400'
-			picture "gfx/m_white"
-		}
-		Derive Rect Overlay
-		{
-			size		'300 15'
-			drawFlag 	[DrawFlagAdditive]
-			alpha		0.4
-		}
-		Derive MultiLabel Description
-		{
-			size	'300 200'
-			pos	'0 400'
-			wrap	27
-			fontSize '11 11 0'
-		}
-		Derive TextButton Prev
-		{
-			pos 	'0 0'
-			normal	"<<"
-
-			action	Nex_Action_Avatar_Prev
-		}
-		Derive Label Name
-		{
-			pos		'24 0'
-			size		'276 12'
-			alignment	[AlignCenter]
-		}
-		Derive TextButton Next
-		{
-			pos	'278 0'
-			normal	">>"
-
-			action	Nex_Action_Avatar_Next
-		}
-		Item Task_Job Job
-		{
-			init  	Nex_Automation_UpdateAvatar
-		}
-	}
-	Item Layout Settings
-	{
-		pos		'320 20'
-		size		'440 600'
-		origin		'180 0'
-		flag		[FlagEmbedded]
-		alignment	[AlignFirst]
-		direction	[Nex_DefaultVertDirection]
-
-		Derive Nex_Composition Name
-		{
-			Derive TextButton Description
-			{
-				normal	"Player name"
-				link	"EditBox"
-			}
-			Derive EditBox EditBox
-			{
-				size 	'182 20'
-				target	"Data::Player::Name::Text"
-			}
-		}
-		Derive Nex_Composition TeamColor
-		{
-			text	"Team color"
-			target	"::Data::Player::TeamColor::TextSwitch"
-
-			Derive Nex_Automation_Option_Slider Automation
-			{}
-			Derive TextButton Description
-			{}
-			Derive Slider Slider
-			{}
-			Derive PictureValueButton Value
-			{
-				color		"1.0 1.0 1.0"
-				colorPressed	"1.0 1.0 1.0"
-				colorSelected	"1.0 1.0 1.0"
-			}
-		}
-		Derive Nex_Option_Slider FOV
-		{
-			text	"Field of View"
-			target	"::Data::Player::FOV::Value"
-		}
-		Derive Nex_Option_Slider ViewSize
-		{
-			text	"View Size"
-			target	"::Data::Player::ViewSize::Value"
-		}
-		Derive Nex_Option_Slider CrosshairType
-		{
-			text	"Crosshair Type"
-			target	"::Data::Player::Crosshair::Type::Switch"
-		}
-		Derive Nex_Option_Slider CrosshairSize
-		{
-			text	"Crosshair Size"
-			target	"::Data::Player::Crosshair::Size::Value"
-		}
-		Derive Nex_Void Seperator1
-		{}
-		Derive PictureButton Apply
-		{
-			normal		"$gfx/m_apply"
-
-			action	Nex_Action_Player_Apply
-		}
-		Derive TextButton Reset
-		{
-			alignment [AlignRight]
-			normal	"Reset"
-			init	Nex_Action_ResetData
-			target	"::Data::Player"
-		}
-	}
-}
+// Property of Alientrap/AK
+// options/player.menu
+Item Window Player
+{
+	size	  '760 600'
+
+	Item Window Avatar
+	{
+		size	'300 600'
+		pos	'20 20'
+		flag	[FlagEmbedded]
+
+		Derive Picture Picture
+		{
+			size	'300 400'
+			picture "gfx/m_white"
+		}
+		Derive Rect Overlay
+		{
+			size		'300 15'
+			drawFlag 	[DrawFlagAdditive]
+			alpha		0.4
+		}
+		Derive MultiLabel Description
+		{
+			size	'300 200'
+			pos	'0 400'
+			wrap	27
+			fontSize '11 11 0'
+		}
+		Derive TextButton Prev
+		{
+			pos 	'0 0'
+			normal	"<<"
+
+			action	Nex_Action_Avatar_Prev
+		}
+		Derive Label Name
+		{
+			pos		'24 0'
+			size		'276 12'
+			alignment	[AlignCenter]
+		}
+		Derive TextButton Next
+		{
+			pos	'278 0'
+			normal	">>"
+
+			action	Nex_Action_Avatar_Next
+		}
+		Item Task_Job Job
+		{
+			init  	Nex_Automation_UpdateAvatar
+		}
+	}
+	Item Layout Settings
+	{
+		pos		'320 20'
+		size		'440 600'
+		origin		'180 0'
+		flag		[FlagEmbedded]
+		alignment	[AlignFirst]
+		direction	[Nex_DefaultVertDirection]
+
+		Derive Nex_Composition Name
+		{
+			Derive TextButton Description
+			{
+				normal	"Player name"
+				link	"EditBox"
+			}
+			Derive EditBox EditBox
+			{
+				size 	'182 20'
+				target	"Data::Player::Name::Text"
+			}
+		}
+		Derive Nex_Composition TeamColor
+		{
+			text	"Team color"
+			target	"::Data::Player::TeamColor::TextSwitch"
+
+			Derive Nex_Automation_Option_Slider Automation
+			{}
+			Derive TextButton Description
+			{}
+			Derive Slider Slider
+			{}
+			Derive PictureValueButton Value
+			{
+				color		"1.0 1.0 1.0"
+				colorPressed	"1.0 1.0 1.0"
+				colorSelected	"1.0 1.0 1.0"
+			}
+		}
+		Derive Nex_Option_Slider FOV
+		{
+			text	"Field of View"
+			target	"::Data::Player::FOV::Value"
+		}
+		Derive Nex_Option_Slider ViewSize
+		{
+			text	"View Size"
+			target	"::Data::Player::ViewSize::Value"
+		}
+		Derive Nex_Option_Slider CrosshairType
+		{
+			text	"Crosshair Type"
+			target	"::Data::Player::Crosshair::Type::Switch"
+		}
+		Derive Nex_Option_Slider CrosshairSize
+		{
+			text	"Crosshair Size"
+			target	"::Data::Player::Crosshair::Size::Value"
+		}
+		Derive Nex_Void Seperator1
+		{}
+		Derive PictureButton Apply
+		{
+			normal		"$gfx/m_apply"
+
+			action	Nex_Action_Player_Apply
+		}
+		Derive TextButton Reset
+		{
+			alignment [AlignRight]
+			normal	"Reset"
+			init	Nex_Action_ResetData
+			target	"::Data::Player"
+		}
+	}
+}


Property changes on: trunk/basezym/menu/options/player.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/sound.menu
===================================================================
--- trunk/basezym/menu/options/sound.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/sound.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,44 +1,44 @@
-// Property of Alientrap/AK
-// options/sound.menu
-Item Window Sound
-{
-//	size	'600 600'
-
-
-	Item Layout Layout
-	{
-		direction	[Nex_DefaultVertDirection]
-		origin		'600 63'
-		alignment	[AlignFirst]
-
-
-		Derive Nex_Option_Slider MusicVolume
-		{
-			text	"Music Volume"
-			target	"::Data::Sound::CDVolume::Value"
-		}
-		Derive Nex_Option_Slider GameVolume
-		{
-			text	"Game Volume"
-			target	"::Data::Sound::GameVolume::Value"
-		}
-		Derive Nex_Option_Slider AmbientVolume
-		{
-			text	"Ambient Volume"
-			target	"::Data::Sound::AmbientVolume::Value"
-		}
-		Derive Nex_Option_Switch SwapStereo
-		{
-			text	"Swap Stereo"
-			target	"::Data::Sound::SwapStereo::Switch"
-		}
-		Derive Nex_Void Seperator1
-		{}
-		Derive TextButton Reset
-		{
-			normal	"Reset to default"
-			init	Nex_Action_ResetData
-			target	"::Data::Sound"
-		}
-	}
-}
+// Property of Alientrap/AK
+// options/sound.menu
+Item Window Sound
+{
+//	size	'600 600'
+
+
+	Item Layout Layout
+	{
+		direction	[Nex_DefaultVertDirection]
+		origin		'600 63'
+		alignment	[AlignFirst]
+
+
+		Derive Nex_Option_Slider MusicVolume
+		{
+			text	"Music Volume"
+			target	"::Data::Sound::CDVolume::Value"
+		}
+		Derive Nex_Option_Slider GameVolume
+		{
+			text	"Game Volume"
+			target	"::Data::Sound::GameVolume::Value"
+		}
+		Derive Nex_Option_Slider AmbientVolume
+		{
+			text	"Ambient Volume"
+			target	"::Data::Sound::AmbientVolume::Value"
+		}
+		Derive Nex_Option_Switch SwapStereo
+		{
+			text	"Swap Stereo"
+			target	"::Data::Sound::SwapStereo::Switch"
+		}
+		Derive Nex_Void Seperator1
+		{}
+		Derive TextButton Reset
+		{
+			normal	"Reset to default"
+			init	Nex_Action_ResetData
+			target	"::Data::Sound"
+		}
+	}
+}


Property changes on: trunk/basezym/menu/options/sound.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options/video.menu
===================================================================
--- trunk/basezym/menu/options/video.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options/video.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,54 +1,54 @@
-// Property of Alientrap/AK
-// options/key.menu
-Item Window Video
-{
-//	size	'600 600'
-
-	Item Layout Layout
-	{
-		direction	[Nex_DefaultVertDirection]
-		origin		'600 63'
-		alignment	[AlignFirst]
-
-		DeriveTemplate Composition Nex_Video_Option_Switch
-		{
-			direction	[Nex_DefaultHorzDirection]
-
-			DeriveTemplate Nex_Automation_Option_Switch Automation
-			{}
-			DeriveTemplate TextButton 	Description
-			{}
-			DeriveTemplate SwitchButton	Switch
-			{}
-		}
-		Derive Nex_Video_Option_Switch Resolution
-		{
-			text	"Resolution"
-			target	"::Data::Video::Resolution::Switch"
-		}
-		Derive Nex_Video_Option_Switch Bpp
-		{
-			text	"Bits Per Pixel"
-			target	"::Data::Video::BPP::Switch"
-		}
-		Derive Nex_Video_Option_Switch Fullscreen
-		{
-			text	"Fullscreen"
-			target	"::Data::Video::Fullscreen::Switch"
-		}
-		Derive Nex_Void Seperator1
-		{}
-		Derive TextButton Apply
-		{
-			normal		"Apply"
-
-			action	Nex_Action_Video_Apply
-		}
-		Derive TextButton Reset
-		{
-			normal	"Reset to default"
-			init	Nex_Action_ResetData
-			target	"::Data::Video"
-		}
-	}
-}
+// Property of Alientrap/AK
+// options/key.menu
+Item Window Video
+{
+//	size	'600 600'
+
+	Item Layout Layout
+	{
+		direction	[Nex_DefaultVertDirection]
+		origin		'600 63'
+		alignment	[AlignFirst]
+
+		DeriveTemplate Composition Nex_Video_Option_Switch
+		{
+			direction	[Nex_DefaultHorzDirection]
+
+			DeriveTemplate Nex_Automation_Option_Switch Automation
+			{}
+			DeriveTemplate TextButton 	Description
+			{}
+			DeriveTemplate SwitchButton	Switch
+			{}
+		}
+		Derive Nex_Video_Option_Switch Resolution
+		{
+			text	"Resolution"
+			target	"::Data::Video::Resolution::Switch"
+		}
+		Derive Nex_Video_Option_Switch Bpp
+		{
+			text	"Bits Per Pixel"
+			target	"::Data::Video::BPP::Switch"
+		}
+		Derive Nex_Video_Option_Switch Fullscreen
+		{
+			text	"Fullscreen"
+			target	"::Data::Video::Fullscreen::Switch"
+		}
+		Derive Nex_Void Seperator1
+		{}
+		Derive TextButton Apply
+		{
+			normal		"Apply"
+
+			action	Nex_Action_Video_Apply
+		}
+		Derive TextButton Reset
+		{
+			normal	"Reset to default"
+			init	Nex_Action_ResetData
+			target	"::Data::Video"
+		}
+	}
+}


Property changes on: trunk/basezym/menu/options/video.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/options.menu
===================================================================
--- trunk/basezym/menu/options.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/options.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,95 +1,95 @@
-// Property of Alientrap/AK
-// Options menu
-
-Item Layout Options
-{
-	Derive Picture Table1
-	{
-		picture	"gfx/sub_background"
-		pos	'0 0'
-		origin	'0 0'
-		size	'1024 477'
-	}
-	Item Layout OptionsLayout
-	{
-		direction	'10 0'
-		origin		'100 44'
-	
-		Item Layout LeftOptions
-		{
-			size	'200 392'
-			Derive Picture Table2
-			{
-				picture	"gfx/opti_left"
-				size	'200 392'
-			}
-			Item Layout MainOptions
-			{
-				direction	'0 10'
-				origin		'20 20'
-
-				Derive TextButton Controls
-				{
-					normal	"Controls"
-		
-					init	Nex_Action_JumpToPage
-					target	"Panel::KeyControl"
-				}
-				Derive TextButton Audio
-				{
-					normal 	"Audio"
-		
-					init	Nex_Action_JumpToPage
-					target	"Panel::Sound"
-				}
-				Derive TextButton Video
-				{
-					normal	"Video"
-		
-					init	Nex_Action_JumpToPage
-					target	"Panel::Video"
-				}
-				Derive TextButton ColorControl
-				{
-					normal	"Color"
-		
-					init	Nex_Action_JumpToPage
-					target	"Panel::ColorControl"
-				}
-				Derive TextButton Effects
-				{
-					normal	"Effects"
-		
-					init	Nex_Action_JumpToPage
-					target	"Panel::Effects"
-				}
-				Derive TextButton Input
-				{
-					normal	"Input"
-		
-					init	Nex_Action_JumpToPage
-					target	"Panel::Input"
-				}
-			}
-		}
-		Derive Picture Table3
-		{
-			picture	"gfx/opti_right"
-			size	'620 392'
-		}
-	}
-	Item EventWindow Panel
-	{
-		size	'760 500'
-//		origin	'300 45'
-		reinit	Nex_Action_MakeFirstVisible
-
-		#include "menu/options/sound.menu"
-		#include "menu/options/video.menu"
-		#include "menu/options/key.menu"
-		#include "menu/options/player.menu"
-		#include "menu/options/color.menu"
-		#include "menu/options/effects.menu"
-		#include "menu/options/input.menu"
-	}
+// Property of Alientrap/AK
+// Options menu
+
+Item Layout Options
+{
+	Derive Picture Table1
+	{
+		picture	"gfx/sub_background"
+		pos	'0 0'
+		origin	'0 0'
+		size	'1024 477'
+	}
+	Item Layout OptionsLayout
+	{
+		direction	'10 0'
+		origin		'100 44'
+	
+		Item Layout LeftOptions
+		{
+			size	'200 392'
+			Derive Picture Table2
+			{
+				picture	"gfx/opti_left"
+				size	'200 392'
+			}
+			Item Layout MainOptions
+			{
+				direction	'0 10'
+				origin		'20 20'
+
+				Derive TextButton Controls
+				{
+					normal	"Controls"
+		
+					init	Nex_Action_JumpToPage
+					target	"Panel::KeyControl"
+				}
+				Derive TextButton Audio
+				{
+					normal 	"Audio"
+		
+					init	Nex_Action_JumpToPage
+					target	"Panel::Sound"
+				}
+				Derive TextButton Video
+				{
+					normal	"Video"
+		
+					init	Nex_Action_JumpToPage
+					target	"Panel::Video"
+				}
+				Derive TextButton ColorControl
+				{
+					normal	"Color"
+		
+					init	Nex_Action_JumpToPage
+					target	"Panel::ColorControl"
+				}
+				Derive TextButton Effects
+				{
+					normal	"Effects"
+		
+					init	Nex_Action_JumpToPage
+					target	"Panel::Effects"
+				}
+				Derive TextButton Input
+				{
+					normal	"Input"
+		
+					init	Nex_Action_JumpToPage
+					target	"Panel::Input"
+				}
+			}
+		}
+		Derive Picture Table3
+		{
+			picture	"gfx/opti_right"
+			size	'620 392'
+		}
+	}
+	Item EventWindow Panel
+	{
+		size	'760 500'
+//		origin	'300 45'
+		reinit	Nex_Action_MakeFirstVisible
+
+		#include "menu/options/sound.menu"
+		#include "menu/options/video.menu"
+		#include "menu/options/key.menu"
+		#include "menu/options/player.menu"
+		#include "menu/options/color.menu"
+		#include "menu/options/effects.menu"
+		#include "menu/options/input.menu"
+	}
 }
\ No newline at end of file


Property changes on: trunk/basezym/menu/options.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/quit.menu
===================================================================
--- trunk/basezym/menu/quit.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/quit.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,76 +1,76 @@
-// Property of Alientrap
-//
-// Quit window
-Item Window QuitWnd
-{
-	pos 	'300 300'
-	size	'400 80'
-	flag	[FlagHidden]
-
-	Derive Rect Background
-	{
-		flag		[FlagSealOffMouse]
-		color		'0 0 0'
-		alpha		0.8
-		Ignore {
-			color		'0.1 0.1 0.1'
-			drawFlag 	[DrawFlagModulate]
-
-
-			Derive Rect Layer
-			{
-				color		'0.3 0.3 0.3'
-				drawFlag	[DrawFlagAdditive]
-			}
-		}
-	}
-	Item Layout Layout
-	{
-		origin		'200 0'
-		direction 	'0.0 10'
-		flag		[FlagEmbedded]
-		alignment 	[AlignCenter]
-
-		Item FloatingArea Title
-		{
-			size		'400 13'
-			target		"##up up"
-			Derive Rect Background
-			{
-				//color		'0.5 0.5 0.5'
-				color		'0.05 0.05 0.05'
-			}
-			Derive TextButton Caption
-			{
-				color		'1.0 1.0 1.0'
-				size		'400 11'
-				alignment 	[AlignCenter]
-				normal		"Quit Window"
-				link		"##up"
-			}
-		}
-		Derive Label Text
-		{
-			color		'1.0 1.0 1.0'
-			text		"Do you really want to quit?"
-		}
-		Item Arrangement Buttons
-		{
-			direction	'40 0'
-			key		Nex_Quit_Key
-
-			Derive TextButton Yes
-			{
-				color	'1.0 1.0 1.0'
-				normal	"Yes"
-				action	Nex_Quit_Yes
-			}
-			Derive TextButton No
-			{
-				color	'1.0 1.0 1.0'
-				normal	"No"
-				action	Nex_Quit_No
-			}
-		}
-	}
-}
+// Property of Alientrap
+//
+// Quit window
+Item Window QuitWnd
+{
+	pos 	'300 300'
+	size	'400 80'
+	flag	[FlagHidden]
+
+	Derive Rect Background
+	{
+		flag		[FlagSealOffMouse]
+		color		'0 0 0'
+		alpha		0.8
+		Ignore {
+			color		'0.1 0.1 0.1'
+			drawFlag 	[DrawFlagModulate]
+
+
+			Derive Rect Layer
+			{
+				color		'0.3 0.3 0.3'
+				drawFlag	[DrawFlagAdditive]
+			}
+		}
+	}
+	Item Layout Layout
+	{
+		origin		'200 0'
+		direction 	'0.0 10'
+		flag		[FlagEmbedded]
+		alignment 	[AlignCenter]
+
+		Item FloatingArea Title
+		{
+			size		'400 13'
+			target		"##up up"
+			Derive Rect Background
+			{
+				//color		'0.5 0.5 0.5'
+				color		'0.05 0.05 0.05'
+			}
+			Derive TextButton Caption
+			{
+				color		'1.0 1.0 1.0'
+				size		'400 11'
+				alignment 	[AlignCenter]
+				normal		"Quit Window"
+				link		"##up"
+			}
+		}
+		Derive Label Text
+		{
+			color		'1.0 1.0 1.0'
+			text		"Do you really want to quit?"
+		}
+		Item Arrangement Buttons
+		{
+			direction	'40 0'
+			key		Nex_Quit_Key
+
+			Derive TextButton Yes
+			{
+				color	'1.0 1.0 1.0'
+				normal	"Yes"
+				action	Nex_Quit_Yes
+			}
+			Derive TextButton No
+			{
+				color	'1.0 1.0 1.0'
+				normal	"No"
+				action	Nex_Quit_No
+			}
+		}
+	}
+}


Property changes on: trunk/basezym/menu/quit.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/templates.menu
===================================================================
--- trunk/basezym/menu/templates.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/templates.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,256 +1,256 @@
-// Property of Alientrap
-//
-// Templates
-
-//////////////////////////////////////////////////////////////////////////////////
-// Basic default templates (setting default properties)
-//////////////////////////////////////////////////////////////////////////////////
-Template Rect Rect
-{
-	size		[InfiniteVector]
-	alpha		1.0
-	drawFlag	[DrawFlagNormal]
-	color		'1.0 1.0 1.0'
-}
-Template Label Label
-{
-	color		[DefaultTextColor]
-	alpha		[DefaultTextAlpha]
-	drawFlag	[DefaultTextDrawFlag]
-	fontSize	[DefaultFontSize]
-}
-Template Picture Picture
-{
-	color		[DefaultPicColor]
-	alpha		[DefaultPicAlpha]
-	drawFlag	[DefaultPicDrawFlag]
-}
-Template Button TextButton
-{
-	fontSize	[DefaultFontSize]
-	color		[DefaultTextColor]
-	colorSelected	[DefaultSelTextColor]
-	colorPressed	[DefaultPreTextColor]
-	alphas_x	[DefaultTextAlpha]
-	alphas_y 	[DefaultSelTextAlpha]
-	alphas_z	[DefaultPreTextAlpha]
-	drawFlags_x	[DefaultTextDrawFlag]
-	drawFlags_y	[DefaultSelTextDrawFlag]
-	drawFlags_z	[DefaultPreTextDrawFlag]
-	soundSelected	[DefaultSelectSound]
-	soundPressed	[DefaultPressSound]
-}
-Template Button PictureButton
-{
-	color		[DefaultPicColor]
-	colorSelected	[DefaultSelPicColor]
-	colorPressed	[DefaultPrePicColor]
-	alphas_x	[DefaultPicAlpha]
-	alphas_y 	[DefaultSelPicAlpha]
-	alphas_z	[DefaultPrePicAlpha]
-	drawFlags_x	[DefaultPicDrawFlag]
-	drawFlags_y	[DefaultSelPicDrawFlag]
-	drawFlags_z	[DefaultPrePicDrawFlag]
-	soundSelected	[DefaultSelectSound]
-	soundPressed	[DefaultPressSound]
-}
-Template Slider Slider
-{
-	color		[DefaultPicColor]
-	//colorSelected	[DefaultSelPicColor]
-	colorSelected	"0.9 0.9 1.0"
-	alphas_x	[DefaultPicAlpha]
-	alphas_y	[DefaultSelPicAlpha]
-	drawFlags_x	[DefaultPicDrawFlag]
-	drawFlags_y	[DefaultSelPicDrawFlag]
-	soundSelected	[DefaultSelectSound]
-	soundIncrease	[DefaultIncreaseSound]
-	soundDecrease	[DefaultDecreaseSound]
-	picture		[DefaultSliderBar]
-	pictureSlider	[DefaultSlider]
-	proportions	[DefaultProportions]
-	direction	[DefaultDirection]
-	size		[DefaultSliderBarSize]
-	sizeSlider	[DefaultSliderSize]
-}
-Template EditBox EditBox
-{
-	fontSize	[DefaultFontSize]
-	color		[DefaultTextColor]
-	colorSelected	[DefaultTextColor]
-	colorPressed	[DefaultPreTextColor]
-	alphas_x	[DefaultTextAlpha]
-	alphas_y 	[DefaultSelTextAlpha]
-	alphas_z	[DefaultPreTextAlpha]
-	drawFlags_x	[DefaultTextDrawFlag]
-	drawFlags_y	[DefaultSelTextDrawFlag]
-	drawFlags_z	[DefaultPreTextDrawFlag]
-	colorCursor	[DefaultCursorColor]
-	colorCursorFlash [DefaultCursorFlashColor]
-	alphasCursor_x	[DefaultTextAlpha]
-	alphasCursor_y 	[DefaultSelTextAlpha]
-	drawFlagsCursor_x [DefaultTextDrawFlag]
-	drawFlagsCursor_y [DefaultSelTextDrawFlag]
-	sizeCursor	[DefaultCursorSize]
-	sizeCursorFlash [DefaultCursorFlashSize]
-	soundSelected	[DefaultSelectSound]
-	soundMove	[DefaultIncreaseSound]
-	soundKey	[DefaultDecreaseSound]
-}
-Template List List
-{
-	fontSize	[DefaultFontSize]
-	color		[DefaultTextColor]
-	colorSelected	[DefaultSelTextColor]
-	colorPressed	[DefaultPreTextColor]
-	colorInactive	[DefaultInaTextColor]
-	alphas_x	[DefaultTextAlpha]
-	alphas_y 	[DefaultSelTextAlpha]
-	alphas_z	[DefaultPreTextAlpha]
-	alphaInactive	[DefaultInaTextAlpha]
-	drawFlags_x	[DefaultTextDrawFlag]
-	drawFlags_y	[DefaultSelTextDrawFlag]
-	drawFlags_z	[DefaultPreTextDrawFlag]
-	drawFlagInactive [DefaultInaTextDrawFlag]
-	soundSelected	[DefaultSelectSound]
-	soundPressed	[DefaultPressSound]
-}
-DeriveTemplate TextButton ValueButton
-{
-	type 	"Item_ValueButton"
-}
-DeriveTemplate PictureButton PictureValueButton
-{
-	type	"Item_ValueButton"
-}
-DeriveTemplate Label MultiLabel
-{
-	type 	"Item_MultiLabel"
-}
-DeriveTemplate TextButton SwitchButton
-{
-	type	"Item_SwitchButton"
-}
-//////////////////////////////////////////////////////////////////////////////////
-// Derived items
-//////////////////////////////////////////////////////////////////////////////////
-Template Arrangement Composition
-{
-	flag		[FlagEmbedded]
-}
-//////////////////////////////////////////////////////////////////////////////////
-// Specialized items
-//////////////////////////////////////////////////////////////////////////////////
-Template DataLink_ValueSwitch DataLink_OnOffSwitch
-{
-	minValue	0.0
-	maxValue	1.0
-	descList	"'Off' 'On'"
-	link		"##up"
-}
-Template DataLink_Value DataLink_ZeroOneValue
-{
-	minValue 	0.0
-	maxValue	1.0
-	stepValue	0.05
-	link		"##up"
-}
-Template DataLink_Value DataLink_SettingValue
-{
-	minValue	0.0
-	maxValue	9999.0
-	stepValue	0.01
-	link		"##up"
-}
-Template DataLink_Text DataLink_SettingText
-{
-	maxValue	9
-	link		"##down"
-
-	Template DataLink_TextValue DataLink_TextValue
-	{
-		link	"##up prev"
-	}
-}
-//////////////////////////////////////////////////////////////////////////////////
-// Nexuiz specialized items
-//////////////////////////////////////////////////////////////////////////////////
-#define Nex_DefaultHorzDirection	'20 0 0'
-#define Nex_DefaultVertDirection	'0 10 0'
-Template Automation_Job Nex_Automation_Option_Slider
-{
-	action Nex_Automation_Option_Slider
-}
-Template Automation_Job Nex_Automation_Option_EditBox
-{
-	action Nex_Automation_Option_EditBox
-}
-Template Automation_Job Nex_Automation_Option_Switch
-{
-	action Nex_Automation_Option_Switch
-}
-DeriveTemplate Composition Nex_Composition
-{
-	direction	[Nex_DefaultHorzDirection]
-}
-DeriveTemplate Picture Nex_Line
-{
-	picture	"gfx/m_dot"
-	size	"200 10"
-}
-Item Custom Nex_Void
-{
-	size	"200 12"
-	flag	[FlagNoSelect]
-}
-
-DeriveTemplate TextButton Nex_KeyButton
-{
-	type	"Item_Nex_KeyButton"
-}
-DeriveTemplate MultiLabel Nex_Credits
-{
-	type	"Item_Nex_Credits"
-}
-DeriveTemplate Label Nex_HostCache_StringField
-{
-	type	"Item_Nex_HostCache_StringField"
-}
-DeriveTemplate Label Nex_HostCache_ValueField
-{
-	type	"Item_Nex_HostCache_ValueField"
-}
-DeriveTemplate Label Nex_HostCache_Players
-{
-	type	"Item_Nex_HostCache_Players"
-}
-DeriveTemplate PictureButton Nex_HostCache_Entry
-{
-	normal		"$gfx/white"
-	drawFlags	[DrawFlagModulate]
-	type		"Item_Nex_HostCache_Entry"
-}
-DeriveTemplate Nex_Composition Nex_Option_Slider
-{
-	DeriveTemplate Nex_Automation_Option_Slider Automation
-	{}
-	DeriveTemplate TextButton 	Description
-	{}
-	DeriveTemplate Slider 		Slider
-	{
-		action	Nex_Action_TestOnChange
-	}
-	DeriveTemplate ValueButton 	Value
-	{}
-}
-DeriveTemplate Nex_Composition Nex_Option_Switch
-{
-	DeriveTemplate Nex_Automation_Option_Switch Automation
-	{}
-	DeriveTemplate TextButton 	Description
-	{}
-	DeriveTemplate SwitchButton	Switch
-	{
-		action	Nex_Action_TestOnChange
-	}
-}
+// Property of Alientrap
+//
+// Templates
+
+//////////////////////////////////////////////////////////////////////////////////
+// Basic default templates (setting default properties)
+//////////////////////////////////////////////////////////////////////////////////
+Template Rect Rect
+{
+	size		[InfiniteVector]
+	alpha		1.0
+	drawFlag	[DrawFlagNormal]
+	color		'1.0 1.0 1.0'
+}
+Template Label Label
+{
+	color		[DefaultTextColor]
+	alpha		[DefaultTextAlpha]
+	drawFlag	[DefaultTextDrawFlag]
+	fontSize	[DefaultFontSize]
+}
+Template Picture Picture
+{
+	color		[DefaultPicColor]
+	alpha		[DefaultPicAlpha]
+	drawFlag	[DefaultPicDrawFlag]
+}
+Template Button TextButton
+{
+	fontSize	[DefaultFontSize]
+	color		[DefaultTextColor]
+	colorSelected	[DefaultSelTextColor]
+	colorPressed	[DefaultPreTextColor]
+	alphas_x	[DefaultTextAlpha]
+	alphas_y 	[DefaultSelTextAlpha]
+	alphas_z	[DefaultPreTextAlpha]
+	drawFlags_x	[DefaultTextDrawFlag]
+	drawFlags_y	[DefaultSelTextDrawFlag]
+	drawFlags_z	[DefaultPreTextDrawFlag]
+	soundSelected	[DefaultSelectSound]
+	soundPressed	[DefaultPressSound]
+}
+Template Button PictureButton
+{
+	color		[DefaultPicColor]
+	colorSelected	[DefaultSelPicColor]
+	colorPressed	[DefaultPrePicColor]
+	alphas_x	[DefaultPicAlpha]
+	alphas_y 	[DefaultSelPicAlpha]
+	alphas_z	[DefaultPrePicAlpha]
+	drawFlags_x	[DefaultPicDrawFlag]
+	drawFlags_y	[DefaultSelPicDrawFlag]
+	drawFlags_z	[DefaultPrePicDrawFlag]
+	soundSelected	[DefaultSelectSound]
+	soundPressed	[DefaultPressSound]
+}
+Template Slider Slider
+{
+	color		[DefaultPicColor]
+	//colorSelected	[DefaultSelPicColor]
+	colorSelected	"0.9 0.9 1.0"
+	alphas_x	[DefaultPicAlpha]
+	alphas_y	[DefaultSelPicAlpha]
+	drawFlags_x	[DefaultPicDrawFlag]
+	drawFlags_y	[DefaultSelPicDrawFlag]
+	soundSelected	[DefaultSelectSound]
+	soundIncrease	[DefaultIncreaseSound]
+	soundDecrease	[DefaultDecreaseSound]
+	picture		[DefaultSliderBar]
+	pictureSlider	[DefaultSlider]
+	proportions	[DefaultProportions]
+	direction	[DefaultDirection]
+	size		[DefaultSliderBarSize]
+	sizeSlider	[DefaultSliderSize]
+}
+Template EditBox EditBox
+{
+	fontSize	[DefaultFontSize]
+	color		[DefaultTextColor]
+	colorSelected	[DefaultTextColor]
+	colorPressed	[DefaultPreTextColor]
+	alphas_x	[DefaultTextAlpha]
+	alphas_y 	[DefaultSelTextAlpha]
+	alphas_z	[DefaultPreTextAlpha]
+	drawFlags_x	[DefaultTextDrawFlag]
+	drawFlags_y	[DefaultSelTextDrawFlag]
+	drawFlags_z	[DefaultPreTextDrawFlag]
+	colorCursor	[DefaultCursorColor]
+	colorCursorFlash [DefaultCursorFlashColor]
+	alphasCursor_x	[DefaultTextAlpha]
+	alphasCursor_y 	[DefaultSelTextAlpha]
+	drawFlagsCursor_x [DefaultTextDrawFlag]
+	drawFlagsCursor_y [DefaultSelTextDrawFlag]
+	sizeCursor	[DefaultCursorSize]
+	sizeCursorFlash [DefaultCursorFlashSize]
+	soundSelected	[DefaultSelectSound]
+	soundMove	[DefaultIncreaseSound]
+	soundKey	[DefaultDecreaseSound]
+}
+Template List List
+{
+	fontSize	[DefaultFontSize]
+	color		[DefaultTextColor]
+	colorSelected	[DefaultSelTextColor]
+	colorPressed	[DefaultPreTextColor]
+	colorInactive	[DefaultInaTextColor]
+	alphas_x	[DefaultTextAlpha]
+	alphas_y 	[DefaultSelTextAlpha]
+	alphas_z	[DefaultPreTextAlpha]
+	alphaInactive	[DefaultInaTextAlpha]
+	drawFlags_x	[DefaultTextDrawFlag]
+	drawFlags_y	[DefaultSelTextDrawFlag]
+	drawFlags_z	[DefaultPreTextDrawFlag]
+	drawFlagInactive [DefaultInaTextDrawFlag]
+	soundSelected	[DefaultSelectSound]
+	soundPressed	[DefaultPressSound]
+}
+DeriveTemplate TextButton ValueButton
+{
+	type 	"Item_ValueButton"
+}
+DeriveTemplate PictureButton PictureValueButton
+{
+	type	"Item_ValueButton"
+}
+DeriveTemplate Label MultiLabel
+{
+	type 	"Item_MultiLabel"
+}
+DeriveTemplate TextButton SwitchButton
+{
+	type	"Item_SwitchButton"
+}
+//////////////////////////////////////////////////////////////////////////////////
+// Derived items
+//////////////////////////////////////////////////////////////////////////////////
+Template Arrangement Composition
+{
+	flag		[FlagEmbedded]
+}
+//////////////////////////////////////////////////////////////////////////////////
+// Specialized items
+//////////////////////////////////////////////////////////////////////////////////
+Template DataLink_ValueSwitch DataLink_OnOffSwitch
+{
+	minValue	0.0
+	maxValue	1.0
+	descList	"'Off' 'On'"
+	link		"##up"
+}
+Template DataLink_Value DataLink_ZeroOneValue
+{
+	minValue 	0.0
+	maxValue	1.0
+	stepValue	0.05
+	link		"##up"
+}
+Template DataLink_Value DataLink_SettingValue
+{
+	minValue	0.0
+	maxValue	9999.0
+	stepValue	0.01
+	link		"##up"
+}
+Template DataLink_Text DataLink_SettingText
+{
+	maxValue	9
+	link		"##down"
+
+	Template DataLink_TextValue DataLink_TextValue
+	{
+		link	"##up prev"
+	}
+}
+//////////////////////////////////////////////////////////////////////////////////
+// Nexuiz specialized items
+//////////////////////////////////////////////////////////////////////////////////
+#define Nex_DefaultHorzDirection	'20 0 0'
+#define Nex_DefaultVertDirection	'0 10 0'
+Template Automation_Job Nex_Automation_Option_Slider
+{
+	action Nex_Automation_Option_Slider
+}
+Template Automation_Job Nex_Automation_Option_EditBox
+{
+	action Nex_Automation_Option_EditBox
+}
+Template Automation_Job Nex_Automation_Option_Switch
+{
+	action Nex_Automation_Option_Switch
+}
+DeriveTemplate Composition Nex_Composition
+{
+	direction	[Nex_DefaultHorzDirection]
+}
+DeriveTemplate Picture Nex_Line
+{
+	picture	"gfx/m_dot"
+	size	"200 10"
+}
+Item Custom Nex_Void
+{
+	size	"200 12"
+	flag	[FlagNoSelect]
+}
+
+DeriveTemplate TextButton Nex_KeyButton
+{
+	type	"Item_Nex_KeyButton"
+}
+DeriveTemplate MultiLabel Nex_Credits
+{
+	type	"Item_Nex_Credits"
+}
+DeriveTemplate Label Nex_HostCache_StringField
+{
+	type	"Item_Nex_HostCache_StringField"
+}
+DeriveTemplate Label Nex_HostCache_ValueField
+{
+	type	"Item_Nex_HostCache_ValueField"
+}
+DeriveTemplate Label Nex_HostCache_Players
+{
+	type	"Item_Nex_HostCache_Players"
+}
+DeriveTemplate PictureButton Nex_HostCache_Entry
+{
+	normal		"$gfx/white"
+	drawFlags	[DrawFlagModulate]
+	type		"Item_Nex_HostCache_Entry"
+}
+DeriveTemplate Nex_Composition Nex_Option_Slider
+{
+	DeriveTemplate Nex_Automation_Option_Slider Automation
+	{}
+	DeriveTemplate TextButton 	Description
+	{}
+	DeriveTemplate Slider 		Slider
+	{
+		action	Nex_Action_TestOnChange
+	}
+	DeriveTemplate ValueButton 	Value
+	{}
+}
+DeriveTemplate Nex_Composition Nex_Option_Switch
+{
+	DeriveTemplate Nex_Automation_Option_Switch Automation
+	{}
+	DeriveTemplate TextButton 	Description
+	{}
+	DeriveTemplate SwitchButton	Switch
+	{
+		action	Nex_Action_TestOnChange
+	}
+}


Property changes on: trunk/basezym/menu/templates.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menu/test.menu
===================================================================
--- trunk/basezym/menu/test.menu	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menu/test.menu	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,21 +1,21 @@
-// DP/Nex Menu
-// Test Menu
-Item Window Normal
-{
-	pos	'100 100'
-	size	'800 500'
-
-	Item Window Test1
-	{
-		pos 	'10 10'
-		origin	'20 20'
-		size	'100 100'
-	}
-	Item Window Test2
-	{
-		pos	'200 200'
-		origin	'100 100'
-		size	'300 300'
-	}
-}
-
+// DP/Nex Menu
+// Test Menu
+Item Window Normal
+{
+	pos	'100 100'
+	size	'800 500'
+
+	Item Window Test1
+	{
+		pos 	'10 10'
+		origin	'20 20'
+		size	'100 100'
+	}
+	Item Window Test2
+	{
+		pos	'200 200'
+		origin	'100 100'
+		size	'300 300'
+	}
+}
+


Property changes on: trunk/basezym/menu/test.menu
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/cursor.qc
===================================================================
--- trunk/basezym/menuqc/base/cursor.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/cursor.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,96 +1,96 @@
-// NG-Menu
-// base/cursor.qc
-
-void() Cursor_Init =
-{
-	// default cursor (embedded into DP): ui/mousepointer.tga
-	if( Gfx_Precache( CURSOR_PATH ) )
-		Cursor_Current = CURSOR_PATH;
-	else {
-		Cursor_Current = "ui/mousepointer.tga";
-		Gfx_Precache( Cursor_Current );
-	}
-
-	Cursor_Position = Cursor_Relative = '0 0 0';
-
-	Cursor_Animation = Cursor_DefaultAnimation;
-};
-
-void() Cursor_Quit =
-{
-};
-
-void() Cursor_Display =
-{
-	setmousetarget( MT_MENU );
-};
-
-void() Cursor_Hide =
-{
-	setmousetarget( MT_CLIENT );
-};
-
-void() Cursor_Draw =
-{
-	local vector lPos;
-	local vector lSize;
-
-	lSize = Gfx_GetImageSize( Cursor_Current ) * Cursor_Scale;
-	lPos_x = Cursor_Position_x + lSize_x * Cursor_Offset_x;
-	lPos_y = Cursor_Position_y + lSize_y * Cursor_Offset_y;
-	lPos_z = 0.0;
-
-	Gfx_DrawPic( lPos, Cursor_Current, lSize, Cursor_Color, Cursor_Transparency, Cursor_Flag );
-};
-
-void() Cursor_Update =
-{
-	local vector lRelPos;
-
-	lRelPos = getmousepos();
-	lRelPos = Gfx_ConToMen( lRelPos );
-
-	Cursor_Relative_x = lRelPos_x * Cursor_Speed_x;
-	Cursor_Relative_y = lRelPos_y * Cursor_Speed_y;
-
-	Cursor_Relative_x = bound( 0.0, Cursor_Position_x + Cursor_Relative_x, Gfx_Menu_Width ) - Cursor_Position_x;
-	Cursor_Relative_y = bound( 0.0, Cursor_Position_y + Cursor_Relative_y, Gfx_Menu_Height ) - Cursor_Position_y;
-
-	Cursor_Position_x = Cursor_Position_x + Cursor_Relative_x;
-	Cursor_Position_y = Cursor_Position_y + Cursor_Relative_y;
-	Cursor_Position_z = 0.0;
-
-	Cursor_Animation();
-};
-
-void() Cursor_DefaultAnimation =
-{
-};
-
-void( vector pRelPos, string pText, vector pScale, vector pColor, float pAlpha, float pDrawFlag ) Cursor_PrintInfo =
-{
-	local vector lPosition;
-	local vector lSize;
-
-	lSize = Gfx_GetImageSize( Cursor_Current ) * Cursor_Scale;
-
-	if( pRelPos_x != 0 ) {
-		if( pRelPos_x > 0 ) // align it on the left
-			lPosition_x = Cursor_Position_x + lSize_x * (Cursor_Offset_x + 0.5 + pRelPos_x / 2) ;
-		else if( pRelPos_x < 0 ) // align it on the right
-			lPosition_x = Cursor_Position_x + lSize_x * (Cursor_Offset_x + 0.5 + pRelPos_x / 2) -
-					pScale_x * strlen( pText );
-		lPosition_y = Cursor_Position_y + lSize_y * (Cursor_Offset_y + 0.5 + pRelPos_y / 2 ) - pScale_y / 2;
-	} else
-		lPosition_x = Cursor_Position_x + lSize_x * (Cursor_Offset_x + 0.5) -
-				pScale_x * strlen( pText ) / 2;
-
-	if( pRelPos_y != 0 ) {
-		if( pRelPos_y > 0 )
-			lPosition_y = Cursor_Position_y + lSize_y * (Cursor_Offset_y + 0.5 - pRelPos_y / 2) - pScale_y;
-		else if( pRelPos_y < 0 )
-			lPosition_y = Cursor_Position_y + lSize_y * (Cursor_Offset_y + 0.5 - pRelPos_y / 2);
-	}
-
-	Gfx_DrawString( lPosition, pText, pScale, pColor, pAlpha, pDrawFlag );
-};
+// NG-Menu
+// base/cursor.qc
+
+void() Cursor_Init =
+{
+	// default cursor (embedded into DP): ui/mousepointer.tga
+	if( Gfx_Precache( CURSOR_PATH ) )
+		Cursor_Current = CURSOR_PATH;
+	else {
+		Cursor_Current = "ui/mousepointer.tga";
+		Gfx_Precache( Cursor_Current );
+	}
+
+	Cursor_Position = Cursor_Relative = '0 0 0';
+
+	Cursor_Animation = Cursor_DefaultAnimation;
+};
+
+void() Cursor_Quit =
+{
+};
+
+void() Cursor_Display =
+{
+	setmousetarget( MT_MENU );
+};
+
+void() Cursor_Hide =
+{
+	setmousetarget( MT_CLIENT );
+};
+
+void() Cursor_Draw =
+{
+	local vector lPos;
+	local vector lSize;
+
+	lSize = Gfx_GetImageSize( Cursor_Current ) * Cursor_Scale;
+	lPos_x = Cursor_Position_x + lSize_x * Cursor_Offset_x;
+	lPos_y = Cursor_Position_y + lSize_y * Cursor_Offset_y;
+	lPos_z = 0.0;
+
+	Gfx_DrawPic( lPos, Cursor_Current, lSize, Cursor_Color, Cursor_Transparency, Cursor_Flag );
+};
+
+void() Cursor_Update =
+{
+	local vector lRelPos;
+
+	lRelPos = getmousepos();
+	lRelPos = Gfx_ConToMen( lRelPos );
+
+	Cursor_Relative_x = lRelPos_x * Cursor_Speed_x;
+	Cursor_Relative_y = lRelPos_y * Cursor_Speed_y;
+
+	Cursor_Relative_x = bound( 0.0, Cursor_Position_x + Cursor_Relative_x, Gfx_Menu_Width ) - Cursor_Position_x;
+	Cursor_Relative_y = bound( 0.0, Cursor_Position_y + Cursor_Relative_y, Gfx_Menu_Height ) - Cursor_Position_y;
+
+	Cursor_Position_x = Cursor_Position_x + Cursor_Relative_x;
+	Cursor_Position_y = Cursor_Position_y + Cursor_Relative_y;
+	Cursor_Position_z = 0.0;
+
+	Cursor_Animation();
+};
+
+void() Cursor_DefaultAnimation =
+{
+};
+
+void( vector pRelPos, string pText, vector pScale, vector pColor, float pAlpha, float pDrawFlag ) Cursor_PrintInfo =
+{
+	local vector lPosition;
+	local vector lSize;
+
+	lSize = Gfx_GetImageSize( Cursor_Current ) * Cursor_Scale;
+
+	if( pRelPos_x != 0 ) {
+		if( pRelPos_x > 0 ) // align it on the left
+			lPosition_x = Cursor_Position_x + lSize_x * (Cursor_Offset_x + 0.5 + pRelPos_x / 2) ;
+		else if( pRelPos_x < 0 ) // align it on the right
+			lPosition_x = Cursor_Position_x + lSize_x * (Cursor_Offset_x + 0.5 + pRelPos_x / 2) -
+					pScale_x * strlen( pText );
+		lPosition_y = Cursor_Position_y + lSize_y * (Cursor_Offset_y + 0.5 + pRelPos_y / 2 ) - pScale_y / 2;
+	} else
+		lPosition_x = Cursor_Position_x + lSize_x * (Cursor_Offset_x + 0.5) -
+				pScale_x * strlen( pText ) / 2;
+
+	if( pRelPos_y != 0 ) {
+		if( pRelPos_y > 0 )
+			lPosition_y = Cursor_Position_y + lSize_y * (Cursor_Offset_y + 0.5 - pRelPos_y / 2) - pScale_y;
+		else if( pRelPos_y < 0 )
+			lPosition_y = Cursor_Position_y + lSize_y * (Cursor_Offset_y + 0.5 - pRelPos_y / 2);
+	}
+
+	Gfx_DrawString( lPosition, pText, pScale, pColor, pAlpha, pDrawFlag );
+};


Property changes on: trunk/basezym/menuqc/base/cursor.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/cursor.qh
===================================================================
--- trunk/basezym/menuqc/base/cursor.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/cursor.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,32 +1,32 @@
-// NG Menu
-// cursor qh
-
-const string	CURSOR_PATH		= "gfx/m_cursor"; //"ui/mousepointer.tga";
-
-string Cursor_Current;
-var void() Cursor_Animation = __NULL__;
-
-vector Cursor_Relative;
-vector Cursor_Position;
-vector Cursor_Speed	= '1 1 0';
-
-vector Cursor_Position; // will be adjusted to be in the current origin
-
-float 	Cursor_Transparency 	= 1.0;
-vector  Cursor_Color		= '1.0 1.0 1.0';
-float	Cursor_Scale		= 1.0;
-float 	Cursor_Flag		= 0;
-vector 	Cursor_Offset		= '-0.5 -0.5 0';
-
-void() Cursor_Init;
-void() Cursor_Quit;
-
-void() Cursor_Display;
-void() Cursor_Hide;
-
-void() Cursor_Draw;
-void() Cursor_Update;
-
-void() Cursor_DefaultAnimation;
-
-void( vector pRelPos, string pText, vector pScale, vector pColor, float pAlpha, float pDrawFlag ) Cursor_PrintInfo;
+// NG Menu
+// cursor qh
+
+const string	CURSOR_PATH		= "gfx/m_cursor"; //"ui/mousepointer.tga";
+
+string Cursor_Current;
+var void() Cursor_Animation = __NULL__;
+
+vector Cursor_Relative;
+vector Cursor_Position;
+vector Cursor_Speed	= '1 1 0';
+
+vector Cursor_Position; // will be adjusted to be in the current origin
+
+float 	Cursor_Transparency 	= 1.0;
+vector  Cursor_Color		= '1.0 1.0 1.0';
+float	Cursor_Scale		= 1.0;
+float 	Cursor_Flag		= 0;
+vector 	Cursor_Offset		= '-0.5 -0.5 0';
+
+void() Cursor_Init;
+void() Cursor_Quit;
+
+void() Cursor_Display;
+void() Cursor_Hide;
+
+void() Cursor_Draw;
+void() Cursor_Update;
+
+void() Cursor_DefaultAnimation;
+
+void( vector pRelPos, string pText, vector pScale, vector pColor, float pAlpha, float pDrawFlag ) Cursor_PrintInfo;


Property changes on: trunk/basezym/menuqc/base/cursor.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/gfx.qc
===================================================================
--- trunk/basezym/menuqc/base/gfx.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/gfx.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,194 +1,194 @@
-// NG-Menu
-// base/gfx.qc
-
-float _Gfx_FPS;
-float _Gfx_LastTime;
-float _Gfx_FrameCount;
-
-void() _Gfx_UpdateFPS =
-{
-	local float lDeltaTime;
-
-	_Gfx_FrameCount = _Gfx_FrameCount + 1;
-
-	lDeltaTime = Timer_Time - _Gfx_LastTime;
-	if( GFX_SHOWFPS_DURATION < lDeltaTime ) {
-		_Gfx_FPS = _Gfx_FrameCount / lDeltaTime;
-		_Gfx_LastTime = Timer_Time;
-		_Gfx_FrameCount = 0;
-	}
-};
-
-// cvar ngmenu_menu_height
-void() _Gfx_UpdateRes =
-{
-	Gfx_Real_Width = cvar( "vid_conwidth" );
-	Gfx_Real_Height = cvar( "vid_conheight" );
-	Gfx_Menu_Width = cvar( CVAR_SCMENU_MENU_WIDTH );
-	Gfx_Menu_Height = cvar( CVAR_SCMENU_MENU_HEIGHT );
-
-	if( Gfx_Menu_Width == 0.0 )
-		Gfx_Menu_Width = GFX_MENU_DEFAULT_WIDTH;
-	if( Gfx_Menu_Height == 0.0 )
-		Gfx_Menu_Height = GFX_MENU_DEFAULT_HEIGHT;
-};
-
-void() Gfx_Init =
-{
-	local string lWidth, lHeight;
-
-	lWidth = ftos( GFX_MENU_DEFAULT_WIDTH );
-	lHeight = ftos( GFX_MENU_DEFAULT_HEIGHT );
-
-	registercvar( CVAR_SCMENU_MENU_WIDTH, lWidth, CVAR_SAVE );
-	registercvar( CVAR_SCMENU_MENU_HEIGHT, lHeight, CVAR_SAVE );
-
-	registercvar( CVAR_SCMENU_SHOWFPS, ftos( GFX_SHOWFPS_DEFAULT ), 0 );
-
-	_Gfx_UpdateRes();
-};
-
-void() Gfx_Quit =
-{
-};
-
-void() Gfx_Display =
-{
-	Gfx_ResetClipArea();
-};
-
-void() Gfx_Hide =
-{
-};
-
-void() Gfx_Update =
-{
-	_Gfx_UpdateRes();
-	_Gfx_UpdateFPS();
-};
-
-void() Gfx_Draw =
-{
-	if( cvar( CVAR_SCMENU_SHOWFPS ) ) {
-		local string lText;
-		local vector lScale;
-		local vector lPosition;
-
-		lText = strcat( "FPS: ", ftos( floor( _Gfx_FPS ) ) );
-		lScale = '15 15 0';
-
-		lPosition_x = 0;
-		lPosition_y = Gfx_Menu_Height - lScale_y - 5;
-		lPosition_z = 0;
-
-		Gfx_DrawString( lPosition, lText, lScale, '1.0 1.0 1.0', 1.0, 0 );
-	}
-};
-
-bool( string pPic )	Gfx_IsCached =
-{
-	return iscachedpic( pPic );
-};
-
-bool( string pPic )	Gfx_Precache =
-{
-	if( pPic == "" )
-		return false;
-
-	if( iscachedpic( pPic ) )
-		return true;
-	if( precache_pic( pPic ) == pPic )
-		return true;
-	return false;
-};
-
-void( string pPic )	Gfx_Free
-{
-	// DO NOTHING UNTIL A REF COUNTER IS IMPLEMENTED
-};
-
-vector( string pPic ) 	Gfx_GetImageSize
-{
-	return drawgetimagesize( pPic );
-};
-
-vector( vector pPos )  Gfx_ConToMen =
-{
-	pPos_x = pPos_x * Gfx_Menu_Width / Gfx_Real_Width;
-	pPos_y = pPos_y * Gfx_Menu_Height / Gfx_Real_Height;
-	pPos_z = 0.0;
-
-	return pPos;
-};
-
-vector( vector pPos )  Gfx_MenToCon =
-{
-	pPos_x = pPos_x * Gfx_Real_Width / Gfx_Menu_Width;
-	pPos_y = pPos_y * Gfx_Real_Height / Gfx_Menu_Height;
-	pPos_z = 0.0;
-
-	return pPos;
-};
-
-void() Gfx_ResetClipArea =
-{
-	drawresetcliparea();
-};
-
-vector( vector pPosition ) _Gfx_FitCenter =
-{
-	return (pPosition + '0.375 0.375 0');
-};
-
-float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Gfx_DrawCharacter =
-{
-	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
-	pScale = Gfx_MenToCon( pScale );
-
-	return drawcharacter( pPosition, pCharacter, pScale, pRGB, pAlpha, pFlag );
-};
-
-float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Gfx_DrawString =
-{
-	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
-	pScale = Gfx_MenToCon( pScale );
-
-	return drawstring( pPosition, pText, pScale, pRGB, pAlpha, pFlag );
-};
-
-float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Gfx_DrawPic =
-{
-	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
-	pSize = Gfx_MenToCon( pSize );
-
-	return drawpic( pPosition, pPicture, pSize, pRGB, pAlpha, pFlag );
-};
-
-float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Gfx_Fill =
-{
-	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
-	pSize = Gfx_MenToCon( pSize );
-
-	return drawfill( pPosition, pSize, pRGB, pAlpha, pFlag );
-};
-
-void( float pX, float pY, float pWidth, float pHeight )
-Gfx_SetClipArea =
-{
-	local vector lPosition, lSize;
-
-	lPosition_x = pX;
-	lPosition_y = pY;
-
-	lSize_x = pWidth;
-	lSize_y = pHeight;
-
-	lPosition = _Gfx_FitCenter( Gfx_MenToCon( lPosition ) );
-	lSize = Gfx_MenToCon( lSize ) + '1 1 0';
-
-	drawsetcliparea( lPosition_x, lPosition_y, lSize_x, lSize_y );
-};
+// NG-Menu
+// base/gfx.qc
+
+float _Gfx_FPS;
+float _Gfx_LastTime;
+float _Gfx_FrameCount;
+
+void() _Gfx_UpdateFPS =
+{
+	local float lDeltaTime;
+
+	_Gfx_FrameCount = _Gfx_FrameCount + 1;
+
+	lDeltaTime = Timer_Time - _Gfx_LastTime;
+	if( GFX_SHOWFPS_DURATION < lDeltaTime ) {
+		_Gfx_FPS = _Gfx_FrameCount / lDeltaTime;
+		_Gfx_LastTime = Timer_Time;
+		_Gfx_FrameCount = 0;
+	}
+};
+
+// cvar ngmenu_menu_height
+void() _Gfx_UpdateRes =
+{
+	Gfx_Real_Width = cvar( "vid_conwidth" );
+	Gfx_Real_Height = cvar( "vid_conheight" );
+	Gfx_Menu_Width = cvar( CVAR_SCMENU_MENU_WIDTH );
+	Gfx_Menu_Height = cvar( CVAR_SCMENU_MENU_HEIGHT );
+
+	if( Gfx_Menu_Width == 0.0 )
+		Gfx_Menu_Width = GFX_MENU_DEFAULT_WIDTH;
+	if( Gfx_Menu_Height == 0.0 )
+		Gfx_Menu_Height = GFX_MENU_DEFAULT_HEIGHT;
+};
+
+void() Gfx_Init =
+{
+	local string lWidth, lHeight;
+
+	lWidth = ftos( GFX_MENU_DEFAULT_WIDTH );
+	lHeight = ftos( GFX_MENU_DEFAULT_HEIGHT );
+
+	registercvar( CVAR_SCMENU_MENU_WIDTH, lWidth, CVAR_SAVE );
+	registercvar( CVAR_SCMENU_MENU_HEIGHT, lHeight, CVAR_SAVE );
+
+	registercvar( CVAR_SCMENU_SHOWFPS, ftos( GFX_SHOWFPS_DEFAULT ), 0 );
+
+	_Gfx_UpdateRes();
+};
+
+void() Gfx_Quit =
+{
+};
+
+void() Gfx_Display =
+{
+	Gfx_ResetClipArea();
+};
+
+void() Gfx_Hide =
+{
+};
+
+void() Gfx_Update =
+{
+	_Gfx_UpdateRes();
+	_Gfx_UpdateFPS();
+};
+
+void() Gfx_Draw =
+{
+	if( cvar( CVAR_SCMENU_SHOWFPS ) ) {
+		local string lText;
+		local vector lScale;
+		local vector lPosition;
+
+		lText = strcat( "FPS: ", ftos( floor( _Gfx_FPS ) ) );
+		lScale = '15 15 0';
+
+		lPosition_x = 0;
+		lPosition_y = Gfx_Menu_Height - lScale_y - 5;
+		lPosition_z = 0;
+
+		Gfx_DrawString( lPosition, lText, lScale, '1.0 1.0 1.0', 1.0, 0 );
+	}
+};
+
+bool( string pPic )	Gfx_IsCached =
+{
+	return iscachedpic( pPic );
+};
+
+bool( string pPic )	Gfx_Precache =
+{
+	if( pPic == "" )
+		return false;
+
+	if( iscachedpic( pPic ) )
+		return true;
+	if( precache_pic( pPic ) == pPic )
+		return true;
+	return false;
+};
+
+void( string pPic )	Gfx_Free
+{
+	// DO NOTHING UNTIL A REF COUNTER IS IMPLEMENTED
+};
+
+vector( string pPic ) 	Gfx_GetImageSize
+{
+	return drawgetimagesize( pPic );
+};
+
+vector( vector pPos )  Gfx_ConToMen =
+{
+	pPos_x = pPos_x * Gfx_Menu_Width / Gfx_Real_Width;
+	pPos_y = pPos_y * Gfx_Menu_Height / Gfx_Real_Height;
+	pPos_z = 0.0;
+
+	return pPos;
+};
+
+vector( vector pPos )  Gfx_MenToCon =
+{
+	pPos_x = pPos_x * Gfx_Real_Width / Gfx_Menu_Width;
+	pPos_y = pPos_y * Gfx_Real_Height / Gfx_Menu_Height;
+	pPos_z = 0.0;
+
+	return pPos;
+};
+
+void() Gfx_ResetClipArea =
+{
+	drawresetcliparea();
+};
+
+vector( vector pPosition ) _Gfx_FitCenter =
+{
+	return (pPosition + '0.375 0.375 0');
+};
+
+float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Gfx_DrawCharacter =
+{
+	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
+	pScale = Gfx_MenToCon( pScale );
+
+	return drawcharacter( pPosition, pCharacter, pScale, pRGB, pAlpha, pFlag );
+};
+
+float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Gfx_DrawString =
+{
+	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
+	pScale = Gfx_MenToCon( pScale );
+
+	return drawstring( pPosition, pText, pScale, pRGB, pAlpha, pFlag );
+};
+
+float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Gfx_DrawPic =
+{
+	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
+	pSize = Gfx_MenToCon( pSize );
+
+	return drawpic( pPosition, pPicture, pSize, pRGB, pAlpha, pFlag );
+};
+
+float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Gfx_Fill =
+{
+	pPosition = _Gfx_FitCenter( Gfx_MenToCon( pPosition ) );
+	pSize = Gfx_MenToCon( pSize );
+
+	return drawfill( pPosition, pSize, pRGB, pAlpha, pFlag );
+};
+
+void( float pX, float pY, float pWidth, float pHeight )
+Gfx_SetClipArea =
+{
+	local vector lPosition, lSize;
+
+	lPosition_x = pX;
+	lPosition_y = pY;
+
+	lSize_x = pWidth;
+	lSize_y = pHeight;
+
+	lPosition = _Gfx_FitCenter( Gfx_MenToCon( lPosition ) );
+	lSize = Gfx_MenToCon( lSize ) + '1 1 0';
+
+	drawsetcliparea( lPosition_x, lPosition_y, lSize_x, lSize_y );
+};


Property changes on: trunk/basezym/menuqc/base/gfx.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/gfx.qh
===================================================================
--- trunk/basezym/menuqc/base/gfx.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/gfx.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,51 +1,51 @@
-// NG-Menu
-// base/gfx.h
-
-const float GFX_MENU_DEFAULT_WIDTH = 1024;
-const float GFX_MENU_DEFAULT_HEIGHT = 768;
-
-const string CVAR_SCMENU_MENU_WIDTH = "scmenu_menu_width";
-const string CVAR_SCMENU_MENU_HEIGHT = "scmenu_menu_height";
-
-// measurement block duration in seconds
-const float GFX_SHOWFPS_DURATION = 1.000;
-
-const float GFX_SHOWFPS_DEFAULT = 0;
-const string CVAR_SCMENU_SHOWFPS = "scmenu_showfps";
-
-float Gfx_Menu_Width;
-float Gfx_Menu_Height;
-float Gfx_Real_Width;
-float Gfx_Real_Height;
-
-void() Gfx_Init;
-void() Gfx_Quit;
-void() Gfx_Display;
-void() Gfx_Hide;
-void() Gfx_Update;
-void() Gfx_Draw;
-
-bool( string pPic )	Gfx_IsCached;
-bool( string pPic )	Gfx_Precache;
-void( string pPic )	Gfx_Free;
-vector( string pPic ) 	Gfx_GetImageSize;
-
-vector( vector pPos )  Gfx_ConToMen;
-vector( vector pPos )  Gfx_MenToCon;
-
-void() Gfx_ResetClipArea;
-
-float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Gfx_DrawCharacter;
-
-float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Gfx_DrawString;
-
-float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Gfx_DrawPic;
-
-float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Gfx_Fill;
-
-void( float pX, float pY, float pWidth, float pHeight )
-Gfx_SetClipArea;
+// NG-Menu
+// base/gfx.h
+
+const float GFX_MENU_DEFAULT_WIDTH = 1024;
+const float GFX_MENU_DEFAULT_HEIGHT = 768;
+
+const string CVAR_SCMENU_MENU_WIDTH = "scmenu_menu_width";
+const string CVAR_SCMENU_MENU_HEIGHT = "scmenu_menu_height";
+
+// measurement block duration in seconds
+const float GFX_SHOWFPS_DURATION = 1.000;
+
+const float GFX_SHOWFPS_DEFAULT = 0;
+const string CVAR_SCMENU_SHOWFPS = "scmenu_showfps";
+
+float Gfx_Menu_Width;
+float Gfx_Menu_Height;
+float Gfx_Real_Width;
+float Gfx_Real_Height;
+
+void() Gfx_Init;
+void() Gfx_Quit;
+void() Gfx_Display;
+void() Gfx_Hide;
+void() Gfx_Update;
+void() Gfx_Draw;
+
+bool( string pPic )	Gfx_IsCached;
+bool( string pPic )	Gfx_Precache;
+void( string pPic )	Gfx_Free;
+vector( string pPic ) 	Gfx_GetImageSize;
+
+vector( vector pPos )  Gfx_ConToMen;
+vector( vector pPos )  Gfx_MenToCon;
+
+void() Gfx_ResetClipArea;
+
+float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Gfx_DrawCharacter;
+
+float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Gfx_DrawString;
+
+float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Gfx_DrawPic;
+
+float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Gfx_Fill;
+
+void( float pX, float pY, float pWidth, float pHeight )
+Gfx_SetClipArea;


Property changes on: trunk/basezym/menuqc/base/gfx.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/hostcache.qc
===================================================================
--- trunk/basezym/menuqc/base/hostcache.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/hostcache.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,39 +1,39 @@
-// DP/Nex Menu
-// base/hostcache.qc
-
-void() HostCache_Init =
-{
-	SLIST_FIELD_CNAME = gethostcacheindexforkey( "cname" );
-	SLIST_FIELD_PING = gethostcacheindexforkey( "ping" );
-	SLIST_FIELD_GAME = gethostcacheindexforkey( "game" );
-	SLIST_FIELD_MOD = gethostcacheindexforkey( "mod" );
-	SLIST_FIELD_MAP = gethostcacheindexforkey( "map" );
-	SLIST_FIELD_NAME = gethostcacheindexforkey( "name" );
-	SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey( "maxplayers" );
-	SLIST_FIELD_NUMPLAYERS = gethostcacheindexforkey( "numplayers" );
-	SLIST_FIELD_PROTOCOL = gethostcacheindexforkey( "protocol" );
-};
-
-void() HostCache_Update =
-{
-	HostCache_ViewCount = gethostcachevalue( SLIST_HOSTCACHEVIEWCOUNT );
-	HostCache_TotalCount = gethostcachevalue( SLIST_HOSTCACHETOTALCOUNT );
-	HostCache_MasterQueryCount = gethostcachevalue( SLIST_MASTERQUERYCOUNT );
-	HostCache_MasterReplyCount = gethostcachevalue( SLIST_MASTERREPLYCOUNT );
-	HostCache_ServerQueryCount = gethostcachevalue( SLIST_SERVERQUERYCOUNT );
-	HostCache_ServerReplyCount = gethostcachevalue( SLIST_SERVERREPLYCOUNT );
-	HostCache_SortField = gethostcachevalue( SLIST_SORTFIELD );
-	HostCache_SortDescending = gethostcachevalue( SLIST_SORTDESCENDING );
-};
-
-void() HostCache_ResortViewSet =
-{
-	resorthostcache();
-	HostCache_Update();
-};
-
-void() HostCache_RefreshHostCache =
-{
-	refreshhostcache();
-	HostCache_Update();
-};
+// DP/Nex Menu
+// base/hostcache.qc
+
+void() HostCache_Init =
+{
+	SLIST_FIELD_CNAME = gethostcacheindexforkey( "cname" );
+	SLIST_FIELD_PING = gethostcacheindexforkey( "ping" );
+	SLIST_FIELD_GAME = gethostcacheindexforkey( "game" );
+	SLIST_FIELD_MOD = gethostcacheindexforkey( "mod" );
+	SLIST_FIELD_MAP = gethostcacheindexforkey( "map" );
+	SLIST_FIELD_NAME = gethostcacheindexforkey( "name" );
+	SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey( "maxplayers" );
+	SLIST_FIELD_NUMPLAYERS = gethostcacheindexforkey( "numplayers" );
+	SLIST_FIELD_PROTOCOL = gethostcacheindexforkey( "protocol" );
+};
+
+void() HostCache_Update =
+{
+	HostCache_ViewCount = gethostcachevalue( SLIST_HOSTCACHEVIEWCOUNT );
+	HostCache_TotalCount = gethostcachevalue( SLIST_HOSTCACHETOTALCOUNT );
+	HostCache_MasterQueryCount = gethostcachevalue( SLIST_MASTERQUERYCOUNT );
+	HostCache_MasterReplyCount = gethostcachevalue( SLIST_MASTERREPLYCOUNT );
+	HostCache_ServerQueryCount = gethostcachevalue( SLIST_SERVERQUERYCOUNT );
+	HostCache_ServerReplyCount = gethostcachevalue( SLIST_SERVERREPLYCOUNT );
+	HostCache_SortField = gethostcachevalue( SLIST_SORTFIELD );
+	HostCache_SortDescending = gethostcachevalue( SLIST_SORTDESCENDING );
+};
+
+void() HostCache_ResortViewSet =
+{
+	resorthostcache();
+	HostCache_Update();
+};
+
+void() HostCache_RefreshHostCache =
+{
+	refreshhostcache();
+	HostCache_Update();
+};


Property changes on: trunk/basezym/menuqc/base/hostcache.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/hostcache.qh
===================================================================
--- trunk/basezym/menuqc/base/hostcache.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/hostcache.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,26 +1,26 @@
-// DP/Nex Menu
-// base/hostcache.qh
-
-float SLIST_FIELD_CNAME;
-float SLIST_FIELD_PING;
-float SLIST_FIELD_GAME;
-float SLIST_FIELD_MOD;
-float SLIST_FIELD_MAP;
-float SLIST_FIELD_NAME;
-float SLIST_FIELD_MAXPLAYERS;
-float SLIST_FIELD_NUMPLAYERS;
-float SLIST_FIELD_PROTOCOL;
-
-float HostCache_ViewCount;
-float HostCache_TotalCount;
-float HostCache_MasterQueryCount;
-float HostCache_MasterReplyCount;
-float HostCache_ServerQueryCount;
-float HostCache_ServerReplyCount;
-float HostCache_SortField;
-float HostCache_SortDescending;
-
-void() HostCache_Init;
-void() HostCache_Update;
-void() HostCache_ResortViewSet;
-void() HostCache_RefreshHostCache;
+// DP/Nex Menu
+// base/hostcache.qh
+
+float SLIST_FIELD_CNAME;
+float SLIST_FIELD_PING;
+float SLIST_FIELD_GAME;
+float SLIST_FIELD_MOD;
+float SLIST_FIELD_MAP;
+float SLIST_FIELD_NAME;
+float SLIST_FIELD_MAXPLAYERS;
+float SLIST_FIELD_NUMPLAYERS;
+float SLIST_FIELD_PROTOCOL;
+
+float HostCache_ViewCount;
+float HostCache_TotalCount;
+float HostCache_MasterQueryCount;
+float HostCache_MasterReplyCount;
+float HostCache_ServerQueryCount;
+float HostCache_ServerReplyCount;
+float HostCache_SortField;
+float HostCache_SortDescending;
+
+void() HostCache_Init;
+void() HostCache_Update;
+void() HostCache_ResortViewSet;
+void() HostCache_RefreshHostCache;


Property changes on: trunk/basezym/menuqc/base/hostcache.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/key.qc
===================================================================
--- trunk/basezym/menuqc/base/key.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/key.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,80 +1,80 @@
-// NG-Menu
-// base/key.qc
-
-void() Key_Init =
-{
-};
-
-void() Key_Quit =
-{
-};
-
-void() Key_Display =
-{
-	setkeydest( KEY_MENU );
-};
-
-void() Key_Update =
-{
-#ifdef BRAVEMENU
-	// make sure that we have the input focus
-	setkeydest( KEY_MENU );
-#else
-	if( getkeydest() != KEY_MENU ) {
-		m_hide();
-	}
-#endif
-};
-
-void() Key_Hide =
-{
-	setkeydest( KEY_GAME );
-};
-
-void( string pKey ) Key_Unbind =
-{
-	cmd( strcat( "unbind ", pKey, "\n" ) );
-};
-
-string( float pKey ) Key_GetName =
-{
-	return keynumtostring( pKey );
-};
-
-float( string pKey ) Key_GetNum =
-{
-	return stringtokeynum( pKey );
-};
-
-string( string pCommand ) Key_GetBindList =
-{
-	return String_Zone( findkeysforcommand( pCommand ) );
-};
-
-void(string pKey, string pCommand) Key_Bind =
-{
-	cmd( strcat( "bind \"", pKey, "\" \"", pCommand, "\"\n" ) );
-};
-
-void(float pNum, string pCommand)  Key_LimitBinds =
-{
-	local string lAltlist;
-	local float  lCounter;
-	local float  lMaxnum;
-	local float  lValue;
-
-	lAltlist = Key_GetBindList( pCommand );
-	lMaxnum = Util_GetAltStringCount( lAltlist );
-
-	for( lCounter = 0 ; lCounter < lMaxnum ; lCounter = lCounter + 1 ) {
-		lValue = stof( String_Normal( Util_GetAltStringItem( lAltlist, lCounter ) ) );
-
-		if( lValue == -1 )
-			break;
-		if( lCounter >= pNum )
-			Key_Unbind( Key_GetName( lValue ) );
-	}
-
-	String_Free( lAltlist );
-};
-
+// NG-Menu
+// base/key.qc
+
+void() Key_Init =
+{
+};
+
+void() Key_Quit =
+{
+};
+
+void() Key_Display =
+{
+	setkeydest( KEY_MENU );
+};
+
+void() Key_Update =
+{
+#ifdef BRAVEMENU
+	// make sure that we have the input focus
+	setkeydest( KEY_MENU );
+#else
+	if( getkeydest() != KEY_MENU ) {
+		m_hide();
+	}
+#endif
+};
+
+void() Key_Hide =
+{
+	setkeydest( KEY_GAME );
+};
+
+void( string pKey ) Key_Unbind =
+{
+	cmd( strcat( "unbind ", pKey, "\n" ) );
+};
+
+string( float pKey ) Key_GetName =
+{
+	return keynumtostring( pKey );
+};
+
+float( string pKey ) Key_GetNum =
+{
+	return stringtokeynum( pKey );
+};
+
+string( string pCommand ) Key_GetBindList =
+{
+	return String_Zone( findkeysforcommand( pCommand ) );
+};
+
+void(string pKey, string pCommand) Key_Bind =
+{
+	cmd( strcat( "bind \"", pKey, "\" \"", pCommand, "\"\n" ) );
+};
+
+void(float pNum, string pCommand)  Key_LimitBinds =
+{
+	local string lAltlist;
+	local float  lCounter;
+	local float  lMaxnum;
+	local float  lValue;
+
+	lAltlist = Key_GetBindList( pCommand );
+	lMaxnum = Util_GetAltStringCount( lAltlist );
+
+	for( lCounter = 0 ; lCounter < lMaxnum ; lCounter = lCounter + 1 ) {
+		lValue = stof( String_Normal( Util_GetAltStringItem( lAltlist, lCounter ) ) );
+
+		if( lValue == -1 )
+			break;
+		if( lCounter >= pNum )
+			Key_Unbind( Key_GetName( lValue ) );
+	}
+
+	String_Free( lAltlist );
+};
+


Property changes on: trunk/basezym/menuqc/base/key.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/key.qh
===================================================================
--- trunk/basezym/menuqc/base/key.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/key.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,16 +1,16 @@
-// NG-Menu
-// base/key.qh
-
-void() Key_Init;
-void() Key_Quit;
-void() Key_Update;
-void() Key_Display;
-void() Key_Hide;
-
-void( string pKey ) 		 Key_Unbind;
-string( float pKey ) 		 Key_GetName;
-float( string pKey )		 Key_GetNum;
-string( string pCommand )	 Key_GetBindList; // returns altstring containing keynrs
-void( float pNum, string pCommand)  Key_LimitBinds;
-void( string pKey, string pCommand) Key_Bind;
-
+// NG-Menu
+// base/key.qh
+
+void() Key_Init;
+void() Key_Quit;
+void() Key_Update;
+void() Key_Display;
+void() Key_Hide;
+
+void( string pKey ) 		 Key_Unbind;
+string( float pKey ) 		 Key_GetName;
+float( string pKey )		 Key_GetNum;
+string( string pCommand )	 Key_GetBindList; // returns altstring containing keynrs
+void( float pNum, string pCommand)  Key_LimitBinds;
+void( string pKey, string pCommand) Key_Bind;
+


Property changes on: trunk/basezym/menuqc/base/key.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/snd.qc
===================================================================
--- trunk/basezym/menuqc/base/snd.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/snd.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,30 +1,30 @@
-// NG-Menu
-// base/snd.qc
-
-void( string pText ) _Sound_DPrint =
-{
-	if( sys_debug_sound )
-		print( pText );
-};
-
-bool( string pSnd )  Sound_Precache =
-{
-	_Sound_DPrint( strcat( "Precaching sound '", pSnd, "'\n" ) );
-	if( pSnd == "" )
-		return false;
-	if( pSnd != precache_sound( pSnd ) )
-		return false;
-	else
-		return true;
-};
-
-void( string pSnd ) Sound_Free =
-{
-};
-
-void( string pSnd) Sound_Play =
-{
-	_Sound_DPrint( strcat( "Playing sound '", pSnd, "'\n" ) );
-	localsound( pSnd );
-};
-
+// NG-Menu
+// base/snd.qc
+
+void( string pText ) _Sound_DPrint =
+{
+	if( sys_debug_sound )
+		print( pText );
+};
+
+bool( string pSnd )  Sound_Precache =
+{
+	_Sound_DPrint( strcat( "Precaching sound '", pSnd, "'\n" ) );
+	if( pSnd == "" )
+		return false;
+	if( pSnd != precache_sound( pSnd ) )
+		return false;
+	else
+		return true;
+};
+
+void( string pSnd ) Sound_Free =
+{
+};
+
+void( string pSnd) Sound_Play =
+{
+	_Sound_DPrint( strcat( "Playing sound '", pSnd, "'\n" ) );
+	localsound( pSnd );
+};
+


Property changes on: trunk/basezym/menuqc/base/snd.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/snd.qh
===================================================================
--- trunk/basezym/menuqc/base/snd.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/snd.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,8 +1,8 @@
-// NG-Menu
-// base/snd.qh
-
-bool( string pSnd )  Sound_Precache;
-
-void( string pSnd ) Sound_Free;
-
-void( string pSnd ) Sound_Play;
+// NG-Menu
+// base/snd.qh
+
+bool( string pSnd )  Sound_Precache;
+
+void( string pSnd ) Sound_Free;
+
+void( string pSnd ) Sound_Play;


Property changes on: trunk/basezym/menuqc/base/snd.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/timer.qc
===================================================================
--- trunk/basezym/menuqc/base/timer.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/timer.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,22 +1,22 @@
-// NG-Menu
-// base/timer.qc
-
-float _Timer_LastTime;
-
-void() Timer_Init =
-{
-	Timer_Time = gettime();
-	Timer_Delta = 0.0;
-};
-
-void() Timer_Update =
-{
-	_Timer_LastTime = Timer_Time;
-	Timer_Time = gettime();
-	Timer_Delta = Timer_Time - _Timer_LastTime;
-};
-
-void() Timer_Quit =
-{
-};
-
+// NG-Menu
+// base/timer.qc
+
+float _Timer_LastTime;
+
+void() Timer_Init =
+{
+	Timer_Time = gettime();
+	Timer_Delta = 0.0;
+};
+
+void() Timer_Update =
+{
+	_Timer_LastTime = Timer_Time;
+	Timer_Time = gettime();
+	Timer_Delta = Timer_Time - _Timer_LastTime;
+};
+
+void() Timer_Quit =
+{
+};
+


Property changes on: trunk/basezym/menuqc/base/timer.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/base/timer.qh
===================================================================
--- trunk/basezym/menuqc/base/timer.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/base/timer.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,11 +1,11 @@
-// NG-Menu
-// base/timer.qh
-
-// timer
-float Timer_Time; 	// current time
-float Timer_Delta;	// time difference to the last cycle
-
-void() Timer_Init;
-void() Timer_Update;
-void() Timer_Quit;
-
+// NG-Menu
+// base/timer.qh
+
+// timer
+float Timer_Time; 	// current time
+float Timer_Delta;	// time difference to the last cycle
+
+void() Timer_Init;
+void() Timer_Update;
+void() Timer_Quit;
+


Property changes on: trunk/basezym/menuqc/base/timer.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/control/cinematic.qc
===================================================================
--- trunk/basezym/menuqc/control/cinematic.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/control/cinematic.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,49 +1,49 @@
-// DP/Nex Menu
-// control/cinematic.qc
-
-/////////////////////
-// [Item_Cinematic]
-///
-
-/*
-===================
-Item_Cinematic_Destroy
-===================
-*/
-void() Item_Cinematic_Destroy =
-{
-	// close the video stream
-	cin_close( self.normal );
-
-	String_EntityFree( self, link );
-	String_EntityFree( self, normal );
-}
-
-/*
-===================
-Item_Cinematic_Init
-===================
-*/
-void() Item_Cinematic_Init =
-{
-	self.flag = self.flag | FLAG_HIDDEN;
-
-	String_EntityZone( self, link );
-	String_EntityZone( self, normal );
-
-	cin_open( self.link, self.normal );
-
-	self._destroy = Item_Cinematic_Destroy;
-};
-
-/////////////////////////
-// Item_Cinematic_Loop
-///
-
-void() Item_Cinematic_Loop_Spawn =
-{
-	Item_Cinematic_Init();
-
-	cin_setstate( self.normal, CINE_LOOP );
-};
-
+// DP/Nex Menu
+// control/cinematic.qc
+
+/////////////////////
+// [Item_Cinematic]
+///
+
+/*
+===================
+Item_Cinematic_Destroy
+===================
+*/
+void() Item_Cinematic_Destroy =
+{
+	// close the video stream
+	cin_close( self.normal );
+
+	String_EntityFree( self, link );
+	String_EntityFree( self, normal );
+}
+
+/*
+===================
+Item_Cinematic_Init
+===================
+*/
+void() Item_Cinematic_Init =
+{
+	self.flag = self.flag | FLAG_HIDDEN;
+
+	String_EntityZone( self, link );
+	String_EntityZone( self, normal );
+
+	cin_open( self.link, self.normal );
+
+	self._destroy = Item_Cinematic_Destroy;
+};
+
+/////////////////////////
+// Item_Cinematic_Loop
+///
+
+void() Item_Cinematic_Loop_Spawn =
+{
+	Item_Cinematic_Init();
+
+	cin_setstate( self.normal, CINE_LOOP );
+};
+


Property changes on: trunk/basezym/menuqc/control/cinematic.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/control/constants.qh
===================================================================
--- trunk/basezym/menuqc/control/constants.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/control/constants.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,13 +1,13 @@
-// DP/Nex Menu
-// control/constants.qh
-
-const string ITEM_SOUND_NOSELECT		= "misc/temp.wav";
-
-// Item_Button
-
-const float ITEM_BUTTON_ACTIONTIME		= 0.2;
-
-// ITEM_EDITBOX constantes
-const float	ITEM_EDITBOX_CURSOR_FREQ = 2;
-const float	ITEM_EDITBOX_FLASHTIME = 0.1;
-const float 	ITEM_EDITBOX_SCROLLDISTANCE = 1.5;
+// DP/Nex Menu
+// control/constants.qh
+
+const string ITEM_SOUND_NOSELECT		= "misc/temp.wav";
+
+// Item_Button
+
+const float ITEM_BUTTON_ACTIONTIME		= 0.2;
+
+// ITEM_EDITBOX constantes
+const float	ITEM_EDITBOX_CURSOR_FREQ = 2;
+const float	ITEM_EDITBOX_FLASHTIME = 0.1;
+const float 	ITEM_EDITBOX_SCROLLDISTANCE = 1.5;


Property changes on: trunk/basezym/menuqc/control/constants.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/control/container.qc
===================================================================
--- trunk/basezym/menuqc/control/container.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/control/container.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,7 +1,7 @@
-// DP/Nex Menu
-// control/container.qc
-
-void() Item_Container_Spawn =
-{
-	self.flag = self.flag | FLAG_HIDDEN;
-};
+// DP/Nex Menu
+// control/container.qc
+
+void() Item_Container_Spawn =
+{
+	self.flag = self.flag | FLAG_HIDDEN;
+};


Property changes on: trunk/basezym/menuqc/control/container.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/control/custom.qc
===================================================================
--- trunk/basezym/menuqc/control/custom.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/control/custom.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,22 +1,22 @@
-// DP/Nex Menu
-// control/custom.qc
-
-////////////////
-// Item_Custom
-///
-// TODO: Remove Item_Custom - No, it should be the only customizable item
-
-void() Item_Custom_Spawn =
-{
-	self._reinit = CtCall_Reinit;
-	self._destroy = CtCall_Destroy;
-	self._key = CtCall_Key;
-	self._draw = CtCall_Draw;
-	self._mouseEnter = CtCall_MouseEnter;
-	self._mouseLeave = CtCall_MouseLeave;
-	self._select = CtCall_Select;
-	self._update = CtCall_Update;
-
-	CtCall_Init();
-};
-
+// DP/Nex Menu
+// control/custom.qc
+
+////////////////
+// Item_Custom
+///
+// TODO: Remove Item_Custom - No, it should be the only customizable item
+
+void() Item_Custom_Spawn =
+{
+	self._reinit = CtCall_Reinit;
+	self._destroy = CtCall_Destroy;
+	self._key = CtCall_Key;
+	self._draw = CtCall_Draw;
+	self._mouseEnter = CtCall_MouseEnter;
+	self._mouseLeave = CtCall_MouseLeave;
+	self._select = CtCall_Select;
+	self._update = CtCall_Update;
+
+	CtCall_Init();
+};
+


Property changes on: trunk/basezym/menuqc/control/custom.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/control/items.qh
===================================================================
--- trunk/basezym/menuqc/control/items.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/control/items.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,99 +1,99 @@
-// DP/Nex Menu
-// control/items.qh
-
-/*
-Items/Controls:
-
-This control is supported/required by the menu manager :
-Item_Window
-Item_Reference
-
-Item_Layout
-
-The rest is not required:
-Item_Custom
-
-Item_Picture
-
-Item_Text
-
-Item_Rect
-
-ITEM_BUTTON
-ITEM_TEXTBUTTON
-
-
-
-ITEM_SLIDER
-
-ITEM_TEXTSWITCH
-*/
-
-// INFO: some information about the spawn functions
-// INFO: Since I dont want another namespace clutching all spawn functions will have a nice and neat
-// INFO: "_Spawn" suffix.
-
-// item constants
-
-const float ITEM_ALIGN_LEFT = 0;
-enumflags {
-	ITEM_ALIGN_CENTER,
-	ITEM_ALIGN_RIGHT,
-	ITEM_ALIGN_FIX_RIGHT,	// |text - actually this isnt necessary
-	ITEM_ALIGN_FIX_CENTER,	// te|xt
-	ITEM_ALIGN_FIX_LEFT,	// text|
-	ITEM_ALIGN_FIRST	// for layouts: Item| ... with | being the origin
-};
-
-// flags constant
-
-enumflags {
-	FLAG_TEMPLATE,			// this is a template do not touch, do not draw - actually dont do anything with it
-	FLAG_EMBEDDED,			// the item cant be selected and all its children are embedded into its parent
-	FLAG_HIDDEN,			// events wont be called and it wont be drawn, etc.
-	FLAG_NOSELECT,			// cant be selected (but events will be called)
-	FLAG_CONNECTEDONLY,		// only if connected (i.e. playing)
-	FLAG_SERVERONLY,		// only displayed if server
-	FLAG_DEVELOPERONLY,		// only displayed if developer
-	FLAG_DRAWONLY,			// only the draw event will be called
-	FLAG_CHILDDRAWONLY,		// used to make the children only drawable
-	FLAG_DRAWUPDATEONLY,		// only the draw and update event get called
-	FLAG_CHILDDRAWUPDATEONLY,	// only the draw and refresh events are called for children
-	FLAG_SEALOFFMOUSE		// used to seal all items under the item with this flag off from mouse events
-	// TODO: real seal off all events (not only items not being selected)
-};
-
-// [Item_Link] [Item}
-.entity _link; // item link
-
-void() Item_Link_Init;
-void() Item_Link_Destroy;
-void() Item_Link_Update;
-bool( float pKey, float pAscii ) Item_Link_Key;
-void() Item_Link_MouseEnter;
-
-bool() Item_Link_IsSelected;
-
-// [Item_Cinematic]
-.string link; // full name of the video
-.string normal; // normal name used with cachepic
-
-void() Item_Cinematic_Destroy;
-void() Item_Cinematic_Init;
-
-// Item_Cinematic_Loop [Item_Cinematic]
-void() Item_Cinematic_Loop_Spawn;
-
-// Item_Container
-// used for non-visible, non-selectable data
-void() Item_Container_Spawn;
-
-// Parser_Define
-.string name;
-.string value;
-
-/*
-// ITEM_EDITBOX (derived from ITEM_TEXT mostly)
-.string format; // //wildcards are * for each letter except the next after it - \* for * and * / space ' ' for one letter e.g. "   .   .   .   " for an ip field
-.float maxlen; // -1 for infinite
-.float _cursorpos;*/
+// DP/Nex Menu
+// control/items.qh
+
+/*
+Items/Controls:
+
+This control is supported/required by the menu manager :
+Item_Window
+Item_Reference
+
+Item_Layout
+
+The rest is not required:
+Item_Custom
+
+Item_Picture
+
+Item_Text
+
+Item_Rect
+
+ITEM_BUTTON
+ITEM_TEXTBUTTON
+
+
+
+ITEM_SLIDER
+
+ITEM_TEXTSWITCH
+*/
+
+// INFO: some information about the spawn functions
+// INFO: Since I dont want another namespace clutching all spawn functions will have a nice and neat
+// INFO: "_Spawn" suffix.
+
+// item constants
+
+const float ITEM_ALIGN_LEFT = 0;
+enumflags {
+	ITEM_ALIGN_CENTER,
+	ITEM_ALIGN_RIGHT,
+	ITEM_ALIGN_FIX_RIGHT,	// |text - actually this isnt necessary
+	ITEM_ALIGN_FIX_CENTER,	// te|xt
+	ITEM_ALIGN_FIX_LEFT,	// text|
+	ITEM_ALIGN_FIRST	// for layouts: Item| ... with | being the origin
+};
+
+// flags constant
+
+enumflags {
+	FLAG_TEMPLATE,			// this is a template do not touch, do not draw - actually dont do anything with it
+	FLAG_EMBEDDED,			// the item cant be selected and all its children are embedded into its parent
+	FLAG_HIDDEN,			// events wont be called and it wont be drawn, etc.
+	FLAG_NOSELECT,			// cant be selected (but events will be called)
+	FLAG_CONNECTEDONLY,		// only if connected (i.e. playing)
+	FLAG_SERVERONLY,		// only displayed if server
+	FLAG_DEVELOPERONLY,		// only displayed if developer
+	FLAG_DRAWONLY,			// only the draw event will be called
+	FLAG_CHILDDRAWONLY,		// used to make the children only drawable
+	FLAG_DRAWUPDATEONLY,		// only the draw and update event get called
+	FLAG_CHILDDRAWUPDATEONLY,	// only the draw and refresh events are called for children
+	FLAG_SEALOFFMOUSE		// used to seal all items under the item with this flag off from mouse events
+	// TODO: real seal off all events (not only items not being selected)
+};
+
+// [Item_Link] [Item}
+.entity _link; // item link
+
+void() Item_Link_Init;
+void() Item_Link_Destroy;
+void() Item_Link_Update;
+bool( float pKey, float pAscii ) Item_Link_Key;
+void() Item_Link_MouseEnter;
+
+bool() Item_Link_IsSelected;
+
+// [Item_Cinematic]
+.string link; // full name of the video
+.string normal; // normal name used with cachepic
+
+void() Item_Cinematic_Destroy;
+void() Item_Cinematic_Init;
+
+// Item_Cinematic_Loop [Item_Cinematic]
+void() Item_Cinematic_Loop_Spawn;
+
+// Item_Container
+// used for non-visible, non-selectable data
+void() Item_Container_Spawn;
+
+// Parser_Define
+.string name;
+.string value;
+
+/*
+// ITEM_EDITBOX (derived from ITEM_TEXT mostly)
+.string format; // //wildcards are * for each letter except the next after it - \* for * and * / space ' ' for one letter e.g. "   .   .   .   " for an ip field
+.float maxlen; // -1 for infinite
+.float _cursorpos;*/


Property changes on: trunk/basezym/menuqc/control/items.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/control/link.qc
===================================================================
--- trunk/basezym/menuqc/control/link.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/control/link.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,63 +1,63 @@
-// DP/Nex Menu
-// control/link.qc
-
-////////////////
-// [Item_Link]
-///
-
-/*
-The Link is only established if self.link is valid.
-If it is valid, the item is made no selectable since the link should be selectable
-*/
-
-void() Item_Link_Update =
-{
-	if( self.link == "" )
-		self._link = null_entity;
-	else if( self.link != self._link.name ) {
-		self._link = Menu_GetItem( self.link );
-		self.flag = self.flag | FLAG_NOSELECT;
-	}
-};
-
-bool( float pKey, float pAscii ) Item_Link_Key =
-{
-	if( self._link )
-		return Raise_Key( self._link, pKey, pAscii );
-
-	return false;
-};
-
-void() Item_Link_MouseEnter =
-{
-	if( self._link && Menu_IsSelectable( self._link ) )
-		Menu_Select( self._link, true );
-};
-
-bool() Item_Link_IsSelected =
-{
-	if( Menu_ActiveItem == self )
-		return true;
-
-	if( self._link )
-		return (Menu_ActiveItem == self._link);
-	else
-		return false;
-};
-
-void() Item_Link_Destroy =
-{
-	String_EntityFree( self, link );
-};
-
-void() Item_Link_Init =
-{
-	String_EntityZone( self, link );
-
-	Item_Link_Update();
-
-	self._destroy = Item_Link_Destroy;
-	self._key = Item_Link_Key;
-	self._mouseEnter = Item_Link_MouseEnter;
-	self._update = Item_Link_MouseEnter;
-};
+// DP/Nex Menu
+// control/link.qc
+
+////////////////
+// [Item_Link]
+///
+
+/*
+The Link is only established if self.link is valid.
+If it is valid, the item is made no selectable since the link should be selectable
+*/
+
+void() Item_Link_Update =
+{
+	if( self.link == "" )
+		self._link = null_entity;
+	else if( self.link != self._link.name ) {
+		self._link = Menu_GetItem( self.link );
+		self.flag = self.flag | FLAG_NOSELECT;
+	}
+};
+
+bool( float pKey, float pAscii ) Item_Link_Key =
+{
+	if( self._link )
+		return Raise_Key( self._link, pKey, pAscii );
+
+	return false;
+};
+
+void() Item_Link_MouseEnter =
+{
+	if( self._link && Menu_IsSelectable( self._link ) )
+		Menu_Select( self._link, true );
+};
+
+bool() Item_Link_IsSelected =
+{
+	if( Menu_ActiveItem == self )
+		return true;
+
+	if( self._link )
+		return (Menu_ActiveItem == self._link);
+	else
+		return false;
+};
+
+void() Item_Link_Destroy =
+{
+	String_EntityFree( self, link );
+};
+
+void() Item_Link_Init =
+{
+	String_EntityZone( self, link );
+
+	Item_Link_Update();
+
+	self._destroy = Item_Link_Destroy;
+	self._key = Item_Link_Key;
+	self._mouseEnter = Item_Link_MouseEnter;
+	self._update = Item_Link_MouseEnter;
+};


Property changes on: trunk/basezym/menuqc/control/link.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/credits.qc
===================================================================
--- trunk/basezym/menuqc/custom/credits.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/credits.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,26 +1,26 @@
-// Property of Alientrap/AK
-// custom/credits.qc
-
-void() Item_Nex_Credits_Spawn =
-{
-	local float lFile;
-	local string lText, lLine;
-
-	lFile = fopen( self.target, FILE_READ );
-	if( lFile < 0 ) {
-		// shut up
-		Menu_DeleteAfterToggle( self );
-		return;
-	}
-
-	lText = String_Create();
-	do {
-		lLine = fgets( lFile );
-		lText = String_Append( lText, strcat( lLine, "\n" ) );
-	} while( validstring( lLine ) );
-	self.text = lText;
-	fclose( lFile );
-
-	Item_MultiLabel_Spawn();
-	String_Free( lText );
-};
+// Property of Alientrap/AK
+// custom/credits.qc
+
+void() Item_Nex_Credits_Spawn =
+{
+	local float lFile;
+	local string lText, lLine;
+
+	lFile = fopen( self.target, FILE_READ );
+	if( lFile < 0 ) {
+		// shut up
+		Menu_DeleteAfterToggle( self );
+		return;
+	}
+
+	lText = String_Create();
+	do {
+		lLine = fgets( lFile );
+		lText = String_Append( lText, strcat( lLine, "\n" ) );
+	} while( validstring( lLine ) );
+	self.text = lText;
+	fclose( lFile );
+
+	Item_MultiLabel_Spawn();
+	String_Free( lText );
+};


Property changes on: trunk/basezym/menuqc/custom/credits.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/credits.qh
===================================================================
--- trunk/basezym/menuqc/custom/credits.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/credits.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,7 +1,7 @@
-// Property of Alientrap/AK
-// custom/credits.qh
-
-// Item_Nex_Credits Item_MultiLabel
-.string target;		// filename
-
-void() Item_Nex_Credits_Spawn;
+// Property of Alientrap/AK
+// custom/credits.qh
+
+// Item_Nex_Credits Item_MultiLabel
+.string target;		// filename
+
+void() Item_Nex_Credits_Spawn;


Property changes on: trunk/basezym/menuqc/custom/credits.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/custom.qh
===================================================================
--- trunk/basezym/menuqc/custom/custom.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/custom.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,5 +1,5 @@
-// Property of Alientrap/AK
-// custom/custom.qh
-
-// Moves through all of pItem's neighbors and makes pItem the only visible item
-void( entity pItem ) Nex_MakeOnlyVisible;
+// Property of Alientrap/AK
+// custom/custom.qh
+
+// Moves through all of pItem's neighbors and makes pItem the only visible item
+void( entity pItem ) Nex_MakeOnlyVisible;


Property changes on: trunk/basezym/menuqc/custom/custom.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/joingame.qc
===================================================================
--- trunk/basezym/menuqc/custom/joingame.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/joingame.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,113 +1,113 @@
-// Property of Alientrap/AK
-// custom/joingame/joingame.qc
-
-////////////////////////////////////
-// Item_Nex_HostCache_Entry
-//////
-
-void() Item_Nex_HostCache_Entry_Update =
-{
-	if( HostCache_ViewCount <= self.stepValue ) {
-		self.flag = self.flag | FLAG_HIDDEN;
-		return;
-	} else if( self.flag & FLAG_HIDDEN )
-		self.flag = self.flag - FLAG_HIDDEN;
-
-	if( Menu_HasRunFlag( self, RUNFLAG_CLIPPED ) )
-		return;
-
-	Item_Button_Update();
-};
-
-void() Item_Nex_HostCache_Entry_Draw =
-{
-	Item_Window_Draw();
-	Item_Button_Draw();
-};
-
-void() Item_Nex_HostCache_Entry_Spawn =
-{
-	Item_Window_Spawn();
-	Item_Button_Spawn();
-
-	self.flag = self.flag | FLAG_HIDDEN; // we dont want to get this bloody hostcachestring warning
-	if( self.flag & FLAG_NOSELECT )
-		self.flag = self.flag - FLAG_NOSELECT;
-	self._draw = Item_Nex_HostCache_Entry_Draw;
-	self._update = Item_Nex_HostCache_Entry_Update;
-};
-
-////////////////////////////////////
-// Item_Nex_HostCache_StringField
-////////
-
-void() Item_Nex_HostCache_StringField_Update =
-{
-	local float lMaxLen;
-	local string lString;
-
-	if( HostCache_ViewCount <= self._parent.stepValue )
-		return;
-	lMaxLen = floor( self.size_x / self.fontSize_x );
-	lString = gethostcachestring( self._realValue, self._parent.stepValue );
-	if( lMaxLen < strlen( lString ) ) {
-		lString = strcat( substring( lString, 0, lMaxLen - 3 ), "..." );
-	}
-	String_EntitySet( self, text, lString );
-
-	Item_Label_Update();
-};
-
-void() Item_Nex_HostCache_StringField_Spawn =
-{
-	Item_Label_Spawn();
-
-	self._realValue = gethostcacheindexforkey( self.target );
-	self._update = Item_Nex_HostCache_StringField_Update;
-};
-
-////////////////////////////////////
-// Item_Nex_HostCache_ValueField
-////////
-
-void() Item_Nex_HostCache_ValueField_Update =
-{
-	if( HostCache_ViewCount <= self._parent.stepValue )
-		return;
-	String_EntitySet( self, text, ftos( gethostcachenumber( self._realValue, self._parent.stepValue ) ) );
-
-	Item_Label_Update();
-};
-
-void() Item_Nex_HostCache_ValueField_Spawn =
-{
-	Item_Label_Spawn();
-
-	self._realValue = gethostcacheindexforkey( self.target );
-	self._update = Item_Nex_HostCache_ValueField_Update;
-};
-
-//////////////////////////////////
-// Item_Nex_HostCache_Players
-///////
-
-void() Item_Nex_HostCache_Players_Update =
-{
-	local string lNum, lMax;
-
-	if( HostCache_ViewCount <= self._parent.stepValue )
-		return;
-	lNum = ftos( gethostcachenumber( SLIST_FIELD_NUMPLAYERS, self._parent.stepValue ) );
-	lMax = ftos( gethostcachenumber( SLIST_FIELD_MAXPLAYERS, self._parent.stepValue ) );
-
-	String_EntitySet( self, text, strcat( lNum, "/", lMax ) );
-
-	Item_Label_Update();
-};
-
-void() Item_Nex_HostCache_Players_Spawn =
-{
-	Item_Label_Spawn();
-
-	self._update = Item_Nex_HostCache_Players_Update;
-};
+// Property of Alientrap/AK
+// custom/joingame/joingame.qc
+
+////////////////////////////////////
+// Item_Nex_HostCache_Entry
+//////
+
+void() Item_Nex_HostCache_Entry_Update =
+{
+	if( HostCache_ViewCount <= self.stepValue ) {
+		self.flag = self.flag | FLAG_HIDDEN;
+		return;
+	} else if( self.flag & FLAG_HIDDEN )
+		self.flag = self.flag - FLAG_HIDDEN;
+
+	if( Menu_HasRunFlag( self, RUNFLAG_CLIPPED ) )
+		return;
+
+	Item_Button_Update();
+};
+
+void() Item_Nex_HostCache_Entry_Draw =
+{
+	Item_Window_Draw();
+	Item_Button_Draw();
+};
+
+void() Item_Nex_HostCache_Entry_Spawn =
+{
+	Item_Window_Spawn();
+	Item_Button_Spawn();
+
+	self.flag = self.flag | FLAG_HIDDEN; // we dont want to get this bloody hostcachestring warning
+	if( self.flag & FLAG_NOSELECT )
+		self.flag = self.flag - FLAG_NOSELECT;
+	self._draw = Item_Nex_HostCache_Entry_Draw;
+	self._update = Item_Nex_HostCache_Entry_Update;
+};
+
+////////////////////////////////////
+// Item_Nex_HostCache_StringField
+////////
+
+void() Item_Nex_HostCache_StringField_Update =
+{
+	local float lMaxLen;
+	local string lString;
+
+	if( HostCache_ViewCount <= self._parent.stepValue )
+		return;
+	lMaxLen = floor( self.size_x / self.fontSize_x );
+	lString = gethostcachestring( self._realValue, self._parent.stepValue );
+	if( lMaxLen < strlen( lString ) ) {
+		lString = strcat( substring( lString, 0, lMaxLen - 3 ), "..." );
+	}
+	String_EntitySet( self, text, lString );
+
+	Item_Label_Update();
+};
+
+void() Item_Nex_HostCache_StringField_Spawn =
+{
+	Item_Label_Spawn();
+
+	self._realValue = gethostcacheindexforkey( self.target );
+	self._update = Item_Nex_HostCache_StringField_Update;
+};
+
+////////////////////////////////////
+// Item_Nex_HostCache_ValueField
+////////
+
+void() Item_Nex_HostCache_ValueField_Update =
+{
+	if( HostCache_ViewCount <= self._parent.stepValue )
+		return;
+	String_EntitySet( self, text, ftos( gethostcachenumber( self._realValue, self._parent.stepValue ) ) );
+
+	Item_Label_Update();
+};
+
+void() Item_Nex_HostCache_ValueField_Spawn =
+{
+	Item_Label_Spawn();
+
+	self._realValue = gethostcacheindexforkey( self.target );
+	self._update = Item_Nex_HostCache_ValueField_Update;
+};
+
+//////////////////////////////////
+// Item_Nex_HostCache_Players
+///////
+
+void() Item_Nex_HostCache_Players_Update =
+{
+	local string lNum, lMax;
+
+	if( HostCache_ViewCount <= self._parent.stepValue )
+		return;
+	lNum = ftos( gethostcachenumber( SLIST_FIELD_NUMPLAYERS, self._parent.stepValue ) );
+	lMax = ftos( gethostcachenumber( SLIST_FIELD_MAXPLAYERS, self._parent.stepValue ) );
+
+	String_EntitySet( self, text, strcat( lNum, "/", lMax ) );
+
+	Item_Label_Update();
+};
+
+void() Item_Nex_HostCache_Players_Spawn =
+{
+	Item_Label_Spawn();
+
+	self._update = Item_Nex_HostCache_Players_Update;
+};


Property changes on: trunk/basezym/menuqc/custom/joingame.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/joingame.qh
===================================================================
--- trunk/basezym/menuqc/custom/joingame.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/joingame.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,31 +1,31 @@
-// Property of Alientrap
-// custom/joingame/joingame.qh
-
-// Item_Nex_HostCache_Entry Item_Arrangement
-.string soundSelected;
-.vector color;
-.float 	alpha;
-.float  drawFlag;
-.float 	stepValue; // contains the entry number
-
-void() Item_Nex_HostCache_Entry_Update;
-void() Item_Nex_HostCache_Entry_Spawn;
-
-// Item_Nex_HostCache_StringField Item_Label
-.float _realValue; // contains the field number
-.string target; // wont be zoned
-
-void() Item_Nex_HostCache_StringField_Update;
-void() Item_Nex_HostCache_StringField_Spawn;
-
-// Item_Nex_HostCache_ValueField Item_Label
-.float _realValue; // contains the field number
-.string target; // wont be zoned
-
-void() Item_Nex_HostCache_ValueField_Update;
-void() Item_Nex_HostCache_ValueField_Spawn;
-
-// Item_Nex_HostCache_Players Item_Label
-void() Item_Nex_HostCache_Players_Update;
-void() Item_Nex_HostCache_Players_Spawn;
-
+// Property of Alientrap
+// custom/joingame/joingame.qh
+
+// Item_Nex_HostCache_Entry Item_Arrangement
+.string soundSelected;
+.vector color;
+.float 	alpha;
+.float  drawFlag;
+.float 	stepValue; // contains the entry number
+
+void() Item_Nex_HostCache_Entry_Update;
+void() Item_Nex_HostCache_Entry_Spawn;
+
+// Item_Nex_HostCache_StringField Item_Label
+.float _realValue; // contains the field number
+.string target; // wont be zoned
+
+void() Item_Nex_HostCache_StringField_Update;
+void() Item_Nex_HostCache_StringField_Spawn;
+
+// Item_Nex_HostCache_ValueField Item_Label
+.float _realValue; // contains the field number
+.string target; // wont be zoned
+
+void() Item_Nex_HostCache_ValueField_Update;
+void() Item_Nex_HostCache_ValueField_Spawn;
+
+// Item_Nex_HostCache_Players Item_Label
+void() Item_Nex_HostCache_Players_Update;
+void() Item_Nex_HostCache_Players_Spawn;
+


Property changes on: trunk/basezym/menuqc/custom/joingame.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/key.qc
===================================================================
--- trunk/basezym/menuqc/custom/key.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/key.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,162 +1,162 @@
-// Property of Alientrap/AK
-// custom/key.qc
-
-void( float pEvent ) Item_Data_Nex_Key_DataEvent;
-
-void() _IDNK_Sync =
-{
-	String_EntitySet( self, value, String_Normal( Key_GetBindList( self.target ) ) );
-	String_EntitySet( self, _syncValue, self.value );
-};
-
-void() _IDNK_Set =
-{
-	local float lCount, lCounter;
-
-	lCount = Util_GetAltStringCount( self.value );
-	Key_LimitBinds( 0, self.target );
-
-	for( lCounter = 0 ; lCounter < lCount ; ++lCounter )
-		Key_Bind( Key_GetName( stof( String_Normal( Util_GetAltStringItem( self.value, lCounter ) ) ) ), self.target );
-};
-
-void() _IDNK_Send =
-{
-	_IDNK_Set();
-	String_EntitySet( self, _syncValue, self.value );
-};
-
-void() _IDNK_Reset =
-{
-	local float lCount, lCounter;
-	local string lKey;
-	// TODO: remove this - but we need this for testing purposes atm
-	// INFO: defValue should contain the key names used by DP not the key numbers!
-	if( !self.defValue )
-		return;
-
-	String_EntitySet( self, value, "" );
-
-	lCount = Util_GetAltStringCount( self.defValue );
-	Key_LimitBinds( 0, self.target );
-
-	for( lCounter = 0 ; lCounter < lCount ; lCounter++ ) {
-		lKey = Util_GetAltStringItem( self.defValue, lCounter );
-		Key_Bind( lKey, self.target );
-		String_EntitySet( self, value, strcat( self.value, " '", Key_GetNum( lKey ), "'" ) );
-		String_Free( lKey );
-	}
-
-	String_EntitySet( self, _syncValue, self.value );
-};
-
-void() _IDNK_Test_Start =
-{
-	_IDNK_Set();
-};
-
-void() _IDNK_Test_End =
-{
-	String_EntitySet( self, value, self._syncValue );
-	_IDNK_Set();
-};
-
-void( float pEvent ) Item_Data_Nex_Key_DataEvent =
-{
-	switch( pEvent ) {
-	case ITEM_DATA_SYNC:
-		_IDNK_Sync();
-		break;
-	case ITEM_DATA_SEND:
-		_IDNK_Send();
-		break;
-	case ITEM_DATA_RESET:
-		_IDNK_Reset();
-		break;
-	case ITEM_DATA_TEST_START:
-		_IDNK_Test_Start();
-		break;
-	case ITEM_DATA_TEST_END:
-		_IDNK_Test_End();
-		break;
-	}
-};
-
-void() Item_Data_Nex_Key_Destroy =
-{
-	String_EntityFree( self, target );
-	Item_Data_Destroy();
-};
-
-void() Item_Data_Nex_Key_Spawn =
-{
-	Item_Data_Init();
-
-	String_EntityZone( self, target );
-
-	self._destroy = Item_Data_Nex_Key_Destroy;
-	self._reinit = _IDNK_Sync;
-	self._dataEvent = Item_Data_Nex_Key_DataEvent;
-};
-
-
-/*
-===================
-Item_Nex_KeyButton Item_Button
-===================
-*/
-
-bool( float pKey, float pAscii ) Item_Nex_KeyButton_Key =
-{
-	if( pKey == K_BACKSPACE ) {
-		local float lNum;
-		// unbind the key
-		Raise_DataEvent( self._target, ITEM_DATALINK_GET );
-		lNum = stof( self._target.value );
-		if( lNum >= 0 ) {
-			Key_Unbind( Key_GetName( lNum ) );
-			Raise_DataEvent( self._target, ITEM_DATALINK_SET );
-		}
-		return true;
-	} else if( pKey == K_UPARROW ) {
-		Menu_SelectPrev( false );
-		Menu_SelectPrev( true );
-		return true;
-	} else if( pKey == K_DOWNARROW ) {
-		Menu_SelectNext( false );
-		Menu_SelectNext( true );
-		return true;
-	} else
-		return Item_Button_Key( pKey, pAscii );
-};
-
-void() Item_Nex_KeyButton_Update =
-{
-	local float lNum;
-	Item_DataUser_Update();
-
-	Raise_DataEvent( self._target, ITEM_DATALINK_GET );
-	lNum = stof( self._target.value );
-	if( lNum < 0 )
-		String_EntitySet( self, normal, "-" );
-	else
-		String_EntitySet( self, normal, Key_GetName( lNum ) );
-	Item_Button_Update();
-};
-
-void() Item_Nex_KeyButton_Destroy =
-{
-	Item_DataUser_Destroy();
-	Item_Button_Destroy();
-};
-
-void() Item_Nex_KeyButton_Spawn =
-{
-	Item_DataUser_Init();
-	Item_Button_Spawn();
-
-	self._destroy = Item_Nex_KeyButton_Destroy;
-	self._update = Item_Nex_KeyButton_Update;
-	self._key = Item_Nex_KeyButton_Key;
-};
-
+// Property of Alientrap/AK
+// custom/key.qc
+
+void( float pEvent ) Item_Data_Nex_Key_DataEvent;
+
+void() _IDNK_Sync =
+{
+	String_EntitySet( self, value, String_Normal( Key_GetBindList( self.target ) ) );
+	String_EntitySet( self, _syncValue, self.value );
+};
+
+void() _IDNK_Set =
+{
+	local float lCount, lCounter;
+
+	lCount = Util_GetAltStringCount( self.value );
+	Key_LimitBinds( 0, self.target );
+
+	for( lCounter = 0 ; lCounter < lCount ; ++lCounter )
+		Key_Bind( Key_GetName( stof( String_Normal( Util_GetAltStringItem( self.value, lCounter ) ) ) ), self.target );
+};
+
+void() _IDNK_Send =
+{
+	_IDNK_Set();
+	String_EntitySet( self, _syncValue, self.value );
+};
+
+void() _IDNK_Reset =
+{
+	local float lCount, lCounter;
+	local string lKey;
+	// TODO: remove this - but we need this for testing purposes atm
+	// INFO: defValue should contain the key names used by DP not the key numbers!
+	if( !self.defValue )
+		return;
+
+	String_EntitySet( self, value, "" );
+
+	lCount = Util_GetAltStringCount( self.defValue );
+	Key_LimitBinds( 0, self.target );
+
+	for( lCounter = 0 ; lCounter < lCount ; lCounter++ ) {
+		lKey = Util_GetAltStringItem( self.defValue, lCounter );
+		Key_Bind( lKey, self.target );
+		String_EntitySet( self, value, strcat( self.value, " '", Key_GetNum( lKey ), "'" ) );
+		String_Free( lKey );
+	}
+
+	String_EntitySet( self, _syncValue, self.value );
+};
+
+void() _IDNK_Test_Start =
+{
+	_IDNK_Set();
+};
+
+void() _IDNK_Test_End =
+{
+	String_EntitySet( self, value, self._syncValue );
+	_IDNK_Set();
+};
+
+void( float pEvent ) Item_Data_Nex_Key_DataEvent =
+{
+	switch( pEvent ) {
+	case ITEM_DATA_SYNC:
+		_IDNK_Sync();
+		break;
+	case ITEM_DATA_SEND:
+		_IDNK_Send();
+		break;
+	case ITEM_DATA_RESET:
+		_IDNK_Reset();
+		break;
+	case ITEM_DATA_TEST_START:
+		_IDNK_Test_Start();
+		break;
+	case ITEM_DATA_TEST_END:
+		_IDNK_Test_End();
+		break;
+	}
+};
+
+void() Item_Data_Nex_Key_Destroy =
+{
+	String_EntityFree( self, target );
+	Item_Data_Destroy();
+};
+
+void() Item_Data_Nex_Key_Spawn =
+{
+	Item_Data_Init();
+
+	String_EntityZone( self, target );
+
+	self._destroy = Item_Data_Nex_Key_Destroy;
+	self._reinit = _IDNK_Sync;
+	self._dataEvent = Item_Data_Nex_Key_DataEvent;
+};
+
+
+/*
+===================
+Item_Nex_KeyButton Item_Button
+===================
+*/
+
+bool( float pKey, float pAscii ) Item_Nex_KeyButton_Key =
+{
+	if( pKey == K_BACKSPACE ) {
+		local float lNum;
+		// unbind the key
+		Raise_DataEvent( self._target, ITEM_DATALINK_GET );
+		lNum = stof( self._target.value );
+		if( lNum >= 0 ) {
+			Key_Unbind( Key_GetName( lNum ) );
+			Raise_DataEvent( self._target, ITEM_DATALINK_SET );
+		}
+		return true;
+	} else if( pKey == K_UPARROW ) {
+		Menu_SelectPrev( false );
+		Menu_SelectPrev( true );
+		return true;
+	} else if( pKey == K_DOWNARROW ) {
+		Menu_SelectNext( false );
+		Menu_SelectNext( true );
+		return true;
+	} else
+		return Item_Button_Key( pKey, pAscii );
+};
+
+void() Item_Nex_KeyButton_Update =
+{
+	local float lNum;
+	Item_DataUser_Update();
+
+	Raise_DataEvent( self._target, ITEM_DATALINK_GET );
+	lNum = stof( self._target.value );
+	if( lNum < 0 )
+		String_EntitySet( self, normal, "-" );
+	else
+		String_EntitySet( self, normal, Key_GetName( lNum ) );
+	Item_Button_Update();
+};
+
+void() Item_Nex_KeyButton_Destroy =
+{
+	Item_DataUser_Destroy();
+	Item_Button_Destroy();
+};
+
+void() Item_Nex_KeyButton_Spawn =
+{
+	Item_DataUser_Init();
+	Item_Button_Spawn();
+
+	self._destroy = Item_Nex_KeyButton_Destroy;
+	self._update = Item_Nex_KeyButton_Update;
+	self._key = Item_Nex_KeyButton_Key;
+};
+


Property changes on: trunk/basezym/menuqc/custom/key.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/key.qh
===================================================================
--- trunk/basezym/menuqc/custom/key.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/key.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,13 +1,13 @@
-// Property of Alientrap/AK
-// custom/key.qh
-
-// Item_Data_Nex_Key [Item_Data]
-// value is an altstring which contains all assigned key names
-//
-.string target; // action name
-
-void( float pEvent ) Item_Data_Nex_Key_DataEvent;
-void() Item_Data_Nex_Key_Spawn;
-
-// Item_Nex_KeyButton Item_Button
-void() Item_Nex_KeyButton_Spawn;
+// Property of Alientrap/AK
+// custom/key.qh
+
+// Item_Data_Nex_Key [Item_Data]
+// value is an altstring which contains all assigned key names
+//
+.string target; // action name
+
+void( float pEvent ) Item_Data_Nex_Key_DataEvent;
+void() Item_Data_Nex_Key_Spawn;
+
+// Item_Nex_KeyButton Item_Button
+void() Item_Nex_KeyButton_Spawn;


Property changes on: trunk/basezym/menuqc/custom/key.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/messagebox.qc
===================================================================
--- trunk/basezym/menuqc/custom/messagebox.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/messagebox.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,79 +1,79 @@
-// Property of Alientrap/AK
-// custom/messagebox.qc
-
-var event Nex_MessageBox_LeftEvent = __NULL__;
-var event Nex_MessageBox_RightEvent = __NULL__;
-
-void( string pTitle, string pText, string pLeftButton, string pRightButton, event pLeftEvent, event pRightEvent )
-Nex_MessageBox =
-{
-	local entity lItem;
-
-	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Title::Caption" );
-	String_EntitySet( lItem, normal, pTitle );
-	// reset its size since this one has to be centered and AlignCenter takes care of everything
-	//lItem.size = '0 0 0';
-
-	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Text" );
-	String_EntitySet( lItem, text, pText );
-	lItem.size = '0 0 0';
-
-	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Buttons::Left" );
-	String_EntitySet( lItem, normal, pLeftButton );
-	lItem.size = '0 0 0';
-
-	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Buttons::Right" );
-	String_EntitySet( lItem, normal, pRightButton );
-	lItem.size = '0 0 0';
-	if( strlen( pRightButton ) == 0 ) {
-		lItem.flag = lItem.flag | FLAG_HIDDEN;
-	} else if( lItem.flag & FLAG_HIDDEN ) {
-		lItem.flag = lItem.flag - FLAG_HIDDEN;
-	}
-
-	Nex_MessageBox_LeftEvent = pLeftEvent;
-	Nex_MessageBox_RightEvent = pRightEvent;
-
-	lItem = Menu_GetItem( "MessageBoxWnd" );
-	if( lItem.flag & FLAG_HIDDEN )
-		lItem.flag = lItem.flag - FLAG_HIDDEN;
-
-	Menu_Select( Menu_GetItem( "MessageBoxWnd::Layout::Buttons::Right" ), false );
-};
-
-void() Nex_MessageBox_Hide =
-{
-	local entity lEntity;
-
-	lEntity = Menu_GetItem( "MessageBoxWnd" );
-	if( !(lEntity.flag & FLAG_HIDDEN) ) {
-		lEntity.flag = lEntity.flag + FLAG_HIDDEN;
-		Menu_Reselect( false );
-	}
-}
-
-void() Nex_MessageBox_LeftButton =
-{
-	if( Nex_MessageBox_LeftEvent ) {
-		Nex_MessageBox_LeftEvent();
-	}
-	Nex_MessageBox_Hide();
-};
-
-void() Nex_MessageBox_RightButton =
-{
-	if( Nex_MessageBox_RightEvent ) {
-		Nex_MessageBox_RightEvent();
-	}
-	Nex_MessageBox_Hide();
-};
-
-bool( float pKey, float pAscii ) Nex_MessageBox_Key =
-{
-	if( pKey == K_ESCAPE ) {
-		// escape == right button!
-		Nex_MessageBox_RightButton();
-		return true;
-	}
-	return false;
-};
+// Property of Alientrap/AK
+// custom/messagebox.qc
+
+var event Nex_MessageBox_LeftEvent = __NULL__;
+var event Nex_MessageBox_RightEvent = __NULL__;
+
+void( string pTitle, string pText, string pLeftButton, string pRightButton, event pLeftEvent, event pRightEvent )
+Nex_MessageBox =
+{
+	local entity lItem;
+
+	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Title::Caption" );
+	String_EntitySet( lItem, normal, pTitle );
+	// reset its size since this one has to be centered and AlignCenter takes care of everything
+	//lItem.size = '0 0 0';
+
+	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Text" );
+	String_EntitySet( lItem, text, pText );
+	lItem.size = '0 0 0';
+
+	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Buttons::Left" );
+	String_EntitySet( lItem, normal, pLeftButton );
+	lItem.size = '0 0 0';
+
+	lItem = Menu_GetItem( "MessageBoxWnd::Layout::Buttons::Right" );
+	String_EntitySet( lItem, normal, pRightButton );
+	lItem.size = '0 0 0';
+	if( strlen( pRightButton ) == 0 ) {
+		lItem.flag = lItem.flag | FLAG_HIDDEN;
+	} else if( lItem.flag & FLAG_HIDDEN ) {
+		lItem.flag = lItem.flag - FLAG_HIDDEN;
+	}
+
+	Nex_MessageBox_LeftEvent = pLeftEvent;
+	Nex_MessageBox_RightEvent = pRightEvent;
+
+	lItem = Menu_GetItem( "MessageBoxWnd" );
+	if( lItem.flag & FLAG_HIDDEN )
+		lItem.flag = lItem.flag - FLAG_HIDDEN;
+
+	Menu_Select( Menu_GetItem( "MessageBoxWnd::Layout::Buttons::Right" ), false );
+};
+
+void() Nex_MessageBox_Hide =
+{
+	local entity lEntity;
+
+	lEntity = Menu_GetItem( "MessageBoxWnd" );
+	if( !(lEntity.flag & FLAG_HIDDEN) ) {
+		lEntity.flag = lEntity.flag + FLAG_HIDDEN;
+		Menu_Reselect( false );
+	}
+}
+
+void() Nex_MessageBox_LeftButton =
+{
+	if( Nex_MessageBox_LeftEvent ) {
+		Nex_MessageBox_LeftEvent();
+	}
+	Nex_MessageBox_Hide();
+};
+
+void() Nex_MessageBox_RightButton =
+{
+	if( Nex_MessageBox_RightEvent ) {
+		Nex_MessageBox_RightEvent();
+	}
+	Nex_MessageBox_Hide();
+};
+
+bool( float pKey, float pAscii ) Nex_MessageBox_Key =
+{
+	if( pKey == K_ESCAPE ) {
+		// escape == right button!
+		Nex_MessageBox_RightButton();
+		return true;
+	}
+	return false;
+};


Property changes on: trunk/basezym/menuqc/custom/messagebox.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/messagebox.qh
===================================================================
--- trunk/basezym/menuqc/custom/messagebox.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/messagebox.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,5 +1,5 @@
-// Property of Alientrap/AK
-// custom/messagebox.qh
-
-void( string pTitle, string pText, string pLeftButton, string pRightButton, event pLeftEvent, event pRightEvent )
-Nex_MessageBox;
+// Property of Alientrap/AK
+// custom/messagebox.qh
+
+void( string pTitle, string pText, string pLeftButton, string pRightButton, event pLeftEvent, event pRightEvent )
+Nex_MessageBox;


Property changes on: trunk/basezym/menuqc/custom/messagebox.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/video.qc
===================================================================
--- trunk/basezym/menuqc/custom/video.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/video.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,67 +1,67 @@
-// Property of Alientrap
-// custom/video.qc
-
-void() _IDNR_Sync =
-{
-	String_EntitySet( self, value, strcat( cvar_string( "vid_width" ), " ", cvar_string( "vid_height" ) ) );
-	String_EntitySet( self, _syncValue, self.value );
-};
-
-void() _IDNR_Set =
-{
-	tokenize( self.value );
-	cvar_set( "vid_width", argv( 0 ) );
-	cvar_set( "vid_height", argv( 1 ) );
-};
-
-void() _IDNR_Send =
-{
-	_IDNR_Set();
-	_IDNR_Sync();
-};
-
-void() _IDNR_Reset =
-{
-	String_EntitySet( self, value, self.defValue );
-	_IDNR_Send();
-};
-
-void() _IDNR_Test_Start =
-{
-	_IDNR_Set();
-};
-
-void() _IDNR_Test_End =
-{
-	String_EntitySet( self, value, self._syncValue );
-	_IDNR_Send();
-};
-
-void( float pEvent ) Item_Data_Nex_Resolution_DataEvent =
-{
-	switch( pEvent ) {
-		case ITEM_DATA_SYNC:
-		_IDNR_Sync();
-		break;
-		case ITEM_DATA_SEND:
-		_IDNR_Send();
-		break;
-		case ITEM_DATA_RESET:
-		_IDNR_Reset();
-		break;
-		case ITEM_DATA_TEST_START:
-		_IDNR_Test_Start();
-		break;
-		case ITEM_DATA_TEST_END:
-		_IDNR_Test_End();
-		break;
-	}
-};
-
-void() Item_Data_Nex_Resolution_Spawn =
-{
-	Item_Data_Init();
-
-	self._dataEvent = Item_Data_Nex_Resolution_DataEvent;
-	self._reinit = _IDNR_Sync;
-};
+// Property of Alientrap
+// custom/video.qc
+
+void() _IDNR_Sync =
+{
+	String_EntitySet( self, value, strcat( cvar_string( "vid_width" ), " ", cvar_string( "vid_height" ) ) );
+	String_EntitySet( self, _syncValue, self.value );
+};
+
+void() _IDNR_Set =
+{
+	tokenize( self.value );
+	cvar_set( "vid_width", argv( 0 ) );
+	cvar_set( "vid_height", argv( 1 ) );
+};
+
+void() _IDNR_Send =
+{
+	_IDNR_Set();
+	_IDNR_Sync();
+};
+
+void() _IDNR_Reset =
+{
+	String_EntitySet( self, value, self.defValue );
+	_IDNR_Send();
+};
+
+void() _IDNR_Test_Start =
+{
+	_IDNR_Set();
+};
+
+void() _IDNR_Test_End =
+{
+	String_EntitySet( self, value, self._syncValue );
+	_IDNR_Send();
+};
+
+void( float pEvent ) Item_Data_Nex_Resolution_DataEvent =
+{
+	switch( pEvent ) {
+		case ITEM_DATA_SYNC:
+		_IDNR_Sync();
+		break;
+		case ITEM_DATA_SEND:
+		_IDNR_Send();
+		break;
+		case ITEM_DATA_RESET:
+		_IDNR_Reset();
+		break;
+		case ITEM_DATA_TEST_START:
+		_IDNR_Test_Start();
+		break;
+		case ITEM_DATA_TEST_END:
+		_IDNR_Test_End();
+		break;
+	}
+};
+
+void() Item_Data_Nex_Resolution_Spawn =
+{
+	Item_Data_Init();
+
+	self._dataEvent = Item_Data_Nex_Resolution_DataEvent;
+	self._reinit = _IDNR_Sync;
+};


Property changes on: trunk/basezym/menuqc/custom/video.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/video.qh
===================================================================
--- trunk/basezym/menuqc/custom/video.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/video.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,9 +1,9 @@
-// Property of Alientrap
-// custom/video.qh
-
-// Item_Data_Nex_Resolution [Item_Data]
-.string value; // contains the current resolution in the format "width height"
-
-void() Item_Data_Nex_Resolution_Spawn;
-
-
+// Property of Alientrap
+// custom/video.qh
+
+// Item_Data_Nex_Resolution [Item_Data]
+.string value; // contains the current resolution in the format "width height"
+
+void() Item_Data_Nex_Resolution_Spawn;
+
+


Property changes on: trunk/basezym/menuqc/custom/video.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/custom/visible.qc
===================================================================
--- trunk/basezym/menuqc/custom/visible.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/custom/visible.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,14 +1,14 @@
-// Property of Alientrap/AK
-// custom/visible.qc
-
-void( entity pItem ) Nex_MakeOnlyVisible =
-{
-	local entity lChild;
-
-	for( lChild = pItem._parent._child ; lChild ; lChild = lChild._next )
-		lChild.flag = lChild.flag | FLAG_HIDDEN;
-
-	pItem.flag = pItem.flag - FLAG_HIDDEN;
-
-	Menu_UpdateRunFlags();
-};
+// Property of Alientrap/AK
+// custom/visible.qc
+
+void( entity pItem ) Nex_MakeOnlyVisible =
+{
+	local entity lChild;
+
+	for( lChild = pItem._parent._child ; lChild ; lChild = lChild._next )
+		lChild.flag = lChild.flag | FLAG_HIDDEN;
+
+	pItem.flag = pItem.flag - FLAG_HIDDEN;
+
+	Menu_UpdateRunFlags();
+};


Property changes on: trunk/basezym/menuqc/custom/visible.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/mbuiltin.qc
===================================================================
--- trunk/basezym/menuqc/mbuiltin.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/mbuiltin.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,250 +1,250 @@
-//////////////////////////////////////////////////
-// common cmd
-//////////////////////////////////////////////////
-// AK FIXME: Create perhaps a special builtin file for the common cmds
-
-//#define PROFILESTRZONE
-#define FIXEDFOPEN
-
-void 	checkextension(string ext) = #1;
-
-// error cmds
-void 	error(string err,...) 	= #2;
-void 	objerror(string err,...) 	= #3;
-
-// print
-
-void 	print(string text,...) 	= #4;
-void 	bprint(string text,...)	= #5;
-void	sprint(float clientnum, string text,...) = #6;
-void 	centerprint(string text,...) = #7;
-
-// vector stuff
-
-vector	normalize(vector v) 	= #8;
-float 	vlen(vector v)			= #9;
-float  	vectoyaw(vector v)		= #10;
-vector 	vectoangles(vector v)	= #11;
-
-float	random(void)  = #12;
-
-void	cmd(string command) = #13;
-
-// cvar cmds
-
-float 	cvar(string name) = #14;
-const string cvar_string(string name) = #71;
-const string cvar_defstring(string name) = #89;
-void	cvar_set(string name, string value) = #15;
-
-void	dprint(string text,...) = #16;
-
-// conversion functions
-
-string	ftos(float f)  = #17;
-float	fabs(float f)	= #18;
-string	vtos(vector v)  = #19;
-string	etos(entity e) = #20;
-
-float	stof(string val,...)  = #21;
-
-entity	spawn(void) = #22;
-void	remove(entity e) = #23;
-
-entity	findstring(entity start, .string _field, string match)  = #24;
-entity	findfloat(entity start, .float _field, float match) = #25;
-entity	findentity(entity start, .entity _field, entity match) = #25;
-
-entity	findchainstring(.string _field, string match) = #26;
-entity	findchainfloat(.float _field, float match) = #27;
-entity	findchainentity(.entity _field, entity match) = #27;
-
-entity	findflags(entity start, .float field, float match) = #87;
-entity	findchainflags(.float field, float match) = #88;
-
-string	precache_file(string file) = #28;
-string	precache_sound(string sample) = #29;
-
-void	crash(void)	= #72;
-void	coredump(void) = #30;
-void	stackdump(void) = #73;
-void	traceon(void) = #31;
-void	traceoff(void) = #32;
-
-void	eprint(entity e)  = #33;
-float	rint(float f) = #34;
-float	floor(float f)  = #35;
-float	ceil(float f)  = #36;
-entity	nextent(entity e)  = #37;
-float	sin(float f)  = #38;
-float	cos(float f)  = #39;
-float	sqrt(float f)  = #40;
-vector	randomvec(void)  = #41;
-
-float	registercvar(string name, string value, float flags)  = #42; // returns 1 if success
-float	min(float f,...)  = #43;
-float	max(float f,...)  = #44;
-float	bound(float min,float value, float max)  = #45;
-float	pow(float a, float b)  = #46;
-void	copyentity(entity src, entity dst)  = #47;
-
-#ifdef FIXEDFOPEN
-float 	_fopen( string filename, float mode ) = #48;
-#else
-float	fopen(string filename, float mode)  = #48;
-#endif
-void	fclose(float fhandle)  = #49;
-string	fgets(float fhandle)  = #50;
-void	fputs(float fhandle, string s)  = #51;
-
-float	strlen(string s)  = #52;
-//string	strcat(string s1,string s2,...)  = #53;
-string	strcat(string s1, ...)  = #53;
-string	substring(string s, float start, float length)  = #54;
-
-vector	stov(string s)  = #55;
-
-#ifdef PROFILESTRZONE
-string	_strzone(string s)  = #56;
-void	_strunzone(string s) = #57;
-
-string( string s ) strzone =
-{
-	return _strzone( s );
-};
-
-void( string s ) strunzone =
-{
-	return _strunzone( s );
-};
-#else
-string	strzone(string s)  = #56;
-void	strunzone(string s) = #57;
-#endif
-
-float	tokenize(string s)  = #58
-string	argv(float n)  = #59;
-
-float	isserver(void)  = #60;
-float	clientcount(void)  = #61;
-float	clientstate(void)  = #62;
-void	clientcommand(float client, string s)  = #63;
-void	changelevel(string map)  = #64;
-void	localsound(string sample)  = #65;
-vector	getmousepos(void)  	= #66;
-float	gettime(void)		= #67;
-void 	loadfromdata(string data) = #68;
-void	loadfromfile(string file) = #69;
-
-float	mod(float val, float m) = #70;
-
-float	search_begin(string pattern, float caseinsensitive, float quiet) = #74;
-void	search_end(float handle) = #75;
-float	search_getsize(float handle) = #76;
-string	search_getfilename(float handle, float num) = #77;
-
-string	chr(float ascii) = #78;
-
-float 	etof(entity ent) = #79;
-entity 	ftoe(float num)	 = #80;
-
-float   validstring(string str) = #81;
-
-float 	altstr_count(string str) = #82;
-string  altstr_prepare(string str) = #83;
-string  altstr_get(string str, float num) = #84;
-string  altstr_set(string str, float num, string set) = #85;
-string 	altstr_ins(string str, float num, string set) = #86;
-
-/////////////////////////////////////////////////
-// Write* Functions
-/////////////////////////////////////////////////
-void	WriteByte(float data, float dest, float desto)	= #401;
-void	WriteChar(float data, float dest, float desto)	= #402;
-void	WriteShort(float data, float dest, float desto)	= #403;
-void	WriteLong(float data, float dest, float desto)	= #404;
-void	WriteAngle(float data, float dest, float desto)	= #405;
-void	WriteCoord(float data, float dest, float desto)	= #406;
-void	WriteString(string data, float dest, float desto)= #407;
-void	WriteEntity(entity data, float dest, float desto) = #408;
-
-//////////////////////////////////////////////////
-// Draw funtions
-//////////////////////////////////////////////////
-
-float	iscachedpic(string name)	= #451;
-string	precache_pic(string name)	= #452;
-void	freepic(string name)		= #453;
-
-float	drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
-
-float	drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
-
-float	drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
-
-float	drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
-
-void	drawsetcliparea(float x, float y, float width, float height) = #458;
-
-void	drawresetcliparea(void) = #459;
-
-vector  drawgetimagesize(string pic) = #460;
-
-float	cin_open(string file, string name) 	= #461;
-void	cin_close(string name) 			= #462;
-void	cin_setstate(string name, float type) 	= #463;
-float	cin_getstate(string name)		= #464;
-
-////////////////////////////////////////////////
-// Menu functions
-////////////////////////////////////////////////
-
-void	setkeydest(float dest) 	= #601;
-float	getkeydest(void)	= #602;
-
-void	setmousetarget(float trg) = #603;
-float	getmousetarget(void)	  = #604;
-
-float	isfunction(string function_name) = #607;
-void	callfunction(...) = #605;
-void	writetofile(float fhandle, entity ent) = #606;
-vector	getresolution(float number) = #608;
-string	keynumtostring(float keynum) = #609;
-string	findkeysforcommand(string command) = #610;
-
-float	gethostcachevalue(float type) = #611;
-string	gethostcachestring(float type, float hostnr) = #612;
-
-void 	parseentitydata(entity ent, string data) = #613;
-
-float	stringtokeynum(string key) = #614;
-
-void 	resethostcachemasks(void) = #615;
-void 	sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
-void	sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
-void 	resorthostcache(void) = #618;
-void	sethostcachesort(float fld, float descending) = #619;
-void	refreshhostcache(void) = #620;
-float	gethostcachenumber(float fld, float hostnr) = #621;
-float	gethostcacheindexforkey(string key) = #622;
-void	addwantedhostcachekey(string key) = #623;
-
-#ifdef FIXEDFOPEN
-float 	fopen( string filename, float mode ) =
-{
-	local float handle;
-	if( mode == FILE_READ ) {
-		return _fopen( filename, mode );
-	}
-
-	// check for data/
-	filename = strzone( filename );
-	if( substring( filename, 0, 5 ) != "data/" ) {
-		print( "menu: fopen: all output must go into data/!\n" );
-		return -1;
-	}
-	handle = _fopen( substring( filename, 5, 10000 ), mode );
-	strunzone( filename );
-	return handle;
-};
-#endif
+//////////////////////////////////////////////////
+// common cmd
+//////////////////////////////////////////////////
+// AK FIXME: Create perhaps a special builtin file for the common cmds
+
+//#define PROFILESTRZONE
+#define FIXEDFOPEN
+
+void 	checkextension(string ext) = #1;
+
+// error cmds
+void 	error(string err,...) 	= #2;
+void 	objerror(string err,...) 	= #3;
+
+// print
+
+void 	print(string text,...) 	= #4;
+void 	bprint(string text,...)	= #5;
+void	sprint(float clientnum, string text,...) = #6;
+void 	centerprint(string text,...) = #7;
+
+// vector stuff
+
+vector	normalize(vector v) 	= #8;
+float 	vlen(vector v)			= #9;
+float  	vectoyaw(vector v)		= #10;
+vector 	vectoangles(vector v)	= #11;
+
+float	random(void)  = #12;
+
+void	cmd(string command) = #13;
+
+// cvar cmds
+
+float 	cvar(string name) = #14;
+const string cvar_string(string name) = #71;
+const string cvar_defstring(string name) = #89;
+void	cvar_set(string name, string value) = #15;
+
+void	dprint(string text,...) = #16;
+
+// conversion functions
+
+string	ftos(float f)  = #17;
+float	fabs(float f)	= #18;
+string	vtos(vector v)  = #19;
+string	etos(entity e) = #20;
+
+float	stof(string val,...)  = #21;
+
+entity	spawn(void) = #22;
+void	remove(entity e) = #23;
+
+entity	findstring(entity start, .string _field, string match)  = #24;
+entity	findfloat(entity start, .float _field, float match) = #25;
+entity	findentity(entity start, .entity _field, entity match) = #25;
+
+entity	findchainstring(.string _field, string match) = #26;
+entity	findchainfloat(.float _field, float match) = #27;
+entity	findchainentity(.entity _field, entity match) = #27;
+
+entity	findflags(entity start, .float field, float match) = #87;
+entity	findchainflags(.float field, float match) = #88;
+
+string	precache_file(string file) = #28;
+string	precache_sound(string sample) = #29;
+
+void	crash(void)	= #72;
+void	coredump(void) = #30;
+void	stackdump(void) = #73;
+void	traceon(void) = #31;
+void	traceoff(void) = #32;
+
+void	eprint(entity e)  = #33;
+float	rint(float f) = #34;
+float	floor(float f)  = #35;
+float	ceil(float f)  = #36;
+entity	nextent(entity e)  = #37;
+float	sin(float f)  = #38;
+float	cos(float f)  = #39;
+float	sqrt(float f)  = #40;
+vector	randomvec(void)  = #41;
+
+float	registercvar(string name, string value, float flags)  = #42; // returns 1 if success
+float	min(float f,...)  = #43;
+float	max(float f,...)  = #44;
+float	bound(float min,float value, float max)  = #45;
+float	pow(float a, float b)  = #46;
+void	copyentity(entity src, entity dst)  = #47;
+
+#ifdef FIXEDFOPEN
+float 	_fopen( string filename, float mode ) = #48;
+#else
+float	fopen(string filename, float mode)  = #48;
+#endif
+void	fclose(float fhandle)  = #49;
+string	fgets(float fhandle)  = #50;
+void	fputs(float fhandle, string s)  = #51;
+
+float	strlen(string s)  = #52;
+//string	strcat(string s1,string s2,...)  = #53;
+string	strcat(string s1, ...)  = #53;
+string	substring(string s, float start, float length)  = #54;
+
+vector	stov(string s)  = #55;
+
+#ifdef PROFILESTRZONE
+string	_strzone(string s)  = #56;
+void	_strunzone(string s) = #57;
+
+string( string s ) strzone =
+{
+	return _strzone( s );
+};
+
+void( string s ) strunzone =
+{
+	return _strunzone( s );
+};
+#else
+string	strzone(string s)  = #56;
+void	strunzone(string s) = #57;
+#endif
+
+float	tokenize(string s)  = #58
+string	argv(float n)  = #59;
+
+float	isserver(void)  = #60;
+float	clientcount(void)  = #61;
+float	clientstate(void)  = #62;
+void	clientcommand(float client, string s)  = #63;
+void	changelevel(string map)  = #64;
+void	localsound(string sample)  = #65;
+vector	getmousepos(void)  	= #66;
+float	gettime(void)		= #67;
+void 	loadfromdata(string data) = #68;
+void	loadfromfile(string file) = #69;
+
+float	mod(float val, float m) = #70;
+
+float	search_begin(string pattern, float caseinsensitive, float quiet) = #74;
+void	search_end(float handle) = #75;
+float	search_getsize(float handle) = #76;
+string	search_getfilename(float handle, float num) = #77;
+
+string	chr(float ascii) = #78;
+
+float 	etof(entity ent) = #79;
+entity 	ftoe(float num)	 = #80;
+
+float   validstring(string str) = #81;
+
+float 	altstr_count(string str) = #82;
+string  altstr_prepare(string str) = #83;
+string  altstr_get(string str, float num) = #84;
+string  altstr_set(string str, float num, string set) = #85;
+string 	altstr_ins(string str, float num, string set) = #86;
+
+/////////////////////////////////////////////////
+// Write* Functions
+/////////////////////////////////////////////////
+void	WriteByte(float data, float dest, float desto)	= #401;
+void	WriteChar(float data, float dest, float desto)	= #402;
+void	WriteShort(float data, float dest, float desto)	= #403;
+void	WriteLong(float data, float dest, float desto)	= #404;
+void	WriteAngle(float data, float dest, float desto)	= #405;
+void	WriteCoord(float data, float dest, float desto)	= #406;
+void	WriteString(string data, float dest, float desto)= #407;
+void	WriteEntity(entity data, float dest, float desto) = #408;
+
+//////////////////////////////////////////////////
+// Draw funtions
+//////////////////////////////////////////////////
+
+float	iscachedpic(string name)	= #451;
+string	precache_pic(string name)	= #452;
+void	freepic(string name)		= #453;
+
+float	drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
+
+float	drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
+
+float	drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
+
+float	drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
+
+void	drawsetcliparea(float x, float y, float width, float height) = #458;
+
+void	drawresetcliparea(void) = #459;
+
+vector  drawgetimagesize(string pic) = #460;
+
+float	cin_open(string file, string name) 	= #461;
+void	cin_close(string name) 			= #462;
+void	cin_setstate(string name, float type) 	= #463;
+float	cin_getstate(string name)		= #464;
+
+////////////////////////////////////////////////
+// Menu functions
+////////////////////////////////////////////////
+
+void	setkeydest(float dest) 	= #601;
+float	getkeydest(void)	= #602;
+
+void	setmousetarget(float trg) = #603;
+float	getmousetarget(void)	  = #604;
+
+float	isfunction(string function_name) = #607;
+void	callfunction(...) = #605;
+void	writetofile(float fhandle, entity ent) = #606;
+vector	getresolution(float number) = #608;
+string	keynumtostring(float keynum) = #609;
+string	findkeysforcommand(string command) = #610;
+
+float	gethostcachevalue(float type) = #611;
+string	gethostcachestring(float type, float hostnr) = #612;
+
+void 	parseentitydata(entity ent, string data) = #613;
+
+float	stringtokeynum(string key) = #614;
+
+void 	resethostcachemasks(void) = #615;
+void 	sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
+void	sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
+void 	resorthostcache(void) = #618;
+void	sethostcachesort(float fld, float descending) = #619;
+void	refreshhostcache(void) = #620;
+float	gethostcachenumber(float fld, float hostnr) = #621;
+float	gethostcacheindexforkey(string key) = #622;
+void	addwantedhostcachekey(string key) = #623;
+
+#ifdef FIXEDFOPEN
+float 	fopen( string filename, float mode ) =
+{
+	local float handle;
+	if( mode == FILE_READ ) {
+		return _fopen( filename, mode );
+	}
+
+	// check for data/
+	filename = strzone( filename );
+	if( substring( filename, 0, 5 ) != "data/" ) {
+		print( "menu: fopen: all output must go into data/!\n" );
+		return -1;
+	}
+	handle = _fopen( substring( filename, 5, 10000 ), mode );
+	strunzone( filename );
+	return handle;
+};
+#endif


Property changes on: trunk/basezym/menuqc/mbuiltin.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/menu.qc
===================================================================
--- trunk/basezym/menuqc/menu.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/menu.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,151 +1,151 @@
-///////////////////////////////////////////////
-// Menu Source File
-///////////////////////
-// This file belongs to dpmod/darkplaces
-// AK contains all menu functions (especially the required ones)
-///////////////////////////////////////////////
-
-void() m_updategamestate =
-{
-	// update isserver and clientstate
-	gamestatus = 0;
-	if( isserver() )
-		gamestatus = gamestatus | GAME_ISSERVER;
-	if( clientstate() == CS_CONNECTED )
-		gamestatus = gamestatus | GAME_CONNECTED;
-	if( cvar("developer") )
-		gamestatus = gamestatus | GAME_DEVELOPER;
-};
-
-void() m_init =
-{
-	// init graphic
-	Gfx_Init();
-
-	// init cursor
-	Cursor_Init();
-
-	Key_Init();
-
-	HostCache_Init();
-
-	// init menu
-	Menu_Init();
-};
-
-// required menu functions
-void( float pKey, float pAscii ) m_keydown =
-{
-	if( !Menu_Active )
-		return;
-
-	// actually the menu is the only system that needs to react on key events
-	Menu_Key( pKey, pAscii );
-};
-
-void() m_frame =
-{
-	Timer_Update();
-
-	HostCache_Update();
-
-	Key_Update();
-
-	// graphic frame
-	Gfx_Update();
-
-	// cursor frame
-	Cursor_Update();
-
-	// menu frame
-	Menu_Frame();
-};
-
-void() m_draw =
-{
-	m_updategamestate();
-
-
-	if( !Menu_Active ) {
-		// test whether we want to force it to be displayed
-		if( !(gamestatus & GAME_CONNECTED) && !(gamestatus & GAME_DEVELOPER) ) {
-			m_display();
-		}
-		else {
-			return;
-		}
-	}
-
-	// call m_frame cause draw is the only menu function called once per frame
-	m_frame();
-
-	// now the drawing code
-	Menu_Draw();
-
-	// draw the cursor on top of the menu
-	Cursor_Draw();
-
-	// and now the gfx drawing code (for special fx)
-	Gfx_Draw();
-};
-
-void() m_display =
-{
-	Menu_Active = true;
-
-	m_updategamestate();
-
-	// let also the snd and gfx know (perhaps for sfx)
-	Gfx_Display();
-	Cursor_Display();
-	Key_Display();
-
-	// let the menu manager know
-	Menu_PerformReinit();
-};
-
-void() m_hide =
-{
-	Gfx_Hide();
-	Cursor_Hide();
-	Key_Hide();
-
-	// let the menu manager know
-	Menu_Hide();
-
-	Menu_Active = false;
-};
-
-void() m_toggle =
-{
-	Timer_Update();
-
-	if( Menu_Active )
-		m_hide();
-	else
-		m_display();
-};
-
-void() m_shutdown =
-{
-	Timer_Update();
-
-	// shutdown menu
-	Menu_Shutdown();
-
-	// shutdown timer
-	Timer_Quit();
-
-	// shutdown key system
-	Key_Quit();
-
-	// shutdown cursor
-	Cursor_Quit();
-
-	// shutdown graphic
-	Gfx_Quit();
-
-	// make sure everything is reset
-	setkeydest( KEY_GAME );
-	setmousetarget( MT_CLIENT );
+///////////////////////////////////////////////
+// Menu Source File
+///////////////////////
+// This file belongs to dpmod/darkplaces
+// AK contains all menu functions (especially the required ones)
+///////////////////////////////////////////////
+
+void() m_updategamestate =
+{
+	// update isserver and clientstate
+	gamestatus = 0;
+	if( isserver() )
+		gamestatus = gamestatus | GAME_ISSERVER;
+	if( clientstate() == CS_CONNECTED )
+		gamestatus = gamestatus | GAME_CONNECTED;
+	if( cvar("developer") )
+		gamestatus = gamestatus | GAME_DEVELOPER;
+};
+
+void() m_init =
+{
+	// init graphic
+	Gfx_Init();
+
+	// init cursor
+	Cursor_Init();
+
+	Key_Init();
+
+	HostCache_Init();
+
+	// init menu
+	Menu_Init();
+};
+
+// required menu functions
+void( float pKey, float pAscii ) m_keydown =
+{
+	if( !Menu_Active )
+		return;
+
+	// actually the menu is the only system that needs to react on key events
+	Menu_Key( pKey, pAscii );
+};
+
+void() m_frame =
+{
+	Timer_Update();
+
+	HostCache_Update();
+
+	Key_Update();
+
+	// graphic frame
+	Gfx_Update();
+
+	// cursor frame
+	Cursor_Update();
+
+	// menu frame
+	Menu_Frame();
+};
+
+void() m_draw =
+{
+	m_updategamestate();
+
+
+	if( !Menu_Active ) {
+		// test whether we want to force it to be displayed
+		if( !(gamestatus & GAME_CONNECTED) && !(gamestatus & GAME_DEVELOPER) ) {
+			m_display();
+		}
+		else {
+			return;
+		}
+	}
+
+	// call m_frame cause draw is the only menu function called once per frame
+	m_frame();
+
+	// now the drawing code
+	Menu_Draw();
+
+	// draw the cursor on top of the menu
+	Cursor_Draw();
+
+	// and now the gfx drawing code (for special fx)
+	Gfx_Draw();
+};
+
+void() m_display =
+{
+	Menu_Active = true;
+
+	m_updategamestate();
+
+	// let also the snd and gfx know (perhaps for sfx)
+	Gfx_Display();
+	Cursor_Display();
+	Key_Display();
+
+	// let the menu manager know
+	Menu_PerformReinit();
+};
+
+void() m_hide =
+{
+	Gfx_Hide();
+	Cursor_Hide();
+	Key_Hide();
+
+	// let the menu manager know
+	Menu_Hide();
+
+	Menu_Active = false;
+};
+
+void() m_toggle =
+{
+	Timer_Update();
+
+	if( Menu_Active )
+		m_hide();
+	else
+		m_display();
+};
+
+void() m_shutdown =
+{
+	Timer_Update();
+
+	// shutdown menu
+	Menu_Shutdown();
+
+	// shutdown timer
+	Timer_Quit();
+
+	// shutdown key system
+	Key_Quit();
+
+	// shutdown cursor
+	Cursor_Quit();
+
+	// shutdown graphic
+	Gfx_Quit();
+
+	// make sure everything is reset
+	setkeydest( KEY_GAME );
+	setmousetarget( MT_CLIENT );
 };
\ No newline at end of file


Property changes on: trunk/basezym/menuqc/menu.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/menu.qh
===================================================================
--- trunk/basezym/menuqc/menu.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/menu.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,35 +1,35 @@
-///////////////////////////////////////////////
-// Menu Header File
-///////////////////////
-// This file belongs to dpmod/darkplaces
-// AK contains all common constants, etc.
-///////////////////////////////////////////////
-// constants
-
-const float GAME_ISSERVER 	= 1;
-const float GAME_CONNECTED	= 2;
-const float GAME_DEVELOPER	= 4;
-
-const float INFINITY  = 10000000.0;
-
-// prototypes
-
-typedef float bool;
-
-// global vars
-
-//float time; 		// important for animations, etc.
-bool Menu_Active;	// is set when the menu is active
-
-// updated every time toggle is called
-float gamestatus;
-
-//#define USEFUNCTIONS
-//#define UTILALTSTRING
-
-#define AVOIDSTRZONES
-
-// get rid of __NULL__ sets again!
-
-#pragma keyword enable ifstring
-#pragma keyword enable lo
+///////////////////////////////////////////////
+// Menu Header File
+///////////////////////
+// This file belongs to dpmod/darkplaces
+// AK contains all common constants, etc.
+///////////////////////////////////////////////
+// constants
+
+const float GAME_ISSERVER 	= 1;
+const float GAME_CONNECTED	= 2;
+const float GAME_DEVELOPER	= 4;
+
+const float INFINITY  = 10000000.0;
+
+// prototypes
+
+typedef float bool;
+
+// global vars
+
+//float time; 		// important for animations, etc.
+bool Menu_Active;	// is set when the menu is active
+
+// updated every time toggle is called
+float gamestatus;
+
+//#define USEFUNCTIONS
+//#define UTILALTSTRING
+
+#define AVOIDSTRZONES
+
+// get rid of __NULL__ sets again!
+
+#pragma keyword enable ifstring
+#pragma keyword enable lo


Property changes on: trunk/basezym/menuqc/menu.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/msys.qc
===================================================================
--- trunk/basezym/menuqc/msys.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/msys.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,278 +1,278 @@
-//////////////////////////////////////////////////////////
-// sys globals
-
-entity self;
-
-/////////////////////////////////////////////////////////
-void		end_sys_globals;
-/////////////////////////////////////////////////////////
-// sys fields
-
-/////////////////////////////////////////////////////////
-void		end_sys_fields;
-/////////////////////////////////////////////////////////
-// sys functions
-
-void() m_init;
-void(float keynr, float ascii) m_keydown;
-void() m_draw;
-void() m_display; 	// old NG Menu
-void() m_toggle;
-void() m_hide;		// old NG Menu
-void() m_shutdown;
-
-/////////////////////////////////////////////////////////
-// sys constants
-///////////////////////////
-// key constants
-
-//
-// these are the key numbers that should be passed to Key_Event
-//
-float K_TAB			=	9;
-float K_ENTER		=	13;
-float K_ESCAPE		=	27;
-float K_SPACE		=	32;
-
-// normal keys should be passed as lowercased ascii
-
-float K_BACKSPACE	=	127;
-float K_UPARROW		=	128;
-float K_DOWNARROW	=	129;
-float K_LEFTARROW	=	130;
-float K_RIGHTARROW	=	131;
-
-float K_ALT		=	132;
-float K_CTRL	=	133;
-float K_SHIFT	=	134;
-float K_F1		=	135;
-float K_F2		=	136;
-float K_F3		=	137;
-float K_F4		=	138;
-float K_F5		=	139;
-float K_F6		=	140;
-float K_F7		=	141;
-float K_F8		=	142;
-float K_F9		=	143;
-float K_F10		=	144;
-float K_F11		=	145;
-float K_F12		=	146;
-float K_INS		=	147;
-float K_DEL		=	148;
-float K_PGDN	=	149;
-float K_PGUP	=	150;
-float K_HOME	=	151;
-float K_END		=	152;
-
-float K_KP_HOME			=	160;
-float K_KP_UPARROW		=	161;
-float K_KP_PGUP			=	162;
-float K_KP_LEFTARROW	=	163;
-float K_KP_5			=	164;
-float K_KP_RIGHTARROW	=	165;
-float K_KP_END			=	166;
-float K_KP_DOWNARROW	=	167;
-float K_KP_PGDN			=	168;
-float K_KP_ENTER		=	169;
-float K_KP_INS   		=	170;
-float K_KP_DEL			=	171;
-float K_KP_SLASH		=	172;
-float K_KP_MINUS		=	173;
-float K_KP_PLUS			=	174;
-
-float K_PAUSE		=	255;
-
-//
-// joystick buttons
-//
-float K_JOY1		=	768;
-float K_JOY2		=	769;
-float K_JOY3		=	770;
-float K_JOY4		=	771;
-
-//
-// aux keys are for multi-buttoned joysticks to generate so they can use
-// the normal binding process
-//
-float K_AUX1		=	772;
-float K_AUX2		=	773;
-float K_AUX3		=	774;
-float K_AUX4		=	775;
-float K_AUX5		=	776;
-float K_AUX6		=	777;
-float K_AUX7		=	778;
-float K_AUX8		=	779;
-float K_AUX9		=	780;
-float K_AUX10		=	781;
-float K_AUX11		=	782;
-float K_AUX12		=	783;
-float K_AUX13		=	784;
-float K_AUX14		=	785;
-float K_AUX15		=	786;
-float K_AUX16		=	787;
-float K_AUX17		=	788;
-float K_AUX18		=	789;
-float K_AUX19		=	790;
-float K_AUX20		=	791;
-float K_AUX21		=	792;
-float K_AUX22		=	793;
-float K_AUX23		=	794;
-float K_AUX24		=	795;
-float K_AUX25		=	796;
-float K_AUX26		=	797;
-float K_AUX27		=	798;
-float K_AUX28		=	799;
-float K_AUX29		=	800;
-float K_AUX30		=	801;
-float K_AUX31		=	802;
-float K_AUX32		=	803;
-
-//
-// mouse buttons generate virtual keys
-//
-float K_MOUSE1		=	512;
-float K_MOUSE2		=	513;
-float K_MOUSE3		=	514;
-float K_MOUSE4		=	515;
-float K_MOUSE5		=	516;
-float K_MOUSE6		=	517;
-float K_MOUSE7		=	518;
-float K_MOUSE8		=	519;
-float K_MOUSE9		=	520;
-float K_MOUSE10		=	521;
-
-float K_MWHEELDOWN	=	K_MOUSE4;
-float K_MWHEELUP	=	K_MOUSE5;
-
-///////////////////////////
-// key dest constants
-
-float KEY_GAME 		=	0;
-float KEY_MENU		=	2;
-float KEY_UNKNOWN	= 	3;
-
-///////////////////////////
-// file constants
-
-float FILE_READ = 0;
-float FILE_APPEND = 1;
-float FILE_WRITE = 2;
-
-///////////////////////////
-// logical constants (just for completeness)
-
-float TRUE 	= 1;
-float FALSE = 0;
-
-///////////////////////////
-// boolean constants
-
-float true  = 1;
-float false = 0;
-
-///////////////////////////
-// msg constants
-
-float MSG_BROADCAST		= 0;		// unreliable to all
-float MSG_ONE			= 1;		// reliable to one (msg_entity)
-float MSG_ALL			= 2;		// reliable to all
-float MSG_INIT			= 3;		// write to the init string
-
-/////////////////////////////
-// mouse target constants
-
-float MT_MENU = 1;
-float MT_CLIENT = 2;
-
-/////////////////////////
-// client state constants
-
-float CS_DEDICATED 		= 0;
-float CS_DISCONNECTED 	= 1;
-float CS_CONNECTED		= 2;
-
-///////////////////////////
-// blend flags
-
-float DRAWFLAG_NORMAL		= 0;
-float DRAWFLAG_ADDITIVE 	= 1;
-float DRAWFLAG_MODULATE 	= 2;
-float DRAWFLAG_2XMODULATE   = 3;
-
-
-///////////////////////////
-// cvar constants
-
-float CVAR_SAVE 	= 1;
-float CVAR_NOTIFY 	= 2;
-float CVAR_READONLY	= 4;
-
-///////////////////////////
-// server list constants
-
-float SLIST_HOSTCACHEVIEWCOUNT  = 0;
-float SLIST_HOSTCACHETOTALCOUNT = 1;
-float SLIST_MASTERQUERYCOUNT 	= 2;
-float SLIST_MASTERREPLYCOUNT 	= 3;
-float SLIST_SERVERQUERYCOUNT 	= 4;
-float SLIST_SERVERREPLYCOUNT 	= 5;
-float SLIST_SORTFIELD		= 6;
-float SLIST_SORTDESCENDING	= 7;
-
-float SLIST_LEGACY_LINE1 	= 1024;
-float SLIST_LEGACY_LINE2 	= 1025;
-
-float SLIST_TEST_CONTAINS	= 0;
-float SLIST_TEST_NOTCONTAIN	= 1;
-float SLIST_TEST_LESSEQUAL	= 2;
-float SLIST_TEST_LESS		= 3;
-float SLIST_TEST_EQUAL		= 4;
-float SLIST_TEST_GREATER	= 5;
-float SLIST_TEST_GREATEREQUAL	= 6;
-float SLIST_TEST_NOTEQUAL	= 7;
-
-float SLIST_MASK_AND = 0;
-float SLIST_MASK_OR  = 512;
-
-float NET_CURRENTPROTOCOL = 3;
-
-////////////////////////////////
-// cinematic action constants
-
-float CINE_PLAY 	= 1;
-float CINE_LOOP 	= 2;
-float CINE_PAUSE 	= 3;
-float CINE_FIRSTFRAME 	= 4;
-float CINE_RESETONWAKEUP= 5;
-
-///////////////////////////
-// null entity (actually it is the same like the world entity)
-
-entity null_entity;
-
-///////////////////////////
-// error constants
-
-// file handling
-float ERR_CANNOTOPEN			= -1; // fopen
-float ERR_NOTENOUGHFILEHANDLES 	= -2; // fopen
-float ERR_INVALIDMODE 			= -3; // fopen
-float ERR_BADFILENAME 			= -4; // fopen
-
-// drawing functions
-
-float ERR_NULLSTRING			= -1;
-float ERR_BADDRAWFLAG			= -2;
-float ERR_BADSCALE			= -3;
-float ERR_BADSIZE			= ERR_BADSCALE;
-float ERR_NOTCACHED			= -4;
-
-/* not supported at the moment
-///////////////////////////
-// os constants
-
-float OS_WINDOWS	= 0;
-float OS_LINUX		= 1;
-float OS_MAC		= 2;
-*/
-
+//////////////////////////////////////////////////////////
+// sys globals
+
+entity self;
+
+/////////////////////////////////////////////////////////
+void		end_sys_globals;
+/////////////////////////////////////////////////////////
+// sys fields
+
+/////////////////////////////////////////////////////////
+void		end_sys_fields;
+/////////////////////////////////////////////////////////
+// sys functions
+
+void() m_init;
+void(float keynr, float ascii) m_keydown;
+void() m_draw;
+void() m_display; 	// old NG Menu
+void() m_toggle;
+void() m_hide;		// old NG Menu
+void() m_shutdown;
+
+/////////////////////////////////////////////////////////
+// sys constants
+///////////////////////////
+// key constants
+
+//
+// these are the key numbers that should be passed to Key_Event
+//
+float K_TAB			=	9;
+float K_ENTER		=	13;
+float K_ESCAPE		=	27;
+float K_SPACE		=	32;
+
+// normal keys should be passed as lowercased ascii
+
+float K_BACKSPACE	=	127;
+float K_UPARROW		=	128;
+float K_DOWNARROW	=	129;
+float K_LEFTARROW	=	130;
+float K_RIGHTARROW	=	131;
+
+float K_ALT		=	132;
+float K_CTRL	=	133;
+float K_SHIFT	=	134;
+float K_F1		=	135;
+float K_F2		=	136;
+float K_F3		=	137;
+float K_F4		=	138;
+float K_F5		=	139;
+float K_F6		=	140;
+float K_F7		=	141;
+float K_F8		=	142;
+float K_F9		=	143;
+float K_F10		=	144;
+float K_F11		=	145;
+float K_F12		=	146;
+float K_INS		=	147;
+float K_DEL		=	148;
+float K_PGDN	=	149;
+float K_PGUP	=	150;
+float K_HOME	=	151;
+float K_END		=	152;
+
+float K_KP_HOME			=	160;
+float K_KP_UPARROW		=	161;
+float K_KP_PGUP			=	162;
+float K_KP_LEFTARROW	=	163;
+float K_KP_5			=	164;
+float K_KP_RIGHTARROW	=	165;
+float K_KP_END			=	166;
+float K_KP_DOWNARROW	=	167;
+float K_KP_PGDN			=	168;
+float K_KP_ENTER		=	169;
+float K_KP_INS   		=	170;
+float K_KP_DEL			=	171;
+float K_KP_SLASH		=	172;
+float K_KP_MINUS		=	173;
+float K_KP_PLUS			=	174;
+
+float K_PAUSE		=	255;
+
+//
+// joystick buttons
+//
+float K_JOY1		=	768;
+float K_JOY2		=	769;
+float K_JOY3		=	770;
+float K_JOY4		=	771;
+
+//
+// aux keys are for multi-buttoned joysticks to generate so they can use
+// the normal binding process
+//
+float K_AUX1		=	772;
+float K_AUX2		=	773;
+float K_AUX3		=	774;
+float K_AUX4		=	775;
+float K_AUX5		=	776;
+float K_AUX6		=	777;
+float K_AUX7		=	778;
+float K_AUX8		=	779;
+float K_AUX9		=	780;
+float K_AUX10		=	781;
+float K_AUX11		=	782;
+float K_AUX12		=	783;
+float K_AUX13		=	784;
+float K_AUX14		=	785;
+float K_AUX15		=	786;
+float K_AUX16		=	787;
+float K_AUX17		=	788;
+float K_AUX18		=	789;
+float K_AUX19		=	790;
+float K_AUX20		=	791;
+float K_AUX21		=	792;
+float K_AUX22		=	793;
+float K_AUX23		=	794;
+float K_AUX24		=	795;
+float K_AUX25		=	796;
+float K_AUX26		=	797;
+float K_AUX27		=	798;
+float K_AUX28		=	799;
+float K_AUX29		=	800;
+float K_AUX30		=	801;
+float K_AUX31		=	802;
+float K_AUX32		=	803;
+
+//
+// mouse buttons generate virtual keys
+//
+float K_MOUSE1		=	512;
+float K_MOUSE2		=	513;
+float K_MOUSE3		=	514;
+float K_MOUSE4		=	515;
+float K_MOUSE5		=	516;
+float K_MOUSE6		=	517;
+float K_MOUSE7		=	518;
+float K_MOUSE8		=	519;
+float K_MOUSE9		=	520;
+float K_MOUSE10		=	521;
+
+float K_MWHEELDOWN	=	K_MOUSE4;
+float K_MWHEELUP	=	K_MOUSE5;
+
+///////////////////////////
+// key dest constants
+
+float KEY_GAME 		=	0;
+float KEY_MENU		=	2;
+float KEY_UNKNOWN	= 	3;
+
+///////////////////////////
+// file constants
+
+float FILE_READ = 0;
+float FILE_APPEND = 1;
+float FILE_WRITE = 2;
+
+///////////////////////////
+// logical constants (just for completeness)
+
+float TRUE 	= 1;
+float FALSE = 0;
+
+///////////////////////////
+// boolean constants
+
+float true  = 1;
+float false = 0;
+
+///////////////////////////
+// msg constants
+
+float MSG_BROADCAST		= 0;		// unreliable to all
+float MSG_ONE			= 1;		// reliable to one (msg_entity)
+float MSG_ALL			= 2;		// reliable to all
+float MSG_INIT			= 3;		// write to the init string
+
+/////////////////////////////
+// mouse target constants
+
+float MT_MENU = 1;
+float MT_CLIENT = 2;
+
+/////////////////////////
+// client state constants
+
+float CS_DEDICATED 		= 0;
+float CS_DISCONNECTED 	= 1;
+float CS_CONNECTED		= 2;
+
+///////////////////////////
+// blend flags
+
+float DRAWFLAG_NORMAL		= 0;
+float DRAWFLAG_ADDITIVE 	= 1;
+float DRAWFLAG_MODULATE 	= 2;
+float DRAWFLAG_2XMODULATE   = 3;
+
+
+///////////////////////////
+// cvar constants
+
+float CVAR_SAVE 	= 1;
+float CVAR_NOTIFY 	= 2;
+float CVAR_READONLY	= 4;
+
+///////////////////////////
+// server list constants
+
+float SLIST_HOSTCACHEVIEWCOUNT  = 0;
+float SLIST_HOSTCACHETOTALCOUNT = 1;
+float SLIST_MASTERQUERYCOUNT 	= 2;
+float SLIST_MASTERREPLYCOUNT 	= 3;
+float SLIST_SERVERQUERYCOUNT 	= 4;
+float SLIST_SERVERREPLYCOUNT 	= 5;
+float SLIST_SORTFIELD		= 6;
+float SLIST_SORTDESCENDING	= 7;
+
+float SLIST_LEGACY_LINE1 	= 1024;
+float SLIST_LEGACY_LINE2 	= 1025;
+
+float SLIST_TEST_CONTAINS	= 0;
+float SLIST_TEST_NOTCONTAIN	= 1;
+float SLIST_TEST_LESSEQUAL	= 2;
+float SLIST_TEST_LESS		= 3;
+float SLIST_TEST_EQUAL		= 4;
+float SLIST_TEST_GREATER	= 5;
+float SLIST_TEST_GREATEREQUAL	= 6;
+float SLIST_TEST_NOTEQUAL	= 7;
+
+float SLIST_MASK_AND = 0;
+float SLIST_MASK_OR  = 512;
+
+float NET_CURRENTPROTOCOL = 3;
+
+////////////////////////////////
+// cinematic action constants
+
+float CINE_PLAY 	= 1;
+float CINE_LOOP 	= 2;
+float CINE_PAUSE 	= 3;
+float CINE_FIRSTFRAME 	= 4;
+float CINE_RESETONWAKEUP= 5;
+
+///////////////////////////
+// null entity (actually it is the same like the world entity)
+
+entity null_entity;
+
+///////////////////////////
+// error constants
+
+// file handling
+float ERR_CANNOTOPEN			= -1; // fopen
+float ERR_NOTENOUGHFILEHANDLES 	= -2; // fopen
+float ERR_INVALIDMODE 			= -3; // fopen
+float ERR_BADFILENAME 			= -4; // fopen
+
+// drawing functions
+
+float ERR_NULLSTRING			= -1;
+float ERR_BADDRAWFLAG			= -2;
+float ERR_BADSCALE			= -3;
+float ERR_BADSIZE			= ERR_BADSCALE;
+float ERR_NOTCACHED			= -4;
+
+/* not supported at the moment
+///////////////////////////
+// os constants
+
+float OS_WINDOWS	= 0;
+float OS_LINUX		= 1;
+float OS_MAC		= 2;
+*/
+


Property changes on: trunk/basezym/menuqc/msys.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/progs.src
===================================================================
--- trunk/basezym/menuqc/progs.src	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/progs.src	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,180 +1,180 @@
-///////////////////////////////////////////////
-// Progs file
-///////////////////////
-// This file belongs to dpmod/darkplaces
-// AK contains all file names which should be included into menu.dat
-// this is absolutly beta
-///////////////////////////////////////////////
-// menu.dat destination path
-../menu.dat
-
-// these are the default qc header files
-msys.qc
-mbuiltin.qc
-
-////////////////////////////
-// dpmod-specific menu files
-///
-
-// Header Files
-
-menu.qh
-
-// util functions
-util/util.qh
-util/altstring.qh
-util/rect.qh
-util/string.qh
-util/text.qh
-util/uid.qh
-util/property.qh
-
-// base system
-base/timer.qh
-base/gfx.qh
-base/snd.qh
-base/cursor.qh
-base/key.qh
-base/hostcache.qh
-
-// main system
-system/parser.qh
-system/debug.qh
-system/isframe.qh
-system/mgfx.qh
-system/item.qh
-system/structure.qh
-system/events.qh
-system/history.qh
-system/gc.qh
-
-// controls
-control/items.qh
-control/constants.qh
-control/data/data.qh
-control/window/windows.qh
-control/visual/visual.qh
-control/automation/automation.qh
-//control/fx/fx.qh
-
-// custom (game specific)
-custom/custom.qh
-custom/player/player.qh
-custom/creategame/creategame.qh
-custom/joingame.qh
-custom/key.qh
-custom/video.qh
-custom/credits.qh
-custom/messagebox.qh
-
-// Source Files
-
-// custom (game specific)
-custom/quit.qm
-custom/option.qm
-custom/globalkey.qm
-custom/stresstest.qm
-custom/visible.qm
-custom/color.qm
-custom/player.qm
-custom/util.qm
-custom/creategame.qm
-custom/key.qm
-custom/video.qm
-custom/joingame.qm
-custom/credits.qm
-
-custom/player/avatar.qc
-custom/player/name.qc
-custom/player/color.qc
-
-custom/creategame/maps.qc
-custom/creategame/mods.qc
-custom/creategame/filelist.qc
-
-custom/visible.qc
-custom/key.qc
-custom/video.qc
-custom/joingame.qc
-custom/credits.qc
-custom/messagebox.qc
-
-// controls
-control/automation/automation.qc
-control/automation/foreach.qc
-control/automation/job.qc
-
-control/data/base.qc
-control/data/container.qc
-control/data/cvar.qc
-control/data/text.qc
-control/data/value.qc
-control/data/textswitch.qc
-control/data/valueswitch.qc
-control/data/fastresync.qc
-control/data/textvalue.qc
-control/data/texttime.qc
-control/data/altstring.qc
-control/data/router.qc
-
-control/window/window.qc
-control/window/reference.qc
-control/window/layout.qc
-control/window/arrangement.qc
-control/window/scroll.qc
-control/window/eventwindow.qc
-control/window/frame.qc
-
-control/visual/list.qc
-control/visual/button.qc
-control/visual/editbox.qc
-control/visual/label.qc
-control/visual/multilabel.qc
-control/visual/picture.qc
-control/visual/rect.qc
-control/visual/slider.qc
-control/visual/valuebutton.qc
-control/visual/floating.qc
-control/visual/switchbutton.qc
-control/visual/scrollbar.qc
-
-//control/fx/vector.qc
-//control/fx/float.qc
-//control/fx/interpol.qc
-
-control/cinematic.qc
-control/container.qc
-control/custom.qc
-control/link.qc
-
-// main system
-system/history.qc
-system/events.qc
-//system/events_.qc
-system/event_helper.qc
-system/structure.qc
-system/mgfx.qc
-system/isframe.qc
-system/debug.qc
-system/parser.qc
-system/gc.qc
-
-// base systems
-base/key.qc
-base/cursor.qc
-base/snd.qc
-base/gfx.qc
-base/timer.qc
-base/hostcache.qc
-
-// util functions
-util/property.qc
-util/text.qc
-util/uid.qc
-util/string.qc
-util/rect.qc
-util/altstring.qc
-util/nfunction.qc
-
-menu.qc
-
+///////////////////////////////////////////////
+// Progs file
+///////////////////////
+// This file belongs to dpmod/darkplaces
+// AK contains all file names which should be included into menu.dat
+// this is absolutly beta
+///////////////////////////////////////////////
+// menu.dat destination path
+../menu.dat
+
+// these are the default qc header files
+msys.qc
+mbuiltin.qc
+
+////////////////////////////
+// dpmod-specific menu files
+///
+
+// Header Files
+
+menu.qh
+
+// util functions
+util/util.qh
+util/altstring.qh
+util/rect.qh
+util/string.qh
+util/text.qh
+util/uid.qh
+util/property.qh
+
+// base system
+base/timer.qh
+base/gfx.qh
+base/snd.qh
+base/cursor.qh
+base/key.qh
+base/hostcache.qh
+
+// main system
+system/parser.qh
+system/debug.qh
+system/isframe.qh
+system/mgfx.qh
+system/item.qh
+system/structure.qh
+system/events.qh
+system/history.qh
+system/gc.qh
+
+// controls
+control/items.qh
+control/constants.qh
+control/data/data.qh
+control/window/windows.qh
+control/visual/visual.qh
+control/automation/automation.qh
+//control/fx/fx.qh
+
+// custom (game specific)
+custom/custom.qh
+custom/player/player.qh
+custom/creategame/creategame.qh
+custom/joingame.qh
+custom/key.qh
+custom/video.qh
+custom/credits.qh
+custom/messagebox.qh
+
+// Source Files
+
+// custom (game specific)
+custom/quit.qm
+custom/option.qm
+custom/globalkey.qm
+custom/stresstest.qm
+custom/visible.qm
+custom/color.qm
+custom/player.qm
+custom/util.qm
+custom/creategame.qm
+custom/key.qm
+custom/video.qm
+custom/joingame.qm
+custom/credits.qm
+
+custom/player/avatar.qc
+custom/player/name.qc
+custom/player/color.qc
+
+custom/creategame/maps.qc
+custom/creategame/mods.qc
+custom/creategame/filelist.qc
+
+custom/visible.qc
+custom/key.qc
+custom/video.qc
+custom/joingame.qc
+custom/credits.qc
+custom/messagebox.qc
+
+// controls
+control/automation/automation.qc
+control/automation/foreach.qc
+control/automation/job.qc
+
+control/data/base.qc
+control/data/container.qc
+control/data/cvar.qc
+control/data/text.qc
+control/data/value.qc
+control/data/textswitch.qc
+control/data/valueswitch.qc
+control/data/fastresync.qc
+control/data/textvalue.qc
+control/data/texttime.qc
+control/data/altstring.qc
+control/data/router.qc
+
+control/window/window.qc
+control/window/reference.qc
+control/window/layout.qc
+control/window/arrangement.qc
+control/window/scroll.qc
+control/window/eventwindow.qc
+control/window/frame.qc
+
+control/visual/list.qc
+control/visual/button.qc
+control/visual/editbox.qc
+control/visual/label.qc
+control/visual/multilabel.qc
+control/visual/picture.qc
+control/visual/rect.qc
+control/visual/slider.qc
+control/visual/valuebutton.qc
+control/visual/floating.qc
+control/visual/switchbutton.qc
+control/visual/scrollbar.qc
+
+//control/fx/vector.qc
+//control/fx/float.qc
+//control/fx/interpol.qc
+
+control/cinematic.qc
+control/container.qc
+control/custom.qc
+control/link.qc
+
+// main system
+system/history.qc
+system/events.qc
+//system/events_.qc
+system/event_helper.qc
+system/structure.qc
+system/mgfx.qc
+system/isframe.qc
+system/debug.qc
+system/parser.qc
+system/gc.qc
+
+// base systems
+base/key.qc
+base/cursor.qc
+base/snd.qc
+base/gfx.qc
+base/timer.qc
+base/hostcache.qc
+
+// util functions
+util/property.qc
+util/text.qc
+util/uid.qc
+util/string.qc
+util/rect.qc
+util/altstring.qc
+util/nfunction.qc
+
+menu.qc
+


Property changes on: trunk/basezym/menuqc/progs.src
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/debug.qc
===================================================================
--- trunk/basezym/menuqc/system/debug.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/debug.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,179 +1,179 @@
-// SCMenu
-// system/debug.qc
-
-
-/*
-===================
-Sys_Debug_Init
-===================
-*/
-void() Sys_Debug_Init =
-{
-	registercvar( SYSTEM_CVAR_VERSION_BUILDDATE, "", CVAR_READONLY );
-	cvar_set( SYSTEM_CVAR_VERSION_BUILDDATE, SYSTEM_CVAR_VERSION_BUILDDATE_VALUE );
-	registercvar( SYSTEM_CVAR_VERSION_BUILDTIME, "", CVAR_READONLY );
-	cvar_set( SYSTEM_CVAR_VERSION_BUILDTIME, SYSTEM_CVAR_VERSION_BUILDTIME_VALUE );
-	registercvar( SYSTEM_CVAR_VERSION, "", CVAR_READONLY );
-	cvar_set( SYSTEM_CVAR_VERSION, SYSTEM_CVAR_VERSION_VALUE );
-
-	registercvar( SYSTEM_CVAR_DEBUG, ftos( SYSTEM_CVAR_DEBUG_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_REF, ftos( SYSTEM_CVAR_DEBUG_REF_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_RUNFLAG, ftos( SYSTEM_CVAR_DEBUG_RUNFLAG_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_PROCESS, ftos( SYSTEM_CVAR_DEBUG_PROCESS_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_MGFX, ftos( SYSTEM_CVAR_DEBUG_MGFX_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_STRUCTURE, ftos( SYSTEM_CVAR_DEBUG_STRUCTURE_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_PARSER, SYSTEM_CVAR_DEBUG_PARSER_DEFAULT, 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_PROCESS_FILTER, SYSTEM_CVAR_DEBUG_PROCESS_FILTER_DEFAULT, 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_SOUND, ftos( SYSTEM_CVAR_DEBUG_SOUND_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_DUMP_NAMES, "0", 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_AREA, ftos( SYSTEM_CVAR_DEBUG_AREA_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_STEP, ftos( SYSTEM_CVAR_DEBUG_STEP_DEFAULT ), 0 );
-	registercvar( SYSTEM_CVAR_DEBUG_MOUSE, ftos( SYSTEM_CVAR_DEBUG_MOUSE_DEFAULT ), 0 );
-};
-
-/*
-===================
-Sys_Debug_Frame
-===================
-*/
-void() Sys_Debug_Frame =
-{
-	local float lTemp1, lTemp2, lStep;
-	sys_debug = cvar( SYSTEM_CVAR_DEBUG );
-	if( sys_debug ) {
-		sys_debug_ref = cvar( SYSTEM_CVAR_DEBUG_REF );
-
-		sys_debug_area = cvar( SYSTEM_CVAR_DEBUG_AREA );
-
-		sys_debug_sound = cvar( SYSTEM_CVAR_DEBUG_SOUND );
-
-		sys_debug_structure = cvar( SYSTEM_CVAR_DEBUG_STRUCTURE );
-
-		sys_debug_mouse = cvar( SYSTEM_CVAR_DEBUG_MOUSE );
-
-		lStep = cvar( SYSTEM_CVAR_DEBUG_STEP );
-		if( lStep == 1 ) {
-			sys_debug_halt = true;
-		} else if( lStep == 2 ) {
-			sys_debug_halt = false;
-			cvar_set( SYSTEM_CVAR_DEBUG_STEP, "1" );
-
-			print( "Menu: -- Step: Time:", ftos( gettime() ), "\n" );
-		} else {
-			sys_debug_halt = false;
-		}
-
-		sys_debug_runflag = cvar( SYSTEM_CVAR_DEBUG_RUNFLAG );
-		// FIXME: evil bug in fteqcc!! dont pass function calls to switches
-		switch( sys_debug_runflag ) {
-		case 0:
-			sys_debug_runflag = false;
-			break;
-		case 1:
-			cvar_set( SYSTEM_CVAR_DEBUG_RUNFLAG, "0" );
-		case 2:
-			sys_debug_runflag = true;
-			break;
-		}
-
-		sys_debug_process = cvar( SYSTEM_CVAR_DEBUG_PROCESS );
-		switch( sys_debug_process ) {
-		case 0:
-			sys_debug_process = false;
-			break;
-		case 1:
-			cvar_set( SYSTEM_CVAR_DEBUG_PROCESS, "0" );
-		case 2:
-			sys_debug_process = true;
-			break;
-		}
-
-		sys_debug_mgfx = cvar( SYSTEM_CVAR_DEBUG_MGFX );
-		switch( sys_debug_mgfx ) {
-		case 0:
-			sys_debug_mgfx = false;
-			break;
-		case 1:
-			cvar_set( SYSTEM_CVAR_DEBUG_MGFX, "0" );
-		case 2:
-			sys_debug_mgfx = true;
-			break;
-		}
-
-		lTemp1 = tokenize( cvar_string( SYSTEM_CVAR_DEBUG_PROCESS_FILTER ) );
-		sys_debug_process_filter = 0;
-		for( lTemp2 = 0 ; lTemp2 < lTemp1 ; ++lTemp2 )
-			if( argv( lTemp2 ) == "runflag" )
-				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_RUNFLAG;
-			else if( argv( lTemp2 ) == "draw" )
-				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_DRAW;
-			else if( argv( lTemp2 ) == "update" )
-				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_UPDATE;
-			else if( argv( lTemp2 ) == "mouse" )
-				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_MOUSE;
-			else if( argv( lTemp2 ) == "key" )
-				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_KEY;
-
-		lTemp1 = tokenize( cvar_string( SYSTEM_CVAR_DEBUG_PARSER ) );
-		sys_debug_parser = 0;
-		for( lTemp2 = 0 ; lTemp2 < lTemp1 ; ++lTemp2 )
-			if( argv( lTemp2 ) == "info" )
-				sys_debug_parser = sys_debug_parser | PARSER_INFO;
-			else if( argv( lTemp2 ) == "high" )
-				sys_debug_parser = sys_debug_parser | PARSER_HIGH;
-			else if( argv( lTemp2 ) == "low" )
-				sys_debug_parser = sys_debug_parser | PARSER_LOW;
-
-
-	} else {
-		sys_debug_halt = false;
-		sys_debug_ref = false;
-		sys_debug_area = false;
-		sys_debug_sound = false;
-		sys_debug_runflag = 0;
-		sys_debug_process = 0;
-		sys_debug_mgfx = false;
-		sys_debug_structure = 0;
-		sys_debug_parser = 0;
-		sys_debug_process_filter = 0;
-		sys_debug_mouse = 0;
-	}
-	if( cvar( SYSTEM_CVAR_DEBUG_DUMP_NAMES ) ) {
-		Sys_Debug_DumpNames();
-		cvar_set( SYSTEM_CVAR_DEBUG_DUMP_NAMES, "0" );
-	}
-	sys_debug_cursor_localpos = '-1 -1 -1';
-};
-
-/*
-===================
-Sys_Debug_Draw
-===================
-*/
-void() Sys_Debug_Draw =
-{
-	if( sys_debug_mouse == 1 )
-		Cursor_PrintInfo( '1 0 0', strcat( ftos( floor( sys_debug_cursor_localpos_x ) ),
-			" ", ftos( floor( sys_debug_cursor_localpos_y ) ) ), '9 9 0', '0.8 0.8 0.8',
-			1, DRAWFLAG_ADDITIVE );
-	else if( sys_debug_mouse == 2 )
-		Cursor_PrintInfo( '1 0 0', strcat( ftos( floor( Cursor_Position_x ) ), " ",
-			ftos( floor( Cursor_Position_y ) ) ), '9 9 0', '0.8 0.8 0.8', 1, DRAWFLAG_ADDITIVE );
-};
-
-/*
-===================
-Sys_Debug_DumpNames
-===================
-*/
-void() Sys_Debug_DumpNames =
-{
-	local entity lNode;
-
-	print( "Menu: Dumping names..\n" );
-
-	lNode = null_entity;
-	while( (lNode = nextent( lNode )) != null_entity )
-		print( "Menu: ", etos( lNode ), " <-> ", lNode.name, "\n" );
-	print( "\n" );
-};
+// SCMenu
+// system/debug.qc
+
+
+/*
+===================
+Sys_Debug_Init
+===================
+*/
+void() Sys_Debug_Init =
+{
+	registercvar( SYSTEM_CVAR_VERSION_BUILDDATE, "", CVAR_READONLY );
+	cvar_set( SYSTEM_CVAR_VERSION_BUILDDATE, SYSTEM_CVAR_VERSION_BUILDDATE_VALUE );
+	registercvar( SYSTEM_CVAR_VERSION_BUILDTIME, "", CVAR_READONLY );
+	cvar_set( SYSTEM_CVAR_VERSION_BUILDTIME, SYSTEM_CVAR_VERSION_BUILDTIME_VALUE );
+	registercvar( SYSTEM_CVAR_VERSION, "", CVAR_READONLY );
+	cvar_set( SYSTEM_CVAR_VERSION, SYSTEM_CVAR_VERSION_VALUE );
+
+	registercvar( SYSTEM_CVAR_DEBUG, ftos( SYSTEM_CVAR_DEBUG_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_REF, ftos( SYSTEM_CVAR_DEBUG_REF_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_RUNFLAG, ftos( SYSTEM_CVAR_DEBUG_RUNFLAG_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_PROCESS, ftos( SYSTEM_CVAR_DEBUG_PROCESS_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_MGFX, ftos( SYSTEM_CVAR_DEBUG_MGFX_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_STRUCTURE, ftos( SYSTEM_CVAR_DEBUG_STRUCTURE_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_PARSER, SYSTEM_CVAR_DEBUG_PARSER_DEFAULT, 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_PROCESS_FILTER, SYSTEM_CVAR_DEBUG_PROCESS_FILTER_DEFAULT, 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_SOUND, ftos( SYSTEM_CVAR_DEBUG_SOUND_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_DUMP_NAMES, "0", 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_AREA, ftos( SYSTEM_CVAR_DEBUG_AREA_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_STEP, ftos( SYSTEM_CVAR_DEBUG_STEP_DEFAULT ), 0 );
+	registercvar( SYSTEM_CVAR_DEBUG_MOUSE, ftos( SYSTEM_CVAR_DEBUG_MOUSE_DEFAULT ), 0 );
+};
+
+/*
+===================
+Sys_Debug_Frame
+===================
+*/
+void() Sys_Debug_Frame =
+{
+	local float lTemp1, lTemp2, lStep;
+	sys_debug = cvar( SYSTEM_CVAR_DEBUG );
+	if( sys_debug ) {
+		sys_debug_ref = cvar( SYSTEM_CVAR_DEBUG_REF );
+
+		sys_debug_area = cvar( SYSTEM_CVAR_DEBUG_AREA );
+
+		sys_debug_sound = cvar( SYSTEM_CVAR_DEBUG_SOUND );
+
+		sys_debug_structure = cvar( SYSTEM_CVAR_DEBUG_STRUCTURE );
+
+		sys_debug_mouse = cvar( SYSTEM_CVAR_DEBUG_MOUSE );
+
+		lStep = cvar( SYSTEM_CVAR_DEBUG_STEP );
+		if( lStep == 1 ) {
+			sys_debug_halt = true;
+		} else if( lStep == 2 ) {
+			sys_debug_halt = false;
+			cvar_set( SYSTEM_CVAR_DEBUG_STEP, "1" );
+
+			print( "Menu: -- Step: Time:", ftos( gettime() ), "\n" );
+		} else {
+			sys_debug_halt = false;
+		}
+
+		sys_debug_runflag = cvar( SYSTEM_CVAR_DEBUG_RUNFLAG );
+		// FIXME: evil bug in fteqcc!! dont pass function calls to switches
+		switch( sys_debug_runflag ) {
+		case 0:
+			sys_debug_runflag = false;
+			break;
+		case 1:
+			cvar_set( SYSTEM_CVAR_DEBUG_RUNFLAG, "0" );
+		case 2:
+			sys_debug_runflag = true;
+			break;
+		}
+
+		sys_debug_process = cvar( SYSTEM_CVAR_DEBUG_PROCESS );
+		switch( sys_debug_process ) {
+		case 0:
+			sys_debug_process = false;
+			break;
+		case 1:
+			cvar_set( SYSTEM_CVAR_DEBUG_PROCESS, "0" );
+		case 2:
+			sys_debug_process = true;
+			break;
+		}
+
+		sys_debug_mgfx = cvar( SYSTEM_CVAR_DEBUG_MGFX );
+		switch( sys_debug_mgfx ) {
+		case 0:
+			sys_debug_mgfx = false;
+			break;
+		case 1:
+			cvar_set( SYSTEM_CVAR_DEBUG_MGFX, "0" );
+		case 2:
+			sys_debug_mgfx = true;
+			break;
+		}
+
+		lTemp1 = tokenize( cvar_string( SYSTEM_CVAR_DEBUG_PROCESS_FILTER ) );
+		sys_debug_process_filter = 0;
+		for( lTemp2 = 0 ; lTemp2 < lTemp1 ; ++lTemp2 )
+			if( argv( lTemp2 ) == "runflag" )
+				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_RUNFLAG;
+			else if( argv( lTemp2 ) == "draw" )
+				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_DRAW;
+			else if( argv( lTemp2 ) == "update" )
+				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_UPDATE;
+			else if( argv( lTemp2 ) == "mouse" )
+				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_MOUSE;
+			else if( argv( lTemp2 ) == "key" )
+				sys_debug_process_filter = sys_debug_process_filter | MENU_PROCESS_KEY;
+
+		lTemp1 = tokenize( cvar_string( SYSTEM_CVAR_DEBUG_PARSER ) );
+		sys_debug_parser = 0;
+		for( lTemp2 = 0 ; lTemp2 < lTemp1 ; ++lTemp2 )
+			if( argv( lTemp2 ) == "info" )
+				sys_debug_parser = sys_debug_parser | PARSER_INFO;
+			else if( argv( lTemp2 ) == "high" )
+				sys_debug_parser = sys_debug_parser | PARSER_HIGH;
+			else if( argv( lTemp2 ) == "low" )
+				sys_debug_parser = sys_debug_parser | PARSER_LOW;
+
+
+	} else {
+		sys_debug_halt = false;
+		sys_debug_ref = false;
+		sys_debug_area = false;
+		sys_debug_sound = false;
+		sys_debug_runflag = 0;
+		sys_debug_process = 0;
+		sys_debug_mgfx = false;
+		sys_debug_structure = 0;
+		sys_debug_parser = 0;
+		sys_debug_process_filter = 0;
+		sys_debug_mouse = 0;
+	}
+	if( cvar( SYSTEM_CVAR_DEBUG_DUMP_NAMES ) ) {
+		Sys_Debug_DumpNames();
+		cvar_set( SYSTEM_CVAR_DEBUG_DUMP_NAMES, "0" );
+	}
+	sys_debug_cursor_localpos = '-1 -1 -1';
+};
+
+/*
+===================
+Sys_Debug_Draw
+===================
+*/
+void() Sys_Debug_Draw =
+{
+	if( sys_debug_mouse == 1 )
+		Cursor_PrintInfo( '1 0 0', strcat( ftos( floor( sys_debug_cursor_localpos_x ) ),
+			" ", ftos( floor( sys_debug_cursor_localpos_y ) ) ), '9 9 0', '0.8 0.8 0.8',
+			1, DRAWFLAG_ADDITIVE );
+	else if( sys_debug_mouse == 2 )
+		Cursor_PrintInfo( '1 0 0', strcat( ftos( floor( Cursor_Position_x ) ), " ",
+			ftos( floor( Cursor_Position_y ) ) ), '9 9 0', '0.8 0.8 0.8', 1, DRAWFLAG_ADDITIVE );
+};
+
+/*
+===================
+Sys_Debug_DumpNames
+===================
+*/
+void() Sys_Debug_DumpNames =
+{
+	local entity lNode;
+
+	print( "Menu: Dumping names..\n" );
+
+	lNode = null_entity;
+	while( (lNode = nextent( lNode )) != null_entity )
+		print( "Menu: ", etos( lNode ), " <-> ", lNode.name, "\n" );
+	print( "\n" );
+};


Property changes on: trunk/basezym/menuqc/system/debug.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/debug.qh
===================================================================
--- trunk/basezym/menuqc/system/debug.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/debug.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,80 +1,80 @@
-// SCMenu
-// system/debug.qh
-
-// version cvars (constant)
-const string 	SYSTEM_CVAR_VERSION_BUILDDATE		= "scmenu_version_builddate";
-const string 	SYSTEM_CVAR_VERSION_BUILDTIME		= "scmenu_version_buildtime";
-const string	SYSTEM_CVAR_VERSION			= "scmenu_version";
-
-const string 	SYSTEM_CVAR_VERSION_BUILDDATE_VALUE	= __DATE__;
-const string 	SYSTEM_CVAR_VERSION_BUILDTIME_VALUE	= __TIME__;
-const string 	SYSTEM_CVAR_VERSION_VALUE		= "prerelease";
-
-// system cvars
-
-// 0 or 1
-const string 	SYSTEM_CVAR_DEBUG		= "scmenu_debug";
-const string 	SYSTEM_CVAR_DEBUG_REF 		= "scmenu_debug_ref";
-const string 	SYSTEM_CVAR_DEBUG_SOUND		= "scmenu_debug_sound";
-const string 	SYSTEM_CVAR_DEBUG_AREA		= "scmenu_debug_area";
-
-// 0 for normal, 1 for halted, 2 for new step
-const string	SYSTEM_CVAR_DEBUG_STEP		= "scmenu_debug_step";
-
-// 0 for no info, 1 for local position, 2 for absolute position
-const string 	SYSTEM_CVAR_DEBUG_MOUSE		= "scmenu_debug_mouse";
-
-// 0 for no output, 1 for medium output, 2 for extensive output
-const string 	SYSTEM_CVAR_DEBUG_STRUCTURE	= "scmenu_debug_structure";
-
-// NOTE: set it to 1 to make it display the data for one frame, set it to 2 to display it always
-const string 	SYSTEM_CVAR_DEBUG_RUNFLAG	= "scmenu_debug_runflag";
-const string	SYSTEM_CVAR_DEBUG_PROCESS	= "scmenu_debug_process";
-const string 	SYSTEM_CVAR_DEBUG_MGFX		= "scmenu_debug_mgfx";
-
-// parser filter, possible values: info high low
-const string 	SYSTEM_CVAR_DEBUG_PARSER	= "scmenu_debug_parser";
-
-// process_filter, possible values: runflag update draw mouse key
-const string	SYSTEM_CVAR_DEBUG_PROCESS_FILTER = "scmenu_debug_process_filter";
-
-// dump item names
-const string 	SYSTEM_CVAR_DEBUG_DUMP_NAMES = "scmenu_dumpnames";
-
-const float 	SYSTEM_CVAR_DEBUG_DEFAULT		= 0;
-const float	SYSTEM_CVAR_DEBUG_REF_DEFAULT 		= 0;
-const float 	SYSTEM_CVAR_DEBUG_RUNFLAG_DEFAULT	= 0;
-const float 	SYSTEM_CVAR_DEBUG_PROCESS_DEFAULT	= 0;
-const float 	SYSTEM_CVAR_DEBUG_MGFX_DEFAULT		= 0;
-const float	SYSTEM_CVAR_DEBUG_STRUCTURE_DEFAULT	= 0;
-const string	SYSTEM_CVAR_DEBUG_PARSER_DEFAULT	= "";
-const string	SYSTEM_CVAR_DEBUG_PROCESS_FILTER_DEFAULT= "";
-const float	SYSTEM_CVAR_DEBUG_SOUND_DEFAULT		= 0;
-const float 	SYSTEM_CVAR_DEBUG_AREA_DEFAULT		= 0;
-const float 	SYSTEM_CVAR_DEBUG_STEP_DEFAULT		= 0;
-const float 	SYSTEM_CVAR_DEBUG_MOUSE_DEFAULT		= 0;
-
-bool sys_debug;
-bool sys_debug_sound;
-bool sys_debug_ref;
-bool sys_debug_area;
-bool sys_debug_runflag;
-bool sys_debug_process;
-bool sys_debug_mgfx;
-float sys_debug_mouse;
-float sys_debug_structure;
-float sys_debug_parser;
-
-bool sys_debug_halt;
-
-float sys_debug_process_filter;
-
-vector sys_debug_cursor_localpos;
-
-void() Sys_Debug_Init;
-void() Sys_Debug_Frame;
-void() Sys_Debug_Draw;
-
-void() Sys_Debug_DumpNames;
-
-
+// SCMenu
+// system/debug.qh
+
+// version cvars (constant)
+const string 	SYSTEM_CVAR_VERSION_BUILDDATE		= "scmenu_version_builddate";
+const string 	SYSTEM_CVAR_VERSION_BUILDTIME		= "scmenu_version_buildtime";
+const string	SYSTEM_CVAR_VERSION			= "scmenu_version";
+
+const string 	SYSTEM_CVAR_VERSION_BUILDDATE_VALUE	= __DATE__;
+const string 	SYSTEM_CVAR_VERSION_BUILDTIME_VALUE	= __TIME__;
+const string 	SYSTEM_CVAR_VERSION_VALUE		= "prerelease";
+
+// system cvars
+
+// 0 or 1
+const string 	SYSTEM_CVAR_DEBUG		= "scmenu_debug";
+const string 	SYSTEM_CVAR_DEBUG_REF 		= "scmenu_debug_ref";
+const string 	SYSTEM_CVAR_DEBUG_SOUND		= "scmenu_debug_sound";
+const string 	SYSTEM_CVAR_DEBUG_AREA		= "scmenu_debug_area";
+
+// 0 for normal, 1 for halted, 2 for new step
+const string	SYSTEM_CVAR_DEBUG_STEP		= "scmenu_debug_step";
+
+// 0 for no info, 1 for local position, 2 for absolute position
+const string 	SYSTEM_CVAR_DEBUG_MOUSE		= "scmenu_debug_mouse";
+
+// 0 for no output, 1 for medium output, 2 for extensive output
+const string 	SYSTEM_CVAR_DEBUG_STRUCTURE	= "scmenu_debug_structure";
+
+// NOTE: set it to 1 to make it display the data for one frame, set it to 2 to display it always
+const string 	SYSTEM_CVAR_DEBUG_RUNFLAG	= "scmenu_debug_runflag";
+const string	SYSTEM_CVAR_DEBUG_PROCESS	= "scmenu_debug_process";
+const string 	SYSTEM_CVAR_DEBUG_MGFX		= "scmenu_debug_mgfx";
+
+// parser filter, possible values: info high low
+const string 	SYSTEM_CVAR_DEBUG_PARSER	= "scmenu_debug_parser";
+
+// process_filter, possible values: runflag update draw mouse key
+const string	SYSTEM_CVAR_DEBUG_PROCESS_FILTER = "scmenu_debug_process_filter";
+
+// dump item names
+const string 	SYSTEM_CVAR_DEBUG_DUMP_NAMES = "scmenu_dumpnames";
+
+const float 	SYSTEM_CVAR_DEBUG_DEFAULT		= 0;
+const float	SYSTEM_CVAR_DEBUG_REF_DEFAULT 		= 0;
+const float 	SYSTEM_CVAR_DEBUG_RUNFLAG_DEFAULT	= 0;
+const float 	SYSTEM_CVAR_DEBUG_PROCESS_DEFAULT	= 0;
+const float 	SYSTEM_CVAR_DEBUG_MGFX_DEFAULT		= 0;
+const float	SYSTEM_CVAR_DEBUG_STRUCTURE_DEFAULT	= 0;
+const string	SYSTEM_CVAR_DEBUG_PARSER_DEFAULT	= "";
+const string	SYSTEM_CVAR_DEBUG_PROCESS_FILTER_DEFAULT= "";
+const float	SYSTEM_CVAR_DEBUG_SOUND_DEFAULT		= 0;
+const float 	SYSTEM_CVAR_DEBUG_AREA_DEFAULT		= 0;
+const float 	SYSTEM_CVAR_DEBUG_STEP_DEFAULT		= 0;
+const float 	SYSTEM_CVAR_DEBUG_MOUSE_DEFAULT		= 0;
+
+bool sys_debug;
+bool sys_debug_sound;
+bool sys_debug_ref;
+bool sys_debug_area;
+bool sys_debug_runflag;
+bool sys_debug_process;
+bool sys_debug_mgfx;
+float sys_debug_mouse;
+float sys_debug_structure;
+float sys_debug_parser;
+
+bool sys_debug_halt;
+
+float sys_debug_process_filter;
+
+vector sys_debug_cursor_localpos;
+
+void() Sys_Debug_Init;
+void() Sys_Debug_Frame;
+void() Sys_Debug_Draw;
+
+void() Sys_Debug_DumpNames;
+
+


Property changes on: trunk/basezym/menuqc/system/debug.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/event_helper.qc
===================================================================
--- trunk/basezym/menuqc/system/event_helper.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/event_helper.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,290 +1,290 @@
-// DP/Nex menu
-// system/events.qc
-
-// raise function
-/* template
-
-void( entity pEntity )	Raise_x =
-{
-	local entity lOld;
-	if( !pEntity._y )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._y();
-	self = lOld;
-};
-*/
-
-void( entity pEntity ) Raise_Reinit =
-{
-	local entity lOld;
-	if(!pEntity._reinit)
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._reinit();
-	self = lOld;
-};
-
-void( entity pEntity ) Raise_Destroy =
-{
-	local entity lOld;
-	if( !pEntity._destroy )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._destroy();
-	self = lOld;
-};
-
-bool( entity pEntity, float pKey, float pAscii) Raise_Key =
-{
-	local entity lOld;
-	local bool   lResult;
-
-	if( !pEntity._key )
-		return false;
-
-	lOld = self;
-	self = pEntity;
-	lResult = self._key( pKey, pAscii );
-	self = lOld;
-
-	return lResult;
-};
-
-void( entity pEntity ) Raise_Draw =
-{
-	local entity lOld;
-	if( !pEntity._draw )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._draw();
-	self = lOld;
-};
-
-void( entity pEntity ) Raise_MouseEnter =
-{
-	local entity lOld;
-	if( !pEntity._mouseEnter )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._mouseEnter();
-	self = lOld;
-};
-
-void( entity pEntity ) Raise_MouseLeave =
-{
-	local entity lOld;
-	if( !pEntity._mouseLeave )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._mouseLeave();
-	self = lOld;
-};
-
-void( entity pEntity ) Raise_Update =
-{
-	local entity lOld;
-	if( !pEntity._update )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._update();
-	self = lOld;
-};
-
-void( entity pEntity, bool pSelect, bool pUser ) Raise_Select =
-{
-	local entity lOld;
-	if( !pEntity._select )
-		return;
-
-	lOld = self;
-	self = pEntity;
-	self._select( pSelect, pUser );
-	self = lOld;
-};
-
-// safe call control function functions
-// default control functions
-/* template
-
-void() CtCall_x	=
-{
-	if( self.y )
-		self.y();
-};
-
-*/
-void()	CtCall_Init =
-{
-	if( self.init )
-		self.init();
-};
-
-void()  CtCall_Reinit =
-{
-	if( self.reinit )
-		self.reinit();
-};
-
-void() CtCall_Destroy =
-{
-	if( self.destroy )
-		self.destroy();
-};
-
-bool( float pKey, float pAscii )  CtCall_Key =
-{
-	if( self.key )
-		return self.key( pKey, pAscii );
-	return false;
-};
-
-void()	CtCall_Draw =
-{
-	if( self.draw )
-		self.draw();
-};
-
-void()	CtCall_MouseEnter =
-{
-	if( self.mouseEnter )
-		self.mouseEnter();
-};
-
-void()	CtCall_MouseLeave =
-{
-	if( self.mouseLeave )
-		self.mouseLeave();
-};
-
-void()	CtCall_Action =
-{
-	if( self.action )
-		self.action();
-};
-
-void() CtCall_Update =
-{
-	if( self.update )
-		self.update();
-}
-
-void( bool pSelect, bool pUser ) CtCall_Select =
-{
-	if( self.select )
-		self.select( pSelect, pUser );
-};
-
-// default control functions
-/* template (expect DefCt_Key)
-
-void(void) defct_x =
-{
-	CtCall_x();
-};
-
-*/
-// defct_init not needed cause its the same like the type function
-
-void() DefCt_Reinit =
-{
-};
-
-void() DefCt_Destroy =
-{
-};
-
-bool( float pKey, float pAscii ) DefCt_Key =
-{
-	return false;
-};
-
-void() DefCt_Draw =
-{
-};
-
-void() DefCt_MouseEnter =
-{
-};
-
-void() DefCt_MouseLeave =
-{
-};
-
-void()	DefCt_Action =
-{
-};
-
-void( float pSelect, bool pUser )  DefCt_Select =
-{
-};
-
-void()	DefCt_Update =
-{
-};
-
-// default key function
-/*void(float keynr, float ascii)	def_keyevent =
-{
-	if(keynr == K_ESCAPE)
-	{
-		// move up to the parent
-		menu_selectup();
-	} else if(keynr == K_LEFTARROW || keynr == K_UPARROW)
-	{
-		// move to the previous element
-		menu_loopprev();
-
-		if(Menu_ActiveItem == self)
-		{
-			if(self._prev)
-			{
-				Menu_ActiveItem = self._prev;
-				menu_selectdown();
-				if(Menu_ActiveItem != self._prev)
-				{
-					return;
-				}
-			}
-			Menu_ActiveItem = self;
-		}
-	} else if(keynr == K_RIGHTARROW || keynr == K_DOWNARROW)
-	{
-		// move to the  next element
-		menu_loopnext();
-
-		if(Menu_ActiveItem == self)
-		{
-			if(self._next)
-			{
-				Menu_ActiveItem = self._next;
-				menu_selectdown();
-				if(Menu_ActiveItem != self._next)
-				{
-					return;
-				}
-			}
-			Menu_ActiveItem = self;
-		}
-	} else if(keynr == K_ENTER || keynr == K_MOUSE1)
-	{
-		if(self._action)
-			self._action();
-		// move to the child menu
-		menu_selectdown();
-	}
-};*/
+// DP/Nex menu
+// system/events.qc
+
+// raise function
+/* template
+
+void( entity pEntity )	Raise_x =
+{
+	local entity lOld;
+	if( !pEntity._y )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._y();
+	self = lOld;
+};
+*/
+
+void( entity pEntity ) Raise_Reinit =
+{
+	local entity lOld;
+	if(!pEntity._reinit)
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._reinit();
+	self = lOld;
+};
+
+void( entity pEntity ) Raise_Destroy =
+{
+	local entity lOld;
+	if( !pEntity._destroy )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._destroy();
+	self = lOld;
+};
+
+bool( entity pEntity, float pKey, float pAscii) Raise_Key =
+{
+	local entity lOld;
+	local bool   lResult;
+
+	if( !pEntity._key )
+		return false;
+
+	lOld = self;
+	self = pEntity;
+	lResult = self._key( pKey, pAscii );
+	self = lOld;
+
+	return lResult;
+};
+
+void( entity pEntity ) Raise_Draw =
+{
+	local entity lOld;
+	if( !pEntity._draw )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._draw();
+	self = lOld;
+};
+
+void( entity pEntity ) Raise_MouseEnter =
+{
+	local entity lOld;
+	if( !pEntity._mouseEnter )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._mouseEnter();
+	self = lOld;
+};
+
+void( entity pEntity ) Raise_MouseLeave =
+{
+	local entity lOld;
+	if( !pEntity._mouseLeave )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._mouseLeave();
+	self = lOld;
+};
+
+void( entity pEntity ) Raise_Update =
+{
+	local entity lOld;
+	if( !pEntity._update )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._update();
+	self = lOld;
+};
+
+void( entity pEntity, bool pSelect, bool pUser ) Raise_Select =
+{
+	local entity lOld;
+	if( !pEntity._select )
+		return;
+
+	lOld = self;
+	self = pEntity;
+	self._select( pSelect, pUser );
+	self = lOld;
+};
+
+// safe call control function functions
+// default control functions
+/* template
+
+void() CtCall_x	=
+{
+	if( self.y )
+		self.y();
+};
+
+*/
+void()	CtCall_Init =
+{
+	if( self.init )
+		self.init();
+};
+
+void()  CtCall_Reinit =
+{
+	if( self.reinit )
+		self.reinit();
+};
+
+void() CtCall_Destroy =
+{
+	if( self.destroy )
+		self.destroy();
+};
+
+bool( float pKey, float pAscii )  CtCall_Key =
+{
+	if( self.key )
+		return self.key( pKey, pAscii );
+	return false;
+};
+
+void()	CtCall_Draw =
+{
+	if( self.draw )
+		self.draw();
+};
+
+void()	CtCall_MouseEnter =
+{
+	if( self.mouseEnter )
+		self.mouseEnter();
+};
+
+void()	CtCall_MouseLeave =
+{
+	if( self.mouseLeave )
+		self.mouseLeave();
+};
+
+void()	CtCall_Action =
+{
+	if( self.action )
+		self.action();
+};
+
+void() CtCall_Update =
+{
+	if( self.update )
+		self.update();
+}
+
+void( bool pSelect, bool pUser ) CtCall_Select =
+{
+	if( self.select )
+		self.select( pSelect, pUser );
+};
+
+// default control functions
+/* template (expect DefCt_Key)
+
+void(void) defct_x =
+{
+	CtCall_x();
+};
+
+*/
+// defct_init not needed cause its the same like the type function
+
+void() DefCt_Reinit =
+{
+};
+
+void() DefCt_Destroy =
+{
+};
+
+bool( float pKey, float pAscii ) DefCt_Key =
+{
+	return false;
+};
+
+void() DefCt_Draw =
+{
+};
+
+void() DefCt_MouseEnter =
+{
+};
+
+void() DefCt_MouseLeave =
+{
+};
+
+void()	DefCt_Action =
+{
+};
+
+void( float pSelect, bool pUser )  DefCt_Select =
+{
+};
+
+void()	DefCt_Update =
+{
+};
+
+// default key function
+/*void(float keynr, float ascii)	def_keyevent =
+{
+	if(keynr == K_ESCAPE)
+	{
+		// move up to the parent
+		menu_selectup();
+	} else if(keynr == K_LEFTARROW || keynr == K_UPARROW)
+	{
+		// move to the previous element
+		menu_loopprev();
+
+		if(Menu_ActiveItem == self)
+		{
+			if(self._prev)
+			{
+				Menu_ActiveItem = self._prev;
+				menu_selectdown();
+				if(Menu_ActiveItem != self._prev)
+				{
+					return;
+				}
+			}
+			Menu_ActiveItem = self;
+		}
+	} else if(keynr == K_RIGHTARROW || keynr == K_DOWNARROW)
+	{
+		// move to the  next element
+		menu_loopnext();
+
+		if(Menu_ActiveItem == self)
+		{
+			if(self._next)
+			{
+				Menu_ActiveItem = self._next;
+				menu_selectdown();
+				if(Menu_ActiveItem != self._next)
+				{
+					return;
+				}
+			}
+			Menu_ActiveItem = self;
+		}
+	} else if(keynr == K_ENTER || keynr == K_MOUSE1)
+	{
+		if(self._action)
+			self._action();
+		// move to the child menu
+		menu_selectdown();
+	}
+};*/


Property changes on: trunk/basezym/menuqc/system/event_helper.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/events.qc
===================================================================
--- trunk/basezym/menuqc/system/events.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/events.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,447 +1,447 @@
-// DP/Nex menu
-// system/events.qc
-
-// debug process output functions
-bool _menu_process_filtered;
-void( float pMode, float pSelectState ) _Menu_Process_Debug_Filter =
-{
-	if( !sys_debug_process )
-		_menu_process_filtered = false;
-	else if( sys_debug_process_filter )
-		_menu_process_filtered = (pMode & sys_debug_process_filter);
-	else
-		_menu_process_filtered = true;
-	if( _menu_process_filtered == MENU_PROCESS_MOUSE && pSelectState == MENU_SELECT_NEVER )
-		_menu_process_filtered = false;
-};
-
-#ifdef USEFUNCTIONS
-void( string pText ) _Menu_Process_Debug_Print =
-{
-	if( _menu_process_filtered )
-		print( pText );
-};
-#else
-#define _Menu_Process_Debug_Print(pText)   if( _menu_process_filtered ) print( pText )
-#endif
-
-// process stacks
-
-void() Menu_Process_Setup =
-{
-	Menu_Origin = '0 0 0';
-	Menu_Clip_Position = '0 0 0';
-	Menu_Clip_Size = '0 0 0';
-};
-
-void( entity pItem ) _Menu_Env_LoadClipArea
-{
-	Menu_Clip_Position = pItem._cache_clip_pos;
-	Menu_Clip_Size = pItem._cache_clip_size;
-
-	if( sys_debug_mgfx && _menu_process_filtered )
-		print( "MGFX Loaded clip area = (", vtos( Menu_Clip_Position ), "; ", vtos( Menu_Clip_Size ), ")\n" );
-};
-
-void( entity pItem ) _Menu_Env_LoadOrigin =
-{
-	Menu_Origin = pItem._cache_origin;
-	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
-
-	if( sys_debug_mgfx && _menu_process_filtered )
-		print( "MGFX Loaded org = ", vtos( Menu_Origin ), "\n" );
-};
-
-void( entity pItem ) _Menu_Env_Reload =
-{
-	Menu_Origin = pItem._cache_origin;
-	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
-	Menu_Clip_Position = pItem._cache_clip_pos;
-	Menu_Clip_Size = pItem._cache_clip_size;
-
-	if( sys_debug_mgfx && _menu_process_filtered )
-		print( "MGFX Reloaded env for: org = ", vtos( Menu_Origin ), "; clip area = (", vtos( Menu_Clip_Position ), "; ", vtos( Menu_Clip_Size ), ")\n" );
-};
-
-void() _MGX_SetClipArea =
-{
-	if( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' )
-		Gfx_ResetClipArea();
-	else
-		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
-};
-
-void( entity pItem ) _Menu_Env_SetupClipArea
-{
-	local vector lDelta, lPos, lSize;
-
-	lPos = pItem.pos;
-	lSize = pItem.size;
-	if( lPos != '0 0 0' || lSize != '0 0 0' ) {
-		if( (Menu_Clip_Position != '0 0 0' || Menu_Clip_Size != '0 0 0') ) {
-			lPos = Menu_Origin + lPos;
-			lDelta = Util_GetClipDelta( lPos, Menu_Clip_Position, Menu_Clip_Size );
-			lPos = lPos + lDelta;
-			lSize = Util_ClipRect( lPos, lSize - lDelta, Menu_Clip_Position, Menu_Clip_Size );
-		}
-
-		Menu_Clip_Position = lPos;
-		Menu_Clip_Size = lSize;
-	}
-	pItem._cache_clip_pos = Menu_Clip_Position;
-	pItem._cache_clip_size = Menu_Clip_Size;
-
-	if( sys_debug_mgfx && _menu_process_filtered ) {
-		print( "MGFX Setup clip area: (", vtos( pItem.pos ), "; ", vtos( pItem.size ) );
-		print( ") clipped to (", vtos( Menu_Clip_Position ), "; ", vtos( Menu_Clip_Size ), ")\n" );
-	}
-};
-
-void( entity pItem ) _Menu_Env_SetupOrigin =
-{
-	Menu_Origin = Menu_Origin + pItem.origin + pItem.pos;
-	pItem._cache_origin = Menu_Origin;
-
-	if( sys_debug_mgfx && _menu_process_filtered )
-		print( "MGFX Setup org = ", vtos( Menu_Origin ), "\n" );
-};
-
-void( entity pItem ) _Menu_ProcessRunFlag =
-{
-	local entity lChild;
-
-	_Menu_Process_Debug_Print( strcat( "R ", pItem.name, "\n" ) );
-
-	// setup the cache and the Menu_* variables
-	_Menu_Env_SetupClipArea( pItem );
-
-	Menu_SetRunFlag( pItem );
-
-	// we adjust the origin for the children
-	_Menu_Env_SetupOrigin( pItem );
-
-	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
-			Menu_InheritRunFlag( pItem, lChild );
-			_Menu_ProcessRunFlag( lChild );
-			// reload the cached state
-			_Menu_Env_Reload( pItem );
-	}
-};
-
-void( entity pItem ) _Menu_ProcessDraw =
-{
-	local entity lChild;
-
-	_Menu_Process_Debug_Print( strcat( "D ", pItem.name, " " ) );
-
-	if( !Menu_IsVisible( pItem ) ) {
-		_Menu_Process_Debug_Print( "Failed (Not visible)\n" );
-		return;
-	}
-	_Menu_Process_Debug_Print( "\n" );
-
-	_Menu_Env_LoadClipArea( pItem );
-	_MGX_SetClipArea();
-
-	Raise_Draw( pItem );
-
-	_Menu_Env_LoadOrigin( pItem );
-	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
-		_Menu_ProcessDraw( lChild );
-		// reload old state
-		_Menu_Env_Reload( pItem );
-		_MGX_SetClipArea();
-	}
-};
-
-void( entity pItem ) _Menu_ProcessUpdate =
-{
-	local entity lChild;
-
-	_Menu_Process_Debug_Print( strcat( "U ", pItem.name, " " ) );
-
-	if( Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) ) {
-		_Menu_Process_Debug_Print( "Failed (RUNFLAG_CHILDDRAWONLY)\n" );
-		return;
-	}
-
-	_Menu_Env_LoadClipArea( pItem );
-	Raise_Update( pItem );
-
-	if( Menu_HasRunFlag( pItem, RUNFLAG_HIDDEN ) ) {
-		_Menu_Process_Debug_Print( "Aborted branching (RUNFLAG_HIDDEN)\n" );
-		return;
-	}
-	_Menu_Process_Debug_Print( "\n" );
-
-	_Menu_Env_LoadOrigin( pItem );
-	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
-		_Menu_ProcessUpdate( lChild );
-		_Menu_Env_Reload( lChild );
-	}
-};
-
-void( entity pItem, float pSelectMode ) _Menu_ProcessMouse =
-{
-	local entity lChild;
-
-	if( _menu_process_filtered ) {
-		print( "M " );
-		switch( pSelectMode ) {
-			case MENU_SELECT_SELECTABLE:
-				print( "S " );
-				break;
-			case MENU_SELECT_ALWAYS:
-				print( "A " );
-				break;
-			case MENU_SELECT_NEVER:
-				print( "N " );
-				break;
-		}
-		print( pItem.name, " " );
-	}
-
-	if( !Menu_IsVisible( pItem ) ) {
-		_Menu_Process_Debug_Print( "Failed (Not visible)\n" );
-		return;
-	}
-
-	_Menu_Env_LoadClipArea( pItem );
-	// check if the mouse is even in the clip area
-	if( Util_InRect( Cursor_Position, Menu_Clip_Position, Menu_Clip_Size ) ||
-	( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' ) ) {
-		pItem._runFlag = pItem._runFlag | RUNFLAG_MOUSEINAREA;
-
-		if( !Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
-			Raise_MouseEnter( pItem );
-		if( pSelectMode != MENU_SELECT_NEVER && Menu_HasFlag( pItem, FLAG_SEALOFFMOUSE ) )
-			Menu_ActiveItem = null_entity;
-		if( ( pSelectMode == MENU_SELECT_ALWAYS ) ||
-		    ( Menu_IsSelectable( pItem ) && pSelectMode == MENU_SELECT_SELECTABLE ) )
-			Menu_ActiveItem = pItem;
-	} else { // if the mouse isnt in the clip area, neither the children will be!
-		if( Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
-			Raise_MouseLeave( pItem );
-		_Menu_Process_Debug_Print( "Aborted branching (Outside the clip area)\n" );
-		return;
-	}
-	_Menu_Process_Debug_Print( "\n" );
-
-	_Menu_Env_LoadOrigin( pItem );
-	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
-		if( !Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWUPDATEONLY ) || !Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) )
-			_Menu_ProcessMouse( lChild, pSelectMode );
-		else
-			_Menu_ProcessMouse( lChild, MENU_SELECT_NEVER );
-		_Menu_Env_Reload( pItem );
-	}
-};
-
-float( float pRetValue ) _Menu_Process_Debug_Return =
-{
-	if( _menu_process_filtered )
-		switch( pRetValue ) {
-		case MENU_EVENT_NORMAL:
-		case MENU_EVENT_CONTINUE:
-			print( "MENU_EVENT_CONTINUE\n" );
-			break;
-		case MENU_EVENT_RAISEPARENT:
-			print( "MENU_EVENT_RAISEPARENT\n" );
-			break;
-		case MENU_EVENT_PROCESSED:
-			print( "MENU_EVENT_PROCESSED\n" );
-			break;
-		}
-
-	return pRetValue;
-};
-
-float( entity pItem, float pKey, float pAscii ) _Menu_ProcessKey =
-{
-	local entity lChild;
-	local float lResult;
-
-	_Menu_Process_Debug_Print( strcat( "K ", ftos( pKey ), " ", pItem.name, " " ) );
-	if( Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWUPDATEONLY ) || Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) )
-		return _Menu_Process_Debug_Return( MENU_EVENT_CONTINUE );
-
-	_Menu_Env_LoadClipArea( pItem );
-
-	if( Menu_ActiveItem == pItem ) {
-		if( Raise_Key( pItem, pKey, pAscii ) )
-			lResult = MENU_EVENT_PROCESSED;
-		else
-			lResult = MENU_EVENT_RAISEPARENT;
-
-		return _Menu_Process_Debug_Return( lResult );
-	}
-
-	_Menu_Env_LoadOrigin( pItem );
-	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
-		lResult = _Menu_ProcessKey( lChild, pKey, pAscii );
-		_Menu_Env_Reload( pItem );
-
-		if( lResult == MENU_EVENT_PROCESSED )
-			return _Menu_Process_Debug_Return( MENU_EVENT_PROCESSED );
-		else if( lResult == MENU_EVENT_RAISEPARENT )
-			if( Raise_Key( pItem, pKey, pAscii ) )
-				return _Menu_Process_Debug_Return( MENU_EVENT_PROCESSED );
-			else
-				return _Menu_Process_Debug_Return( MENU_EVENT_RAISEPARENT );
-	}
-
-	return _Menu_Process_Debug_Return( MENU_EVENT_CONTINUE );
-};
-
-float( entity pItem, float pMode, float pSelectMode, float pKey, float pAscii ) Menu_Process =
-{
-	local vector lSize, lPos, lOrigin;
-	local float lResult;
-
-	lSize = Menu_Clip_Size;
-	lPos = Menu_Clip_Position;
-	lOrigin = Menu_Origin;
-
-	_Menu_Process_Debug_Filter( pMode, pSelectMode );
-
-	lResult = 0;
-	switch( pMode ) {
-		case MENU_PROCESS_RUNFLAG:
-			_Menu_ProcessRunFlag( pItem );
-			break;
-		case MENU_PROCESS_UPDATE:
-			_Menu_ProcessUpdate( pItem );
-			break;
-		case MENU_PROCESS_DRAW:
-			_Menu_ProcessDraw( pItem );
-			break;
-		case MENU_PROCESS_MOUSE:
-			_Menu_ProcessMouse( pItem, pSelectMode );
-			break;
-		case MENU_PROCESS_KEY:
-			lResult = _Menu_ProcessKey( pItem, pKey, pAscii );
-			break;
-	}
-
-	Menu_Clip_Size = lSize;
-	Menu_Clip_Position = lPos;
-	Menu_Origin = lOrigin;
-	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
-	if( pMode == MENU_PROCESS_DRAW )
-		_MGX_SetClipArea();
-
-	return lResult;
-};
-
-void() Menu_Frame =
-{
-	Sys_Debug_Frame();
-	if( sys_debug_halt ) {
-		return;
-	}
-
-	Menu_UpdateRunFlags();
-
-	Menu_Process_Setup();
-	// if mouse was moved, select an item
-	if( Cursor_Relative != '0 0 0' ) {
-		local entity lOld;
-
-		lOld = Menu_ActiveItem;
-		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
-
-		if( !Menu_ActiveItem )
-			Menu_ActiveItem = lOld;
-		else if( lOld != Menu_ActiveItem ) {
-			Raise_Select( lOld, false, true );
-			Raise_Select( Menu_ActiveItem, true, true );
-		}
-	} else // just update mouseinarea
-		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_NEVER );
-
-	// process the update event
-	Menu_Process_Setup();
-	Menu_ProcessUpdate( Menu_ActiveWindow, MENU_PROCESS_UPDATE );
-
-
-	Menu_CollectGarbage( false );
-}
-
-void() Menu_Draw =
-{
-	if( sys_debug_halt ) {
-		return;
-	}
-	// if Menu_ActiveWindow is visible loop though it
-	if( Menu_IsVisible( Menu_ActiveWindow ) )
-	{
-		Menu_Process_Setup();
-		Menu_ProcessDraw( Menu_ActiveWindow );
-	}
-
-	Sys_Debug_Draw();
-};
-
-void( float pKey, float pAscii) Menu_Key =
-{
-	if( sys_debug_halt ) {
-		return;
-	}
-
-	// is a keyhook set ?
-	if( Menu_KeyHook != Util_NullFunction ) {
-		// call it
-		Menu_KeyHook( pKey, pAscii );
-		return;
-	}
-	// before calling the current keydown functions, process the mouse again
-	// to make sure the correct item is called
-	// (except mouse wheel up and down)
-	// if the mouse doesnt point to an item, there wont be a reaction on the clicking
-	if(K_MOUSE1 <= pKey && pKey <= K_MOUSE10) {
-		local entity lOld;
-
-		lOld = Menu_ActiveItem;
-		Menu_ActiveItem = null_entity;
-		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
-
-		if( !Menu_ActiveItem ) {
-			Menu_ActiveItem = lOld;
-			return;
-		} else if( lOld != Menu_ActiveItem ) {
-			Raise_Select( lOld, false, true );
-			Raise_Select( Menu_ActiveItem, true, true );
-		}
-	}
-
-	// call current selected keydown function
-	// if nothing is selected -> window has no items -> call window key
-	if(Menu_ActiveItem == null_entity)
-		Menu_Reselect( false );
-
-	if( ( !Menu_IsSelectable( Menu_ActiveItem ) && Menu_ActiveItem != Menu_ActiveWindow ) ||
-	     Menu_ProcessKey( Menu_ActiveWindow, pKey, pAscii ) != MENU_EVENT_PROCESSED )
-		// If it goes really wrong:
-		if( pKey == K_ESCAPE )
-			if( gamestatus & GAME_DEVELOPER )
-				error( " K_ESCAPE wasnt processed!\n" );
-			else {
-				Menu_Toggle();
-				cmd( "menu_restart\n" );
-			}
-		else if( gamestatus & GAME_DEVELOPER ) {
-			print( " Key ", ftos( pKey ), " ('" );
-			print( chr( pAscii ), "') wasn't processed!\n" );
-		}
-};
-
-bool() Menu_Toggle =
-{
-	// only let the qc toggle the menu if we are ingame or a developer
-	if( gamestatus & GAME_CONNECTED || gamestatus & GAME_DEVELOPER ) {
-		// then allow toggling
-		m_hide();
-		return true;
-	} else
-		return false;
-};
+// DP/Nex menu
+// system/events.qc
+
+// debug process output functions
+bool _menu_process_filtered;
+void( float pMode, float pSelectState ) _Menu_Process_Debug_Filter =
+{
+	if( !sys_debug_process )
+		_menu_process_filtered = false;
+	else if( sys_debug_process_filter )
+		_menu_process_filtered = (pMode & sys_debug_process_filter);
+	else
+		_menu_process_filtered = true;
+	if( _menu_process_filtered == MENU_PROCESS_MOUSE && pSelectState == MENU_SELECT_NEVER )
+		_menu_process_filtered = false;
+};
+
+#ifdef USEFUNCTIONS
+void( string pText ) _Menu_Process_Debug_Print =
+{
+	if( _menu_process_filtered )
+		print( pText );
+};
+#else
+#define _Menu_Process_Debug_Print(pText)   if( _menu_process_filtered ) print( pText )
+#endif
+
+// process stacks
+
+void() Menu_Process_Setup =
+{
+	Menu_Origin = '0 0 0';
+	Menu_Clip_Position = '0 0 0';
+	Menu_Clip_Size = '0 0 0';
+};
+
+void( entity pItem ) _Menu_Env_LoadClipArea
+{
+	Menu_Clip_Position = pItem._cache_clip_pos;
+	Menu_Clip_Size = pItem._cache_clip_size;
+
+	if( sys_debug_mgfx && _menu_process_filtered )
+		print( "MGFX Loaded clip area = (", vtos( Menu_Clip_Position ), "; ", vtos( Menu_Clip_Size ), ")\n" );
+};
+
+void( entity pItem ) _Menu_Env_LoadOrigin =
+{
+	Menu_Origin = pItem._cache_origin;
+	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
+
+	if( sys_debug_mgfx && _menu_process_filtered )
+		print( "MGFX Loaded org = ", vtos( Menu_Origin ), "\n" );
+};
+
+void( entity pItem ) _Menu_Env_Reload =
+{
+	Menu_Origin = pItem._cache_origin;
+	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
+	Menu_Clip_Position = pItem._cache_clip_pos;
+	Menu_Clip_Size = pItem._cache_clip_size;
+
+	if( sys_debug_mgfx && _menu_process_filtered )
+		print( "MGFX Reloaded env for: org = ", vtos( Menu_Origin ), "; clip area = (", vtos( Menu_Clip_Position ), "; ", vtos( Menu_Clip_Size ), ")\n" );
+};
+
+void() _MGX_SetClipArea =
+{
+	if( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' )
+		Gfx_ResetClipArea();
+	else
+		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
+};
+
+void( entity pItem ) _Menu_Env_SetupClipArea
+{
+	local vector lDelta, lPos, lSize;
+
+	lPos = pItem.pos;
+	lSize = pItem.size;
+	if( lPos != '0 0 0' || lSize != '0 0 0' ) {
+		if( (Menu_Clip_Position != '0 0 0' || Menu_Clip_Size != '0 0 0') ) {
+			lPos = Menu_Origin + lPos;
+			lDelta = Util_GetClipDelta( lPos, Menu_Clip_Position, Menu_Clip_Size );
+			lPos = lPos + lDelta;
+			lSize = Util_ClipRect( lPos, lSize - lDelta, Menu_Clip_Position, Menu_Clip_Size );
+		}
+
+		Menu_Clip_Position = lPos;
+		Menu_Clip_Size = lSize;
+	}
+	pItem._cache_clip_pos = Menu_Clip_Position;
+	pItem._cache_clip_size = Menu_Clip_Size;
+
+	if( sys_debug_mgfx && _menu_process_filtered ) {
+		print( "MGFX Setup clip area: (", vtos( pItem.pos ), "; ", vtos( pItem.size ) );
+		print( ") clipped to (", vtos( Menu_Clip_Position ), "; ", vtos( Menu_Clip_Size ), ")\n" );
+	}
+};
+
+void( entity pItem ) _Menu_Env_SetupOrigin =
+{
+	Menu_Origin = Menu_Origin + pItem.origin + pItem.pos;
+	pItem._cache_origin = Menu_Origin;
+
+	if( sys_debug_mgfx && _menu_process_filtered )
+		print( "MGFX Setup org = ", vtos( Menu_Origin ), "\n" );
+};
+
+void( entity pItem ) _Menu_ProcessRunFlag =
+{
+	local entity lChild;
+
+	_Menu_Process_Debug_Print( strcat( "R ", pItem.name, "\n" ) );
+
+	// setup the cache and the Menu_* variables
+	_Menu_Env_SetupClipArea( pItem );
+
+	Menu_SetRunFlag( pItem );
+
+	// we adjust the origin for the children
+	_Menu_Env_SetupOrigin( pItem );
+
+	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
+			Menu_InheritRunFlag( pItem, lChild );
+			_Menu_ProcessRunFlag( lChild );
+			// reload the cached state
+			_Menu_Env_Reload( pItem );
+	}
+};
+
+void( entity pItem ) _Menu_ProcessDraw =
+{
+	local entity lChild;
+
+	_Menu_Process_Debug_Print( strcat( "D ", pItem.name, " " ) );
+
+	if( !Menu_IsVisible( pItem ) ) {
+		_Menu_Process_Debug_Print( "Failed (Not visible)\n" );
+		return;
+	}
+	_Menu_Process_Debug_Print( "\n" );
+
+	_Menu_Env_LoadClipArea( pItem );
+	_MGX_SetClipArea();
+
+	Raise_Draw( pItem );
+
+	_Menu_Env_LoadOrigin( pItem );
+	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
+		_Menu_ProcessDraw( lChild );
+		// reload old state
+		_Menu_Env_Reload( pItem );
+		_MGX_SetClipArea();
+	}
+};
+
+void( entity pItem ) _Menu_ProcessUpdate =
+{
+	local entity lChild;
+
+	_Menu_Process_Debug_Print( strcat( "U ", pItem.name, " " ) );
+
+	if( Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) ) {
+		_Menu_Process_Debug_Print( "Failed (RUNFLAG_CHILDDRAWONLY)\n" );
+		return;
+	}
+
+	_Menu_Env_LoadClipArea( pItem );
+	Raise_Update( pItem );
+
+	if( Menu_HasRunFlag( pItem, RUNFLAG_HIDDEN ) ) {
+		_Menu_Process_Debug_Print( "Aborted branching (RUNFLAG_HIDDEN)\n" );
+		return;
+	}
+	_Menu_Process_Debug_Print( "\n" );
+
+	_Menu_Env_LoadOrigin( pItem );
+	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
+		_Menu_ProcessUpdate( lChild );
+		_Menu_Env_Reload( lChild );
+	}
+};
+
+void( entity pItem, float pSelectMode ) _Menu_ProcessMouse =
+{
+	local entity lChild;
+
+	if( _menu_process_filtered ) {
+		print( "M " );
+		switch( pSelectMode ) {
+			case MENU_SELECT_SELECTABLE:
+				print( "S " );
+				break;
+			case MENU_SELECT_ALWAYS:
+				print( "A " );
+				break;
+			case MENU_SELECT_NEVER:
+				print( "N " );
+				break;
+		}
+		print( pItem.name, " " );
+	}
+
+	if( !Menu_IsVisible( pItem ) ) {
+		_Menu_Process_Debug_Print( "Failed (Not visible)\n" );
+		return;
+	}
+
+	_Menu_Env_LoadClipArea( pItem );
+	// check if the mouse is even in the clip area
+	if( Util_InRect( Cursor_Position, Menu_Clip_Position, Menu_Clip_Size ) ||
+	( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' ) ) {
+		pItem._runFlag = pItem._runFlag | RUNFLAG_MOUSEINAREA;
+
+		if( !Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
+			Raise_MouseEnter( pItem );
+		if( pSelectMode != MENU_SELECT_NEVER && Menu_HasFlag( pItem, FLAG_SEALOFFMOUSE ) )
+			Menu_ActiveItem = null_entity;
+		if( ( pSelectMode == MENU_SELECT_ALWAYS ) ||
+		    ( Menu_IsSelectable( pItem ) && pSelectMode == MENU_SELECT_SELECTABLE ) )
+			Menu_ActiveItem = pItem;
+	} else { // if the mouse isnt in the clip area, neither the children will be!
+		if( Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
+			Raise_MouseLeave( pItem );
+		_Menu_Process_Debug_Print( "Aborted branching (Outside the clip area)\n" );
+		return;
+	}
+	_Menu_Process_Debug_Print( "\n" );
+
+	_Menu_Env_LoadOrigin( pItem );
+	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
+		if( !Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWUPDATEONLY ) || !Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) )
+			_Menu_ProcessMouse( lChild, pSelectMode );
+		else
+			_Menu_ProcessMouse( lChild, MENU_SELECT_NEVER );
+		_Menu_Env_Reload( pItem );
+	}
+};
+
+float( float pRetValue ) _Menu_Process_Debug_Return =
+{
+	if( _menu_process_filtered )
+		switch( pRetValue ) {
+		case MENU_EVENT_NORMAL:
+		case MENU_EVENT_CONTINUE:
+			print( "MENU_EVENT_CONTINUE\n" );
+			break;
+		case MENU_EVENT_RAISEPARENT:
+			print( "MENU_EVENT_RAISEPARENT\n" );
+			break;
+		case MENU_EVENT_PROCESSED:
+			print( "MENU_EVENT_PROCESSED\n" );
+			break;
+		}
+
+	return pRetValue;
+};
+
+float( entity pItem, float pKey, float pAscii ) _Menu_ProcessKey =
+{
+	local entity lChild;
+	local float lResult;
+
+	_Menu_Process_Debug_Print( strcat( "K ", ftos( pKey ), " ", pItem.name, " " ) );
+	if( Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWUPDATEONLY ) || Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) )
+		return _Menu_Process_Debug_Return( MENU_EVENT_CONTINUE );
+
+	_Menu_Env_LoadClipArea( pItem );
+
+	if( Menu_ActiveItem == pItem ) {
+		if( Raise_Key( pItem, pKey, pAscii ) )
+			lResult = MENU_EVENT_PROCESSED;
+		else
+			lResult = MENU_EVENT_RAISEPARENT;
+
+		return _Menu_Process_Debug_Return( lResult );
+	}
+
+	_Menu_Env_LoadOrigin( pItem );
+	for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
+		lResult = _Menu_ProcessKey( lChild, pKey, pAscii );
+		_Menu_Env_Reload( pItem );
+
+		if( lResult == MENU_EVENT_PROCESSED )
+			return _Menu_Process_Debug_Return( MENU_EVENT_PROCESSED );
+		else if( lResult == MENU_EVENT_RAISEPARENT )
+			if( Raise_Key( pItem, pKey, pAscii ) )
+				return _Menu_Process_Debug_Return( MENU_EVENT_PROCESSED );
+			else
+				return _Menu_Process_Debug_Return( MENU_EVENT_RAISEPARENT );
+	}
+
+	return _Menu_Process_Debug_Return( MENU_EVENT_CONTINUE );
+};
+
+float( entity pItem, float pMode, float pSelectMode, float pKey, float pAscii ) Menu_Process =
+{
+	local vector lSize, lPos, lOrigin;
+	local float lResult;
+
+	lSize = Menu_Clip_Size;
+	lPos = Menu_Clip_Position;
+	lOrigin = Menu_Origin;
+
+	_Menu_Process_Debug_Filter( pMode, pSelectMode );
+
+	lResult = 0;
+	switch( pMode ) {
+		case MENU_PROCESS_RUNFLAG:
+			_Menu_ProcessRunFlag( pItem );
+			break;
+		case MENU_PROCESS_UPDATE:
+			_Menu_ProcessUpdate( pItem );
+			break;
+		case MENU_PROCESS_DRAW:
+			_Menu_ProcessDraw( pItem );
+			break;
+		case MENU_PROCESS_MOUSE:
+			_Menu_ProcessMouse( pItem, pSelectMode );
+			break;
+		case MENU_PROCESS_KEY:
+			lResult = _Menu_ProcessKey( pItem, pKey, pAscii );
+			break;
+	}
+
+	Menu_Clip_Size = lSize;
+	Menu_Clip_Position = lPos;
+	Menu_Origin = lOrigin;
+	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
+	if( pMode == MENU_PROCESS_DRAW )
+		_MGX_SetClipArea();
+
+	return lResult;
+};
+
+void() Menu_Frame =
+{
+	Sys_Debug_Frame();
+	if( sys_debug_halt ) {
+		return;
+	}
+
+	Menu_UpdateRunFlags();
+
+	Menu_Process_Setup();
+	// if mouse was moved, select an item
+	if( Cursor_Relative != '0 0 0' ) {
+		local entity lOld;
+
+		lOld = Menu_ActiveItem;
+		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
+
+		if( !Menu_ActiveItem )
+			Menu_ActiveItem = lOld;
+		else if( lOld != Menu_ActiveItem ) {
+			Raise_Select( lOld, false, true );
+			Raise_Select( Menu_ActiveItem, true, true );
+		}
+	} else // just update mouseinarea
+		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_NEVER );
+
+	// process the update event
+	Menu_Process_Setup();
+	Menu_ProcessUpdate( Menu_ActiveWindow, MENU_PROCESS_UPDATE );
+
+
+	Menu_CollectGarbage( false );
+}
+
+void() Menu_Draw =
+{
+	if( sys_debug_halt ) {
+		return;
+	}
+	// if Menu_ActiveWindow is visible loop though it
+	if( Menu_IsVisible( Menu_ActiveWindow ) )
+	{
+		Menu_Process_Setup();
+		Menu_ProcessDraw( Menu_ActiveWindow );
+	}
+
+	Sys_Debug_Draw();
+};
+
+void( float pKey, float pAscii) Menu_Key =
+{
+	if( sys_debug_halt ) {
+		return;
+	}
+
+	// is a keyhook set ?
+	if( Menu_KeyHook != Util_NullFunction ) {
+		// call it
+		Menu_KeyHook( pKey, pAscii );
+		return;
+	}
+	// before calling the current keydown functions, process the mouse again
+	// to make sure the correct item is called
+	// (except mouse wheel up and down)
+	// if the mouse doesnt point to an item, there wont be a reaction on the clicking
+	if(K_MOUSE1 <= pKey && pKey <= K_MOUSE10) {
+		local entity lOld;
+
+		lOld = Menu_ActiveItem;
+		Menu_ActiveItem = null_entity;
+		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
+
+		if( !Menu_ActiveItem ) {
+			Menu_ActiveItem = lOld;
+			return;
+		} else if( lOld != Menu_ActiveItem ) {
+			Raise_Select( lOld, false, true );
+			Raise_Select( Menu_ActiveItem, true, true );
+		}
+	}
+
+	// call current selected keydown function
+	// if nothing is selected -> window has no items -> call window key
+	if(Menu_ActiveItem == null_entity)
+		Menu_Reselect( false );
+
+	if( ( !Menu_IsSelectable( Menu_ActiveItem ) && Menu_ActiveItem != Menu_ActiveWindow ) ||
+	     Menu_ProcessKey( Menu_ActiveWindow, pKey, pAscii ) != MENU_EVENT_PROCESSED )
+		// If it goes really wrong:
+		if( pKey == K_ESCAPE )
+			if( gamestatus & GAME_DEVELOPER )
+				error( " K_ESCAPE wasnt processed!\n" );
+			else {
+				Menu_Toggle();
+				cmd( "menu_restart\n" );
+			}
+		else if( gamestatus & GAME_DEVELOPER ) {
+			print( " Key ", ftos( pKey ), " ('" );
+			print( chr( pAscii ), "') wasn't processed!\n" );
+		}
+};
+
+bool() Menu_Toggle =
+{
+	// only let the qc toggle the menu if we are ingame or a developer
+	if( gamestatus & GAME_CONNECTED || gamestatus & GAME_DEVELOPER ) {
+		// then allow toggling
+		m_hide();
+		return true;
+	} else
+		return false;
+};


Property changes on: trunk/basezym/menuqc/system/events.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/events.qh
===================================================================
--- trunk/basezym/menuqc/system/events.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/events.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,56 +1,56 @@
-// DP/Nex Menu
-// system/events.qh
-
-// menu_processmous states
-enum {
-	MENU_SELECT_SELECTABLE,
-	MENU_SELECT_ALWAYS,
-	MENU_SELECT_NEVER
-};
-
-enum {
-	MENU_EVENT_NORMAL,
-	MENU_EVENT_CONTINUE = 0,
-	MENU_EVENT_RAISEPARENT,
-	MENU_EVENT_PROCESSED
-};
-
-enumflags { //enumflags because of the debug filter
-	MENU_PROCESS_RUNFLAG,
-	MENU_PROCESS_UPDATE,
-	MENU_PROCESS_DRAW,
-	MENU_PROCESS_MOUSE,
-	MENU_PROCESS_KEY
-};
-
-// used to build up the local coord system
-vector Menu_Cursor_Position;
-
-// key hook - only as long as there is no history change or the menu is closed
-entity Menu_KeyHook_Target;
-var void( float pKey, float pAscii ) Menu_KeyHook = __NULL__;
-
-///////////////
-// prototypes
-///
-
-void() Menu_Frame;
-void() Menu_Draw;
-void(float pKey, float pAscii) Menu_Key;
-
-// decide whether to toggle the menu
-bool() Menu_Toggle;
-
-void() Menu_Process_Setup;
-
-float( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) Menu_Process;
-#define _Menu_Process(item,mode) 	Menu_Process( item, mode, 0, 0, 0 )
-#define Menu_ProcessDraw(item)	 	_Menu_Process( item, MENU_PROCESS_DRAW )
-#define Menu_ProcessUpdate(item)	_Menu_Process( item, MENU_PROCESS_UPDATE )
-#define Menu_ProcessRunFlag(item)	_Menu_Process( item, MENU_PROCESS_RUNFLAG )
-#define Menu_ProcessMouse(item,select)  Menu_Process( item, MENU_PROCESS_MOUSE, select, 0, 0 )
-#define Menu_ProcessKey(item,key,ascii) Menu_Process( item, MENU_PROCESS_KEY, 0, key, ascii )
-
-
-
-
+// DP/Nex Menu
+// system/events.qh
+
+// menu_processmous states
+enum {
+	MENU_SELECT_SELECTABLE,
+	MENU_SELECT_ALWAYS,
+	MENU_SELECT_NEVER
+};
+
+enum {
+	MENU_EVENT_NORMAL,
+	MENU_EVENT_CONTINUE = 0,
+	MENU_EVENT_RAISEPARENT,
+	MENU_EVENT_PROCESSED
+};
+
+enumflags { //enumflags because of the debug filter
+	MENU_PROCESS_RUNFLAG,
+	MENU_PROCESS_UPDATE,
+	MENU_PROCESS_DRAW,
+	MENU_PROCESS_MOUSE,
+	MENU_PROCESS_KEY
+};
+
+// used to build up the local coord system
+vector Menu_Cursor_Position;
+
+// key hook - only as long as there is no history change or the menu is closed
+entity Menu_KeyHook_Target;
+var void( float pKey, float pAscii ) Menu_KeyHook = __NULL__;
+
+///////////////
+// prototypes
+///
+
+void() Menu_Frame;
+void() Menu_Draw;
+void(float pKey, float pAscii) Menu_Key;
+
+// decide whether to toggle the menu
+bool() Menu_Toggle;
+
+void() Menu_Process_Setup;
+
+float( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) Menu_Process;
+#define _Menu_Process(item,mode) 	Menu_Process( item, mode, 0, 0, 0 )
+#define Menu_ProcessDraw(item)	 	_Menu_Process( item, MENU_PROCESS_DRAW )
+#define Menu_ProcessUpdate(item)	_Menu_Process( item, MENU_PROCESS_UPDATE )
+#define Menu_ProcessRunFlag(item)	_Menu_Process( item, MENU_PROCESS_RUNFLAG )
+#define Menu_ProcessMouse(item,select)  Menu_Process( item, MENU_PROCESS_MOUSE, select, 0, 0 )
+#define Menu_ProcessKey(item,key,ascii) Menu_Process( item, MENU_PROCESS_KEY, 0, key, ascii )
+
+
+
+


Property changes on: trunk/basezym/menuqc/system/events.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/events_.qc
===================================================================
--- trunk/basezym/menuqc/system/events_.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/events_.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,419 +1,419 @@
-// DP/Nex menu
-// system/events.qc
-
-// process stacks
-
-void() Menu_Process_Setup =
-{
-
-	Menu_Origin = '0 0 0';
-	Menu_Clip_Position = '0 0 0';
-	Menu_Clip_Size = '0 0 0';
-
-	Gfx_ResetClipArea();
-}
-
-void( vector pOrigin ) _Menu_Origin_Push =
-{
-	Menu_Origin = Menu_OrgToMen( pOrigin );
-
-	if( _menu_process_filtered ) {
-		print( "MGFX Pushed origin: ", vtos( pOrigin ), " Absolute ", vtos( Menu_Origin ), "\n" );
-		//print( "MGFX Pushed origin: ", vtos( pOrigin ), " Absolute " );
-		//print( vtos( Menu_Origin ), "\n" );
-	}
-
-	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
-};
-
-void( vector pOldOrigin ) _Menu_Origin_Pop =
-{
-	Menu_Origin = pOldOrigin;
-
-	if( _menu_process_filtered )
-		print( "MGFX Popped origin for origin: ", vtos( Menu_Origin ), "\n" );
-
-	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
-};
-
-void( vector pPos, vector pSize ) _Menu_Clip_Push =
-{
-	local vector lDelta;
-
-	if( pPos != '0 0 0' || pSize != '0 0 0' ) {
-		if( (Menu_Clip_Position != '0 0 0' || Menu_Clip_Size != '0 0 0') ) {
-			pPos = Menu_OrgToMen( pPos );
-			lDelta = Util_GetClipDelta( pPos, Menu_Clip_Position, Menu_Clip_Size );
-			pPos = pPos + lDelta;
-			pSize = Util_ClipRect( pPos, pSize - lDelta, Menu_Clip_Position, Menu_Clip_Size );
-		}
-
-		Menu_Clip_Position = pPos;
-		Menu_Clip_Size = pSize;
-		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
-	}
-
-	if( _menu_process_filtered ) {
-		print( "MGFX Pushed clipper: ", vtos( pPos ), " " );
-		print( vtos( pSize ) );
-		print( " Clipped to: ", vtos( Menu_Clip_Position ), " " );
-		print( vtos( Menu_Clip_Size),"\n" );
-	}
-};
-
-void( vector pOldPos, vector pOldSize ) _Menu_Clip_Pop =
-{
-	Menu_Clip_Position = pOldPos;
-	Menu_Clip_Size = pOldSize;
-
-	if( sys_debug_mgfx ) {
-		print( "MGFX Popped clipper for clip area: ", vtos( Menu_Clip_Position ), " " );
-		print( vtos( Menu_Clip_Size ), "\n" );
-	}
-
-	if( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' )
-		Gfx_ResetClipArea();
-	else
-		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
-};
-
-// debug process functions
-bool _menu_process_filtered;
-void( float pMode, float pSelectState ) _Menu_Process_Debug_Filter =
-{
-	if( !sys_debug_process )
-		_menu_process_filtered = false;
-	else if( sys_debug_process_filter )
-		_menu_process_filtered = (pMode & sys_debug_process_filter);
-	else
-		_menu_process_filtered = true;
-	if( _menu_process_filtered == MENU_PROCESS_MOUSE && pSelectState == MENU_SELECT_NEVER )
-		_menu_process_filtered = false;
-};
-
-void( string pText ) _Menu_Process_Debug_Print =
-{
-	if( _menu_process_filtered )
-		print( pText );
-};
-
-void( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) _Menu_Process_Debug_Header =
-{
-	if( sys_debug_process && _menu_process_filtered ) {
-		switch( pMode ) {
-		case MENU_PROCESS_RUNFLAG:
-			print( "R " );
-			break;
-		case MENU_PROCESS_UPDATE:
-			print( "U " );
-			break;
-		case MENU_PROCESS_DRAW:
-			print( "D " );
-			break;
-		case MENU_PROCESS_MOUSE:
-			print( "M " );
-			switch( pSelectState ) {
-			case MENU_SELECT_SELECTABLE:
-				print( "S " );
-				break;
-			case MENU_SELECT_ALWAYS:
-				print( "A " );
-				break;
-			case MENU_SELECT_NEVER:
-				print( "N " );
-				break;
-			}
-			break;
-		case MENU_PROCESS_KEY:
-			print( "K " );
-			print( ftos( pKey ), " " );
-			break;
-		default:
-			print( "~ " );
-		}
-		print( pItem.name, " " );
-	}
-};
-
-void( float pRetValue ) _Menu_Process_Debug_Return =
-{
-	if( sys_debug_process && _menu_process_filtered )
-		switch( pRetValue ) {
-		case MENU_EVENT_NORMAL:
-		case MENU_EVENT_CONTINUE:
-			print( "MENU_EVENT_CONTINUE\n" );
-			break;
-		case MENU_EVENT_RAISEPARENT:
-			print( "MENU_EVENT_RAISEPARENT\n" );
-			break;
-		case MENU_EVENT_PROCESSED:
-			print( "MENU_EVENT_PROCESSED\n" );
-			break;
-		}
-};
-
-// main process functions
-float( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) Menu_Process =
-{
-	local entity lChild;
-	local bool lContinue;
-	local float lResult;
-	// the new clip and origin stack
-	local vector lOldOrigin, lOldClipPos, lOldClipSize;
-
-	// set the debug filter
-	_Menu_Process_Debug_Filter( pMode, pSelectState );
-
-	_Menu_Process_Debug_Header( pItem, pMode, pSelectState, pKey, pAscii );
-
-	// adjust the clip area
-	lOldClipPos = Menu_Clip_Position;
-	lOldClipSize = Menu_Clip_Size;
-	_Menu_Clip_Push( pItem.pos, pItem.size );
-
-	// test if its necessary to do anything
-	lContinue = false;
-	lResult = MENU_EVENT_NORMAL;
-	switch( pMode ) {
-	case MENU_PROCESS_RUNFLAG:
-		lContinue = true;
-		break;
-	case MENU_PROCESS_MOUSE:
-		if( !Menu_IsVisible( pItem ) )
-			break;
-		lContinue = true;
-		break;
-	case MENU_PROCESS_DRAW:
-		if( !Menu_IsVisible( pItem ) )
-			break;
-		lContinue = true;
-		break;
-	case MENU_PROCESS_UPDATE:
-		if( Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) )
-			break;
-		lContinue = true;
-		break;
-	case MENU_PROCESS_KEY:
-		if( !Menu_HasEvents( pItem ) )
-			break;
-		lContinue = true;
-		break;
-	default:
-		error( "Bad pMode in Menu_Processs!" );
-		break;
-	}
-	if( !lContinue ) {
-		_Menu_Process_Debug_Print( "Condition failed\n" );
-		_Menu_Clip_Pop( lOldClipPos, lOldClipSize );
-		return lResult;
-	}
-
-	// process the events for this item
-	lContinue = true;
-	switch( pMode ) {
-	case MENU_PROCESS_RUNFLAG:
-		Menu_SetRunFlag( pItem );
-		break;
-	case MENU_PROCESS_UPDATE:
-		Raise_Update( pItem );
-		if( Menu_HasRunFlag( pItem, RUNFLAG_HIDDEN ) )
-			lContinue = false;
-		break;
-	case MENU_PROCESS_DRAW:
-		Raise_Draw( pItem );
-		break;
-	case MENU_PROCESS_MOUSE:
-		// check if the mouse is even in the clip area
-		if( Util_InRect( Cursor_Position, Menu_Clip_Position, Menu_Clip_Size ) ||
-		    ( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' ) ) {
-			pItem._runFlag = pItem._runFlag | RUNFLAG_MOUSEINAREA;
-
-			if( !Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
-				Raise_MouseEnter( pItem );
-			if( pSelectState != MENU_SELECT_NEVER && Menu_HasFlag( pItem, FLAG_SEALOFFMOUSE ) )
-				Menu_ActiveItem = null_entity;
-			if( ( pSelectState == MENU_SELECT_ALWAYS ) ||
-			    ( Menu_IsSelectable( pItem ) && pSelectState == MENU_SELECT_SELECTABLE ) )
-				Menu_ActiveItem = pItem;
-		} else if( Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
-			Raise_MouseLeave( pItem );
-		break;
-	case MENU_PROCESS_KEY:
-		if( Menu_ActiveItem == pItem ) {
-			lContinue = false;
-			if( Raise_Key( pItem, pKey, pAscii ) )
-				lResult = MENU_EVENT_PROCESSED;
-			else
-				lResult = MENU_EVENT_RAISEPARENT;
-
-			_Menu_Process_Debug_Return( lResult );
-		}
-		break;
-	}
-	if( !lContinue ) {
-		_Menu_Process_Debug_Print( "Early\n" );
-		_Menu_Clip_Pop( lOldClipPos, lOldClipSize );
-		return lResult;
-	}
-
-	// we adjust the origin for the children
-	lOldOrigin = Menu_Origin;
-	_Menu_Origin_Push( pItem.pos + pItem.origin );
-
-	_Menu_Process_Debug_Print( "\n" );
-
-	switch( pMode ) {
-	case MENU_PROCESS_RUNFLAG:
-		for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
-			Menu_InheritRunFlag( pItem, lChild );
-			Menu_ProcessRunFlag( lChild );
-		}
-		break;
-	case MENU_PROCESS_DRAW:
-		for( lChild = pItem._child ; lChild ; lChild = lChild._next )
-			Menu_ProcessDraw( lChild );
-		break;
-	case MENU_PROCESS_UPDATE:
-		for( lChild = pItem._child ; lChild ; lChild = lChild._next )
-			Menu_ProcessUpdate( lChild );
-		break;
-	case MENU_PROCESS_MOUSE:
-		for( lChild = pItem._child ; lChild ; lChild = lChild._next )
-			if( Menu_HasEvents( pItem ) )
-				Menu_ProcessMouse( lChild, pSelectState );
-			else
-				Menu_ProcessMouse( lChild, MENU_SELECT_NEVER );
-		break;
-	case MENU_PROCESS_KEY:
-		for( lChild = pItem._child ; lContinue && lChild ; lChild = lChild._next ) {
-			local float lRet;
-
-			lRet = Menu_ProcessKey( lChild, pKey, pAscii );
-
-			switch( lRet ) {
-			case MENU_EVENT_RAISEPARENT:
-				lContinue = false;
-				if( Raise_Key( pItem, pKey, pAscii ) )
-					lResult = MENU_EVENT_PROCESSED;
-				else
-					lResult = MENU_EVENT_RAISEPARENT;
-				break;
-			case MENU_EVENT_PROCESSED:
-				lResult = lRet;
-				lContinue = false;
-				break;
-			case MENU_EVENT_CONTINUE:
-				lResult = lRet;
-				break;
-			}
-		}
-		_Menu_Process_Debug_Return( lResult );
-		break;
-	}
-
-	_Menu_Origin_Pop( lOldOrigin );
-
-	_Menu_Clip_Pop( lOldClipPos, lOldClipSize );
-	return lResult;
-};
-
-void() Menu_Frame =
-{
-	Sys_Debug_Frame();
-
-	Menu_UpdateRunFlags();
-	// process the update event
-	Menu_Process_Setup();
-	Menu_ProcessUpdate( Menu_ActiveWindow, MENU_PROCESS_UPDATE );
-
-	Menu_Process_Setup();
-	// if mouse was moved, select an item
-	if( Cursor_Relative != '0 0 0' ) {
-		local entity lOld;
-
-		lOld = Menu_ActiveItem;
-		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
-
-		if( !Menu_ActiveItem )
-			Menu_ActiveItem = lOld;
-		else if( lOld != Menu_ActiveItem ) {
-			Raise_Select( lOld, false, true );
-			Raise_Select( Menu_ActiveItem, true, true );
-		}
-	} else // just update mouseinarea
-		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_NEVER );
-
-	Menu_CollectGarbage( false );
-}
-
-void() Menu_Draw =
-{
-	// if Menu_ActiveWindow is visible loop though it
-	if( Menu_IsVisible( Menu_ActiveWindow ) )
-	{
-		Menu_Process_Setup();
-		Menu_ProcessDraw( Menu_ActiveWindow );
-	}
-
-	Sys_Debug_Draw();
-};
-
-void( float pKey, float pAscii) Menu_Key =
-{
-	// is a keyhook set ?
-	if( Menu_KeyHook != Util_NullFunction ) {
-		// call it
-		Menu_KeyHook( pKey, pAscii );
-		return;
-	}
-	// before calling the current keydown functions, process the mouse again
-	// to make sure the correct item is called
-	// (except mouse wheel up and down)
-	// if the mouse doesnt point to an item, there wont be a reaction on the clicking
-	if(K_MOUSE1 <= pKey && pKey <= K_MOUSE10) {
-		local entity lOld;
-
-		lOld = Menu_ActiveItem;
-		Menu_ActiveItem = null_entity;
-		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
-
-		if( !Menu_ActiveItem ) {
-			Menu_ActiveItem = lOld;
-			return;
-		} else if( lOld != Menu_ActiveItem ) {
-			Raise_Select( lOld, false, true );
-			Raise_Select( Menu_ActiveItem, true, true );
-		}
-	}
-
-	// call current selected keydown function
-	// if nothing is selected -> window has no items -> call window key
-	if(Menu_ActiveItem == null_entity)
-		Menu_Reselect( false );
-
-	if( ( !Menu_IsSelectable( Menu_ActiveItem ) && Menu_ActiveItem != Menu_ActiveWindow ) ||
-	     Menu_ProcessKey( Menu_ActiveWindow, pKey, pAscii ) != MENU_EVENT_PROCESSED )
-		// If it goes really wrong:
-		if( pKey == K_ESCAPE )
-			if( gamestatus & GAME_DEVELOPER )
-				error( " K_ESCAPE wasnt processed!\n" );
-			else {
-				Menu_Toggle();
-				cmd( "menu_restart\n" );
-			}
-		else if( gamestatus & GAME_DEVELOPER ) {
-			print( " Key ", ftos( pKey ), " ('" );
-			print( chr( pAscii ), "') wasn't processed!\n" );
-		}
-};
-
-bool() Menu_Toggle =
-{
-	// only let the qc toggle the menu if we are ingame or a developer
-	if( gamestatus & GAME_CONNECTED || gamestatus & GAME_DEVELOPER ) {
-		// then allow toggling
-		m_hide();
-		return true;
-	} else
-		return false;
-};
+// DP/Nex menu
+// system/events.qc
+
+// process stacks
+
+void() Menu_Process_Setup =
+{
+
+	Menu_Origin = '0 0 0';
+	Menu_Clip_Position = '0 0 0';
+	Menu_Clip_Size = '0 0 0';
+
+	Gfx_ResetClipArea();
+}
+
+void( vector pOrigin ) _Menu_Origin_Push =
+{
+	Menu_Origin = Menu_OrgToMen( pOrigin );
+
+	if( _menu_process_filtered ) {
+		print( "MGFX Pushed origin: ", vtos( pOrigin ), " Absolute ", vtos( Menu_Origin ), "\n" );
+		//print( "MGFX Pushed origin: ", vtos( pOrigin ), " Absolute " );
+		//print( vtos( Menu_Origin ), "\n" );
+	}
+
+	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
+};
+
+void( vector pOldOrigin ) _Menu_Origin_Pop =
+{
+	Menu_Origin = pOldOrigin;
+
+	if( _menu_process_filtered )
+		print( "MGFX Popped origin for origin: ", vtos( Menu_Origin ), "\n" );
+
+	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
+};
+
+void( vector pPos, vector pSize ) _Menu_Clip_Push =
+{
+	local vector lDelta;
+
+	if( pPos != '0 0 0' || pSize != '0 0 0' ) {
+		if( (Menu_Clip_Position != '0 0 0' || Menu_Clip_Size != '0 0 0') ) {
+			pPos = Menu_OrgToMen( pPos );
+			lDelta = Util_GetClipDelta( pPos, Menu_Clip_Position, Menu_Clip_Size );
+			pPos = pPos + lDelta;
+			pSize = Util_ClipRect( pPos, pSize - lDelta, Menu_Clip_Position, Menu_Clip_Size );
+		}
+
+		Menu_Clip_Position = pPos;
+		Menu_Clip_Size = pSize;
+		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
+	}
+
+	if( _menu_process_filtered ) {
+		print( "MGFX Pushed clipper: ", vtos( pPos ), " " );
+		print( vtos( pSize ) );
+		print( " Clipped to: ", vtos( Menu_Clip_Position ), " " );
+		print( vtos( Menu_Clip_Size),"\n" );
+	}
+};
+
+void( vector pOldPos, vector pOldSize ) _Menu_Clip_Pop =
+{
+	Menu_Clip_Position = pOldPos;
+	Menu_Clip_Size = pOldSize;
+
+	if( sys_debug_mgfx ) {
+		print( "MGFX Popped clipper for clip area: ", vtos( Menu_Clip_Position ), " " );
+		print( vtos( Menu_Clip_Size ), "\n" );
+	}
+
+	if( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' )
+		Gfx_ResetClipArea();
+	else
+		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
+};
+
+// debug process functions
+bool _menu_process_filtered;
+void( float pMode, float pSelectState ) _Menu_Process_Debug_Filter =
+{
+	if( !sys_debug_process )
+		_menu_process_filtered = false;
+	else if( sys_debug_process_filter )
+		_menu_process_filtered = (pMode & sys_debug_process_filter);
+	else
+		_menu_process_filtered = true;
+	if( _menu_process_filtered == MENU_PROCESS_MOUSE && pSelectState == MENU_SELECT_NEVER )
+		_menu_process_filtered = false;
+};
+
+void( string pText ) _Menu_Process_Debug_Print =
+{
+	if( _menu_process_filtered )
+		print( pText );
+};
+
+void( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) _Menu_Process_Debug_Header =
+{
+	if( sys_debug_process && _menu_process_filtered ) {
+		switch( pMode ) {
+		case MENU_PROCESS_RUNFLAG:
+			print( "R " );
+			break;
+		case MENU_PROCESS_UPDATE:
+			print( "U " );
+			break;
+		case MENU_PROCESS_DRAW:
+			print( "D " );
+			break;
+		case MENU_PROCESS_MOUSE:
+			print( "M " );
+			switch( pSelectState ) {
+			case MENU_SELECT_SELECTABLE:
+				print( "S " );
+				break;
+			case MENU_SELECT_ALWAYS:
+				print( "A " );
+				break;
+			case MENU_SELECT_NEVER:
+				print( "N " );
+				break;
+			}
+			break;
+		case MENU_PROCESS_KEY:
+			print( "K " );
+			print( ftos( pKey ), " " );
+			break;
+		default:
+			print( "~ " );
+		}
+		print( pItem.name, " " );
+	}
+};
+
+void( float pRetValue ) _Menu_Process_Debug_Return =
+{
+	if( sys_debug_process && _menu_process_filtered )
+		switch( pRetValue ) {
+		case MENU_EVENT_NORMAL:
+		case MENU_EVENT_CONTINUE:
+			print( "MENU_EVENT_CONTINUE\n" );
+			break;
+		case MENU_EVENT_RAISEPARENT:
+			print( "MENU_EVENT_RAISEPARENT\n" );
+			break;
+		case MENU_EVENT_PROCESSED:
+			print( "MENU_EVENT_PROCESSED\n" );
+			break;
+		}
+};
+
+// main process functions
+float( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) Menu_Process =
+{
+	local entity lChild;
+	local bool lContinue;
+	local float lResult;
+	// the new clip and origin stack
+	local vector lOldOrigin, lOldClipPos, lOldClipSize;
+
+	// set the debug filter
+	_Menu_Process_Debug_Filter( pMode, pSelectState );
+
+	_Menu_Process_Debug_Header( pItem, pMode, pSelectState, pKey, pAscii );
+
+	// adjust the clip area
+	lOldClipPos = Menu_Clip_Position;
+	lOldClipSize = Menu_Clip_Size;
+	_Menu_Clip_Push( pItem.pos, pItem.size );
+
+	// test if its necessary to do anything
+	lContinue = false;
+	lResult = MENU_EVENT_NORMAL;
+	switch( pMode ) {
+	case MENU_PROCESS_RUNFLAG:
+		lContinue = true;
+		break;
+	case MENU_PROCESS_MOUSE:
+		if( !Menu_IsVisible( pItem ) )
+			break;
+		lContinue = true;
+		break;
+	case MENU_PROCESS_DRAW:
+		if( !Menu_IsVisible( pItem ) )
+			break;
+		lContinue = true;
+		break;
+	case MENU_PROCESS_UPDATE:
+		if( Menu_HasRunFlag( pItem, RUNFLAG_CHILDDRAWONLY ) )
+			break;
+		lContinue = true;
+		break;
+	case MENU_PROCESS_KEY:
+		if( !Menu_HasEvents( pItem ) )
+			break;
+		lContinue = true;
+		break;
+	default:
+		error( "Bad pMode in Menu_Processs!" );
+		break;
+	}
+	if( !lContinue ) {
+		_Menu_Process_Debug_Print( "Condition failed\n" );
+		_Menu_Clip_Pop( lOldClipPos, lOldClipSize );
+		return lResult;
+	}
+
+	// process the events for this item
+	lContinue = true;
+	switch( pMode ) {
+	case MENU_PROCESS_RUNFLAG:
+		Menu_SetRunFlag( pItem );
+		break;
+	case MENU_PROCESS_UPDATE:
+		Raise_Update( pItem );
+		if( Menu_HasRunFlag( pItem, RUNFLAG_HIDDEN ) )
+			lContinue = false;
+		break;
+	case MENU_PROCESS_DRAW:
+		Raise_Draw( pItem );
+		break;
+	case MENU_PROCESS_MOUSE:
+		// check if the mouse is even in the clip area
+		if( Util_InRect( Cursor_Position, Menu_Clip_Position, Menu_Clip_Size ) ||
+		    ( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' ) ) {
+			pItem._runFlag = pItem._runFlag | RUNFLAG_MOUSEINAREA;
+
+			if( !Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
+				Raise_MouseEnter( pItem );
+			if( pSelectState != MENU_SELECT_NEVER && Menu_HasFlag( pItem, FLAG_SEALOFFMOUSE ) )
+				Menu_ActiveItem = null_entity;
+			if( ( pSelectState == MENU_SELECT_ALWAYS ) ||
+			    ( Menu_IsSelectable( pItem ) && pSelectState == MENU_SELECT_SELECTABLE ) )
+				Menu_ActiveItem = pItem;
+		} else if( Menu_HasRunFlag( pItem, RUNFLAG_HADMOUSE ) && Menu_HasEvents( pItem ) )
+			Raise_MouseLeave( pItem );
+		break;
+	case MENU_PROCESS_KEY:
+		if( Menu_ActiveItem == pItem ) {
+			lContinue = false;
+			if( Raise_Key( pItem, pKey, pAscii ) )
+				lResult = MENU_EVENT_PROCESSED;
+			else
+				lResult = MENU_EVENT_RAISEPARENT;
+
+			_Menu_Process_Debug_Return( lResult );
+		}
+		break;
+	}
+	if( !lContinue ) {
+		_Menu_Process_Debug_Print( "Early\n" );
+		_Menu_Clip_Pop( lOldClipPos, lOldClipSize );
+		return lResult;
+	}
+
+	// we adjust the origin for the children
+	lOldOrigin = Menu_Origin;
+	_Menu_Origin_Push( pItem.pos + pItem.origin );
+
+	_Menu_Process_Debug_Print( "\n" );
+
+	switch( pMode ) {
+	case MENU_PROCESS_RUNFLAG:
+		for( lChild = pItem._child ; lChild ; lChild = lChild._next ) {
+			Menu_InheritRunFlag( pItem, lChild );
+			Menu_ProcessRunFlag( lChild );
+		}
+		break;
+	case MENU_PROCESS_DRAW:
+		for( lChild = pItem._child ; lChild ; lChild = lChild._next )
+			Menu_ProcessDraw( lChild );
+		break;
+	case MENU_PROCESS_UPDATE:
+		for( lChild = pItem._child ; lChild ; lChild = lChild._next )
+			Menu_ProcessUpdate( lChild );
+		break;
+	case MENU_PROCESS_MOUSE:
+		for( lChild = pItem._child ; lChild ; lChild = lChild._next )
+			if( Menu_HasEvents( pItem ) )
+				Menu_ProcessMouse( lChild, pSelectState );
+			else
+				Menu_ProcessMouse( lChild, MENU_SELECT_NEVER );
+		break;
+	case MENU_PROCESS_KEY:
+		for( lChild = pItem._child ; lContinue && lChild ; lChild = lChild._next ) {
+			local float lRet;
+
+			lRet = Menu_ProcessKey( lChild, pKey, pAscii );
+
+			switch( lRet ) {
+			case MENU_EVENT_RAISEPARENT:
+				lContinue = false;
+				if( Raise_Key( pItem, pKey, pAscii ) )
+					lResult = MENU_EVENT_PROCESSED;
+				else
+					lResult = MENU_EVENT_RAISEPARENT;
+				break;
+			case MENU_EVENT_PROCESSED:
+				lResult = lRet;
+				lContinue = false;
+				break;
+			case MENU_EVENT_CONTINUE:
+				lResult = lRet;
+				break;
+			}
+		}
+		_Menu_Process_Debug_Return( lResult );
+		break;
+	}
+
+	_Menu_Origin_Pop( lOldOrigin );
+
+	_Menu_Clip_Pop( lOldClipPos, lOldClipSize );
+	return lResult;
+};
+
+void() Menu_Frame =
+{
+	Sys_Debug_Frame();
+
+	Menu_UpdateRunFlags();
+	// process the update event
+	Menu_Process_Setup();
+	Menu_ProcessUpdate( Menu_ActiveWindow, MENU_PROCESS_UPDATE );
+
+	Menu_Process_Setup();
+	// if mouse was moved, select an item
+	if( Cursor_Relative != '0 0 0' ) {
+		local entity lOld;
+
+		lOld = Menu_ActiveItem;
+		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
+
+		if( !Menu_ActiveItem )
+			Menu_ActiveItem = lOld;
+		else if( lOld != Menu_ActiveItem ) {
+			Raise_Select( lOld, false, true );
+			Raise_Select( Menu_ActiveItem, true, true );
+		}
+	} else // just update mouseinarea
+		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_NEVER );
+
+	Menu_CollectGarbage( false );
+}
+
+void() Menu_Draw =
+{
+	// if Menu_ActiveWindow is visible loop though it
+	if( Menu_IsVisible( Menu_ActiveWindow ) )
+	{
+		Menu_Process_Setup();
+		Menu_ProcessDraw( Menu_ActiveWindow );
+	}
+
+	Sys_Debug_Draw();
+};
+
+void( float pKey, float pAscii) Menu_Key =
+{
+	// is a keyhook set ?
+	if( Menu_KeyHook != Util_NullFunction ) {
+		// call it
+		Menu_KeyHook( pKey, pAscii );
+		return;
+	}
+	// before calling the current keydown functions, process the mouse again
+	// to make sure the correct item is called
+	// (except mouse wheel up and down)
+	// if the mouse doesnt point to an item, there wont be a reaction on the clicking
+	if(K_MOUSE1 <= pKey && pKey <= K_MOUSE10) {
+		local entity lOld;
+
+		lOld = Menu_ActiveItem;
+		Menu_ActiveItem = null_entity;
+		Menu_ProcessMouse( Menu_ActiveWindow, MENU_SELECT_SELECTABLE );
+
+		if( !Menu_ActiveItem ) {
+			Menu_ActiveItem = lOld;
+			return;
+		} else if( lOld != Menu_ActiveItem ) {
+			Raise_Select( lOld, false, true );
+			Raise_Select( Menu_ActiveItem, true, true );
+		}
+	}
+
+	// call current selected keydown function
+	// if nothing is selected -> window has no items -> call window key
+	if(Menu_ActiveItem == null_entity)
+		Menu_Reselect( false );
+
+	if( ( !Menu_IsSelectable( Menu_ActiveItem ) && Menu_ActiveItem != Menu_ActiveWindow ) ||
+	     Menu_ProcessKey( Menu_ActiveWindow, pKey, pAscii ) != MENU_EVENT_PROCESSED )
+		// If it goes really wrong:
+		if( pKey == K_ESCAPE )
+			if( gamestatus & GAME_DEVELOPER )
+				error( " K_ESCAPE wasnt processed!\n" );
+			else {
+				Menu_Toggle();
+				cmd( "menu_restart\n" );
+			}
+		else if( gamestatus & GAME_DEVELOPER ) {
+			print( " Key ", ftos( pKey ), " ('" );
+			print( chr( pAscii ), "') wasn't processed!\n" );
+		}
+};
+
+bool() Menu_Toggle =
+{
+	// only let the qc toggle the menu if we are ingame or a developer
+	if( gamestatus & GAME_CONNECTED || gamestatus & GAME_DEVELOPER ) {
+		// then allow toggling
+		m_hide();
+		return true;
+	} else
+		return false;
+};


Property changes on: trunk/basezym/menuqc/system/events_.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/gc.qc
===================================================================
--- trunk/basezym/menuqc/system/gc.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/gc.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,72 +1,72 @@
-// DP/Nex Menu
-// system/gc.qc
-
-void() Menu_InitGarbageStats =
-{
-	Menu_GarbageFrameCount = 0;
-	Menu_GarbageToggleCount = 0;
-};
-
-void() Menu_ResetGarbageStats =
-{
-	if( Menu_GarbageFrameCount )
-		print( "Menu: GC: ", ftos( Menu_GarbageFrameCount ), " items marked for frame deletion but couldnt be reached!\n" );
-	if( Menu_GarbageToggleCount )
-		print( "Menu: GC: ", ftos( Menu_GarbageToggleCount ), " items marked for toggle delition but couldnt be reached!\n" );
-
-	Menu_GarbageFrameCount = 0;
-	Menu_GarbageToggleCount = 0;
-};
-
-bool( entity pItem ) Menu_CheckForGarbage =
-{
-	if( Menu_HasRunFlag( pItem, RUNFLAG_DELETEFRAME ) ) {
-		Menu_RemoveItem( pItem );
-		--Menu_GarbageFrameCount;
-		return true;
-	}
-	return false;
-};
-
-void( bool pToggle ) Menu_CollectGarbage =
-{
-	local entity lNode;
-
-	lNode = null_entity;
-	if( pToggle ) {
-		while( (Menu_GarbageFrameCount || Menu_GarbageToggleCount) && (lNode = nextent( lNode )) != null_entity )
-			if( Menu_HasRunFlag( lNode, RUNFLAG_DELETEFRAME ) ) {
-				Menu_RemoveItem( lNode );
-				--Menu_GarbageFrameCount;
-			} else if( Menu_HasRunFlag( lNode, RUNFLAG_DELETETOGGLE ) ) {
-				Menu_RemoveItem( lNode );
-				--Menu_GarbageToggleCount;
-			}
-	} else while( Menu_GarbageFrameCount && (lNode = nextent( lNode )) != null_entity )
-		if( Menu_HasRunFlag( lNode, RUNFLAG_DELETEFRAME ) ) {
-			Menu_RemoveItem( lNode );
-			--Menu_GarbageFrameCount;
-		}
-};
-
-void( entity pItem ) Menu_DeleteAfterFrame =
-{
-	if( !Menu_HasRunFlag( pItem, RUNFLAG_DELETEFRAME ) ) {
-		if( Menu_HasRunFlag( pItem, RUNFLAG_DELETETOGGLE ) ) {
-			pItem._runFlag = pItem._runFlag + RUNFLAG_DELETEFRAME - RUNFLAG_DELETETOGGLE;
-			--Menu_GarbageToggleCount;
-		} else
-			pItem._runFlag = pItem._runFlag + RUNFLAG_DELETEFRAME;
-		++Menu_GarbageFrameCount;
-	}
-};
-
-void( entity pItem ) Menu_DeleteAfterToggle =
-{
-	if( Menu_HasRunFlag( pItem, RUNFLAG_DELETEFRAME )
-		|| Menu_HasRunFlag( pItem, RUNFLAG_DELETETOGGLE ) )
-		return;
-	pItem._runFlag = self._runFlag + RUNFLAG_DELETETOGGLE;
-	++Menu_GarbageToggleCount;
-};
-
+// DP/Nex Menu
+// system/gc.qc
+
+void() Menu_InitGarbageStats =
+{
+	Menu_GarbageFrameCount = 0;
+	Menu_GarbageToggleCount = 0;
+};
+
+void() Menu_ResetGarbageStats =
+{
+	if( Menu_GarbageFrameCount )
+		print( "Menu: GC: ", ftos( Menu_GarbageFrameCount ), " items marked for frame deletion but couldnt be reached!\n" );
+	if( Menu_GarbageToggleCount )
+		print( "Menu: GC: ", ftos( Menu_GarbageToggleCount ), " items marked for toggle delition but couldnt be reached!\n" );
+
+	Menu_GarbageFrameCount = 0;
+	Menu_GarbageToggleCount = 0;
+};
+
+bool( entity pItem ) Menu_CheckForGarbage =
+{
+	if( Menu_HasRunFlag( pItem, RUNFLAG_DELETEFRAME ) ) {
+		Menu_RemoveItem( pItem );
+		--Menu_GarbageFrameCount;
+		return true;
+	}
+	return false;
+};
+
+void( bool pToggle ) Menu_CollectGarbage =
+{
+	local entity lNode;
+
+	lNode = null_entity;
+	if( pToggle ) {
+		while( (Menu_GarbageFrameCount || Menu_GarbageToggleCount) && (lNode = nextent( lNode )) != null_entity )
+			if( Menu_HasRunFlag( lNode, RUNFLAG_DELETEFRAME ) ) {
+				Menu_RemoveItem( lNode );
+				--Menu_GarbageFrameCount;
+			} else if( Menu_HasRunFlag( lNode, RUNFLAG_DELETETOGGLE ) ) {
+				Menu_RemoveItem( lNode );
+				--Menu_GarbageToggleCount;
+			}
+	} else while( Menu_GarbageFrameCount && (lNode = nextent( lNode )) != null_entity )
+		if( Menu_HasRunFlag( lNode, RUNFLAG_DELETEFRAME ) ) {
+			Menu_RemoveItem( lNode );
+			--Menu_GarbageFrameCount;
+		}
+};
+
+void( entity pItem ) Menu_DeleteAfterFrame =
+{
+	if( !Menu_HasRunFlag( pItem, RUNFLAG_DELETEFRAME ) ) {
+		if( Menu_HasRunFlag( pItem, RUNFLAG_DELETETOGGLE ) ) {
+			pItem._runFlag = pItem._runFlag + RUNFLAG_DELETEFRAME - RUNFLAG_DELETETOGGLE;
+			--Menu_GarbageToggleCount;
+		} else
+			pItem._runFlag = pItem._runFlag + RUNFLAG_DELETEFRAME;
+		++Menu_GarbageFrameCount;
+	}
+};
+
+void( entity pItem ) Menu_DeleteAfterToggle =
+{
+	if( Menu_HasRunFlag( pItem, RUNFLAG_DELETEFRAME )
+		|| Menu_HasRunFlag( pItem, RUNFLAG_DELETETOGGLE ) )
+		return;
+	pItem._runFlag = self._runFlag + RUNFLAG_DELETETOGGLE;
+	++Menu_GarbageToggleCount;
+};
+


Property changes on: trunk/basezym/menuqc/system/gc.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/gc.qh
===================================================================
--- trunk/basezym/menuqc/system/gc.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/gc.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,14 +1,14 @@
-// DP/Nex Menu
-// system/gc.qh
-
-float Menu_GarbageFrameCount;
-float Menu_GarbageToggleCount;
-
-void() Menu_InitGarbageStats;
-void() Menu_ResetGarbageStats;
-
-bool( entity pItem ) Menu_CheckForGarbage; // also removes it, only checks for framedelete
-
-void( bool pToggle ) Menu_CollectGarbage;
-void( entity pItem ) Menu_DeleteAfterFrame;
-void( entity pItem ) Menu_DeleteAfterToggle;
+// DP/Nex Menu
+// system/gc.qh
+
+float Menu_GarbageFrameCount;
+float Menu_GarbageToggleCount;
+
+void() Menu_InitGarbageStats;
+void() Menu_ResetGarbageStats;
+
+bool( entity pItem ) Menu_CheckForGarbage; // also removes it, only checks for framedelete
+
+void( bool pToggle ) Menu_CollectGarbage;
+void( entity pItem ) Menu_DeleteAfterFrame;
+void( entity pItem ) Menu_DeleteAfterToggle;


Property changes on: trunk/basezym/menuqc/system/gc.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/history.qc
===================================================================
--- trunk/basezym/menuqc/system/history.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/history.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,81 +1,81 @@
-// DP/Nex menu
-// system/history.qc
-
-
-/*
-===================
-Menu_History_Push
-===================
-*/
-void( entity pEntity, Menu_History_PopFunction pPopFunction ) Menu_History_Push =
-{
-	local entity lHistory;
-
-	Menu_KeyHook = Util_NullFunction;
-
-	lHistory = spawn();
-
-	lHistory.type = "MMANAGER_HISTORY";
-	lHistory._prev = Menu_History;
-	lHistory._child = Menu_ActiveItem;
-	lHistory._parent = Menu_ActiveWindow;
-	lHistory._next = pEntity; // "used for"
-	lHistory._destroy = pPopFunction;
-
-	Menu_History = lHistory;
-};
-
-/*
-===================
-Menu_History_Pop
-===================
-*/
-void() Menu_History_Pop =
-{
-	local entity lTemp;
-
-	if( Menu_History == null_entity )
-		return;
-
-	Menu_KeyHook = Util_NullFunction;
-
-	Menu_ActiveItem = Menu_History._child;
-	Menu_ActiveWindow = Menu_History._parent;
-
-	lTemp = Menu_History;
-	// FIXME: use Menu_DestroyItem
-	Raise_Destroy( lTemp );
-	Menu_History = Menu_History._prev;
-	remove( lTemp );
-};
-
-/*
-===================
-Menu_History_Verify
-===================
-*/
-bool( entity pEntity ) Menu_History_Verify =
-{
-	if( Menu_History == null_entity )
-		return false;
-
-	if( Menu_History._next == pEntity )
-		return true;
-	return false;
-};
-
-/*
-===================
-Menu_History_Clear
-===================
-*/
-void() Menu_History_Clear =
-{
-	local entity lEntity;
-
-	lEntity = null_entity;
-	while( ( lEntity = findstring( lEntity, type, "MMANAGER_HISTORY" ) ) != null_entity)
-		remove( lEntity );
-
-	Menu_History = null_entity;
-};
+// DP/Nex menu
+// system/history.qc
+
+
+/*
+===================
+Menu_History_Push
+===================
+*/
+void( entity pEntity, Menu_History_PopFunction pPopFunction ) Menu_History_Push =
+{
+	local entity lHistory;
+
+	Menu_KeyHook = Util_NullFunction;
+
+	lHistory = spawn();
+
+	lHistory.type = "MMANAGER_HISTORY";
+	lHistory._prev = Menu_History;
+	lHistory._child = Menu_ActiveItem;
+	lHistory._parent = Menu_ActiveWindow;
+	lHistory._next = pEntity; // "used for"
+	lHistory._destroy = pPopFunction;
+
+	Menu_History = lHistory;
+};
+
+/*
+===================
+Menu_History_Pop
+===================
+*/
+void() Menu_History_Pop =
+{
+	local entity lTemp;
+
+	if( Menu_History == null_entity )
+		return;
+
+	Menu_KeyHook = Util_NullFunction;
+
+	Menu_ActiveItem = Menu_History._child;
+	Menu_ActiveWindow = Menu_History._parent;
+
+	lTemp = Menu_History;
+	// FIXME: use Menu_DestroyItem
+	Raise_Destroy( lTemp );
+	Menu_History = Menu_History._prev;
+	remove( lTemp );
+};
+
+/*
+===================
+Menu_History_Verify
+===================
+*/
+bool( entity pEntity ) Menu_History_Verify =
+{
+	if( Menu_History == null_entity )
+		return false;
+
+	if( Menu_History._next == pEntity )
+		return true;
+	return false;
+};
+
+/*
+===================
+Menu_History_Clear
+===================
+*/
+void() Menu_History_Clear =
+{
+	local entity lEntity;
+
+	lEntity = null_entity;
+	while( ( lEntity = findstring( lEntity, type, "MMANAGER_HISTORY" ) ) != null_entity)
+		remove( lEntity );
+
+	Menu_History = null_entity;
+};


Property changes on: trunk/basezym/menuqc/system/history.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/history.qh
===================================================================
--- trunk/basezym/menuqc/system/history.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/history.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,23 +1,23 @@
-// DP/Nex Menu
-// system/history.qh
-
-// MMANAGER_HISTORY
-.entity _prev;	 //	<- points to the previous history element
-.entity _child;  //	<- points to the old/calling selected item
-.entity _parent; // 	<- points to the old active window
-.entity _next;	 //	<- points to the item which the history is used for
-.event  _destroy;  //	<- points to the function that is called when the history is popped
-
-// points to the last element of the history
-entity Menu_History;
-
-///////////////
-// prototypes
-///
-typedef void() Menu_History_PopFunction;
-
-void( entity pEntity, Menu_History_PopFunction pPopFunction )	Menu_History_Push;
-void() 			Menu_History_Pop;
-bool( entity pEntity )	Menu_History_Verify;	// Verifies the target item
-void()			Menu_History_Clear;
-
+// DP/Nex Menu
+// system/history.qh
+
+// MMANAGER_HISTORY
+.entity _prev;	 //	<- points to the previous history element
+.entity _child;  //	<- points to the old/calling selected item
+.entity _parent; // 	<- points to the old active window
+.entity _next;	 //	<- points to the item which the history is used for
+.event  _destroy;  //	<- points to the function that is called when the history is popped
+
+// points to the last element of the history
+entity Menu_History;
+
+///////////////
+// prototypes
+///
+typedef void() Menu_History_PopFunction;
+
+void( entity pEntity, Menu_History_PopFunction pPopFunction )	Menu_History_Push;
+void() 			Menu_History_Pop;
+bool( entity pEntity )	Menu_History_Verify;	// Verifies the target item
+void()			Menu_History_Clear;
+


Property changes on: trunk/basezym/menuqc/system/history.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/isframe.qc
===================================================================
--- trunk/basezym/menuqc/system/isframe.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/isframe.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,335 +1,335 @@
-// DP/Nex Menu
-// system/isframe.qc
-
-void() Menu_Init =
-{
-	//registercvar("menu_reloadlist","0");
-
-	Sys_Debug_Init();
-	// do one frame to make it possible to debug the parser
-	Sys_Debug_Frame();
-
-	Menu_InitGarbageStats();
-	Menu_Load();
-};
-
-void() Menu_Load =
-{
-	Parser_ParseMenu( MENU_MAINFILE, MENU_PLUGINDIR );
-
-	Menu_LinkWindows();
-};
-
-// the good thing is, finddef doesnt fuck up any chain lists
-entity(entity pStart, .string pFind1, string pMatch, .float pFind2, float pMatch2) finddef =
-{
-	while( 1 ) {
-		pStart = findstring( pStart, pFind1, pMatch );
-		if( pStart == null_entity )
-			break;
-		if( pStart.pFind2 == pMatch2 )
-			break;
-	}
-
-	return pStart;
-};
-
-void( entity pParent ) Menu_LinkChildren =
-{
-	local entity lChild;
-	local float  lOrder;
-	local entity lPrevious;
-
-	// build a list of all children
-	lChild = findchainstring( parent, pParent.name );
-	if( lChild == null_entity )
-		return;
-
-	// inverse the chain
-	lPrevious = null_entity;
-	while( lChild ) {
-		local entity lNext;
-
-		lNext = lChild.chain;
-		lChild.chain = lPrevious;
-		lPrevious = lChild;
-		lChild = lNext;
-	}
-	lChild = lPrevious;
-
-	lOrder = 1; // we start with orderPos 1 (0 is auto-set)
-	lPrevious = null_entity;
-	while( lChild ) {
-		local entity lOverwrite;
-		// try to find an item that has the current orderPos set
-		lOverwrite = finddef( null_entity, parent, pParent.name, orderPos, lOrder );
-		if( lOverwrite == lChild )
-			lChild.orderPos = lOrder;
-		else if( lOverwrite ) {
-			// insert lOverwrite in front of lChild
-			local entity lOPrevious;
-
-			lOPrevious = findentity( null_entity, chain, lOverwrite );
-			lOPrevious.chain = lOverwrite.chain;
-			lOverwrite.chain = lChild;
-			lChild = lOverwrite;
-		} else
-			lChild.orderPos = 0 - lOrder; //INFO: HACK: tell Spike
-
-		// link it
-		if( lPrevious )
-			lPrevious._next = lChild;
-		else
-			pParent._child = lChild;
-		lChild._prev = lPrevious;
-		lChild._parent = pParent;
-
-		lPrevious = lChild;
-		lChild = lChild.chain;
-		lOrder++;
-	}
-	lPrevious._next = null_entity;
-};
-
-void() Menu_LinkWindows =
-{
-	// first verify that MENU_NORMAL_NAME and MENU_INGAME_NAME exist
-	// if not add the default strings
-	local entity lEntity;
-
-	dprint( "Loading defaults if necessary\n" );
-
-	lEntity = findstring( null_entity, name, MENU_NORMAL_NAME );
-	if( lEntity == null_entity )
-		loadfromdata( MENU_NORMAL_DEFAULT );
-
-	// verify again if MENU_NORMAL_NAME is there now
-	lEntity = findstring( null_entity, name, MENU_NORMAL_NAME );
-	if( lEntity == null_entity )
-		error( "Bad MENU_NORMAL_DEFAULT!\n" );
-
-	lEntity = findstring( null_entity, name, MENU_INGAME_NAME );
-	if( lEntity == null_entity )
-		loadfromdata( MENU_INGAME_DEFAULT );
-
-	// verify again if MENU_INGAME_NAME is there now
-	lEntity = findstring( null_entity, name, MENU_INGAME_NAME );
-	if( lEntity == null_entity )
-		error( "Bad MENU_INGAME_DEFAULT!\n" );
-
-	dprint( "Verifying that every name is used only once\n" );
-
-	// verify that every name is only used *once*
-	lEntity = null_entity;
-	while( ( lEntity = nextent( lEntity ) ) != null_entity ) {
-		self = lEntity;
-		while( ( self = findstring( self, name, lEntity.name ) ) != null_entity )
-			if( self != null_entity )
-				objerror( "Name ", lEntity.name, " already used!\n" );
-	}
-
-	dprint( "Verification of: name, type and parent fields\n" );
-
-	// now we have to :
-	// set the parent field with parent_name
-	// check the type field
-	self = null_entity;
-	while( ( self = nextent( self ) ) != null_entity ) {
-		if( self.name == "" ) {
-			objerror( "Name is missing!\n" );
-			continue;
-		}
-
-		if( self.type == "" ) {
-			objerror( "Type is missing!\n" );
-			continue;
-		}
-
-		if( !isfunction( strcat( self.type, "_Spawn" ) ) ) {
-			objerror( "Control ", self.type, " not found!\n" );
-			continue;
-		}
-
-		// find parent
-		// if parent_name is "" do nothing else check whether the parent exists
-		if( self.parent != "" ) {
-			lEntity = findstring( null_entity, name, self.parent );
-
-			if( lEntity == null_entity ) {
-				objerror( "Item ", self.parent, " not found!\n" );
-				continue;
-			}
-		}
-		else
-			self._parent = null_entity;
-	}
-
-	dprint( "Building the child lists\n" );
-	// call LinkChildren for all entities
-	lEntity = null_entity;
-	while( ( lEntity = nextent( lEntity ) ) != null_entity )
-		Menu_LinkChildren( lEntity );
-
-	dprint( "Calling the type functions\n" );
-
-	// call the type functions (former classname functions)
-	lEntity = null_entity;
-	while( ( lEntity = nextent( lEntity ) ) != null_entity ) {
-		self = lEntity;
-		//dprint("Calling ",self.type," (", etos(self),")\n");
-		if( !Menu_HasFlag( self, FLAG_TEMPLATE ) && !Menu_HasRunFlag( self, RUNFLAG_SPAWNED ) ) {
-			//print( lEntity.name, "\n" );
-			callfunction( strcat( self.type, "_Spawn" ) );
-			self._runFlag = self._runFlag | RUNFLAG_SPAWNED;
-		} //else
-			//print( "X ", lEntity.name, "\n" );
-	}
-
-	dprint( "Linking windows finished.\n" );
-};
-
-void( entity pItem ) Menu_LinkItem =
-{
-	local entity lEntity;
-	local entity lOldSelf;
-
-	if( Menu_HasRunFlag( pItem, RUNFLAG_SPAWNED ) )
-		return;
-
-	// verify the type
-	if( pItem.type == "" )
-		error( "LinkItem: Type is missing (", etos( pItem ), ")!\n" );
-
-	if( !isfunction( strcat( pItem.type, "_Spawn" ) ) )
-		error( "LinkItem: Control ", pItem.type, " not found (", etos( pItem ), ")!\n" );
-
-	// verify name and parent
-	lEntity = null_entity;
-	while( (lEntity = findstring( lEntity, name, pItem.name )) != null_entity )
-		if( lEntity != pItem )
-			error( "LinkItem: Name '", pItem.name, "' already in use (", etos( pItem ), ", ", etos( lEntity ), ")!" );
-
-	if( pItem.parent != "" ) {
-		pItem._parent = findstring( null_entity, name, pItem.parent );
-
-		if( !pItem._parent  )
-			error( "LinkItem: Couldnt find parent '", pItem.parent, "' (", etos( pItem ), ")!" );
-	} else
-		pItem._parent = null_entity;
-
-	// Add the children
-	Menu_LinkChildren( pItem );
-
-	// link children
-	for( lEntity = pItem._child ; lEntity ; lEntity = lEntity._next )
-		Menu_LinkItem( lEntity );
-
-	// call the spawn function
-	lOldSelf = self;
-	self = pItem;
-	if( !Menu_HasFlag( self, FLAG_TEMPLATE ) ) {
-		callfunction( strcat( self.type, "_Spawn" ) );
-		self._runFlag = self._runFlag | RUNFLAG_SPAWNED;
-	}
-	self = lOldSelf;
-};
-
-void() Menu_Hide =
-{
-	Raise_Select( Menu_ActiveItem, false, false );
-	Menu_CollectGarbage( true );
-	Menu_ResetGarbageStats();
-};
-
-void() Menu_PerformReinit =
-{
-	// clear history
-	Menu_History_Clear();
-
-	// reset the key hook (if necessary at all)
-	Menu_KeyHook = Util_NullFunction;
-
-	// choose which menu to display
-	if( MENU_ALLOWINGAME && ( gamestatus & GAME_CONNECTED ) )
-		Menu_ActiveWindow = findstring( null_entity, name, MENU_INGAME_NAME );
-	else
-		Menu_ActiveWindow = findstring( null_entity, name, MENU_NORMAL_NAME );
-
-	// and reinit all menu items
-	self = null_entity;
-	while( (self = nextent( self ) ) != null_entity ) {
-		if( self.parent == "" )
-			self._parent = null_entity;
-		//else actually this shouldnt happen
-		else if( self._parent.name != self.parent )
-			objerror( "Parent (should be ", self.parent, ") of menu item ", self.name, " changed to ", self._parent.name, " !\n" );
-
-		Raise_Reinit( self ); // always call reinit
-	}
-
-	// run one runflag frame to (re)init the runflags
-	Menu_UpdateRunFlags();
-
-	Menu_Reselect( false );
-};
-
-void() Menu_Shutdown =
-{
-	// call the terminate event for each object
-	self = null_entity;
-	while( ( self = nextent( self ) ) != null_entity )
-		Raise_Destroy( self );
-};
-
-entity( string pType, string pName, string pParent ) Menu_CreateItem =
-{
-	local entity lItem;
-
-	if( !pType )
-		error( "Bad pType '", pType, "'!" );
-	if( !pName )
-		error( "Bad pName '", pName, "'!" );
-
-	lItem = spawn();
-	parseentitydata( lItem, strcat( "{ type \"", pType, "\" name \"", strcat( pParent, "::", pName ), "\" parent \"", pParent, "\" }" ) );
-	return lItem;
-};
-
-entity( entity pTemplate, string pName, string pParent, bool pTree ) Menu_DeriveItem =
-{
-	local entity lItem;
-	local entity lChild;
-
-	if( !pTemplate )
-		error( "Null pTemplate!" );
-	if( !pName )
-		error( "Bad pName '", pName, "'!" );
-
-	lItem = spawn();
-	copyentity( pTemplate, lItem );
-	if( lItem.flag & FLAG_TEMPLATE )
-		lItem.flag = lItem.flag - FLAG_TEMPLATE;
-	if( lItem._runFlag & RUNFLAG_SPAWNED )
-		lItem._runFlag = lItem._runFlag - RUNFLAG_SPAWNED;
-	parseentitydata( lItem, strcat( "{ name \"", strcat( pParent, "::", pName ), "\" parent \"", pParent, "\" }" ) );
-
-	if( pTree )
-		for( lChild = pTemplate._child ; lChild ; lChild = lChild._next ) {
-			local string lName;
-			lName = String_Zone( substring( lChild.name, strlen( lChild.parent ) + 2, 100000 ) );
-			Menu_DeriveItem( lChild, lName, lItem.name, true );
-			String_Free( lName );
-		}
-
-	return lItem;
-};
-
-void( entity pItem, string pData ) Menu_AddEntityData =
-{
-	parseentitydata( pItem, pData );
-};
-
-void( entity pWindow ) Menu_LinkWindow =
-{
-	Menu_LinkItem( pWindow );
-};
+// DP/Nex Menu
+// system/isframe.qc
+
+void() Menu_Init =
+{
+	//registercvar("menu_reloadlist","0");
+
+	Sys_Debug_Init();
+	// do one frame to make it possible to debug the parser
+	Sys_Debug_Frame();
+
+	Menu_InitGarbageStats();
+	Menu_Load();
+};
+
+void() Menu_Load =
+{
+	Parser_ParseMenu( MENU_MAINFILE, MENU_PLUGINDIR );
+
+	Menu_LinkWindows();
+};
+
+// the good thing is, finddef doesnt fuck up any chain lists
+entity(entity pStart, .string pFind1, string pMatch, .float pFind2, float pMatch2) finddef =
+{
+	while( 1 ) {
+		pStart = findstring( pStart, pFind1, pMatch );
+		if( pStart == null_entity )
+			break;
+		if( pStart.pFind2 == pMatch2 )
+			break;
+	}
+
+	return pStart;
+};
+
+void( entity pParent ) Menu_LinkChildren =
+{
+	local entity lChild;
+	local float  lOrder;
+	local entity lPrevious;
+
+	// build a list of all children
+	lChild = findchainstring( parent, pParent.name );
+	if( lChild == null_entity )
+		return;
+
+	// inverse the chain
+	lPrevious = null_entity;
+	while( lChild ) {
+		local entity lNext;
+
+		lNext = lChild.chain;
+		lChild.chain = lPrevious;
+		lPrevious = lChild;
+		lChild = lNext;
+	}
+	lChild = lPrevious;
+
+	lOrder = 1; // we start with orderPos 1 (0 is auto-set)
+	lPrevious = null_entity;
+	while( lChild ) {
+		local entity lOverwrite;
+		// try to find an item that has the current orderPos set
+		lOverwrite = finddef( null_entity, parent, pParent.name, orderPos, lOrder );
+		if( lOverwrite == lChild )
+			lChild.orderPos = lOrder;
+		else if( lOverwrite ) {
+			// insert lOverwrite in front of lChild
+			local entity lOPrevious;
+
+			lOPrevious = findentity( null_entity, chain, lOverwrite );
+			lOPrevious.chain = lOverwrite.chain;
+			lOverwrite.chain = lChild;
+			lChild = lOverwrite;
+		} else
+			lChild.orderPos = 0 - lOrder; //INFO: HACK: tell Spike
+
+		// link it
+		if( lPrevious )
+			lPrevious._next = lChild;
+		else
+			pParent._child = lChild;
+		lChild._prev = lPrevious;
+		lChild._parent = pParent;
+
+		lPrevious = lChild;
+		lChild = lChild.chain;
+		lOrder++;
+	}
+	lPrevious._next = null_entity;
+};
+
+void() Menu_LinkWindows =
+{
+	// first verify that MENU_NORMAL_NAME and MENU_INGAME_NAME exist
+	// if not add the default strings
+	local entity lEntity;
+
+	dprint( "Loading defaults if necessary\n" );
+
+	lEntity = findstring( null_entity, name, MENU_NORMAL_NAME );
+	if( lEntity == null_entity )
+		loadfromdata( MENU_NORMAL_DEFAULT );
+
+	// verify again if MENU_NORMAL_NAME is there now
+	lEntity = findstring( null_entity, name, MENU_NORMAL_NAME );
+	if( lEntity == null_entity )
+		error( "Bad MENU_NORMAL_DEFAULT!\n" );
+
+	lEntity = findstring( null_entity, name, MENU_INGAME_NAME );
+	if( lEntity == null_entity )
+		loadfromdata( MENU_INGAME_DEFAULT );
+
+	// verify again if MENU_INGAME_NAME is there now
+	lEntity = findstring( null_entity, name, MENU_INGAME_NAME );
+	if( lEntity == null_entity )
+		error( "Bad MENU_INGAME_DEFAULT!\n" );
+
+	dprint( "Verifying that every name is used only once\n" );
+
+	// verify that every name is only used *once*
+	lEntity = null_entity;
+	while( ( lEntity = nextent( lEntity ) ) != null_entity ) {
+		self = lEntity;
+		while( ( self = findstring( self, name, lEntity.name ) ) != null_entity )
+			if( self != null_entity )
+				objerror( "Name ", lEntity.name, " already used!\n" );
+	}
+
+	dprint( "Verification of: name, type and parent fields\n" );
+
+	// now we have to :
+	// set the parent field with parent_name
+	// check the type field
+	self = null_entity;
+	while( ( self = nextent( self ) ) != null_entity ) {
+		if( self.name == "" ) {
+			objerror( "Name is missing!\n" );
+			continue;
+		}
+
+		if( self.type == "" ) {
+			objerror( "Type is missing!\n" );
+			continue;
+		}
+
+		if( !isfunction( strcat( self.type, "_Spawn" ) ) ) {
+			objerror( "Control ", self.type, " not found!\n" );
+			continue;
+		}
+
+		// find parent
+		// if parent_name is "" do nothing else check whether the parent exists
+		if( self.parent != "" ) {
+			lEntity = findstring( null_entity, name, self.parent );
+
+			if( lEntity == null_entity ) {
+				objerror( "Item ", self.parent, " not found!\n" );
+				continue;
+			}
+		}
+		else
+			self._parent = null_entity;
+	}
+
+	dprint( "Building the child lists\n" );
+	// call LinkChildren for all entities
+	lEntity = null_entity;
+	while( ( lEntity = nextent( lEntity ) ) != null_entity )
+		Menu_LinkChildren( lEntity );
+
+	dprint( "Calling the type functions\n" );
+
+	// call the type functions (former classname functions)
+	lEntity = null_entity;
+	while( ( lEntity = nextent( lEntity ) ) != null_entity ) {
+		self = lEntity;
+		//dprint("Calling ",self.type," (", etos(self),")\n");
+		if( !Menu_HasFlag( self, FLAG_TEMPLATE ) && !Menu_HasRunFlag( self, RUNFLAG_SPAWNED ) ) {
+			//print( lEntity.name, "\n" );
+			callfunction( strcat( self.type, "_Spawn" ) );
+			self._runFlag = self._runFlag | RUNFLAG_SPAWNED;
+		} //else
+			//print( "X ", lEntity.name, "\n" );
+	}
+
+	dprint( "Linking windows finished.\n" );
+};
+
+void( entity pItem ) Menu_LinkItem =
+{
+	local entity lEntity;
+	local entity lOldSelf;
+
+	if( Menu_HasRunFlag( pItem, RUNFLAG_SPAWNED ) )
+		return;
+
+	// verify the type
+	if( pItem.type == "" )
+		error( "LinkItem: Type is missing (", etos( pItem ), ")!\n" );
+
+	if( !isfunction( strcat( pItem.type, "_Spawn" ) ) )
+		error( "LinkItem: Control ", pItem.type, " not found (", etos( pItem ), ")!\n" );
+
+	// verify name and parent
+	lEntity = null_entity;
+	while( (lEntity = findstring( lEntity, name, pItem.name )) != null_entity )
+		if( lEntity != pItem )
+			error( "LinkItem: Name '", pItem.name, "' already in use (", etos( pItem ), ", ", etos( lEntity ), ")!" );
+
+	if( pItem.parent != "" ) {
+		pItem._parent = findstring( null_entity, name, pItem.parent );
+
+		if( !pItem._parent  )
+			error( "LinkItem: Couldnt find parent '", pItem.parent, "' (", etos( pItem ), ")!" );
+	} else
+		pItem._parent = null_entity;
+
+	// Add the children
+	Menu_LinkChildren( pItem );
+
+	// link children
+	for( lEntity = pItem._child ; lEntity ; lEntity = lEntity._next )
+		Menu_LinkItem( lEntity );
+
+	// call the spawn function
+	lOldSelf = self;
+	self = pItem;
+	if( !Menu_HasFlag( self, FLAG_TEMPLATE ) ) {
+		callfunction( strcat( self.type, "_Spawn" ) );
+		self._runFlag = self._runFlag | RUNFLAG_SPAWNED;
+	}
+	self = lOldSelf;
+};
+
+void() Menu_Hide =
+{
+	Raise_Select( Menu_ActiveItem, false, false );
+	Menu_CollectGarbage( true );
+	Menu_ResetGarbageStats();
+};
+
+void() Menu_PerformReinit =
+{
+	// clear history
+	Menu_History_Clear();
+
+	// reset the key hook (if necessary at all)
+	Menu_KeyHook = Util_NullFunction;
+
+	// choose which menu to display
+	if( MENU_ALLOWINGAME && ( gamestatus & GAME_CONNECTED ) )
+		Menu_ActiveWindow = findstring( null_entity, name, MENU_INGAME_NAME );
+	else
+		Menu_ActiveWindow = findstring( null_entity, name, MENU_NORMAL_NAME );
+
+	// and reinit all menu items
+	self = null_entity;
+	while( (self = nextent( self ) ) != null_entity ) {
+		if( self.parent == "" )
+			self._parent = null_entity;
+		//else actually this shouldnt happen
+		else if( self._parent.name != self.parent )
+			objerror( "Parent (should be ", self.parent, ") of menu item ", self.name, " changed to ", self._parent.name, " !\n" );
+
+		Raise_Reinit( self ); // always call reinit
+	}
+
+	// run one runflag frame to (re)init the runflags
+	Menu_UpdateRunFlags();
+
+	Menu_Reselect( false );
+};
+
+void() Menu_Shutdown =
+{
+	// call the terminate event for each object
+	self = null_entity;
+	while( ( self = nextent( self ) ) != null_entity )
+		Raise_Destroy( self );
+};
+
+entity( string pType, string pName, string pParent ) Menu_CreateItem =
+{
+	local entity lItem;
+
+	if( !pType )
+		error( "Bad pType '", pType, "'!" );
+	if( !pName )
+		error( "Bad pName '", pName, "'!" );
+
+	lItem = spawn();
+	parseentitydata( lItem, strcat( "{ type \"", pType, "\" name \"", strcat( pParent, "::", pName ), "\" parent \"", pParent, "\" }" ) );
+	return lItem;
+};
+
+entity( entity pTemplate, string pName, string pParent, bool pTree ) Menu_DeriveItem =
+{
+	local entity lItem;
+	local entity lChild;
+
+	if( !pTemplate )
+		error( "Null pTemplate!" );
+	if( !pName )
+		error( "Bad pName '", pName, "'!" );
+
+	lItem = spawn();
+	copyentity( pTemplate, lItem );
+	if( lItem.flag & FLAG_TEMPLATE )
+		lItem.flag = lItem.flag - FLAG_TEMPLATE;
+	if( lItem._runFlag & RUNFLAG_SPAWNED )
+		lItem._runFlag = lItem._runFlag - RUNFLAG_SPAWNED;
+	parseentitydata( lItem, strcat( "{ name \"", strcat( pParent, "::", pName ), "\" parent \"", pParent, "\" }" ) );
+
+	if( pTree )
+		for( lChild = pTemplate._child ; lChild ; lChild = lChild._next ) {
+			local string lName;
+			lName = String_Zone( substring( lChild.name, strlen( lChild.parent ) + 2, 100000 ) );
+			Menu_DeriveItem( lChild, lName, lItem.name, true );
+			String_Free( lName );
+		}
+
+	return lItem;
+};
+
+void( entity pItem, string pData ) Menu_AddEntityData =
+{
+	parseentitydata( pItem, pData );
+};
+
+void( entity pWindow ) Menu_LinkWindow =
+{
+	Menu_LinkItem( pWindow );
+};


Property changes on: trunk/basezym/menuqc/system/isframe.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/isframe.qh
===================================================================
--- trunk/basezym/menuqc/system/isframe.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/isframe.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,57 +1,57 @@
-// DP/Nex Menu
-// system/isframe.qh
-
-// define these menus in the menu def files or dont
-// if not defined there will be added default items
-const string MENU_NORMAL_NAME = "Normal";
-const string MENU_INGAME_NAME = "Ingame";
-
-const string MENU_NORMAL_DEFAULT =
-"// default normal menu\n"
-"{\n"
-"	\"type\" 	\"Item_Window\"\n"
-"	\"name\"	\"Normal\"\n"
-"}";
-
-const string MENU_INGAME_DEFAULT =
-"// default ingame menu\n"
-"{\n"
-"	\"type\" 	\"Item_Window\"\n"
-"	\"name\"		\"Ingame\"\n"
-"}";
-
-// insert the files here
-var string MENU_MAINFILE = "menu/menu";
-var string MENU_PLUGINDIR = "menu/plugin";
-
-const bool MENU_ALLOWINGAME = false;
-
-///////////////
-// prototypes
-///
-
-// used for global managing
-void() Menu_Init;
-// loads all files the file lists consists of
-void() Menu_Load;
-// used to reset the menu states everytime the menu is activated
-void() Menu_PerformReinit;
-// called when the hide event is processed
-void() Menu_Hide;
-// unload the menu
-void() Menu_Shutdown;
-
-// For runtime addition of items, there is one function:
-// it supposes that the Item has already been embedded into its parent
-void( entity pItem ) Menu_LinkItem; // does also link all children and call their spawn function if necessary
-void( entity pWindow ) Menu_LinkWindow;
-
- // to make life easier
-entity( string pType, string pName, string pParent ) Menu_CreateItem;
-entity( entity pTemplate, string pName, string pParent, bool pTree ) Menu_DeriveItem;
-
-void( entity pItem, string pData ) Menu_AddEntityData;
-
-// these functions are pretty private, so dont call them !
-void( entity pParent ) Menu_LinkChildren;
-void() Menu_LinkWindows;
+// DP/Nex Menu
+// system/isframe.qh
+
+// define these menus in the menu def files or dont
+// if not defined there will be added default items
+const string MENU_NORMAL_NAME = "Normal";
+const string MENU_INGAME_NAME = "Ingame";
+
+const string MENU_NORMAL_DEFAULT =
+"// default normal menu\n"
+"{\n"
+"	\"type\" 	\"Item_Window\"\n"
+"	\"name\"	\"Normal\"\n"
+"}";
+
+const string MENU_INGAME_DEFAULT =
+"// default ingame menu\n"
+"{\n"
+"	\"type\" 	\"Item_Window\"\n"
+"	\"name\"		\"Ingame\"\n"
+"}";
+
+// insert the files here
+var string MENU_MAINFILE = "menu/menu";
+var string MENU_PLUGINDIR = "menu/plugin";
+
+const bool MENU_ALLOWINGAME = false;
+
+///////////////
+// prototypes
+///
+
+// used for global managing
+void() Menu_Init;
+// loads all files the file lists consists of
+void() Menu_Load;
+// used to reset the menu states everytime the menu is activated
+void() Menu_PerformReinit;
+// called when the hide event is processed
+void() Menu_Hide;
+// unload the menu
+void() Menu_Shutdown;
+
+// For runtime addition of items, there is one function:
+// it supposes that the Item has already been embedded into its parent
+void( entity pItem ) Menu_LinkItem; // does also link all children and call their spawn function if necessary
+void( entity pWindow ) Menu_LinkWindow;
+
+ // to make life easier
+entity( string pType, string pName, string pParent ) Menu_CreateItem;
+entity( entity pTemplate, string pName, string pParent, bool pTree ) Menu_DeriveItem;
+
+void( entity pItem, string pData ) Menu_AddEntityData;
+
+// these functions are pretty private, so dont call them !
+void( entity pParent ) Menu_LinkChildren;
+void() Menu_LinkWindows;


Property changes on: trunk/basezym/menuqc/system/isframe.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/item.qh
===================================================================
--- trunk/basezym/menuqc/system/item.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/item.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,126 +1,126 @@
-// DP/Nex Menu
-// system/item.qh
-
-enumflags {
-	RUNFLAG_TEMPLATE,
-
-	RUNFLAG_HADMOUSE,
-	RUNFLAG_MOUSEINAREA,
-
-	RUNFLAG_CHILDDRAWONLY,
-	RUNFLAG_CHILDDRAWUPDATEONLY,
-
-	RUNFLAG_HIDDEN,
-	RUNFLAG_CLIPPED,	// used to distinguish between intentionally hidden and casaully hidden
-	RUNFLAG_NOSELECT,
-
-	RUNFLAG_USERSELECT,
-
-	RUNFLAG_DELETEFRAME,
-	RUNFLAG_DELETETOGGLE,
-
-	RUNFLAG_SPAWNED		// set after the spawn function has been called
-};
-
-typedef void() event;
-typedef bool(float,float) keyEvent;
-typedef void(bool,bool) selectEvent;
-
-///////////
-// [Item] fields
-///
-
-.entity chain;
-
-// controly type
-.string type;
-
-// managing stuff
-.entity _parent;
-.string parent;
-
-//.entity _history;	// used to set up the history -> selectdown prefers _history over _parent
-
-.string name;
-
-.entity _next, _prev;		// point to the next, respectively, the previous item
-
-.entity _child;			// points to the first child
-
-// updating stuff
-.float orderPos;	// if FLAG_NOSELECT or FLAG_HIDDEN is set, it cant be selected
-					// has to be set always to a correct value or to 0 then it is set
-.float flag;
-.float _runFlag;
-
-// drawing
-.vector pos;
-.vector size;
-
-.vector origin;
-
-// event cache fields
-.vector _cache_origin;
-.vector _cache_clip_pos;
-.vector _cache_clip_size;
-
-// function pointers
-.event init; 	// called once at object creation
-.event reinit;
-.event destroy;
-.event mouseEnter;
-.event mouseLeave;
-.event update;
-.selectEvent select;
-.event action;
-.event draw;
-.keyEvent key; // if it returns TRUE, the key was processed by the function
-
-// hidden function pointers - actually these are called by the manager
-// and they call the normal ones (used to make controls more generic
-.event _reinit;	// called in performreinit
-.event _destroy;	// called when the item is removed -> menu_removeitem
-.event _mouseEnter;
-.event _mouseLeave;
-.event _update;
-.selectEvent _select;
-.event _draw;
-.keyEvent _key;
-
-/////////////////////
-// Helper Functions
-///
-
-// default control functions - assign only to the _* event functions
-// (assigning to the 'normal' event functions will crash the vm !)
-// are used by ITEM_CUSTOM and can be used to test new ITEMs easily
-void()  DefCt_Reinit;
-void()	DefCt_Destroy;
-bool( float pKey, float pAscii )  DefCt_Key;
-void()	DefCt_Draw;
-void()	DefCt_MouseEnter;
-void()	DefCt_MouseLeave;
-void() 	DefCt_Update;
-void( bool pSelect, bool pUser )  DefCt_Select;
-
-// use this to raise an event from another item or function
-void( entity pEntity ) Raise_Reinit;
-void( entity pEntity ) Raise_Destroy;
-bool( entity pEntity, float pKey, float pAscii)  Raise_Key;
-void( entity pEntity ) Raise_Draw;
-void( entity pEntity ) Raise_MouseEnter;
-void( entity pEntity ) Raise_MouseLeave;
-void( entity pEntity ) Raise_Update;
-void( entity pEntity, bool pSelect, bool pUser ) Raise_Select;
-
-// safe call the event control functions (only used by the mcontrols function)
-void()	CtCall_Init;
-void()	CtCall_Reinit;
-void()	CtCall_Destroy;
-bool( float pKey, float pAscii)  CtCall_Key;
-void()	CtCall_Draw;
-void()	CtCall_MouseEnter;
-void()	CtCall_MouseLeave;
-void()	CtCall_Action;
-void()	CtCall_Update;
-void( bool pSelect, bool pUser )  CtCall_Select;
+// DP/Nex Menu
+// system/item.qh
+
+enumflags {
+	RUNFLAG_TEMPLATE,
+
+	RUNFLAG_HADMOUSE,
+	RUNFLAG_MOUSEINAREA,
+
+	RUNFLAG_CHILDDRAWONLY,
+	RUNFLAG_CHILDDRAWUPDATEONLY,
+
+	RUNFLAG_HIDDEN,
+	RUNFLAG_CLIPPED,	// used to distinguish between intentionally hidden and casaully hidden
+	RUNFLAG_NOSELECT,
+
+	RUNFLAG_USERSELECT,
+
+	RUNFLAG_DELETEFRAME,
+	RUNFLAG_DELETETOGGLE,
+
+	RUNFLAG_SPAWNED		// set after the spawn function has been called
+};
+
+typedef void() event;
+typedef bool(float,float) keyEvent;
+typedef void(bool,bool) selectEvent;
+
+///////////
+// [Item] fields
+///
+
+.entity chain;
+
+// controly type
+.string type;
+
+// managing stuff
+.entity _parent;
+.string parent;
+
+//.entity _history;	// used to set up the history -> selectdown prefers _history over _parent
+
+.string name;
+
+.entity _next, _prev;		// point to the next, respectively, the previous item
+
+.entity _child;			// points to the first child
+
+// updating stuff
+.float orderPos;	// if FLAG_NOSELECT or FLAG_HIDDEN is set, it cant be selected
+					// has to be set always to a correct value or to 0 then it is set
+.float flag;
+.float _runFlag;
+
+// drawing
+.vector pos;
+.vector size;
+
+.vector origin;
+
+// event cache fields
+.vector _cache_origin;
+.vector _cache_clip_pos;
+.vector _cache_clip_size;
+
+// function pointers
+.event init; 	// called once at object creation
+.event reinit;
+.event destroy;
+.event mouseEnter;
+.event mouseLeave;
+.event update;
+.selectEvent select;
+.event action;
+.event draw;
+.keyEvent key; // if it returns TRUE, the key was processed by the function
+
+// hidden function pointers - actually these are called by the manager
+// and they call the normal ones (used to make controls more generic
+.event _reinit;	// called in performreinit
+.event _destroy;	// called when the item is removed -> menu_removeitem
+.event _mouseEnter;
+.event _mouseLeave;
+.event _update;
+.selectEvent _select;
+.event _draw;
+.keyEvent _key;
+
+/////////////////////
+// Helper Functions
+///
+
+// default control functions - assign only to the _* event functions
+// (assigning to the 'normal' event functions will crash the vm !)
+// are used by ITEM_CUSTOM and can be used to test new ITEMs easily
+void()  DefCt_Reinit;
+void()	DefCt_Destroy;
+bool( float pKey, float pAscii )  DefCt_Key;
+void()	DefCt_Draw;
+void()	DefCt_MouseEnter;
+void()	DefCt_MouseLeave;
+void() 	DefCt_Update;
+void( bool pSelect, bool pUser )  DefCt_Select;
+
+// use this to raise an event from another item or function
+void( entity pEntity ) Raise_Reinit;
+void( entity pEntity ) Raise_Destroy;
+bool( entity pEntity, float pKey, float pAscii)  Raise_Key;
+void( entity pEntity ) Raise_Draw;
+void( entity pEntity ) Raise_MouseEnter;
+void( entity pEntity ) Raise_MouseLeave;
+void( entity pEntity ) Raise_Update;
+void( entity pEntity, bool pSelect, bool pUser ) Raise_Select;
+
+// safe call the event control functions (only used by the mcontrols function)
+void()	CtCall_Init;
+void()	CtCall_Reinit;
+void()	CtCall_Destroy;
+bool( float pKey, float pAscii)  CtCall_Key;
+void()	CtCall_Draw;
+void()	CtCall_MouseEnter;
+void()	CtCall_MouseLeave;
+void()	CtCall_Action;
+void()	CtCall_Update;
+void( bool pSelect, bool pUser )  CtCall_Select;


Property changes on: trunk/basezym/menuqc/system/item.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/mgfx.qc
===================================================================
--- trunk/basezym/menuqc/system/mgfx.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/mgfx.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,158 +1,158 @@
-// DP/Nex Menu
-// system/mgfx.qc
-
-void( vector pPos, vector pSize, vector pColor, float pAlpha, float pDrawFlag, string pText ) _Mgfx_Debug_Info =
-{
-	if( !sys_debug_mgfx )
-		return;
-
-	pText = String_Zone( pText );
-
-	print( "MGFX output: ", vtos( pPos ), " - ", vtos( pSize), " C", vtos( pColor ) );
-	print( " A", ftos( pAlpha ), " X", ftos( pDrawFlag ), " ", pText, "\n" );
-
-	String_Free( pText );
-};
-
-/*
-===================
-Menu_MenToOrg
-===================
-*/
-vector( vector pPos )  Menu_MenToOrg =
-{
-	return pPos - Menu_Origin;
-};
-
-/*
-===================
-Menu_OrgToMen
-===================
-*/
-vector( vector pPos )  Menu_OrgToMen =
-{
-	return pPos + Menu_Origin;
-};
-
-/*
-===================
-Menu_ConToOrg
-===================
-*/
-vector( vector pPos )  Menu_ConToOrg =
-{
-	pPos = Gfx_ConToMen( pPos );
-	return Menu_MenToOrg( pPos );
-};
-
-/*
-===================
-Menu_OrgToCon
-===================
-*/
-vector( vector pPos )  Menu_OrgToCon =
-{
-	pPos = Menu_OrgToMen( pPos );
-	return Gfx_MenToCon( pPos );
-};
-
-/*
-===================
-Menu_DrawCharacter
-===================
-*/
-float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Menu_DrawCharacter =
-{
-	_Mgfx_Debug_Info( pPosition, pScale, pRGB, pAlpha, pFlag, strcat( "DrawChar: ", ftos( pCharacter ) ) );
-
-	pPosition = Menu_OrgToMen( pPosition );
-	return Gfx_DrawCharacter( pPosition, pCharacter, pScale, pRGB, pAlpha, pFlag );
-};
-
-/*
-===================
-Menu_DrawString
-===================
-*/
-float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Menu_DrawString =
-{
-	// TODO: FIXME: do I really want this?
-	if( !pText )
-		return 1;
-
-	_Mgfx_Debug_Info( pPosition, pScale, pRGB, pAlpha, pFlag, strcat( "DrawString: ", pText ) );
-
-	pPosition = Menu_OrgToMen( pPosition );
-	return Gfx_DrawString( pPosition, pText, pScale, pRGB, pAlpha, pFlag );
-};
-
-/*
-===================
-Menu_DrawPicture
-===================
-*/
-float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Menu_DrawPicture =
-{
-	_Mgfx_Debug_Info( pPosition, pSize, pRGB, pAlpha, pFlag, strcat( "DrawPicture: ", pPicture ) );
-
-	pPosition = Menu_OrgToMen( pPosition );
-	return Gfx_DrawPic( pPosition, pPicture, pSize, pRGB, pAlpha, pFlag );
-};
-
-/*
-===================
-Menu_Fill
-===================
-*/
-float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Menu_Fill =
-{
-	_Mgfx_Debug_Info( pPosition, pSize, pRGB, pAlpha, pFlag, "Fill" );
-
-	pPosition = Menu_OrgToMen( pPosition );
-	return Gfx_Fill( pPosition, pSize, pRGB, pAlpha, pFlag );
-};
-
-/*
-===================
-Menu_SetClipArea
-===================
-*/
-void( float pX, float pY, float pWidth, float pHeight )
-Menu_SetClipArea =
-{
-	local vector lPosition;
-	local vector lDelta;
-	local vector lSize;
-
-	lPosition_x = pX;
-	lPosition_y = pY;
-	lPosition = Menu_OrgToMen( lPosition);
-
-	lSize_x = pWidth;
-	lSize_y = pHeight;
-	// clip it to the current clip area
-	lDelta = Util_GetClipDelta( lPosition, Menu_Clip_Position, Menu_Clip_Size );
-	lPosition = lPosition + lDelta;
-	lSize = Util_ClipRect( lPosition, lSize - lDelta, Menu_Clip_Position, Menu_Clip_Size );
-
-	Gfx_SetClipArea( lPosition_x, lPosition_y, pWidth, pHeight );
-};
-
-/*
-===================
-Menu_ResetClipArea
-===================
-*/
-void()
-Menu_ResetClipArea =
-{
-	if( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' )
-		Gfx_ResetClipArea();
-	else
-		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
-}
-
+// DP/Nex Menu
+// system/mgfx.qc
+
+void( vector pPos, vector pSize, vector pColor, float pAlpha, float pDrawFlag, string pText ) _Mgfx_Debug_Info =
+{
+	if( !sys_debug_mgfx )
+		return;
+
+	pText = String_Zone( pText );
+
+	print( "MGFX output: ", vtos( pPos ), " - ", vtos( pSize), " C", vtos( pColor ) );
+	print( " A", ftos( pAlpha ), " X", ftos( pDrawFlag ), " ", pText, "\n" );
+
+	String_Free( pText );
+};
+
+/*
+===================
+Menu_MenToOrg
+===================
+*/
+vector( vector pPos )  Menu_MenToOrg =
+{
+	return pPos - Menu_Origin;
+};
+
+/*
+===================
+Menu_OrgToMen
+===================
+*/
+vector( vector pPos )  Menu_OrgToMen =
+{
+	return pPos + Menu_Origin;
+};
+
+/*
+===================
+Menu_ConToOrg
+===================
+*/
+vector( vector pPos )  Menu_ConToOrg =
+{
+	pPos = Gfx_ConToMen( pPos );
+	return Menu_MenToOrg( pPos );
+};
+
+/*
+===================
+Menu_OrgToCon
+===================
+*/
+vector( vector pPos )  Menu_OrgToCon =
+{
+	pPos = Menu_OrgToMen( pPos );
+	return Gfx_MenToCon( pPos );
+};
+
+/*
+===================
+Menu_DrawCharacter
+===================
+*/
+float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Menu_DrawCharacter =
+{
+	_Mgfx_Debug_Info( pPosition, pScale, pRGB, pAlpha, pFlag, strcat( "DrawChar: ", ftos( pCharacter ) ) );
+
+	pPosition = Menu_OrgToMen( pPosition );
+	return Gfx_DrawCharacter( pPosition, pCharacter, pScale, pRGB, pAlpha, pFlag );
+};
+
+/*
+===================
+Menu_DrawString
+===================
+*/
+float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Menu_DrawString =
+{
+	// TODO: FIXME: do I really want this?
+	if( !pText )
+		return 1;
+
+	_Mgfx_Debug_Info( pPosition, pScale, pRGB, pAlpha, pFlag, strcat( "DrawString: ", pText ) );
+
+	pPosition = Menu_OrgToMen( pPosition );
+	return Gfx_DrawString( pPosition, pText, pScale, pRGB, pAlpha, pFlag );
+};
+
+/*
+===================
+Menu_DrawPicture
+===================
+*/
+float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Menu_DrawPicture =
+{
+	_Mgfx_Debug_Info( pPosition, pSize, pRGB, pAlpha, pFlag, strcat( "DrawPicture: ", pPicture ) );
+
+	pPosition = Menu_OrgToMen( pPosition );
+	return Gfx_DrawPic( pPosition, pPicture, pSize, pRGB, pAlpha, pFlag );
+};
+
+/*
+===================
+Menu_Fill
+===================
+*/
+float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Menu_Fill =
+{
+	_Mgfx_Debug_Info( pPosition, pSize, pRGB, pAlpha, pFlag, "Fill" );
+
+	pPosition = Menu_OrgToMen( pPosition );
+	return Gfx_Fill( pPosition, pSize, pRGB, pAlpha, pFlag );
+};
+
+/*
+===================
+Menu_SetClipArea
+===================
+*/
+void( float pX, float pY, float pWidth, float pHeight )
+Menu_SetClipArea =
+{
+	local vector lPosition;
+	local vector lDelta;
+	local vector lSize;
+
+	lPosition_x = pX;
+	lPosition_y = pY;
+	lPosition = Menu_OrgToMen( lPosition);
+
+	lSize_x = pWidth;
+	lSize_y = pHeight;
+	// clip it to the current clip area
+	lDelta = Util_GetClipDelta( lPosition, Menu_Clip_Position, Menu_Clip_Size );
+	lPosition = lPosition + lDelta;
+	lSize = Util_ClipRect( lPosition, lSize - lDelta, Menu_Clip_Position, Menu_Clip_Size );
+
+	Gfx_SetClipArea( lPosition_x, lPosition_y, pWidth, pHeight );
+};
+
+/*
+===================
+Menu_ResetClipArea
+===================
+*/
+void()
+Menu_ResetClipArea =
+{
+	if( Menu_Clip_Position == '0 0 0' && Menu_Clip_Size == '0 0 0' )
+		Gfx_ResetClipArea();
+	else
+		Gfx_SetClipArea( Menu_Clip_Position_x, Menu_Clip_Position_y, Menu_Clip_Size_x, Menu_Clip_Size_y );
+}
+


Property changes on: trunk/basezym/menuqc/system/mgfx.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/mgfx.qh
===================================================================
--- trunk/basezym/menuqc/system/mgfx.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/mgfx.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,36 +1,36 @@
-// DP/Nex Menu
-// system/mgfx.qh
-
-vector Menu_Clip_Position;
-vector Menu_Clip_Size;
-vector Menu_Origin;
-
-vector( vector pPos )  Menu_OrgToMen;
-vector( vector pPos )  Menu_MenToOrg;
-vector( vector pPos )  Menu_ConToOrg;
-vector( vector pPos )  Menu_OrgToCon;
-
-float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Menu_DrawCharacter;
-
-float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
-Menu_DrawString;
-
-float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Menu_DrawPicture;
-
-float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
-Menu_Fill;
-
-void( float pX, float pY, float pWidth, float pHeight )
-Menu_SetClipArea;
-
-void()
-Menu_ResetClipArea;
-
-#ifdef USEFUNCTIONS
-void( string pText )
-_Menu_Process_Debug_Print;
-#endif
-
-bool _menu_process_filtered;
+// DP/Nex Menu
+// system/mgfx.qh
+
+vector Menu_Clip_Position;
+vector Menu_Clip_Size;
+vector Menu_Origin;
+
+vector( vector pPos )  Menu_OrgToMen;
+vector( vector pPos )  Menu_MenToOrg;
+vector( vector pPos )  Menu_ConToOrg;
+vector( vector pPos )  Menu_OrgToCon;
+
+float( vector pPosition, float pCharacter, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Menu_DrawCharacter;
+
+float( vector pPosition, string pText, vector pScale, vector pRGB, float pAlpha, float pFlag )
+Menu_DrawString;
+
+float( vector pPosition, string pPicture, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Menu_DrawPicture;
+
+float( vector pPosition, vector pSize, vector pRGB, float pAlpha, float pFlag )
+Menu_Fill;
+
+void( float pX, float pY, float pWidth, float pHeight )
+Menu_SetClipArea;
+
+void()
+Menu_ResetClipArea;
+
+#ifdef USEFUNCTIONS
+void( string pText )
+_Menu_Process_Debug_Print;
+#endif
+
+bool _menu_process_filtered;


Property changes on: trunk/basezym/menuqc/system/mgfx.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/parser.qc
===================================================================
--- trunk/basezym/menuqc/system/parser.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/parser.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,569 +1,569 @@
-// DP/Nex Menu
-// system/parser.qc
-
-void() Parser_Define_Spawn = {};
-
-void() Parser_TokenizeLine =
-{
-	Parser_NumTokens = tokenize( Parser_Line );
-	Parser_TokenNum = 0;
-};
-
-bool() Parser_GetToken =
-{
-	local string lLine;
-
-	if( Parser_TokenNum >= Parser_NumTokens ) { // get a new line
-		lLine = fgets( Parser_File );
-		++Parser_LineNumber;
-		if( !lLine )
-			if( !validstring( lLine ) )
-				return false;
-			else
-				return Parser_GetToken();
-
-		Parser_Line = String_Set( Parser_Line, lLine );
-		Parser_TokenizeLine();
-		return Parser_GetToken();
-	} else {
-		Parser_Token = String_Set( Parser_Token, argv( Parser_TokenNum ) );
-		Parser_TokenNum++;
-	}
-
-	Parser_Print( PARSER_LOW, strcat( "Read token '", Parser_Token, "'" ) );
-
-	Parser_TokenType = Parser_GetTokenType();
-	if( Parser_TokenType == PARSER_TT_BRACKETOPEN ) {
-		Parser_ProcessDefine();
-		return Parser_GetToken();
-	}
-
-	return true;
-};
-
-float() Parser_GetTokenType =
-{
-	if( Parser_Token == "Item" )
-		return PARSER_TT_ITEM;
-	else if( Parser_Token == "Template" )
-		return PARSER_TT_TEMPLATE;
-	else if( Parser_Token == "Derive" )
-		return PARSER_TT_DERIVE;
-	else if( Parser_Token == "DeriveTemplate" )
-		return PARSER_TT_DERIVETEMPLATE;
-	else if( Parser_Token == "#define" )
-		return PARSER_TT_DEFINE;
-	else if( Parser_Token == "Ignore" )
-		return PARSER_TT_IGNORE;
-	else if( Parser_Token == "#undef" )
-		return PARSER_TT_UNDEF;
-	else if( Parser_Token == "Namespace" )
-		return PARSER_TT_NAMESPACE;
-	else if( Parser_Token == "#include" )
-		return PARSER_TT_INCLUDE;
-	else if( Parser_Token == "}" )
-		return PARSER_TT_BRACECLOSE;
-	else if( Parser_Token == "{" )
-		return PARSER_TT_BRACEOPEN;
-	else if( Parser_Token == "[" )
-		return PARSER_TT_BRACKETOPEN;
-	else if( Parser_Token == "]" )
-		return PARSER_TT_BRACKETCLOSE;
-
-	return PARSER_TT_TOKEN;
-};
-
-void( float pLevel, string pText ) _Parser_Print =
-{
-	if( pLevel == 0 || sys_debug_parser & pLevel )
-		print( "Parser: ", pText, "\n" );
-};
-
-void( float pLevel, string pInfo ) Parser_Print =
-{
-	if( pLevel == 0 || sys_debug_parser & pLevel )
-		print( "Parser: ", Parser_Filename, ":", ftos( Parser_LineNumber ), ": ", pInfo, "\n" );
-};
-
-void( string pInfo ) Parser_Error =
-{
-	print( "Parser: ", Parser_Filename, ":", ftos( Parser_LineNumber ), ": Error: '");
-	print( Parser_Token, "' not expected (", pInfo, ")!\n" );
-	fclose( Parser_File );
-	error( "Error in the menu parser!" );
-};
-
-void( float pType ) Parser_Expect =
-{
-	if( !Parser_GetToken() || ( Parser_TokenType != pType && Parser_TokenType != PARSER_TT_BRACKETOPEN ) )
-		Parser_Error( strcat( "expected ", PARSER_TT_TEXT[ pType - PARSER_TT_ITEM ] ) );
-};
-
-void( string pNamespace ) Parser_IncludeFile =
-{
-	local string 	lFilename, lLine;
-	local float 	lFile, lLineNumber, lNumTokens, lTokenNum;
-
-	// #include file
-	Parser_Expect( PARSER_TT_TOKEN );
-
-	Parser_Print( PARSER_INFO, strcat( "#include: Including file '", Parser_Token, "'" ) );
-
-	Parser_FileList = String_Append( Parser_FileList, strcat( " {'", String_Normal( Util_AltStringPrepare( Parser_Token ) ), "'" ) );
-
-	lFilename = Parser_Filename;
-	lLine = Parser_Line;
-
-	lFile = Parser_File;
-	lLineNumber = Parser_LineNumber;
-	lNumTokens = Parser_NumTokens;
-	lTokenNum = Parser_TokenNum;
-
-	--Parser_IncludeDepth;
-	if( Parser_IncludeDepth > Parser_MaxIncludeDepth )
-		Parser_Print( PARSER_NORMAL, "#include: Maximum depth reached!" );
-	else
-		Parser_ParseFile( Parser_Token, pNamespace );
-	--Parser_IncludeDepth;
-
-	Parser_Filename = lFilename;
-	Parser_Line = lLine;
-
-	Parser_File = lFile;
-	Parser_LineNumber = lLineNumber;
-
-	// tokenize the line again, but jump to the old position
-	Parser_TokenizeLine();
-	Parser_NumTokens = lNumTokens;
-	Parser_TokenNum = lTokenNum;
-
-	Parser_FileList = String_Append( Parser_FileList, "}" );
-};
-
-void() Parser_ParseDefine =
-{
-	local entity lDefine;
-	local float lOldLine;
-
-	Parser_Print( 2, "Parsing #define..." );
-
-	// #define NAME CONSTANT
-	//Parser_Expect( PARSER_TT_BRACKETOPEN );
-	Parser_Expect( PARSER_TT_TOKEN );
-
-	// check for double definitions (dont error just print a warning)
-	for( lDefine = Parser_DefineChain ; lDefine ; lDefine = lDefine.chain )
-		if( Parser_Token == lDefine.name ) {
-			Parser_Print( PARSER_INFO, strcat( "#define: [", Parser_Token, "] already defined!" ) );
-			Parser_Expect( PARSER_TT_TOKEN );
-			return;
-		}
-
-	lDefine = spawn();
-	lDefine.type = "Parser_Define";
-	lDefine.name = String_Zone( Parser_Token );
-
-	//Parser_Expect( PARSER_TT_BRACKETCLOSE );
-	// read the rest of the line
-	String_EntityZone( lDefine, value );
-	lOldLine = Parser_LineNumber;
-	while( 1 )
-		if( !Parser_GetToken() )
-			break;
-		else if( lOldLine != Parser_LineNumber ) {
-			--Parser_TokenNum;
-			break;
-		} else if( Parser_Token == "\\" )
-			++lOldLine;
-		else
-			String_EntitySet( lDefine, value, strcat( lDefine.value, "\"", Parser_Token, "\" " ) );
-
-	Parser_Print( PARSER_HIGH, strcat( " Name = '", lDefine.name, "' Replacement = '", lDefine.value, "'" ) );
-
-	lDefine.chain = Parser_DefineChain;
-	Parser_DefineChain = lDefine;
-
-	Parser_Print( PARSER_HIGH, "Done parsing #define" );
-};
-
-void() Parser_ParseUndef =
-{
-	local entity lEntity, lPrevious;
-
-	// #undef Name
-	Parser_Print( PARSER_HIGH, "Parsing #undef..." );
-	Parser_Expect( PARSER_TT_TOKEN );
-
-	lPrevious = null_entity;
-	for( lEntity = Parser_DefineChain ; lEntity ; lPrevious = lEntity, lEntity = lEntity.chain )
-		if( lEntity.name == Parser_Token ) {
-			if( lPrevious )
-				lPrevious.chain = lEntity.chain;
-			else
-				Parser_DefineChain = lEntity.chain;
-
-			Parser_Print( PARSER_INFO, strcat( "#undef: Removed [", Parser_Token, "]" ) );
-
-			String_Free( lEntity.name );
-			String_Free( lEntity.value );
-
-			remove( lEntity );
-
-			return;
-		}
-
-	Parser_Print( PARSER_INFO, strcat( "#undef: [", Parser_Token, "] not found!" ) );
-};
-
-void() Parser_ProcessDefine =
-{
-	local string lConstant;
-	local entity lDefine;
-
-	// [Name]
-	Parser_Expect( PARSER_TT_TOKEN );
-	lConstant = String_Zone( Parser_Token );
-
-	Parser_Expect( PARSER_TT_BRACKETCLOSE );
-
-	Parser_Print( PARSER_HIGH, strcat( "Processing [", lConstant, "]..." ) );
-
-	for( lDefine = Parser_DefineChain ; lDefine ; lDefine = lDefine.chain )
-		if( lDefine.name == lConstant ) {
-			// if you want to have a single token use \" or '
-			Parser_Line = String_Set( Parser_Line, strcat( " ", lDefine.value ) );
-			Parser_Print( PARSER_HIGH, strcat( "Replacing with '", Parser_Line, "'" ) );
-			for( ; Parser_TokenNum < Parser_NumTokens ; Parser_TokenNum++ )
-				Parser_Line = String_Set( Parser_Line, strcat( Parser_Line, " \"", argv( Parser_TokenNum ), "\"" ) );
-			Parser_TokenizeLine();
-			String_Free( lConstant );
-			return;
-		}
-
-	Parser_Token = String_Set( Parser_Token, String_Normal( lConstant ) );
-	Parser_Print( PARSER_NORMAL, strcat( "#define: Couldn't find constant '", Parser_Token, "'!" ) );
-	Parser_Error( "constant not found" );
-};
-
-// Item [Template]
-// Template
-void( string pNamespace ) Parser_ParseDefinition =
-{
-	local entity lEntity;
-
-	if( Parser_TokenType == PARSER_TT_ITEM )
-		Parser_ParseItem( pNamespace );
-	else if( Parser_TokenType == PARSER_TT_TEMPLATE ) {
-		lEntity = Parser_ParseItem( pNamespace );
-		lEntity.flag = lEntity.flag | FLAG_TEMPLATE;
-	} else if( Parser_TokenType == PARSER_TT_DEFINE )
-		Parser_ParseDefine();
-	else if( Parser_TokenType == PARSER_TT_DERIVE )
-		Parser_DeriveItem( pNamespace );
-	else if( Parser_TokenType == PARSER_TT_DERIVETEMPLATE ) {
-		lEntity = Parser_DeriveItem( pNamespace );
-		lEntity.flag = lEntity.flag | FLAG_TEMPLATE;
-	} else if( Parser_TokenType == PARSER_TT_UNDEF )
-		Parser_ParseUndef();
-	else if( Parser_TokenType == PARSER_TT_NAMESPACE )
-		Parser_ParseNamespace( pNamespace );
-	else if( Parser_TokenType == PARSER_TT_INCLUDE )
-		Parser_IncludeFile( pNamespace );
-	else if( Parser_TokenType == PARSER_TT_IGNORE )
-		Parser_ParseIgnore();
-	else
-		Parser_Error( "couldn't find type in Parser_ParseDef" );
-};
-
-void() Parser_ParseIgnore =
-{
-	local float lBraceCount;
-
-	Parser_Expect( PARSER_TT_BRACEOPEN );
-	for( lBraceCount = 1 ; lBraceCount > 0 ; )
-		if( !Parser_GetToken() )
-			break;
-		else if( Parser_TokenType == PARSER_TT_BRACEOPEN )
-			++lBraceCount;
-		else if( Parser_TokenType == PARSER_TT_BRACECLOSE )
-			--lBraceCount;
-};
-
-entity( string pNamespace ) Parser_ParseItem =
-{
-	local string lNamespace;
-	local string lEntityText;
-	local entity lEntity;
-
-	Parser_Print( PARSER_HIGH, "Parsing item.." );
-
-	// get the item type
-	Parser_Expect( PARSER_TT_TOKEN );
-	lEntityText = String_Zone( strcat( "{ \"type\" \"Item_", Parser_Token,"\" " ) );
-
-	Parser_Print( PARSER_HIGH, strcat( " Type = '", Parser_Token, "'" ) );
-
-	// get the item name
-	Parser_Expect( PARSER_TT_TOKEN );
-	if( pNamespace != "" )
-		lNamespace = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
-	else
-		lNamespace = String_Zone( Parser_Token );
-
-	lEntityText = String_Set( lEntityText, strcat( lEntityText, "\"name\" \"", lNamespace, "\" " ) );
-	lEntityText = String_Set( lEntityText, strcat( lEntityText, "\"parent\" \"", pNamespace, "\" " ) );
-
-	Parser_Print( PARSER_HIGH, strcat( " Name = '", Parser_Token, "' Parent = '", pNamespace,
-				"' Namespace = '", lNamespace, "'" ) );
-
-	Parser_Expect( PARSER_TT_BRACEOPEN );
-	lEntityText = Parser_ParseEntity( lNamespace, lEntityText );
-
-	// parse the entity (builtin)
-	lEntity = spawn();
-	parseentitydata( lEntity, lEntityText );
-
-	String_Free( lEntityText );
-	String_Free( lNamespace );
-
-	Parser_Print( PARSER_HIGH, strcat( "Parsing '", lEntity.name, "' finished" ) );
-
-	return lEntity;
-};
-
-void( entity pSource, entity pTarget ) Parser_CloneChildren =
-{
-	// we search for all items that are direct children of pSource and copy them
-	// and adapt their parent and names
-	local entity lNode;
-
-	lNode = null_entity;
-	while ( (lNode = findstring( lNode, parent, pSource.name )) != null_entity ) {
-		local entity lClone;
-		local string lModifierString;
-
-		lClone = spawn();
-		copyentity( lNode, lClone );
-
-		if( lClone.flag & FLAG_TEMPLATE )
-			lClone.flag = lClone.flag - FLAG_TEMPLATE;
-
-		lModifierString = strcat( "{ name \"", pTarget.name,
-			substring( lNode.name, strlen( pSource.name ), 100000 ), "\" parent \"", pTarget.name, "\" }" );
-
-		parseentitydata( lClone, lModifierString );
-
-		Parser_CloneChildren( lNode, lClone );
-	}
-};
-
-entity( string pNamespace ) Parser_DeriveItem =
-{
-	local string lNamespace;
-	local string lEntityText;
-	local entity lBase;
-	local string lBaseName;
-	local entity lEntity;
-
-	Parser_Print( PARSER_HIGH, "Parsing derived item.." );
-
-	// get the base item
-	Parser_Expect( PARSER_TT_TOKEN );
-
-	if( substring( Parser_Token, 0, 2 ) == "::" )
-		lBaseName = String_Zone( substring( Parser_Token, 2, strlen( Parser_Token ) - 2 ) );
-	else if( pNamespace == "" )
-		lBaseName = String_Zone( Parser_Token );
-	else {
-		lBaseName = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
-
-		// try the local namespace first, then try to find it in the global
-		if( findstring( null_entity,  name, lBaseName ) == null_entity )
-			lBaseName = String_Set( lBaseName, Parser_Token );
-	}
-
-	Parser_Print( PARSER_HIGH, strcat( " Base = '", lBaseName, "'" ) );
-
-	lBase = findstring( null_entity, name, lBaseName );
-	if( lBase == null_entity )
-		Parser_Error( "couldnt find item" );
-
-	// get the item name
-	Parser_Expect( PARSER_TT_TOKEN );
-	if( pNamespace != "" )
-		lNamespace = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
-	else
-		lNamespace = String_Zone( Parser_Token );
-
-	lEntityText = String_Zone( strcat( "{ \"name\" \"", lNamespace, "\" " ) );
-	lEntityText = String_Set( lEntityText, strcat( lEntityText, "\"parent\" \"", pNamespace, "\" " ) );
-
-	Parser_Print( PARSER_HIGH, strcat( " Name = '", Parser_Token, "' Parent = '", pNamespace,
-				"' Namespace = '", lNamespace, "'" ) );
-
-	Parser_Expect( PARSER_TT_BRACEOPEN );
-	lEntityText = Parser_ParseEntity( lNamespace, lEntityText );
-
-	// parse the entity (builtin)
-	lEntity = spawn();
-	copyentity( lBase, lEntity );
-	if( lEntity.flag & FLAG_TEMPLATE )
-		lEntity.flag = lEntity.flag - FLAG_TEMPLATE;
-	parseentitydata( lEntity, lEntityText );
-
-	String_Free( lEntityText );
-	String_Free( lNamespace );
-	String_Free( lBaseName );
-
-	// now copy over all children
-	Parser_CloneChildren( lBase, lEntity );
-
-	Parser_Print( PARSER_HIGH, strcat( "Parsing '", lEntity.name, "' finished" ) );
-
-	return lEntity;
-};
-
-string( string pNamespace, string pEntityText ) Parser_ParseEntity =
-{
-	while( Parser_GetToken() ) {
-		if( Parser_TokenType == PARSER_TT_TOKEN ) {
-			// must be a property...
-			// store the key value
-			pEntityText = String_Set( pEntityText, strcat( pEntityText, "\"", Parser_Token, "\" " ) );
-			Parser_Expect( PARSER_TT_TOKEN );
-			pEntityText = String_Set( pEntityText, strcat( pEntityText, "\"", Parser_Token, "\" " ) );
-		} else if( Parser_TokenType == PARSER_TT_BRACECLOSE )
-			break;
-		else
-			Parser_ParseDefinition( pNamespace );
-	}
-
-	return String_Append( pEntityText, " }" );
-};
-
-void( string pNamespace ) Parser_ParseNamespace =
-{
-	local string lNamespace;
-
-	Parser_Print( PARSER_HIGH, "Parsing Namespace..." );
-	// namespace Name {
-	Parser_Expect( PARSER_TT_TOKEN );
-	if( pNamespace != "" )
-		lNamespace = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
-	else
-		lNamespace = String_Zone( Parser_Token );
-	Parser_Print( PARSER_HIGH, strcat( " Subnamespace = '", Parser_Token, "' New namespace = '", lNamespace, "'" ) );
-
-	Parser_Expect( PARSER_TT_BRACEOPEN );
-
-	while( Parser_GetToken() ) {
-		if( Parser_TokenType == PARSER_TT_BRACECLOSE )
-			break;
-
-		Parser_ParseDefinition( lNamespace );
-	}
-
-	Parser_Print( PARSER_HIGH, strcat( "Finished parsing Namespace. Namespace = '", pNamespace, "'" ) );
-
-	String_Free( lNamespace );
-};
-
-void( string pFilename, string pNamespace ) Parser_ParseFile =
-{
-	Parser_Filename = String_Zone( pFilename );
-	Parser_File = fopen( Parser_Filename, FILE_READ );
-	if( Parser_File == -1 ) {
-		print( "Parser: Couldn't open ", Parser_Filename, "\n" );
-		return;
-	}
-
-	Parser_Line = String_Create();
-	Parser_LineNumber = 0;
-	Parser_NumTokens = Parser_TokenNum = 0;
-
-	while( Parser_GetToken() )
-		Parser_ParseDefinition( pNamespace );
-
-	fclose( Parser_File );
-	String_Free( Parser_Filename );
-	String_Free( Parser_Line );
-};
-
-void() Parser_Init =
-{
-	Parser_Token = String_Create();
-	Parser_DefineChain = null_entity;
-	Parser_IncludeDepth = 0;
-
-	Parser_FileList = String_Create();
-};
-
-void() Parser_Quit =
-{
-	local entity lNext;
-
-	_Parser_Print( PARSER_HIGH, "Deleting #defines:" );
-	while( Parser_DefineChain ) {
-		lNext = Parser_DefineChain.chain;
-		_Parser_Print( PARSER_HIGH, strcat( "  [", Parser_DefineChain.name, "]" ) );
-
-		String_Free( Parser_DefineChain.name );
-		String_Free( Parser_DefineChain.value );
-
-		remove( Parser_DefineChain );
-		Parser_DefineChain = lNext;
-	}
-
-
-	String_Free( Parser_Token );
-	String_Free( Parser_FileList );
-};
-
-void( string pPluginDir ) Parser_ParsePlugins =
-{
-	local float lSearchHandle;
-	local float lCounter, lCount;
-
-	lSearchHandle = search_begin( strcat( pPluginDir, "/*.plugin" ), true, true );
-	if( lSearchHandle < 0 ) {
-		return;
-	}
-
-	lCount = search_getsize( lSearchHandle );
-
-	for( lCounter = 0 ; lCounter < lCount ; lCounter++ ) {
-		local string pPlugin;
-
-		Parser_FileList = String_Set( Parser_FileList, "" );
-
-		pPlugin = String_Zone( search_getfilename( lSearchHandle, lCounter ) );
-		Parser_FileList = Util_AltStringPush( Parser_FileList, pPlugin );
-
-		Parser_ParseFile( pPlugin, "" );
-
-		_Parser_Print( PARSER_INFO, strcat( "Plugin '", pPlugin, "': files parsed: ", Parser_FileList ) );
-		String_Free( pPlugin );
-	}
-
-	search_end( lSearchHandle );
-};
-
-void( string pMain, string pPluginDir ) Parser_ParseMenu =
-{
-	Parser_Init();
-
-	pMain = String_Zone( pMain );
-	Parser_FileList = Util_AltStringPush( Parser_FileList, pMain );
-
-	Parser_ParseFile( pMain, "" );
-
-	_Parser_Print( PARSER_INFO, strcat( "Files parsed: ", Parser_FileList ) );
-	String_Free( pMain );
-
-	// plugins
-	if( pPluginDir != "" ) {
-		Parser_ParsePlugins( pPluginDir );
-	}
-
-	Parser_Quit();
-};
+// DP/Nex Menu
+// system/parser.qc
+
+void() Parser_Define_Spawn = {};
+
+void() Parser_TokenizeLine =
+{
+	Parser_NumTokens = tokenize( Parser_Line );
+	Parser_TokenNum = 0;
+};
+
+bool() Parser_GetToken =
+{
+	local string lLine;
+
+	if( Parser_TokenNum >= Parser_NumTokens ) { // get a new line
+		lLine = fgets( Parser_File );
+		++Parser_LineNumber;
+		if( !lLine )
+			if( !validstring( lLine ) )
+				return false;
+			else
+				return Parser_GetToken();
+
+		Parser_Line = String_Set( Parser_Line, lLine );
+		Parser_TokenizeLine();
+		return Parser_GetToken();
+	} else {
+		Parser_Token = String_Set( Parser_Token, argv( Parser_TokenNum ) );
+		Parser_TokenNum++;
+	}
+
+	Parser_Print( PARSER_LOW, strcat( "Read token '", Parser_Token, "'" ) );
+
+	Parser_TokenType = Parser_GetTokenType();
+	if( Parser_TokenType == PARSER_TT_BRACKETOPEN ) {
+		Parser_ProcessDefine();
+		return Parser_GetToken();
+	}
+
+	return true;
+};
+
+float() Parser_GetTokenType =
+{
+	if( Parser_Token == "Item" )
+		return PARSER_TT_ITEM;
+	else if( Parser_Token == "Template" )
+		return PARSER_TT_TEMPLATE;
+	else if( Parser_Token == "Derive" )
+		return PARSER_TT_DERIVE;
+	else if( Parser_Token == "DeriveTemplate" )
+		return PARSER_TT_DERIVETEMPLATE;
+	else if( Parser_Token == "#define" )
+		return PARSER_TT_DEFINE;
+	else if( Parser_Token == "Ignore" )
+		return PARSER_TT_IGNORE;
+	else if( Parser_Token == "#undef" )
+		return PARSER_TT_UNDEF;
+	else if( Parser_Token == "Namespace" )
+		return PARSER_TT_NAMESPACE;
+	else if( Parser_Token == "#include" )
+		return PARSER_TT_INCLUDE;
+	else if( Parser_Token == "}" )
+		return PARSER_TT_BRACECLOSE;
+	else if( Parser_Token == "{" )
+		return PARSER_TT_BRACEOPEN;
+	else if( Parser_Token == "[" )
+		return PARSER_TT_BRACKETOPEN;
+	else if( Parser_Token == "]" )
+		return PARSER_TT_BRACKETCLOSE;
+
+	return PARSER_TT_TOKEN;
+};
+
+void( float pLevel, string pText ) _Parser_Print =
+{
+	if( pLevel == 0 || sys_debug_parser & pLevel )
+		print( "Parser: ", pText, "\n" );
+};
+
+void( float pLevel, string pInfo ) Parser_Print =
+{
+	if( pLevel == 0 || sys_debug_parser & pLevel )
+		print( "Parser: ", Parser_Filename, ":", ftos( Parser_LineNumber ), ": ", pInfo, "\n" );
+};
+
+void( string pInfo ) Parser_Error =
+{
+	print( "Parser: ", Parser_Filename, ":", ftos( Parser_LineNumber ), ": Error: '");
+	print( Parser_Token, "' not expected (", pInfo, ")!\n" );
+	fclose( Parser_File );
+	error( "Error in the menu parser!" );
+};
+
+void( float pType ) Parser_Expect =
+{
+	if( !Parser_GetToken() || ( Parser_TokenType != pType && Parser_TokenType != PARSER_TT_BRACKETOPEN ) )
+		Parser_Error( strcat( "expected ", PARSER_TT_TEXT[ pType - PARSER_TT_ITEM ] ) );
+};
+
+void( string pNamespace ) Parser_IncludeFile =
+{
+	local string 	lFilename, lLine;
+	local float 	lFile, lLineNumber, lNumTokens, lTokenNum;
+
+	// #include file
+	Parser_Expect( PARSER_TT_TOKEN );
+
+	Parser_Print( PARSER_INFO, strcat( "#include: Including file '", Parser_Token, "'" ) );
+
+	Parser_FileList = String_Append( Parser_FileList, strcat( " {'", String_Normal( Util_AltStringPrepare( Parser_Token ) ), "'" ) );
+
+	lFilename = Parser_Filename;
+	lLine = Parser_Line;
+
+	lFile = Parser_File;
+	lLineNumber = Parser_LineNumber;
+	lNumTokens = Parser_NumTokens;
+	lTokenNum = Parser_TokenNum;
+
+	--Parser_IncludeDepth;
+	if( Parser_IncludeDepth > Parser_MaxIncludeDepth )
+		Parser_Print( PARSER_NORMAL, "#include: Maximum depth reached!" );
+	else
+		Parser_ParseFile( Parser_Token, pNamespace );
+	--Parser_IncludeDepth;
+
+	Parser_Filename = lFilename;
+	Parser_Line = lLine;
+
+	Parser_File = lFile;
+	Parser_LineNumber = lLineNumber;
+
+	// tokenize the line again, but jump to the old position
+	Parser_TokenizeLine();
+	Parser_NumTokens = lNumTokens;
+	Parser_TokenNum = lTokenNum;
+
+	Parser_FileList = String_Append( Parser_FileList, "}" );
+};
+
+void() Parser_ParseDefine =
+{
+	local entity lDefine;
+	local float lOldLine;
+
+	Parser_Print( 2, "Parsing #define..." );
+
+	// #define NAME CONSTANT
+	//Parser_Expect( PARSER_TT_BRACKETOPEN );
+	Parser_Expect( PARSER_TT_TOKEN );
+
+	// check for double definitions (dont error just print a warning)
+	for( lDefine = Parser_DefineChain ; lDefine ; lDefine = lDefine.chain )
+		if( Parser_Token == lDefine.name ) {
+			Parser_Print( PARSER_INFO, strcat( "#define: [", Parser_Token, "] already defined!" ) );
+			Parser_Expect( PARSER_TT_TOKEN );
+			return;
+		}
+
+	lDefine = spawn();
+	lDefine.type = "Parser_Define";
+	lDefine.name = String_Zone( Parser_Token );
+
+	//Parser_Expect( PARSER_TT_BRACKETCLOSE );
+	// read the rest of the line
+	String_EntityZone( lDefine, value );
+	lOldLine = Parser_LineNumber;
+	while( 1 )
+		if( !Parser_GetToken() )
+			break;
+		else if( lOldLine != Parser_LineNumber ) {
+			--Parser_TokenNum;
+			break;
+		} else if( Parser_Token == "\\" )
+			++lOldLine;
+		else
+			String_EntitySet( lDefine, value, strcat( lDefine.value, "\"", Parser_Token, "\" " ) );
+
+	Parser_Print( PARSER_HIGH, strcat( " Name = '", lDefine.name, "' Replacement = '", lDefine.value, "'" ) );
+
+	lDefine.chain = Parser_DefineChain;
+	Parser_DefineChain = lDefine;
+
+	Parser_Print( PARSER_HIGH, "Done parsing #define" );
+};
+
+void() Parser_ParseUndef =
+{
+	local entity lEntity, lPrevious;
+
+	// #undef Name
+	Parser_Print( PARSER_HIGH, "Parsing #undef..." );
+	Parser_Expect( PARSER_TT_TOKEN );
+
+	lPrevious = null_entity;
+	for( lEntity = Parser_DefineChain ; lEntity ; lPrevious = lEntity, lEntity = lEntity.chain )
+		if( lEntity.name == Parser_Token ) {
+			if( lPrevious )
+				lPrevious.chain = lEntity.chain;
+			else
+				Parser_DefineChain = lEntity.chain;
+
+			Parser_Print( PARSER_INFO, strcat( "#undef: Removed [", Parser_Token, "]" ) );
+
+			String_Free( lEntity.name );
+			String_Free( lEntity.value );
+
+			remove( lEntity );
+
+			return;
+		}
+
+	Parser_Print( PARSER_INFO, strcat( "#undef: [", Parser_Token, "] not found!" ) );
+};
+
+void() Parser_ProcessDefine =
+{
+	local string lConstant;
+	local entity lDefine;
+
+	// [Name]
+	Parser_Expect( PARSER_TT_TOKEN );
+	lConstant = String_Zone( Parser_Token );
+
+	Parser_Expect( PARSER_TT_BRACKETCLOSE );
+
+	Parser_Print( PARSER_HIGH, strcat( "Processing [", lConstant, "]..." ) );
+
+	for( lDefine = Parser_DefineChain ; lDefine ; lDefine = lDefine.chain )
+		if( lDefine.name == lConstant ) {
+			// if you want to have a single token use \" or '
+			Parser_Line = String_Set( Parser_Line, strcat( " ", lDefine.value ) );
+			Parser_Print( PARSER_HIGH, strcat( "Replacing with '", Parser_Line, "'" ) );
+			for( ; Parser_TokenNum < Parser_NumTokens ; Parser_TokenNum++ )
+				Parser_Line = String_Set( Parser_Line, strcat( Parser_Line, " \"", argv( Parser_TokenNum ), "\"" ) );
+			Parser_TokenizeLine();
+			String_Free( lConstant );
+			return;
+		}
+
+	Parser_Token = String_Set( Parser_Token, String_Normal( lConstant ) );
+	Parser_Print( PARSER_NORMAL, strcat( "#define: Couldn't find constant '", Parser_Token, "'!" ) );
+	Parser_Error( "constant not found" );
+};
+
+// Item [Template]
+// Template
+void( string pNamespace ) Parser_ParseDefinition =
+{
+	local entity lEntity;
+
+	if( Parser_TokenType == PARSER_TT_ITEM )
+		Parser_ParseItem( pNamespace );
+	else if( Parser_TokenType == PARSER_TT_TEMPLATE ) {
+		lEntity = Parser_ParseItem( pNamespace );
+		lEntity.flag = lEntity.flag | FLAG_TEMPLATE;
+	} else if( Parser_TokenType == PARSER_TT_DEFINE )
+		Parser_ParseDefine();
+	else if( Parser_TokenType == PARSER_TT_DERIVE )
+		Parser_DeriveItem( pNamespace );
+	else if( Parser_TokenType == PARSER_TT_DERIVETEMPLATE ) {
+		lEntity = Parser_DeriveItem( pNamespace );
+		lEntity.flag = lEntity.flag | FLAG_TEMPLATE;
+	} else if( Parser_TokenType == PARSER_TT_UNDEF )
+		Parser_ParseUndef();
+	else if( Parser_TokenType == PARSER_TT_NAMESPACE )
+		Parser_ParseNamespace( pNamespace );
+	else if( Parser_TokenType == PARSER_TT_INCLUDE )
+		Parser_IncludeFile( pNamespace );
+	else if( Parser_TokenType == PARSER_TT_IGNORE )
+		Parser_ParseIgnore();
+	else
+		Parser_Error( "couldn't find type in Parser_ParseDef" );
+};
+
+void() Parser_ParseIgnore =
+{
+	local float lBraceCount;
+
+	Parser_Expect( PARSER_TT_BRACEOPEN );
+	for( lBraceCount = 1 ; lBraceCount > 0 ; )
+		if( !Parser_GetToken() )
+			break;
+		else if( Parser_TokenType == PARSER_TT_BRACEOPEN )
+			++lBraceCount;
+		else if( Parser_TokenType == PARSER_TT_BRACECLOSE )
+			--lBraceCount;
+};
+
+entity( string pNamespace ) Parser_ParseItem =
+{
+	local string lNamespace;
+	local string lEntityText;
+	local entity lEntity;
+
+	Parser_Print( PARSER_HIGH, "Parsing item.." );
+
+	// get the item type
+	Parser_Expect( PARSER_TT_TOKEN );
+	lEntityText = String_Zone( strcat( "{ \"type\" \"Item_", Parser_Token,"\" " ) );
+
+	Parser_Print( PARSER_HIGH, strcat( " Type = '", Parser_Token, "'" ) );
+
+	// get the item name
+	Parser_Expect( PARSER_TT_TOKEN );
+	if( pNamespace != "" )
+		lNamespace = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
+	else
+		lNamespace = String_Zone( Parser_Token );
+
+	lEntityText = String_Set( lEntityText, strcat( lEntityText, "\"name\" \"", lNamespace, "\" " ) );
+	lEntityText = String_Set( lEntityText, strcat( lEntityText, "\"parent\" \"", pNamespace, "\" " ) );
+
+	Parser_Print( PARSER_HIGH, strcat( " Name = '", Parser_Token, "' Parent = '", pNamespace,
+				"' Namespace = '", lNamespace, "'" ) );
+
+	Parser_Expect( PARSER_TT_BRACEOPEN );
+	lEntityText = Parser_ParseEntity( lNamespace, lEntityText );
+
+	// parse the entity (builtin)
+	lEntity = spawn();
+	parseentitydata( lEntity, lEntityText );
+
+	String_Free( lEntityText );
+	String_Free( lNamespace );
+
+	Parser_Print( PARSER_HIGH, strcat( "Parsing '", lEntity.name, "' finished" ) );
+
+	return lEntity;
+};
+
+void( entity pSource, entity pTarget ) Parser_CloneChildren =
+{
+	// we search for all items that are direct children of pSource and copy them
+	// and adapt their parent and names
+	local entity lNode;
+
+	lNode = null_entity;
+	while ( (lNode = findstring( lNode, parent, pSource.name )) != null_entity ) {
+		local entity lClone;
+		local string lModifierString;
+
+		lClone = spawn();
+		copyentity( lNode, lClone );
+
+		if( lClone.flag & FLAG_TEMPLATE )
+			lClone.flag = lClone.flag - FLAG_TEMPLATE;
+
+		lModifierString = strcat( "{ name \"", pTarget.name,
+			substring( lNode.name, strlen( pSource.name ), 100000 ), "\" parent \"", pTarget.name, "\" }" );
+
+		parseentitydata( lClone, lModifierString );
+
+		Parser_CloneChildren( lNode, lClone );
+	}
+};
+
+entity( string pNamespace ) Parser_DeriveItem =
+{
+	local string lNamespace;
+	local string lEntityText;
+	local entity lBase;
+	local string lBaseName;
+	local entity lEntity;
+
+	Parser_Print( PARSER_HIGH, "Parsing derived item.." );
+
+	// get the base item
+	Parser_Expect( PARSER_TT_TOKEN );
+
+	if( substring( Parser_Token, 0, 2 ) == "::" )
+		lBaseName = String_Zone( substring( Parser_Token, 2, strlen( Parser_Token ) - 2 ) );
+	else if( pNamespace == "" )
+		lBaseName = String_Zone( Parser_Token );
+	else {
+		lBaseName = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
+
+		// try the local namespace first, then try to find it in the global
+		if( findstring( null_entity,  name, lBaseName ) == null_entity )
+			lBaseName = String_Set( lBaseName, Parser_Token );
+	}
+
+	Parser_Print( PARSER_HIGH, strcat( " Base = '", lBaseName, "'" ) );
+
+	lBase = findstring( null_entity, name, lBaseName );
+	if( lBase == null_entity )
+		Parser_Error( "couldnt find item" );
+
+	// get the item name
+	Parser_Expect( PARSER_TT_TOKEN );
+	if( pNamespace != "" )
+		lNamespace = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
+	else
+		lNamespace = String_Zone( Parser_Token );
+
+	lEntityText = String_Zone( strcat( "{ \"name\" \"", lNamespace, "\" " ) );
+	lEntityText = String_Set( lEntityText, strcat( lEntityText, "\"parent\" \"", pNamespace, "\" " ) );
+
+	Parser_Print( PARSER_HIGH, strcat( " Name = '", Parser_Token, "' Parent = '", pNamespace,
+				"' Namespace = '", lNamespace, "'" ) );
+
+	Parser_Expect( PARSER_TT_BRACEOPEN );
+	lEntityText = Parser_ParseEntity( lNamespace, lEntityText );
+
+	// parse the entity (builtin)
+	lEntity = spawn();
+	copyentity( lBase, lEntity );
+	if( lEntity.flag & FLAG_TEMPLATE )
+		lEntity.flag = lEntity.flag - FLAG_TEMPLATE;
+	parseentitydata( lEntity, lEntityText );
+
+	String_Free( lEntityText );
+	String_Free( lNamespace );
+	String_Free( lBaseName );
+
+	// now copy over all children
+	Parser_CloneChildren( lBase, lEntity );
+
+	Parser_Print( PARSER_HIGH, strcat( "Parsing '", lEntity.name, "' finished" ) );
+
+	return lEntity;
+};
+
+string( string pNamespace, string pEntityText ) Parser_ParseEntity =
+{
+	while( Parser_GetToken() ) {
+		if( Parser_TokenType == PARSER_TT_TOKEN ) {
+			// must be a property...
+			// store the key value
+			pEntityText = String_Set( pEntityText, strcat( pEntityText, "\"", Parser_Token, "\" " ) );
+			Parser_Expect( PARSER_TT_TOKEN );
+			pEntityText = String_Set( pEntityText, strcat( pEntityText, "\"", Parser_Token, "\" " ) );
+		} else if( Parser_TokenType == PARSER_TT_BRACECLOSE )
+			break;
+		else
+			Parser_ParseDefinition( pNamespace );
+	}
+
+	return String_Append( pEntityText, " }" );
+};
+
+void( string pNamespace ) Parser_ParseNamespace =
+{
+	local string lNamespace;
+
+	Parser_Print( PARSER_HIGH, "Parsing Namespace..." );
+	// namespace Name {
+	Parser_Expect( PARSER_TT_TOKEN );
+	if( pNamespace != "" )
+		lNamespace = String_Zone( strcat( pNamespace, "::", Parser_Token ) );
+	else
+		lNamespace = String_Zone( Parser_Token );
+	Parser_Print( PARSER_HIGH, strcat( " Subnamespace = '", Parser_Token, "' New namespace = '", lNamespace, "'" ) );
+
+	Parser_Expect( PARSER_TT_BRACEOPEN );
+
+	while( Parser_GetToken() ) {
+		if( Parser_TokenType == PARSER_TT_BRACECLOSE )
+			break;
+
+		Parser_ParseDefinition( lNamespace );
+	}
+
+	Parser_Print( PARSER_HIGH, strcat( "Finished parsing Namespace. Namespace = '", pNamespace, "'" ) );
+
+	String_Free( lNamespace );
+};
+
+void( string pFilename, string pNamespace ) Parser_ParseFile =
+{
+	Parser_Filename = String_Zone( pFilename );
+	Parser_File = fopen( Parser_Filename, FILE_READ );
+	if( Parser_File == -1 ) {
+		print( "Parser: Couldn't open ", Parser_Filename, "\n" );
+		return;
+	}
+
+	Parser_Line = String_Create();
+	Parser_LineNumber = 0;
+	Parser_NumTokens = Parser_TokenNum = 0;
+
+	while( Parser_GetToken() )
+		Parser_ParseDefinition( pNamespace );
+
+	fclose( Parser_File );
+	String_Free( Parser_Filename );
+	String_Free( Parser_Line );
+};
+
+void() Parser_Init =
+{
+	Parser_Token = String_Create();
+	Parser_DefineChain = null_entity;
+	Parser_IncludeDepth = 0;
+
+	Parser_FileList = String_Create();
+};
+
+void() Parser_Quit =
+{
+	local entity lNext;
+
+	_Parser_Print( PARSER_HIGH, "Deleting #defines:" );
+	while( Parser_DefineChain ) {
+		lNext = Parser_DefineChain.chain;
+		_Parser_Print( PARSER_HIGH, strcat( "  [", Parser_DefineChain.name, "]" ) );
+
+		String_Free( Parser_DefineChain.name );
+		String_Free( Parser_DefineChain.value );
+
+		remove( Parser_DefineChain );
+		Parser_DefineChain = lNext;
+	}
+
+
+	String_Free( Parser_Token );
+	String_Free( Parser_FileList );
+};
+
+void( string pPluginDir ) Parser_ParsePlugins =
+{
+	local float lSearchHandle;
+	local float lCounter, lCount;
+
+	lSearchHandle = search_begin( strcat( pPluginDir, "/*.plugin" ), true, true );
+	if( lSearchHandle < 0 ) {
+		return;
+	}
+
+	lCount = search_getsize( lSearchHandle );
+
+	for( lCounter = 0 ; lCounter < lCount ; lCounter++ ) {
+		local string pPlugin;
+
+		Parser_FileList = String_Set( Parser_FileList, "" );
+
+		pPlugin = String_Zone( search_getfilename( lSearchHandle, lCounter ) );
+		Parser_FileList = Util_AltStringPush( Parser_FileList, pPlugin );
+
+		Parser_ParseFile( pPlugin, "" );
+
+		_Parser_Print( PARSER_INFO, strcat( "Plugin '", pPlugin, "': files parsed: ", Parser_FileList ) );
+		String_Free( pPlugin );
+	}
+
+	search_end( lSearchHandle );
+};
+
+void( string pMain, string pPluginDir ) Parser_ParseMenu =
+{
+	Parser_Init();
+
+	pMain = String_Zone( pMain );
+	Parser_FileList = Util_AltStringPush( Parser_FileList, pMain );
+
+	Parser_ParseFile( pMain, "" );
+
+	_Parser_Print( PARSER_INFO, strcat( "Files parsed: ", Parser_FileList ) );
+	String_Free( pMain );
+
+	// plugins
+	if( pPluginDir != "" ) {
+		Parser_ParsePlugins( pPluginDir );
+	}
+
+	Parser_Quit();
+};


Property changes on: trunk/basezym/menuqc/system/parser.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/parser.qh
===================================================================
--- trunk/basezym/menuqc/system/parser.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/parser.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,82 +1,82 @@
-// DP/Nex Menu
-// system/parser.qh
-
-enum {
-	PARSER_TT_ITEM,
-	PARSER_TT_TEMPLATE,
-	PARSER_TT_DERIVE,
-	PARSER_TT_DERIVETEMPLATE,
-	PARSER_TT_DEFINE,
-	PARSER_TT_UNDEF,
-	PARSER_TT_IGNORE,
-	PARSER_TT_NAMESPACE,
-	PARSER_TT_INCLUDE,
-	PARSER_TT_BRACEOPEN,
-	PARSER_TT_BRACECLOSE,
-	PARSER_TT_BRACKETOPEN,
-	PARSER_TT_BRACKETCLOSE,
-	PARSER_TT_TOKEN,
-	PARSER_TT_SIZE
-};
-
-// FIXME: FTEQCC: const string PARSER_TT_TEXT[PARSER_TT_SIZE] = {
-const string PARSER_TT_TEXT[14] = {
-	"Item", "Template", "Derive", "DeriveTemplate", "Define", "#undef", "Ignore", "Namespace",
-	"#include", "{", "}", "[", "]", "Token"
-};
-
-const float PARSER_NORMAL = 0;
-enumflags {
-	PARSER_INFO,
-	PARSER_HIGH,
-	PARSER_LOW
-};
-
-const float Parser_MaxIncludeDepth = 32;
-
-string Parser_FileList;
-float  Parser_IncludeDepth;
-
-entity Parser_DefineChain;
-
-string Parser_Filename;
-float  Parser_LineNumber;
-
-float  Parser_File;
-string Parser_Line;
-
-float   Parser_NumTokens;
-float   Parser_TokenNum;
-string  Parser_Token;
-float 	Parser_TokenType;
-
-bool() Parser_GetToken;
-float() Parser_GetTokenType;
-
-void() Parser_ParseDefine;
-void() Parser_ProcessDefine;
-void() Parser_ParseUndef;
-
-void( float pType ) Parser_Expect;
-
-void( string pInfo ) Parser_Error;
-void( float pLevel, string pInfo ) Parser_Print;
-
-entity( string pNamespace ) Parser_ParseItem;
-entity( string pNamespace ) Parser_DeriveItem;
-string( string pNamespace, string pEntityText ) Parser_ParseEntity;
-void( string pNamespace ) Parser_ParseDefinition;
-void( string pNamespace ) Parser_ParseNamespace;
-void() Parser_ParseIgnore;
-
-void( entity pSource, entity pTarget ) Parser_CloneChildren;
-
-void( string pNamespace ) Parser_IncludeFile;
-
-void( string pFilename, string pNamespace ) Parser_ParseFile;
-
-void( string pPluginDir ) Parser_ParsePlugins;
-void( string pMain, string pPluginDir ) Parser_ParseMenu;
-
-void() Parser_Init;
-void() Parser_Quit;
+// DP/Nex Menu
+// system/parser.qh
+
+enum {
+	PARSER_TT_ITEM,
+	PARSER_TT_TEMPLATE,
+	PARSER_TT_DERIVE,
+	PARSER_TT_DERIVETEMPLATE,
+	PARSER_TT_DEFINE,
+	PARSER_TT_UNDEF,
+	PARSER_TT_IGNORE,
+	PARSER_TT_NAMESPACE,
+	PARSER_TT_INCLUDE,
+	PARSER_TT_BRACEOPEN,
+	PARSER_TT_BRACECLOSE,
+	PARSER_TT_BRACKETOPEN,
+	PARSER_TT_BRACKETCLOSE,
+	PARSER_TT_TOKEN,
+	PARSER_TT_SIZE
+};
+
+// FIXME: FTEQCC: const string PARSER_TT_TEXT[PARSER_TT_SIZE] = {
+const string PARSER_TT_TEXT[14] = {
+	"Item", "Template", "Derive", "DeriveTemplate", "Define", "#undef", "Ignore", "Namespace",
+	"#include", "{", "}", "[", "]", "Token"
+};
+
+const float PARSER_NORMAL = 0;
+enumflags {
+	PARSER_INFO,
+	PARSER_HIGH,
+	PARSER_LOW
+};
+
+const float Parser_MaxIncludeDepth = 32;
+
+string Parser_FileList;
+float  Parser_IncludeDepth;
+
+entity Parser_DefineChain;
+
+string Parser_Filename;
+float  Parser_LineNumber;
+
+float  Parser_File;
+string Parser_Line;
+
+float   Parser_NumTokens;
+float   Parser_TokenNum;
+string  Parser_Token;
+float 	Parser_TokenType;
+
+bool() Parser_GetToken;
+float() Parser_GetTokenType;
+
+void() Parser_ParseDefine;
+void() Parser_ProcessDefine;
+void() Parser_ParseUndef;
+
+void( float pType ) Parser_Expect;
+
+void( string pInfo ) Parser_Error;
+void( float pLevel, string pInfo ) Parser_Print;
+
+entity( string pNamespace ) Parser_ParseItem;
+entity( string pNamespace ) Parser_DeriveItem;
+string( string pNamespace, string pEntityText ) Parser_ParseEntity;
+void( string pNamespace ) Parser_ParseDefinition;
+void( string pNamespace ) Parser_ParseNamespace;
+void() Parser_ParseIgnore;
+
+void( entity pSource, entity pTarget ) Parser_CloneChildren;
+
+void( string pNamespace ) Parser_IncludeFile;
+
+void( string pFilename, string pNamespace ) Parser_ParseFile;
+
+void( string pPluginDir ) Parser_ParsePlugins;
+void( string pMain, string pPluginDir ) Parser_ParseMenu;
+
+void() Parser_Init;
+void() Parser_Quit;


Property changes on: trunk/basezym/menuqc/system/parser.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/structure.qc
===================================================================
--- trunk/basezym/menuqc/system/structure.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/structure.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,599 +1,599 @@
-// DP/Nex Menu
-// system/structure.qc
-
-// TODO: finish the debug output
-void( float pLevel, string pText ) _Menu_Structure_Debug =
-{
-	if( pLevel <= sys_debug_structure )
-		print( pText );
-};
-
-void( bool pUser ) _Menu_Select =
-{
-	Raise_Select( Menu_ActiveItem, true, pUser );
-};
-
-entity( entity pItem ) _Menu_GetParent =
-{
-	if( !pItem._parent )
-		return null_entity;
-	if( Menu_IsEmbedded( pItem._parent ) )
-		return _Menu_GetParent( pItem._parent );
-	return pItem._parent;
-};
-
-bool( entity pItem, entity pParent ) _Menu_IsEmbeddedParentOf =
-{
-	if( pItem._parent == pParent )
-		return true;
-	if( Menu_IsEmbedded( pItem._parent ) )
-		return _Menu_IsEmbeddedParentOf( pItem._parent, pParent );
-	return false;
-};
-
-entity( entity pItem ) _Menu_GetFirst =
-{
-	if( Menu_IsEmbedded( pItem ) && pItem._child )
-		return _Menu_GetFirst( pItem._child );
-	return pItem;
-};
-
-entity( entity pItem ) _Menu_GetLast =
-{
-	if( Menu_IsEmbedded( pItem ) && pItem._child ) {
-		local entity lNode;
-
-		for( lNode = pItem._child ; lNode._next ; lNode = lNode._next );
-		return _Menu_GetLast( lNode );
-	}
-	return pItem;
-};
-
-entity( entity pItem ) _Menu_GetNext =
-{
-	local entity lNext;
-
-	lNext = pItem._next;
-	if( lNext )
-		return _Menu_GetFirst( lNext );
-	if( Menu_IsEmbedded( pItem._parent ) && pItem._parent != Menu_ActiveWindow )
-		return _Menu_GetNext( pItem._parent );
-	else
-		return null_entity;
-};
-
-entity( entity pItem ) _Menu_GetPrev =
-{
-	local entity lPrev;
-
-	lPrev = pItem._prev;
-	if( lPrev )
-		return _Menu_GetLast( lPrev );
-	if( Menu_IsEmbedded( pItem._parent ) && pItem._parent != Menu_ActiveWindow )
-		return _Menu_GetPrev( pItem._parent );
-	else
-		return null_entity;
-};
-
-void() _Menu_SelectNext =
-{
-	local entity lTemp;
-
-	if( !Menu_ActiveItem ) {
-		_Menu_Structure_Debug( 1, "_SelectNext: Bad Menu_ActiveItem!\n" );
-		return;
-	}
-
-	// try to select the next item
-	lTemp = Menu_ActiveItem;
-	while( (lTemp = _Menu_GetNext( lTemp )) != null_entity )
-			if( Menu_IsSelectable( lTemp ) ) {
-			Menu_ActiveItem = lTemp;
-			_Menu_Structure_Debug( 1, strcat( "_SelectNext: ", lTemp.name, "\n" ) );
-			return;
-		}
-	// loop
-	// only because of embedded:
-	for( lTemp = Menu_ActiveItem ; _Menu_GetPrev( lTemp ) ; lTemp = _Menu_GetPrev( lTemp ) );
-// TODO: rewrite _Menu_Select* to use an additional temp variable for storing the result of the functionc all
-	for( ; lTemp != Menu_ActiveItem ; lTemp = _Menu_GetNext( lTemp ) )
-		if( Menu_IsSelectable( lTemp ) ) {
-			Menu_ActiveItem = lTemp;
-			_Menu_Structure_Debug( 1, strcat( "_SelectNext after loop: ", lTemp.name, "\n" ) );
-			return;
-		}
-};
-
-void() _Menu_SelectPrev =
-{
-	local entity lTemp;
-
-	if( !Menu_ActiveItem ) {
-		_Menu_Structure_Debug( 1, "_SelectPrev: Bad Menu_ActiveItem!\n" );
-		return;
-	}
-
-	// try to select the previous item
-	lTemp = Menu_ActiveItem;
-	while( (lTemp = _Menu_GetPrev( lTemp )) != null_entity )
-		if( Menu_IsSelectable( lTemp ) ) {
-			Menu_ActiveItem = lTemp;
-			_Menu_Structure_Debug( 1, strcat( "_SelectPrev: ", lTemp.name, "\n" ) );
-			return;
-		}
-	// loop
-	for( lTemp = Menu_ActiveItem ; _Menu_GetNext( lTemp ) ; lTemp = _Menu_GetNext( lTemp ) );
-	for( ; lTemp != Menu_ActiveItem ; lTemp = _Menu_GetPrev( lTemp ) ) {
-		if( Menu_IsSelectable( lTemp ) ) {
-			Menu_ActiveItem = lTemp;
-			_Menu_Structure_Debug( 1, strcat( "_SelectPrev after loop: ", lTemp.name, "\n" ) );
-			return;
-		}
-	}
-};
-
-bool() _Menu_SelectUp =
-{
-	// Menu_ActiveItem is the child
-	local entity lSelected, lParent, lNode;
-
-	lSelected = Menu_ActiveItem;
-	if( !lSelected ) {
-		_Menu_Structure_Debug( 1, "_SelectUp: Bad Menu_ActiveItem!\n" );
-		return false;
-	}
-
-	// If we try to select up the active window, we'll pop the menu history
-	if( lSelected == Menu_ActiveWindow ) {
-		// If there is no history, we quit the menu
-		_Menu_Structure_Debug( 2, "_SelectUp: Selecting up current active window..\n" );
-		if( Menu_History == null_entity ) {
-			_Menu_Structure_Debug( 2, "_SelectUp: Empty history -> toggling menu..\n" );
-			if( !Menu_Toggle() )
-				Menu_Reselect( false );
-			return true;
-		}
-
-		_Menu_Structure_Debug( 2, "_SelectUp: Popping history..\n" );
-		Menu_History_Pop();
-	}
-
-	lParent = _Menu_GetParent( lSelected );
-	if( !lParent ) {
-		_Menu_Structure_Debug( 2, "_SelectUp: No parent and not active window!\n" );
-		return false;
-	}
-
-	// If this window is selectable, we know that there is at least one selectable item in the parent,
-	// thus we will select the parent
-	if( Menu_IsSelectable( lParent ) ) {
-		Menu_ActiveItem = lParent;
-		_Menu_Structure_Debug( 1, strcat( "_SelectUp: first parent: ", lParent.name, "\n" ) );
-		return true;
-	}
-
-	// if there is no parent window of this window (lParent), it's the active window
-	// else we have failed
-	if( lParent == Menu_ActiveWindow ) {
-		Menu_ActiveItem = Menu_ActiveWindow;
-		_Menu_Structure_Debug( 2, strcat( "_SelectUp: select up parent: ", Menu_ActiveItem.name, "\n" ) );
-		if( _Menu_SelectUp() )
-			return true;
-		Menu_ActiveItem = lSelected;
-		return false;
-	} else if( !lParent._parent ) {
-		_Menu_Structure_Debug( 1, "_SelectUp: No parent of parent and not active window!\n" );
-		return false;
-	}
-
-	// If not, we try to determine whether the window is the first window with a selectable children in
-	// the parent window. If lParent is the selected by selectdown, we move up, if not we have found it.
-	// IDEA: inline this
-	Menu_ActiveItem = _Menu_GetParent( lParent );
-	_Menu_Structure_Debug( 2, strcat( "_SelectUp: SelectDown on parent of parent '", Menu_ActiveItem.name, "' \n" ) );
-	_Menu_SelectDown();
-	// thanks to embedded windows (and not only them) - added later on - perhaps doesnt really
-	// fit into the old logic behind it - take this with caution
-	for( lNode = Menu_ActiveItem ; lNode ; lNode = lNode._parent )
-		if( lNode._parent == lParent ) {
-			Menu_ActiveItem = _Menu_GetParent( lSelected ); //lParent._parent;
-			if( _Menu_SelectUp() )
-				return true;
-			Menu_ActiveItem = lSelected;
-			return false;
-		}
-
-	// else we have already found the window we have searched!
-	return true;
-};
-
-void( entity pItem ) _Menu_PrintRunFlag;
-bool() _Menu_SelectDown =
-{
-	// Menu_ActiveItem is the window
-	local entity lParent, lChild;
-
-	lParent = Menu_ActiveItem;
-	if( !lParent ) {
-		_Menu_Structure_Debug( 1, "_SelectDown: Bad Menu_ActiveItem!\n" );
-		return false;
-	}
-
-	// lets find the first selectable item
-	for( lChild = _Menu_GetFirst( lParent._child ) ; lChild ; lChild = _Menu_GetNext( lChild ) )
-		if( Menu_IsSelectable( lChild ) ) {
-			Menu_ActiveItem = lChild;
-			_Menu_PrintRunFlag( lChild );
-			_Menu_Structure_Debug( 1, strcat( "_SelectDown: ", lChild.name, "\n" ) );
-			return true;
-		}
-
-	// lets find the first window that has a selectable item
-	for( lChild = _Menu_GetFirst( lParent._child ) ; lChild ; lChild = _Menu_GetNext( lChild ) )
-		if( !Menu_IsEmbedded( lChild ) ) {
-			Menu_ActiveItem = lChild;
-			_Menu_Structure_Debug( 2, strcat( "_SelectDown: Try child: ", Menu_ActiveItem.name, "\n" ) );
-			if( _Menu_SelectDown() )
-				return true;
-		}
-
-	Menu_ActiveItem = lParent;
-	return false;
-};
-
-void() _Menu_Reselect =
-{
-	Menu_ActiveItem = Menu_ActiveWindow;
-	_Menu_SelectDown();
-};
-
-void( bool pUser ) Menu_SelectNext =
-{
-	Raise_Select( Menu_ActiveItem, false, pUser );
-	_Menu_SelectNext();
-	Raise_Select( Menu_ActiveItem, true, pUser );
-};
-
-void( bool pUser ) Menu_SelectPrev =
-{
-	Raise_Select( Menu_ActiveItem, false, pUser );
-	_Menu_SelectPrev();
-	Raise_Select( Menu_ActiveItem, true, pUser );
-};
-
-bool( bool pUser ) Menu_SelectUp =
-{
-	local entity lOld;
-
-	lOld = Menu_ActiveItem;
-	if( _Menu_SelectUp() ) {
-		Raise_Select( lOld, false, pUser );
-		Raise_Select( Menu_ActiveItem, true, pUser );
-		return true;
-	}
-	return false;
-};
-
-bool( bool pUser ) Menu_SelectDown =
-{
-	local entity lOld;
-
-	lOld = Menu_ActiveItem;
-	if( _Menu_SelectDown() ) {
-		Raise_Select( lOld, false, pUser );
-		Raise_Select( Menu_ActiveItem, true, pUser );
-		return true;
-	}
-	return false;
-};
-
-void( entity pItem, bool pUser ) Menu_Select =
-{
-	Raise_Select( Menu_ActiveItem, false, pUser );
-	_Menu_Structure_Debug( 1, strcat( "Menu_Select: ", pItem.name, "\n" ) );
-	Menu_ActiveItem = pItem;
-	Raise_Select( Menu_ActiveItem, true, pUser );
-};
-
-void( entity pItem, bool pUser ) Menu_CorrectSelection =
-{
-	if( Menu_ActiveItem != pItem )
-		Menu_Select( pItem, pUser );
-};
-
-void( bool pUser ) Menu_Reselect =
-{
-	Raise_Select( Menu_ActiveItem, false, pUser );
-	_Menu_Reselect();
-	Raise_Select( Menu_ActiveItem, true, pUser );
-};
-
-void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow =
-{
-	Raise_Select( Menu_ActiveItem, false, pUser );
-
-	// only jump to windows
-	if( !pMenu._child )
-		error("Cant jump to ", pMenu.name, " !\n");
-
-	// add a history point
-	if( pMakeActive ) {
-		Menu_History_Push( pMenu, Util_NullFunction );
-		Menu_ActiveWindow = pMenu;
-	}
-
-	// now set the selected to the first selectable child
-	Menu_ActiveItem = pMenu;
-	if( !_Menu_SelectDown() )
-		error( "Couldn't jump to ", pMenu.name, " !\n" );
-
-	Raise_Select( Menu_ActiveItem, true, pUser );
-};
-
-#ifdef USEFUNCTIONS
-bool( entity pEntity, float pFlag ) Menu_HasFlag =
-{
-	if( pEntity.flag & pFlag )
-		return true;
-	return false;
-};
-
-bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag =
-{
-	if( pEntity._runFlag & pRunFlag )
-		return true;
-	return false;
-};
-#endif
-
-entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx =
-{
-	local entity lItem;
-	local string lFirstTwo;
-
-	lFirstTwo = substring( pName, 0, 2 );
-
-	// FIXME: perhaps add another function or do this in some other way
-	if( lFirstTwo == "::" )
-		lItem = findstring( null_entity,  name, substring( pName, 2, 100000 ) );
-	// support for direction tokens, init token ##
-	else if( lFirstTwo == "##" ) {
-		local string lToken;
-		local float lCount, lCounter;
-		lItem = pOrigin;
-		lCount = tokenize( substring( pName, 2, 100000 ) );
-		// we have the following tokens atfer the ##: up down next prev
-		for( lCounter = 0 ; lCounter < lCount && lItem ; ++lCounter ) {
-			lToken = argv( lCounter );
-			if( lToken == "up" )
-				lItem = lItem._parent;
-			else if( lToken == "down" )
-				lItem = lItem._child;
-			else if( lToken == "next" )
-				lItem = lItem._next;
-			else if( lToken == "prev" )
-				lItem = lItem._prev;
-			else
-				error( "Bad direction link(bad token): '", pName, "'!" );
-		}
-	} else  {
-		// we start from the current namespace and try to find the object
-		// by checking for it in all parent namespaces
-		lItem = null_entity;
-		while( !lItem && (pOrigin = pOrigin._parent) != null_entity )
-			lItem = findstring( null_entity, name, strcat( pOrigin.name, "::", pName ) );
-
-		if( !lItem )
-			lItem = findstring( null_entity, name, pName );
-	}
-
-	if( lItem == null_entity && pThrow )
-		error( "Couldn't find item '", pName, "'!" );
-
-	return lItem;
-};
-
-entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx =
-{
-	local entity lItem;
-
-	if( pOrigin )
-		lItem = findstring( null_entity, name, strcat( pOrigin.name, "::", pName ) );
-	else
-		lItem = findstring( null_entity, name, pName );
-
-	if( lItem == null_entity && pThrow )
-		error( "Couldn't find item '", pName, "'!" );
-
-	return lItem;
-};
-
-entity( string pName ) Menu_GetItem =
-{
-	return Menu_GetItemEx( self, pName, true );
-};
-
-entity( string pName ) Menu_GetChild =
-{
-	return Menu_GetChildEx( self, pName, true );
-};
-
-void( entity pWindow ) Menu_EmptyWindow =
-{
-	local entity lChild;
-
-	for( lChild = pWindow._child ; lChild ; lChild = lChild._next ) {
-		Menu_EmptyWindow( lChild );
-		Raise_Destroy( lChild );
-		remove( lChild );
-	}
-
-	pWindow._child = null_entity;
-};
-
-void( entity pEntity ) Menu_RemoveItem =
-{
-	local entity lParent;
-	// raise the destroy event
-	lParent = pEntity._parent;
-	Menu_EmptyWindow( pEntity );
-	Raise_Destroy( pEntity );
-	remove( pEntity );
-	if( lParent )
-		Menu_LinkChildren( lParent );
-};
-
-void( entity pItem ) _Menu_PrintRunFlag =
-{
-	if( sys_debug_runflag ) {
-		print( " ", pItem.name, " Runflags: " );
-		if( pItem._runFlag & RUNFLAG_TEMPLATE )
-			print( "TEMPLATE " );
-		if( pItem._runFlag & RUNFLAG_MOUSEINAREA )
-			print( "MOUSEINAREA " );
-		if( pItem._runFlag & RUNFLAG_HADMOUSE )
-			print( "HADMOUSE " );
-		if( pItem._runFlag & RUNFLAG_CHILDDRAWONLY )
-			print( "CHILDDRAWONLY " );
-		if( pItem._runFlag & RUNFLAG_CHILDDRAWUPDATEONLY )
-			print( "CHILDDRAWUPDATEONLY " );
-		if( pItem._runFlag & RUNFLAG_HIDDEN )
-			print( "HIDDEN " );
-		if( pItem._runFlag & RUNFLAG_CLIPPED )
-			print( "CLIPPED " );
-		if( pItem._runFlag & RUNFLAG_NOSELECT )
-			print( "NOSELECT " );
-		print( "\n" );
-	}
-};
-
-void( entity pItem ) Menu_SetRunFlag =
-{
-	local float lFlag;
-	local float lRunFlag;
-
-	lFlag = pItem.flag;
-
-	// RUNFLAG_TEMPLATE
-	if( lFlag & FLAG_TEMPLATE )
-		pItem._runFlag = pItem._runFlag | RUNFLAG_TEMPLATE;
-	// RUNFLAG_HADMOUSE,
-	lRunFlag = pItem._runFlag;
-	if(lRunFlag & RUNFLAG_MOUSEINAREA )
-		pItem._runFlag = (lRunFlag - RUNFLAG_MOUSEINAREA) | RUNFLAG_HADMOUSE;
-	// RUNFLAG_MOUSEINAREA,
-	// these will be handled in MENU_PROCESS_MOUSE
-	// RUNFLAG_CHILDDRAWONLY,
-	// RUNFLAG_CHILDDRAWONLY,
-	// these two are handled in InheritRunFlag
-	// RUNFLAG_CLIPPED,
-	// check if it is within the clipping area (ie. really visible)
-	// trick: since the position and size are clipped against the previous clipping area
-	// Menu_Clip_Size will be '0 0 0', if the areas dont overlap
-	if( Menu_Clip_Size == '0 0 0' && Menu_Clip_Position != '0 0 0' )
-		pItem._runFlag = pItem._runFlag | RUNFLAG_CLIPPED;
-	// RUNFLAG_HIDDEN
-	lRunFlag = pItem._runFlag;
-	if( ( lFlag & FLAG_HIDDEN  ) ||
-	    ( lRunFlag & RUNFLAG_TEMPLATE ) ||
-	    ( ( lFlag & FLAG_SERVERONLY ) && !( gamestatus & GAME_ISSERVER ) ) ||
-	    ( ( lFlag & FLAG_CONNECTEDONLY ) && !( gamestatus & GAME_CONNECTED ) ) ||
-	    ( ( lFlag & FLAG_DEVELOPERONLY ) && !( gamestatus & GAME_DEVELOPER ) ) )
-		pItem._runFlag = lRunFlag | RUNFLAG_HIDDEN;
-	// RUNFLAG_NOSELECT
-	lRunFlag = pItem._runFlag;
-	if( ( lFlag & FLAG_NOSELECT ) ||
-	    ( lFlag & FLAG_DRAWONLY ) ||
-	    ( lFlag & FLAG_DRAWUPDATEONLY ) ||
-	    ( lFlag & FLAG_EMBEDDED ) ||
-	    ( lRunFlag & RUNFLAG_TEMPLATE ) ||
-	    ( lRunFlag & RUNFLAG_HIDDEN ) ||
-	    ( lRunFlag & RUNFLAG_CHILDDRAWONLY ) ||
-	    ( lRunFlag & RUNFLAG_CHILDDRAWUPDATEONLY ) )
-		pItem._runFlag = lRunFlag | RUNFLAG_NOSELECT;
-
-	_Menu_PrintRunFlag( pItem );
-};
-
-void( entity pParent, entity pItem ) Menu_InheritRunFlag =
-{
-	// reset the runflag
-	pItem._runFlag = pItem._runFlag & (RUNFLAG_MOUSEINAREA | RUNFLAG_DELETEFRAME | RUNFLAG_DELETETOGGLE | RUNFLAG_SPAWNED);
-	// inherit template
-	if( pParent._runFlag & RUNFLAG_TEMPLATE )
-		pItem._runFlag = pItem._runFlag | RUNFLAG_TEMPLATE;
-	// inherit drawonly
-	if( ( pParent._runFlag & RUNFLAG_CHILDDRAWONLY ) ||
-	    ( pParent.flag & FLAG_CHILDDRAWONLY ) )
-		pItem._runFlag = pItem._runFlag | RUNFLAG_CHILDDRAWONLY;
-	// inherit drawupdateonly
-	if( ( pParent._runFlag & RUNFLAG_CHILDDRAWUPDATEONLY )  ||
-	    ( pParent.flag & FLAG_CHILDDRAWUPDATEONLY ) )
-		pItem._runFlag = pItem._runFlag | RUNFLAG_CHILDDRAWUPDATEONLY;
-	if( pParent._runFlag & RUNFLAG_HIDDEN )
-		pItem._runFlag = pItem._runFlag | RUNFLAG_HIDDEN;
-};
-
-void() Menu_UpdateRunFlags =
-{
-	local vector lPos, lSize, lOrg;
-
-	lPos = Menu_Clip_Position;
-	lSize = Menu_Clip_Size;
-	lOrg = Menu_Origin;
-
-	Menu_Process_Setup();
-
-	// set the runflag of the active window
-	Menu_ActiveWindow._runFlag = Menu_ActiveWindow._runFlag & RUNFLAG_MOUSEINAREA;
-
-	// update runflag by using the view tree
-	Menu_ProcessRunFlag( Menu_ActiveWindow );
-
-	Menu_Clip_Size = lSize;
-	Menu_Clip_Position = lPos;
-	Menu_Origin = lOrg;
-	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
-};
-
-bool( entity pEntity ) Menu_HasEvents =
-{
-	if( pEntity._runFlag & RUNFLAG_CHILDDRAWONLY )
-		return false;
-	if( pEntity._runFlag & RUNFLAG_CHILDDRAWUPDATEONLY )
-		return false;
-	if( pEntity.flag & FLAG_DRAWONLY )
-		return false;
-	if( pEntity.flag & FLAG_DRAWUPDATEONLY )
-		return false;
-	//if( pEntity._runflag & RUNFLAG_HIDDEN )
-	//	return false;
-	return true;
-};
-
-#ifdef USEFUNCTIONS
-bool( entity pEntity ) Menu_IsVisible =
-{
-	return !(pEntity._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED));
-};
-
-bool( entity pEntity ) Menu_IsSelectable =
-{
-	return !(pEntity._runFlag & RUNFLAG_NOSELECT); // && !(pEntity._runFlag & RUNFLAG_TEMPLATE);
-};
-
-bool( entity pEntity ) Menu_IsTemplate =
-{
-	return pEntity._runFlag & RUNFLAG_TEMPLATE;
-};
-
-bool( entity pEntity ) Menu_IsEmbedded =
-{
-	return pEntity.flag & FLAG_EMBEDDED;
-};
-
-string( entity pItem ) Menu_GetName =
-{
-	return substring( pItem.name, strlen( pItem.parent ) + 2, 100000 );
-};
-#endif
+// DP/Nex Menu
+// system/structure.qc
+
+// TODO: finish the debug output
+void( float pLevel, string pText ) _Menu_Structure_Debug =
+{
+	if( pLevel <= sys_debug_structure )
+		print( pText );
+};
+
+void( bool pUser ) _Menu_Select =
+{
+	Raise_Select( Menu_ActiveItem, true, pUser );
+};
+
+entity( entity pItem ) _Menu_GetParent =
+{
+	if( !pItem._parent )
+		return null_entity;
+	if( Menu_IsEmbedded( pItem._parent ) )
+		return _Menu_GetParent( pItem._parent );
+	return pItem._parent;
+};
+
+bool( entity pItem, entity pParent ) _Menu_IsEmbeddedParentOf =
+{
+	if( pItem._parent == pParent )
+		return true;
+	if( Menu_IsEmbedded( pItem._parent ) )
+		return _Menu_IsEmbeddedParentOf( pItem._parent, pParent );
+	return false;
+};
+
+entity( entity pItem ) _Menu_GetFirst =
+{
+	if( Menu_IsEmbedded( pItem ) && pItem._child )
+		return _Menu_GetFirst( pItem._child );
+	return pItem;
+};
+
+entity( entity pItem ) _Menu_GetLast =
+{
+	if( Menu_IsEmbedded( pItem ) && pItem._child ) {
+		local entity lNode;
+
+		for( lNode = pItem._child ; lNode._next ; lNode = lNode._next );
+		return _Menu_GetLast( lNode );
+	}
+	return pItem;
+};
+
+entity( entity pItem ) _Menu_GetNext =
+{
+	local entity lNext;
+
+	lNext = pItem._next;
+	if( lNext )
+		return _Menu_GetFirst( lNext );
+	if( Menu_IsEmbedded( pItem._parent ) && pItem._parent != Menu_ActiveWindow )
+		return _Menu_GetNext( pItem._parent );
+	else
+		return null_entity;
+};
+
+entity( entity pItem ) _Menu_GetPrev =
+{
+	local entity lPrev;
+
+	lPrev = pItem._prev;
+	if( lPrev )
+		return _Menu_GetLast( lPrev );
+	if( Menu_IsEmbedded( pItem._parent ) && pItem._parent != Menu_ActiveWindow )
+		return _Menu_GetPrev( pItem._parent );
+	else
+		return null_entity;
+};
+
+void() _Menu_SelectNext =
+{
+	local entity lTemp;
+
+	if( !Menu_ActiveItem ) {
+		_Menu_Structure_Debug( 1, "_SelectNext: Bad Menu_ActiveItem!\n" );
+		return;
+	}
+
+	// try to select the next item
+	lTemp = Menu_ActiveItem;
+	while( (lTemp = _Menu_GetNext( lTemp )) != null_entity )
+			if( Menu_IsSelectable( lTemp ) ) {
+			Menu_ActiveItem = lTemp;
+			_Menu_Structure_Debug( 1, strcat( "_SelectNext: ", lTemp.name, "\n" ) );
+			return;
+		}
+	// loop
+	// only because of embedded:
+	for( lTemp = Menu_ActiveItem ; _Menu_GetPrev( lTemp ) ; lTemp = _Menu_GetPrev( lTemp ) );
+// TODO: rewrite _Menu_Select* to use an additional temp variable for storing the result of the functionc all
+	for( ; lTemp != Menu_ActiveItem ; lTemp = _Menu_GetNext( lTemp ) )
+		if( Menu_IsSelectable( lTemp ) ) {
+			Menu_ActiveItem = lTemp;
+			_Menu_Structure_Debug( 1, strcat( "_SelectNext after loop: ", lTemp.name, "\n" ) );
+			return;
+		}
+};
+
+void() _Menu_SelectPrev =
+{
+	local entity lTemp;
+
+	if( !Menu_ActiveItem ) {
+		_Menu_Structure_Debug( 1, "_SelectPrev: Bad Menu_ActiveItem!\n" );
+		return;
+	}
+
+	// try to select the previous item
+	lTemp = Menu_ActiveItem;
+	while( (lTemp = _Menu_GetPrev( lTemp )) != null_entity )
+		if( Menu_IsSelectable( lTemp ) ) {
+			Menu_ActiveItem = lTemp;
+			_Menu_Structure_Debug( 1, strcat( "_SelectPrev: ", lTemp.name, "\n" ) );
+			return;
+		}
+	// loop
+	for( lTemp = Menu_ActiveItem ; _Menu_GetNext( lTemp ) ; lTemp = _Menu_GetNext( lTemp ) );
+	for( ; lTemp != Menu_ActiveItem ; lTemp = _Menu_GetPrev( lTemp ) ) {
+		if( Menu_IsSelectable( lTemp ) ) {
+			Menu_ActiveItem = lTemp;
+			_Menu_Structure_Debug( 1, strcat( "_SelectPrev after loop: ", lTemp.name, "\n" ) );
+			return;
+		}
+	}
+};
+
+bool() _Menu_SelectUp =
+{
+	// Menu_ActiveItem is the child
+	local entity lSelected, lParent, lNode;
+
+	lSelected = Menu_ActiveItem;
+	if( !lSelected ) {
+		_Menu_Structure_Debug( 1, "_SelectUp: Bad Menu_ActiveItem!\n" );
+		return false;
+	}
+
+	// If we try to select up the active window, we'll pop the menu history
+	if( lSelected == Menu_ActiveWindow ) {
+		// If there is no history, we quit the menu
+		_Menu_Structure_Debug( 2, "_SelectUp: Selecting up current active window..\n" );
+		if( Menu_History == null_entity ) {
+			_Menu_Structure_Debug( 2, "_SelectUp: Empty history -> toggling menu..\n" );
+			if( !Menu_Toggle() )
+				Menu_Reselect( false );
+			return true;
+		}
+
+		_Menu_Structure_Debug( 2, "_SelectUp: Popping history..\n" );
+		Menu_History_Pop();
+	}
+
+	lParent = _Menu_GetParent( lSelected );
+	if( !lParent ) {
+		_Menu_Structure_Debug( 2, "_SelectUp: No parent and not active window!\n" );
+		return false;
+	}
+
+	// If this window is selectable, we know that there is at least one selectable item in the parent,
+	// thus we will select the parent
+	if( Menu_IsSelectable( lParent ) ) {
+		Menu_ActiveItem = lParent;
+		_Menu_Structure_Debug( 1, strcat( "_SelectUp: first parent: ", lParent.name, "\n" ) );
+		return true;
+	}
+
+	// if there is no parent window of this window (lParent), it's the active window
+	// else we have failed
+	if( lParent == Menu_ActiveWindow ) {
+		Menu_ActiveItem = Menu_ActiveWindow;
+		_Menu_Structure_Debug( 2, strcat( "_SelectUp: select up parent: ", Menu_ActiveItem.name, "\n" ) );
+		if( _Menu_SelectUp() )
+			return true;
+		Menu_ActiveItem = lSelected;
+		return false;
+	} else if( !lParent._parent ) {
+		_Menu_Structure_Debug( 1, "_SelectUp: No parent of parent and not active window!\n" );
+		return false;
+	}
+
+	// If not, we try to determine whether the window is the first window with a selectable children in
+	// the parent window. If lParent is the selected by selectdown, we move up, if not we have found it.
+	// IDEA: inline this
+	Menu_ActiveItem = _Menu_GetParent( lParent );
+	_Menu_Structure_Debug( 2, strcat( "_SelectUp: SelectDown on parent of parent '", Menu_ActiveItem.name, "' \n" ) );
+	_Menu_SelectDown();
+	// thanks to embedded windows (and not only them) - added later on - perhaps doesnt really
+	// fit into the old logic behind it - take this with caution
+	for( lNode = Menu_ActiveItem ; lNode ; lNode = lNode._parent )
+		if( lNode._parent == lParent ) {
+			Menu_ActiveItem = _Menu_GetParent( lSelected ); //lParent._parent;
+			if( _Menu_SelectUp() )
+				return true;
+			Menu_ActiveItem = lSelected;
+			return false;
+		}
+
+	// else we have already found the window we have searched!
+	return true;
+};
+
+void( entity pItem ) _Menu_PrintRunFlag;
+bool() _Menu_SelectDown =
+{
+	// Menu_ActiveItem is the window
+	local entity lParent, lChild;
+
+	lParent = Menu_ActiveItem;
+	if( !lParent ) {
+		_Menu_Structure_Debug( 1, "_SelectDown: Bad Menu_ActiveItem!\n" );
+		return false;
+	}
+
+	// lets find the first selectable item
+	for( lChild = _Menu_GetFirst( lParent._child ) ; lChild ; lChild = _Menu_GetNext( lChild ) )
+		if( Menu_IsSelectable( lChild ) ) {
+			Menu_ActiveItem = lChild;
+			_Menu_PrintRunFlag( lChild );
+			_Menu_Structure_Debug( 1, strcat( "_SelectDown: ", lChild.name, "\n" ) );
+			return true;
+		}
+
+	// lets find the first window that has a selectable item
+	for( lChild = _Menu_GetFirst( lParent._child ) ; lChild ; lChild = _Menu_GetNext( lChild ) )
+		if( !Menu_IsEmbedded( lChild ) ) {
+			Menu_ActiveItem = lChild;
+			_Menu_Structure_Debug( 2, strcat( "_SelectDown: Try child: ", Menu_ActiveItem.name, "\n" ) );
+			if( _Menu_SelectDown() )
+				return true;
+		}
+
+	Menu_ActiveItem = lParent;
+	return false;
+};
+
+void() _Menu_Reselect =
+{
+	Menu_ActiveItem = Menu_ActiveWindow;
+	_Menu_SelectDown();
+};
+
+void( bool pUser ) Menu_SelectNext =
+{
+	Raise_Select( Menu_ActiveItem, false, pUser );
+	_Menu_SelectNext();
+	Raise_Select( Menu_ActiveItem, true, pUser );
+};
+
+void( bool pUser ) Menu_SelectPrev =
+{
+	Raise_Select( Menu_ActiveItem, false, pUser );
+	_Menu_SelectPrev();
+	Raise_Select( Menu_ActiveItem, true, pUser );
+};
+
+bool( bool pUser ) Menu_SelectUp =
+{
+	local entity lOld;
+
+	lOld = Menu_ActiveItem;
+	if( _Menu_SelectUp() ) {
+		Raise_Select( lOld, false, pUser );
+		Raise_Select( Menu_ActiveItem, true, pUser );
+		return true;
+	}
+	return false;
+};
+
+bool( bool pUser ) Menu_SelectDown =
+{
+	local entity lOld;
+
+	lOld = Menu_ActiveItem;
+	if( _Menu_SelectDown() ) {
+		Raise_Select( lOld, false, pUser );
+		Raise_Select( Menu_ActiveItem, true, pUser );
+		return true;
+	}
+	return false;
+};
+
+void( entity pItem, bool pUser ) Menu_Select =
+{
+	Raise_Select( Menu_ActiveItem, false, pUser );
+	_Menu_Structure_Debug( 1, strcat( "Menu_Select: ", pItem.name, "\n" ) );
+	Menu_ActiveItem = pItem;
+	Raise_Select( Menu_ActiveItem, true, pUser );
+};
+
+void( entity pItem, bool pUser ) Menu_CorrectSelection =
+{
+	if( Menu_ActiveItem != pItem )
+		Menu_Select( pItem, pUser );
+};
+
+void( bool pUser ) Menu_Reselect =
+{
+	Raise_Select( Menu_ActiveItem, false, pUser );
+	_Menu_Reselect();
+	Raise_Select( Menu_ActiveItem, true, pUser );
+};
+
+void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow =
+{
+	Raise_Select( Menu_ActiveItem, false, pUser );
+
+	// only jump to windows
+	if( !pMenu._child )
+		error("Cant jump to ", pMenu.name, " !\n");
+
+	// add a history point
+	if( pMakeActive ) {
+		Menu_History_Push( pMenu, Util_NullFunction );
+		Menu_ActiveWindow = pMenu;
+	}
+
+	// now set the selected to the first selectable child
+	Menu_ActiveItem = pMenu;
+	if( !_Menu_SelectDown() )
+		error( "Couldn't jump to ", pMenu.name, " !\n" );
+
+	Raise_Select( Menu_ActiveItem, true, pUser );
+};
+
+#ifdef USEFUNCTIONS
+bool( entity pEntity, float pFlag ) Menu_HasFlag =
+{
+	if( pEntity.flag & pFlag )
+		return true;
+	return false;
+};
+
+bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag =
+{
+	if( pEntity._runFlag & pRunFlag )
+		return true;
+	return false;
+};
+#endif
+
+entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx =
+{
+	local entity lItem;
+	local string lFirstTwo;
+
+	lFirstTwo = substring( pName, 0, 2 );
+
+	// FIXME: perhaps add another function or do this in some other way
+	if( lFirstTwo == "::" )
+		lItem = findstring( null_entity,  name, substring( pName, 2, 100000 ) );
+	// support for direction tokens, init token ##
+	else if( lFirstTwo == "##" ) {
+		local string lToken;
+		local float lCount, lCounter;
+		lItem = pOrigin;
+		lCount = tokenize( substring( pName, 2, 100000 ) );
+		// we have the following tokens atfer the ##: up down next prev
+		for( lCounter = 0 ; lCounter < lCount && lItem ; ++lCounter ) {
+			lToken = argv( lCounter );
+			if( lToken == "up" )
+				lItem = lItem._parent;
+			else if( lToken == "down" )
+				lItem = lItem._child;
+			else if( lToken == "next" )
+				lItem = lItem._next;
+			else if( lToken == "prev" )
+				lItem = lItem._prev;
+			else
+				error( "Bad direction link(bad token): '", pName, "'!" );
+		}
+	} else  {
+		// we start from the current namespace and try to find the object
+		// by checking for it in all parent namespaces
+		lItem = null_entity;
+		while( !lItem && (pOrigin = pOrigin._parent) != null_entity )
+			lItem = findstring( null_entity, name, strcat( pOrigin.name, "::", pName ) );
+
+		if( !lItem )
+			lItem = findstring( null_entity, name, pName );
+	}
+
+	if( lItem == null_entity && pThrow )
+		error( "Couldn't find item '", pName, "'!" );
+
+	return lItem;
+};
+
+entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx =
+{
+	local entity lItem;
+
+	if( pOrigin )
+		lItem = findstring( null_entity, name, strcat( pOrigin.name, "::", pName ) );
+	else
+		lItem = findstring( null_entity, name, pName );
+
+	if( lItem == null_entity && pThrow )
+		error( "Couldn't find item '", pName, "'!" );
+
+	return lItem;
+};
+
+entity( string pName ) Menu_GetItem =
+{
+	return Menu_GetItemEx( self, pName, true );
+};
+
+entity( string pName ) Menu_GetChild =
+{
+	return Menu_GetChildEx( self, pName, true );
+};
+
+void( entity pWindow ) Menu_EmptyWindow =
+{
+	local entity lChild;
+
+	for( lChild = pWindow._child ; lChild ; lChild = lChild._next ) {
+		Menu_EmptyWindow( lChild );
+		Raise_Destroy( lChild );
+		remove( lChild );
+	}
+
+	pWindow._child = null_entity;
+};
+
+void( entity pEntity ) Menu_RemoveItem =
+{
+	local entity lParent;
+	// raise the destroy event
+	lParent = pEntity._parent;
+	Menu_EmptyWindow( pEntity );
+	Raise_Destroy( pEntity );
+	remove( pEntity );
+	if( lParent )
+		Menu_LinkChildren( lParent );
+};
+
+void( entity pItem ) _Menu_PrintRunFlag =
+{
+	if( sys_debug_runflag ) {
+		print( " ", pItem.name, " Runflags: " );
+		if( pItem._runFlag & RUNFLAG_TEMPLATE )
+			print( "TEMPLATE " );
+		if( pItem._runFlag & RUNFLAG_MOUSEINAREA )
+			print( "MOUSEINAREA " );
+		if( pItem._runFlag & RUNFLAG_HADMOUSE )
+			print( "HADMOUSE " );
+		if( pItem._runFlag & RUNFLAG_CHILDDRAWONLY )
+			print( "CHILDDRAWONLY " );
+		if( pItem._runFlag & RUNFLAG_CHILDDRAWUPDATEONLY )
+			print( "CHILDDRAWUPDATEONLY " );
+		if( pItem._runFlag & RUNFLAG_HIDDEN )
+			print( "HIDDEN " );
+		if( pItem._runFlag & RUNFLAG_CLIPPED )
+			print( "CLIPPED " );
+		if( pItem._runFlag & RUNFLAG_NOSELECT )
+			print( "NOSELECT " );
+		print( "\n" );
+	}
+};
+
+void( entity pItem ) Menu_SetRunFlag =
+{
+	local float lFlag;
+	local float lRunFlag;
+
+	lFlag = pItem.flag;
+
+	// RUNFLAG_TEMPLATE
+	if( lFlag & FLAG_TEMPLATE )
+		pItem._runFlag = pItem._runFlag | RUNFLAG_TEMPLATE;
+	// RUNFLAG_HADMOUSE,
+	lRunFlag = pItem._runFlag;
+	if(lRunFlag & RUNFLAG_MOUSEINAREA )
+		pItem._runFlag = (lRunFlag - RUNFLAG_MOUSEINAREA) | RUNFLAG_HADMOUSE;
+	// RUNFLAG_MOUSEINAREA,
+	// these will be handled in MENU_PROCESS_MOUSE
+	// RUNFLAG_CHILDDRAWONLY,
+	// RUNFLAG_CHILDDRAWONLY,
+	// these two are handled in InheritRunFlag
+	// RUNFLAG_CLIPPED,
+	// check if it is within the clipping area (ie. really visible)
+	// trick: since the position and size are clipped against the previous clipping area
+	// Menu_Clip_Size will be '0 0 0', if the areas dont overlap
+	if( Menu_Clip_Size == '0 0 0' && Menu_Clip_Position != '0 0 0' )
+		pItem._runFlag = pItem._runFlag | RUNFLAG_CLIPPED;
+	// RUNFLAG_HIDDEN
+	lRunFlag = pItem._runFlag;
+	if( ( lFlag & FLAG_HIDDEN  ) ||
+	    ( lRunFlag & RUNFLAG_TEMPLATE ) ||
+	    ( ( lFlag & FLAG_SERVERONLY ) && !( gamestatus & GAME_ISSERVER ) ) ||
+	    ( ( lFlag & FLAG_CONNECTEDONLY ) && !( gamestatus & GAME_CONNECTED ) ) ||
+	    ( ( lFlag & FLAG_DEVELOPERONLY ) && !( gamestatus & GAME_DEVELOPER ) ) )
+		pItem._runFlag = lRunFlag | RUNFLAG_HIDDEN;
+	// RUNFLAG_NOSELECT
+	lRunFlag = pItem._runFlag;
+	if( ( lFlag & FLAG_NOSELECT ) ||
+	    ( lFlag & FLAG_DRAWONLY ) ||
+	    ( lFlag & FLAG_DRAWUPDATEONLY ) ||
+	    ( lFlag & FLAG_EMBEDDED ) ||
+	    ( lRunFlag & RUNFLAG_TEMPLATE ) ||
+	    ( lRunFlag & RUNFLAG_HIDDEN ) ||
+	    ( lRunFlag & RUNFLAG_CHILDDRAWONLY ) ||
+	    ( lRunFlag & RUNFLAG_CHILDDRAWUPDATEONLY ) )
+		pItem._runFlag = lRunFlag | RUNFLAG_NOSELECT;
+
+	_Menu_PrintRunFlag( pItem );
+};
+
+void( entity pParent, entity pItem ) Menu_InheritRunFlag =
+{
+	// reset the runflag
+	pItem._runFlag = pItem._runFlag & (RUNFLAG_MOUSEINAREA | RUNFLAG_DELETEFRAME | RUNFLAG_DELETETOGGLE | RUNFLAG_SPAWNED);
+	// inherit template
+	if( pParent._runFlag & RUNFLAG_TEMPLATE )
+		pItem._runFlag = pItem._runFlag | RUNFLAG_TEMPLATE;
+	// inherit drawonly
+	if( ( pParent._runFlag & RUNFLAG_CHILDDRAWONLY ) ||
+	    ( pParent.flag & FLAG_CHILDDRAWONLY ) )
+		pItem._runFlag = pItem._runFlag | RUNFLAG_CHILDDRAWONLY;
+	// inherit drawupdateonly
+	if( ( pParent._runFlag & RUNFLAG_CHILDDRAWUPDATEONLY )  ||
+	    ( pParent.flag & FLAG_CHILDDRAWUPDATEONLY ) )
+		pItem._runFlag = pItem._runFlag | RUNFLAG_CHILDDRAWUPDATEONLY;
+	if( pParent._runFlag & RUNFLAG_HIDDEN )
+		pItem._runFlag = pItem._runFlag | RUNFLAG_HIDDEN;
+};
+
+void() Menu_UpdateRunFlags =
+{
+	local vector lPos, lSize, lOrg;
+
+	lPos = Menu_Clip_Position;
+	lSize = Menu_Clip_Size;
+	lOrg = Menu_Origin;
+
+	Menu_Process_Setup();
+
+	// set the runflag of the active window
+	Menu_ActiveWindow._runFlag = Menu_ActiveWindow._runFlag & RUNFLAG_MOUSEINAREA;
+
+	// update runflag by using the view tree
+	Menu_ProcessRunFlag( Menu_ActiveWindow );
+
+	Menu_Clip_Size = lSize;
+	Menu_Clip_Position = lPos;
+	Menu_Origin = lOrg;
+	Menu_Cursor_Position = Cursor_Position - Menu_Origin;
+};
+
+bool( entity pEntity ) Menu_HasEvents =
+{
+	if( pEntity._runFlag & RUNFLAG_CHILDDRAWONLY )
+		return false;
+	if( pEntity._runFlag & RUNFLAG_CHILDDRAWUPDATEONLY )
+		return false;
+	if( pEntity.flag & FLAG_DRAWONLY )
+		return false;
+	if( pEntity.flag & FLAG_DRAWUPDATEONLY )
+		return false;
+	//if( pEntity._runflag & RUNFLAG_HIDDEN )
+	//	return false;
+	return true;
+};
+
+#ifdef USEFUNCTIONS
+bool( entity pEntity ) Menu_IsVisible =
+{
+	return !(pEntity._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED));
+};
+
+bool( entity pEntity ) Menu_IsSelectable =
+{
+	return !(pEntity._runFlag & RUNFLAG_NOSELECT); // && !(pEntity._runFlag & RUNFLAG_TEMPLATE);
+};
+
+bool( entity pEntity ) Menu_IsTemplate =
+{
+	return pEntity._runFlag & RUNFLAG_TEMPLATE;
+};
+
+bool( entity pEntity ) Menu_IsEmbedded =
+{
+	return pEntity.flag & FLAG_EMBEDDED;
+};
+
+string( entity pItem ) Menu_GetName =
+{
+	return substring( pItem.name, strlen( pItem.parent ) + 2, 100000 );
+};
+#endif


Property changes on: trunk/basezym/menuqc/system/structure.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/system/structure.qh
===================================================================
--- trunk/basezym/menuqc/system/structure.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/system/structure.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,88 +1,88 @@
-// DP/Nex Menu
-// system/structure.qh
-
-entity Menu_ActiveWindow;
-
-// points to the lowest selected menu item (that has no child item selected)
-entity Menu_ActiveItem;
-
-///////////////
-// prototypes
-///
-
-// help if you need to iterate through embedded items, too
-entity( entity pItem ) _Menu_GetParent;
-entity( entity pItem ) _Menu_GetFirst;
-entity( entity pItem ) _Menu_GetLast;
-entity( entity pItem ) _Menu_GetNext;
-entity( entity pItem ) _Menu_GetPrev;
-bool( entity pItem, entity pParent ) _Menu_IsEmbeddedParentOf;
-
-// INFO: SelectUp/Down rules:
-// INFO: Down:
-// INFO: 	1. try to select a selectable item
-// INFO:	2. try to select a subwindow
-// INFO: Up:
-// INFO: 	1. try to select the parent
-// INFO:	2. select down the parent
-// INFO:	3. select up the parent
-
-// raw select
-void() _Menu_SelectNext;
-void() _Menu_SelectPrev;
-bool() _Menu_SelectUp;
-bool() _Menu_SelectDown;
-void() _Menu_Reselect;
-
-void( bool pUser ) Menu_SelectNext;
-void( bool pUser ) Menu_SelectPrev;
-bool( bool pUser ) Menu_SelectUp;
-bool( bool pUser ) Menu_SelectDown;
-void( bool pUser ) Menu_Reselect;
-
-// INFO:Should only be used inside of _select event functions and only (only!) when
-// 	absolutely necessary since this is more or less a hack
-void( entity pItem, bool pUser ) Menu_CorrectSelection;
-
-void( entity pItem, bool pUser ) Menu_Select;
-void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow;
-
-bool( entity pEntity ) Menu_HasEvents;
-
-#ifdef USEFUNCTIONS
-bool( entity pEntity ) Menu_IsVisible;
-bool( entity pEntity ) Menu_IsSelectable;
-bool( entity pEntity ) Menu_IsTemplate;
-bool( entity pEntity ) Menu_IsEmbedded;
-
-bool( entity pEntity, float pFlag ) Menu_HasFlag;
-bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag;
-#else
-#define Menu_IsVisible(pEntity) 	(!((pEntity)._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED)))
-#define Menu_IsSelectable(pEntity) 	(!((pEntity)._runFlag & RUNFLAG_NOSELECT))
-#define Menu_IsTemplate(pEntity)	((pEntity)._runFlag & RUNFLAG_TEMPLATE)
-#define Menu_IsEmbedded(pEntity)	((pEntity).flag & FLAG_EMBEDDED)
-
-#define Menu_HasFlag(pEntity,pFlag)		((pEntity).flag & (pFlag))
-#define Menu_HasRunFlag(pEntity,pRunFlag)	((pEntity)._runFlag & (pRunFlag))
-#endif
-
-void( entity pEntity ) Menu_SetRunFlag;
-void( entity pParent, entity pEntity ) Menu_InheritRunFlag;
-
-void() Menu_UpdateRunFlags;
-
-void( entity pWindow ) Menu_EmptyWindow;
-void( entity pEntity ) Menu_RemoveItem;
-
-entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx;
-entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx;
-
-entity( string pName ) Menu_GetItem; // pOrigin = self
-entity( string pName ) Menu_GetChild;
-
-#ifdef USEFUNCTIONS
-string( entity pItem ) Menu_GetName;	// gets the name without the parent namespace
-#else
-#define Menu_GetName(pItem)		(substring( (pItem) .name, strlen( (pItem) .parent ) + 2, 100000 ))
-#endif
+// DP/Nex Menu
+// system/structure.qh
+
+entity Menu_ActiveWindow;
+
+// points to the lowest selected menu item (that has no child item selected)
+entity Menu_ActiveItem;
+
+///////////////
+// prototypes
+///
+
+// help if you need to iterate through embedded items, too
+entity( entity pItem ) _Menu_GetParent;
+entity( entity pItem ) _Menu_GetFirst;
+entity( entity pItem ) _Menu_GetLast;
+entity( entity pItem ) _Menu_GetNext;
+entity( entity pItem ) _Menu_GetPrev;
+bool( entity pItem, entity pParent ) _Menu_IsEmbeddedParentOf;
+
+// INFO: SelectUp/Down rules:
+// INFO: Down:
+// INFO: 	1. try to select a selectable item
+// INFO:	2. try to select a subwindow
+// INFO: Up:
+// INFO: 	1. try to select the parent
+// INFO:	2. select down the parent
+// INFO:	3. select up the parent
+
+// raw select
+void() _Menu_SelectNext;
+void() _Menu_SelectPrev;
+bool() _Menu_SelectUp;
+bool() _Menu_SelectDown;
+void() _Menu_Reselect;
+
+void( bool pUser ) Menu_SelectNext;
+void( bool pUser ) Menu_SelectPrev;
+bool( bool pUser ) Menu_SelectUp;
+bool( bool pUser ) Menu_SelectDown;
+void( bool pUser ) Menu_Reselect;
+
+// INFO:Should only be used inside of _select event functions and only (only!) when
+// 	absolutely necessary since this is more or less a hack
+void( entity pItem, bool pUser ) Menu_CorrectSelection;
+
+void( entity pItem, bool pUser ) Menu_Select;
+void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow;
+
+bool( entity pEntity ) Menu_HasEvents;
+
+#ifdef USEFUNCTIONS
+bool( entity pEntity ) Menu_IsVisible;
+bool( entity pEntity ) Menu_IsSelectable;
+bool( entity pEntity ) Menu_IsTemplate;
+bool( entity pEntity ) Menu_IsEmbedded;
+
+bool( entity pEntity, float pFlag ) Menu_HasFlag;
+bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag;
+#else
+#define Menu_IsVisible(pEntity) 	(!((pEntity)._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED)))
+#define Menu_IsSelectable(pEntity) 	(!((pEntity)._runFlag & RUNFLAG_NOSELECT))
+#define Menu_IsTemplate(pEntity)	((pEntity)._runFlag & RUNFLAG_TEMPLATE)
+#define Menu_IsEmbedded(pEntity)	((pEntity).flag & FLAG_EMBEDDED)
+
+#define Menu_HasFlag(pEntity,pFlag)		((pEntity).flag & (pFlag))
+#define Menu_HasRunFlag(pEntity,pRunFlag)	((pEntity)._runFlag & (pRunFlag))
+#endif
+
+void( entity pEntity ) Menu_SetRunFlag;
+void( entity pParent, entity pEntity ) Menu_InheritRunFlag;
+
+void() Menu_UpdateRunFlags;
+
+void( entity pWindow ) Menu_EmptyWindow;
+void( entity pEntity ) Menu_RemoveItem;
+
+entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx;
+entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx;
+
+entity( string pName ) Menu_GetItem; // pOrigin = self
+entity( string pName ) Menu_GetChild;
+
+#ifdef USEFUNCTIONS
+string( entity pItem ) Menu_GetName;	// gets the name without the parent namespace
+#else
+#define Menu_GetName(pItem)		(substring( (pItem) .name, strlen( (pItem) .parent ) + 2, 100000 ))
+#endif


Property changes on: trunk/basezym/menuqc/system/structure.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/todo
===================================================================
--- trunk/basezym/menuqc/todo	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/todo	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,75 +1,75 @@
-// Todo list
-
--Clean up the Nex_ custom mess a bit
--Notify Spike that the "effectless statement" warning has a off-by-one bug
-*-Rename Item_Composition and make it not embedded by default
-*-Add support for a MOUSECLIP flag which will make the menu not pass any mouse events to the items under it
-*-Move the normal key function somewhere else perhaps??
-*--Write a test menu ^^
---Unroll as menu recursive functions as possible
-f-Remove this bloody RUNFLAG_SPAWNED again
-*-Only spawn an item once(even if its tried to spawn it multiple times)
--Think about the layout alignment and improve it
-*-Calculate the clip sizes and positions only once in PROCESS_RUNFLAG
---Rewrite *all* controls and the event handler to have the origin change before the current event function
--Add #enum and #enumflags to the parser
--Add effect support to all bloody items, use fixed names - if non existent ignore - change Menu_GetItem to a non-erroring version for this
--Add extended # commands like #add or #and, #complement, etc.
--Rewrite isframe to allow automation to create a good amount of new items
-*-Clip the Item_DataLink_Value value strings (so it contains e.g. 1.45 instead of 1.450000)
-*-Make all datalinks route all ITEM_DATA events
--Make FLOATING window clip its movement to the parent window's size so you cant hide it this way
--Fix orderPos in LinkChildren
-*-Add a slist subsystem to base!
--Do a big naming check to smooth things out
--Move the _menu_process stuff somewhere else
-s-Only call the mouse event when the position has been changed - since all changes happens then
--Perhaps make the RUNFLAGs be reset every frame for all items?
--Spend some time writing docs for the API - preferably at http://wiki.quakesrc.org :/
--Write a parser readme file explaining every tiny, little bit of it
-/-Add effects items/classes
-/-Rewrite isframe
-/-Think about when to support ctcalls and when not
-//-Add full support for the template idea or remove it
-?s-Make altstring and property conform with the new string param rules
-?s-Make the Data items support runtime changes, too
-?-Restructurize the controls
-f-Add some kind of overlay control
-f-Remove TokenType
-f-Remove support for cliparea '0 0 0'-'0 0 0' => whole plane
-s-Add a color and alpha stack to mgfx
-s-Add a current namespace global that builds the current namespace from the parent lists
-s-Add the abstract Item Item_Selectable
-s-Remove all ctcall, customizeable events
-
-*-Add ._runflags to system/item.qc - which will be used to determine visibility, etc. of items
-*-Add MENU_PROCESS_KEY to Menu_ProcessEvent
-*-Add MENU_PROCESS_RUNFLAG
-*-Add RUNFLAG_CLIPPED, so we can select items that arent visible (but arent hidden intentionally as well -> scrollwindows)
-*-Add a .userselect event  (Toddd)
-*-Add a multiline label item class
-*-Add a real #include to the parser
-*-Add a scmenu_debug_process_filter cvar (only displays information on a specific process run)
-*-Add a select event instead of userselect
-*-Add a system controlled destruction of items similar to the NG Menu's system
-*-Add direction tokens to Menu_GetItem
-*-Add layout classes
-*-Add more output to the parser (perhaps also a debug mode)
-*-Finish the goddamn design
-*-Finish the structure debug output
-*-Finish this darn #include support!!
-*-Fix the _FLAG_MOUSEINAREA bug: if the flag is set and the item is hidden somehow, it wont be unset
-*-Fix the init function calling the spawn function for templates, too
-*-Fix this strange clipping bug (items plop out of the void instead of shifting slowly in)
-*-Implement an embedded window perhaps
-*-Make FLAG_DRAWONLY and FLAG_DRAWUPDATEONLY only affect the parent item
-*-Merge as many of the debug functions (especially clientarea and parentarea)
-*-Move as many constants as possible to constants.menu
-*-Remove Item_Init - its poison to deriving classes
-*-Rename .refresh to .update and change all constants, too
-*-Rename Spawn_ to _Spawn perhaps??
-*-Rename link to target in the DataUser class
-*-Rewrite _menu_* to use the normal stack instead of an altstring stack
-*-Rewrite all controls
-*-Rewrite all gfx functions to reuse the params for conversions, etc.
-*-Update scmenu_debug_parser to also support tokens instead of pure floats
+// Todo list
+
+-Clean up the Nex_ custom mess a bit
+-Notify Spike that the "effectless statement" warning has a off-by-one bug
+*-Rename Item_Composition and make it not embedded by default
+*-Add support for a MOUSECLIP flag which will make the menu not pass any mouse events to the items under it
+*-Move the normal key function somewhere else perhaps??
+*--Write a test menu ^^
+--Unroll as menu recursive functions as possible
+f-Remove this bloody RUNFLAG_SPAWNED again
+*-Only spawn an item once(even if its tried to spawn it multiple times)
+-Think about the layout alignment and improve it
+*-Calculate the clip sizes and positions only once in PROCESS_RUNFLAG
+--Rewrite *all* controls and the event handler to have the origin change before the current event function
+-Add #enum and #enumflags to the parser
+-Add effect support to all bloody items, use fixed names - if non existent ignore - change Menu_GetItem to a non-erroring version for this
+-Add extended # commands like #add or #and, #complement, etc.
+-Rewrite isframe to allow automation to create a good amount of new items
+*-Clip the Item_DataLink_Value value strings (so it contains e.g. 1.45 instead of 1.450000)
+*-Make all datalinks route all ITEM_DATA events
+-Make FLOATING window clip its movement to the parent window's size so you cant hide it this way
+-Fix orderPos in LinkChildren
+*-Add a slist subsystem to base!
+-Do a big naming check to smooth things out
+-Move the _menu_process stuff somewhere else
+s-Only call the mouse event when the position has been changed - since all changes happens then
+-Perhaps make the RUNFLAGs be reset every frame for all items?
+-Spend some time writing docs for the API - preferably at http://wiki.quakesrc.org :/
+-Write a parser readme file explaining every tiny, little bit of it
+/-Add effects items/classes
+/-Rewrite isframe
+/-Think about when to support ctcalls and when not
+//-Add full support for the template idea or remove it
+?s-Make altstring and property conform with the new string param rules
+?s-Make the Data items support runtime changes, too
+?-Restructurize the controls
+f-Add some kind of overlay control
+f-Remove TokenType
+f-Remove support for cliparea '0 0 0'-'0 0 0' => whole plane
+s-Add a color and alpha stack to mgfx
+s-Add a current namespace global that builds the current namespace from the parent lists
+s-Add the abstract Item Item_Selectable
+s-Remove all ctcall, customizeable events
+
+*-Add ._runflags to system/item.qc - which will be used to determine visibility, etc. of items
+*-Add MENU_PROCESS_KEY to Menu_ProcessEvent
+*-Add MENU_PROCESS_RUNFLAG
+*-Add RUNFLAG_CLIPPED, so we can select items that arent visible (but arent hidden intentionally as well -> scrollwindows)
+*-Add a .userselect event  (Toddd)
+*-Add a multiline label item class
+*-Add a real #include to the parser
+*-Add a scmenu_debug_process_filter cvar (only displays information on a specific process run)
+*-Add a select event instead of userselect
+*-Add a system controlled destruction of items similar to the NG Menu's system
+*-Add direction tokens to Menu_GetItem
+*-Add layout classes
+*-Add more output to the parser (perhaps also a debug mode)
+*-Finish the goddamn design
+*-Finish the structure debug output
+*-Finish this darn #include support!!
+*-Fix the _FLAG_MOUSEINAREA bug: if the flag is set and the item is hidden somehow, it wont be unset
+*-Fix the init function calling the spawn function for templates, too
+*-Fix this strange clipping bug (items plop out of the void instead of shifting slowly in)
+*-Implement an embedded window perhaps
+*-Make FLAG_DRAWONLY and FLAG_DRAWUPDATEONLY only affect the parent item
+*-Merge as many of the debug functions (especially clientarea and parentarea)
+*-Move as many constants as possible to constants.menu
+*-Remove Item_Init - its poison to deriving classes
+*-Rename .refresh to .update and change all constants, too
+*-Rename Spawn_ to _Spawn perhaps??
+*-Rename link to target in the DataUser class
+*-Rewrite _menu_* to use the normal stack instead of an altstring stack
+*-Rewrite all controls
+*-Rewrite all gfx functions to reuse the params for conversions, etc.
+*-Update scmenu_debug_parser to also support tokens instead of pure floats


Property changes on: trunk/basezym/menuqc/todo
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/altstring.qc
===================================================================
--- trunk/basezym/menuqc/util/altstring.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/altstring.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,314 +1,314 @@
-// NG-Menu
-// util/altstring.qc
-
-#ifdef UTILALTSTRING
-/*
-===================
-Util_GetAltStringCount
-===================
-*/
-float( string pStr )	Util_GetAltStringCount =
-{
-	local float lLength;
-	local float lCount;
-	local float lPosition;
-	local string lLetter;
-
-	lPosition = lCount = 0;
-	for( lLength = strlen( pStr ) ; lPosition < lLength ; lPosition++ ) {
-		lLetter = substring( pStr, lPosition, 1 );
-		if( lLetter == "'" )
-			lCount++;
-		else if( lLetter == "\\" )
-			lPosition++;
-	}
-
-	return floor( lCount / 2 );
-};
-
-/*
-===================
-Util_GetAltStringItem
-===================
-*/
-string( string pStr, float pCount ) Util_GetAltStringItem =
-{
-	local float lCount;
-	local float lPosition;
-	local float lLength;
-	local string lLetter;
-	local string lOut;
-
-	pCount = pCount*2 + 1; // number of ' until item starts
-	lCount = lPosition = 0;
-	for( lLength = strlen( pStr ) ; lPosition < lLength && lCount < pCount ; lPosition++ ) {
-		lLetter = substring( pStr, lPosition, 1 );
-
-		if( lLetter == "'" )
-			lCount = lCount + 1;
-		else if( lLetter == "\\" )
-			lPosition++;
-	}
-
-	if( lCount != pCount )
-		return String_Create();
-
-	for( lOut = "" ; lPosition < lLength ; lPosition++ ) {
-		lLetter = substring( pStr, lPosition, 1 );
-
-		if( lLetter == "'" )
-			break;
-		else if( lLetter == "\\" ) {
-			lPosition++;
-			if( lPosition >= lLength )
-				break;
-			lLetter = substring( pStr, lPosition, 1 );
-		}
-
-		// no need for strzone since there are 16 buffers and we use 2 in the for
-		lOut = strcat( lOut, lLetter );
-	}
-
-	return String_Zone( lOut ); // return a strzoned string
-};
-#else
-float( string pStr )	Util_GetAltStringCount =
-{
-	return altstr_count( pStr );
-};
-string( string pStr, float pCount ) Util_GetAltStringItem =
-{
-	return String_Zone( altstr_get( pStr, pCount ) );
-};
-#endif
-
-
-/*
-===================
-Util_SetAltStringItem
-===================
-*/
-#ifdef UTILALTSTRING
-string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem =
-{
-	local float lCount;
-	local float lPosition;
-	local float lStart;
-	local float lLength;
-	local string lLetter;
-	local string lOut;
-
-	pSet = String_Zone( pSet );
-
-	pIndex = pIndex*2 + 1; // number of ' until item starts
-	lCount = lPosition = 0;
-	for( lLength = strlen( pAlt ) ; lPosition < lLength && lCount < pIndex ; lPosition = lPosition + 1 ) {
-		lLetter = substring( pAlt, lPosition, 1 );
-
-		if( lLetter == "'" )
-			lCount = lCount + 1;
-		else if( lLetter == "\\" )
-			lPosition = lPosition + 1;
-	}
-
-	if( lCount != pIndex )
-		return pAlt;
-
-	lStart = lPosition;
-	// find the end of it
-	for( ; lPosition < lLength ; lPosition++ ) {
-		lLetter = substring( pAlt, lPosition, 1 );
-
-		if( lLetter == "'" )
-			break;
-		else if( lLetter == "\\" )
-			lPosition = lPosition + 1;
-	}
-
-	lOut = String_Substring( pAlt, 0, lStart );
-	pSet = String_Normal( Util_AltStringPrepare( String_Normal( pSet ) ) );
-	lOut = strcat( lOut, pSet, substring( pAlt, lPosition, lLength - lPosition ) );
-
-	return String_Set( pAlt, lOut );
-};
-#else
-string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem =
-{
-	return String_Set( pAlt, altstr_set( pAlt, pIndex, pSet ) );
-};
-#endif
-
-/*
-===================
-Util_DelAltStringItem
-===================
-*/
-string( string pAlt, float pIndex ) Util_DelAltStringItem =
-{
-	local float lCount;
-	local float lPosition;
-	local float lStart;
-	local float lLength;
-	local string lLetter;
-	local string lOut;
-
-	pIndex = pIndex*2 + 1; // number of ' until item starts
-	lCount = lPosition = 0;
-	for( lLength = strlen( pAlt ) ; lPosition < lLength && lCount < pIndex ; lPosition = lPosition + 1 ) {
-		lLetter = substring( pAlt, lPosition, 1 );
-
-		if( lLetter == "'" )
-			lCount = lCount + 1;
-		else if( lLetter == "\\" )
-			lPosition = lPosition + 1;
-	}
-
-	if( lCount != pIndex )
-		return pAlt;
-
-	lStart = lPosition;
-	// find the end of it
-	for( ; lPosition < lLength ; lPosition++ ) {
-		lLetter = substring( pAlt, lPosition, 1 );
-
-		if( lLetter == "'" )
-			break;
-		else if( lLetter == "\\" )
-			lPosition = lPosition + 1;
-	}
-
-	if( lStart > 0 )
-		lOut = substring( pAlt, 0, lStart - 1 );
-	if( lPosition < lLength - 1)
-		lOut = strcat( lOut, substring( pAlt, lPosition + 1, lLength - lPosition - 1) );
-
-	return String_Set( pAlt, lOut );
-};
-
-/*
-===================
-Util_InsAltStringItem
-===================
-*/
-#ifdef UTILALTSTRING
-string( string pAlt, float pIndex, string pSet ) Util_InsAltStringItem =
-{
-	local float lCount;
-	local float lPosition;
-	local float lLength;
-	local string lLetter;
-	local string lOut;
-
-	pSet = String_Zone( pSet );
-
-	pIndex = pIndex*2 + 2; // number of ' until item starts
-	lCount = lPosition = 0;
-	for( lLength = strlen( pAlt ) ; lPosition < lLength && lCount < pIndex ; lPosition = lPosition + 1 ) {
-		lLetter = substring( pAlt, lPosition, 1 );
-
-		if( lLetter == "'" )
-			lCount = lCount + 1;
-		else if( lLetter == "\\" )
-			lPosition = lPosition + 1;
-	}
-
-	if( lCount != pIndex )
-		return pAlt;
-
-	lOut = String_Substring( pAlt, 0, lPosition );
-	pSet = String_Normal( Util_AltStringPrepare( String_Normal( pSet ) ) );
-	lOut = strcat( lOut, "'", pSet, "'", substring( pAlt, lPosition, lLength - lPosition ) );
-
-	return String_Set( pAlt, lOut );
-};
-#else
-string( string pAlt, float pIndex, string pSet ) Util_InsAltStringItem =
-{
-	return String_Set( pAlt, altstr_ins( pAlt, pIndex, pSet ) );
-};
-#endif
-
-/*
-===================
-Util_AltStringPrepare
-===================
-*/
-#ifdef UTILALTSTRING
-string( string pString ) Util_AltStringPrepare =
-{
-	local string lOut, lChar;
-	local float lPos, lLength;
-
-	pString = String_Zone( pString );
-
-	lOut = "";
-	lLength = strlen( pString );
-	for( lPos = 0; lPos < lLength  ; lPos = lPos + 1 ) {
-		lChar = substring( pString, lPos, 1 );
-		if( lChar == "'" )
-			lChar = "\\'";
-		lOut = strcat( lOut, lChar );
-	}
-
-	String_Free( pString );
-	return String_Zone( lOut );
-};
-#else
-string( string pString ) Util_AltStringPrepare =
-{
-	return String_Zone( altstr_prepare( pString ) );
-};
-#endif
-
-/*
-===================
-Util_AltStringPush
-===================
-*/
-string( string pAlt, string pPush ) Util_AltStringPush =
-{
-	return String_Set( pAlt, strcat( "'", altstr_prepare( pPush ), "'", pAlt ) );
-};
-
-/*
-===================
-Util_AltStringPushBack
-===================
-*/
-string( string pAlt, string pPush ) 	Util_AltStringPushBack =
-{
-	return String_Set( pAlt, strcat( pAlt, "'", altstr_prepare( pPush ), "'" ) );
-};
-
-/*
-===================
-Util_GetAltStringTop
-===================
-*/
-string( string pAlt ) Util_GetAltStringTop =
-{
-	return Util_GetAltStringItem( pAlt, 0 );
-};
-
-/*
-===================
-Util_AltStringPop
-===================
-*/
-string( string pAlt ) Util_AltStringPop =
-{
-	local float lPos, lCount, lLength;
-	local string lChar;
-
-	lCount = 0;
-	lLength = strlen( pAlt );
-	for( lPos = 0 ; lPos < lLength && lCount < 2 ; lPos++) {
-		lChar = substring( pAlt, lPos, 1 );
-		if( lChar == "\\" )
-			lPos++;
-		else if( lChar == "'" )
-			lCount++;
-	}
-
-	return String_Set( pAlt, substring( pAlt, lPos, lLength - lPos ) ); // no - 1 because this time we dont break after the '
-};
+// NG-Menu
+// util/altstring.qc
+
+#ifdef UTILALTSTRING
+/*
+===================
+Util_GetAltStringCount
+===================
+*/
+float( string pStr )	Util_GetAltStringCount =
+{
+	local float lLength;
+	local float lCount;
+	local float lPosition;
+	local string lLetter;
+
+	lPosition = lCount = 0;
+	for( lLength = strlen( pStr ) ; lPosition < lLength ; lPosition++ ) {
+		lLetter = substring( pStr, lPosition, 1 );
+		if( lLetter == "'" )
+			lCount++;
+		else if( lLetter == "\\" )
+			lPosition++;
+	}
+
+	return floor( lCount / 2 );
+};
+
+/*
+===================
+Util_GetAltStringItem
+===================
+*/
+string( string pStr, float pCount ) Util_GetAltStringItem =
+{
+	local float lCount;
+	local float lPosition;
+	local float lLength;
+	local string lLetter;
+	local string lOut;
+
+	pCount = pCount*2 + 1; // number of ' until item starts
+	lCount = lPosition = 0;
+	for( lLength = strlen( pStr ) ; lPosition < lLength && lCount < pCount ; lPosition++ ) {
+		lLetter = substring( pStr, lPosition, 1 );
+
+		if( lLetter == "'" )
+			lCount = lCount + 1;
+		else if( lLetter == "\\" )
+			lPosition++;
+	}
+
+	if( lCount != pCount )
+		return String_Create();
+
+	for( lOut = "" ; lPosition < lLength ; lPosition++ ) {
+		lLetter = substring( pStr, lPosition, 1 );
+
+		if( lLetter == "'" )
+			break;
+		else if( lLetter == "\\" ) {
+			lPosition++;
+			if( lPosition >= lLength )
+				break;
+			lLetter = substring( pStr, lPosition, 1 );
+		}
+
+		// no need for strzone since there are 16 buffers and we use 2 in the for
+		lOut = strcat( lOut, lLetter );
+	}
+
+	return String_Zone( lOut ); // return a strzoned string
+};
+#else
+float( string pStr )	Util_GetAltStringCount =
+{
+	return altstr_count( pStr );
+};
+string( string pStr, float pCount ) Util_GetAltStringItem =
+{
+	return String_Zone( altstr_get( pStr, pCount ) );
+};
+#endif
+
+
+/*
+===================
+Util_SetAltStringItem
+===================
+*/
+#ifdef UTILALTSTRING
+string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem =
+{
+	local float lCount;
+	local float lPosition;
+	local float lStart;
+	local float lLength;
+	local string lLetter;
+	local string lOut;
+
+	pSet = String_Zone( pSet );
+
+	pIndex = pIndex*2 + 1; // number of ' until item starts
+	lCount = lPosition = 0;
+	for( lLength = strlen( pAlt ) ; lPosition < lLength && lCount < pIndex ; lPosition = lPosition + 1 ) {
+		lLetter = substring( pAlt, lPosition, 1 );
+
+		if( lLetter == "'" )
+			lCount = lCount + 1;
+		else if( lLetter == "\\" )
+			lPosition = lPosition + 1;
+	}
+
+	if( lCount != pIndex )
+		return pAlt;
+
+	lStart = lPosition;
+	// find the end of it
+	for( ; lPosition < lLength ; lPosition++ ) {
+		lLetter = substring( pAlt, lPosition, 1 );
+
+		if( lLetter == "'" )
+			break;
+		else if( lLetter == "\\" )
+			lPosition = lPosition + 1;
+	}
+
+	lOut = String_Substring( pAlt, 0, lStart );
+	pSet = String_Normal( Util_AltStringPrepare( String_Normal( pSet ) ) );
+	lOut = strcat( lOut, pSet, substring( pAlt, lPosition, lLength - lPosition ) );
+
+	return String_Set( pAlt, lOut );
+};
+#else
+string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem =
+{
+	return String_Set( pAlt, altstr_set( pAlt, pIndex, pSet ) );
+};
+#endif
+
+/*
+===================
+Util_DelAltStringItem
+===================
+*/
+string( string pAlt, float pIndex ) Util_DelAltStringItem =
+{
+	local float lCount;
+	local float lPosition;
+	local float lStart;
+	local float lLength;
+	local string lLetter;
+	local string lOut;
+
+	pIndex = pIndex*2 + 1; // number of ' until item starts
+	lCount = lPosition = 0;
+	for( lLength = strlen( pAlt ) ; lPosition < lLength && lCount < pIndex ; lPosition = lPosition + 1 ) {
+		lLetter = substring( pAlt, lPosition, 1 );
+
+		if( lLetter == "'" )
+			lCount = lCount + 1;
+		else if( lLetter == "\\" )
+			lPosition = lPosition + 1;
+	}
+
+	if( lCount != pIndex )
+		return pAlt;
+
+	lStart = lPosition;
+	// find the end of it
+	for( ; lPosition < lLength ; lPosition++ ) {
+		lLetter = substring( pAlt, lPosition, 1 );
+
+		if( lLetter == "'" )
+			break;
+		else if( lLetter == "\\" )
+			lPosition = lPosition + 1;
+	}
+
+	if( lStart > 0 )
+		lOut = substring( pAlt, 0, lStart - 1 );
+	if( lPosition < lLength - 1)
+		lOut = strcat( lOut, substring( pAlt, lPosition + 1, lLength - lPosition - 1) );
+
+	return String_Set( pAlt, lOut );
+};
+
+/*
+===================
+Util_InsAltStringItem
+===================
+*/
+#ifdef UTILALTSTRING
+string( string pAlt, float pIndex, string pSet ) Util_InsAltStringItem =
+{
+	local float lCount;
+	local float lPosition;
+	local float lLength;
+	local string lLetter;
+	local string lOut;
+
+	pSet = String_Zone( pSet );
+
+	pIndex = pIndex*2 + 2; // number of ' until item starts
+	lCount = lPosition = 0;
+	for( lLength = strlen( pAlt ) ; lPosition < lLength && lCount < pIndex ; lPosition = lPosition + 1 ) {
+		lLetter = substring( pAlt, lPosition, 1 );
+
+		if( lLetter == "'" )
+			lCount = lCount + 1;
+		else if( lLetter == "\\" )
+			lPosition = lPosition + 1;
+	}
+
+	if( lCount != pIndex )
+		return pAlt;
+
+	lOut = String_Substring( pAlt, 0, lPosition );
+	pSet = String_Normal( Util_AltStringPrepare( String_Normal( pSet ) ) );
+	lOut = strcat( lOut, "'", pSet, "'", substring( pAlt, lPosition, lLength - lPosition ) );
+
+	return String_Set( pAlt, lOut );
+};
+#else
+string( string pAlt, float pIndex, string pSet ) Util_InsAltStringItem =
+{
+	return String_Set( pAlt, altstr_ins( pAlt, pIndex, pSet ) );
+};
+#endif
+
+/*
+===================
+Util_AltStringPrepare
+===================
+*/
+#ifdef UTILALTSTRING
+string( string pString ) Util_AltStringPrepare =
+{
+	local string lOut, lChar;
+	local float lPos, lLength;
+
+	pString = String_Zone( pString );
+
+	lOut = "";
+	lLength = strlen( pString );
+	for( lPos = 0; lPos < lLength  ; lPos = lPos + 1 ) {
+		lChar = substring( pString, lPos, 1 );
+		if( lChar == "'" )
+			lChar = "\\'";
+		lOut = strcat( lOut, lChar );
+	}
+
+	String_Free( pString );
+	return String_Zone( lOut );
+};
+#else
+string( string pString ) Util_AltStringPrepare =
+{
+	return String_Zone( altstr_prepare( pString ) );
+};
+#endif
+
+/*
+===================
+Util_AltStringPush
+===================
+*/
+string( string pAlt, string pPush ) Util_AltStringPush =
+{
+	return String_Set( pAlt, strcat( "'", altstr_prepare( pPush ), "'", pAlt ) );
+};
+
+/*
+===================
+Util_AltStringPushBack
+===================
+*/
+string( string pAlt, string pPush ) 	Util_AltStringPushBack =
+{
+	return String_Set( pAlt, strcat( pAlt, "'", altstr_prepare( pPush ), "'" ) );
+};
+
+/*
+===================
+Util_GetAltStringTop
+===================
+*/
+string( string pAlt ) Util_GetAltStringTop =
+{
+	return Util_GetAltStringItem( pAlt, 0 );
+};
+
+/*
+===================
+Util_AltStringPop
+===================
+*/
+string( string pAlt ) Util_AltStringPop =
+{
+	local float lPos, lCount, lLength;
+	local string lChar;
+
+	lCount = 0;
+	lLength = strlen( pAlt );
+	for( lPos = 0 ; lPos < lLength && lCount < 2 ; lPos++) {
+		lChar = substring( pAlt, lPos, 1 );
+		if( lChar == "\\" )
+			lPos++;
+		else if( lChar == "'" )
+			lCount++;
+	}
+
+	return String_Set( pAlt, substring( pAlt, lPos, lLength - lPos ) ); // no - 1 because this time we dont break after the '
+};


Property changes on: trunk/basezym/menuqc/util/altstring.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/altstring.qh
===================================================================
--- trunk/basezym/menuqc/util/altstring.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/altstring.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,17 +1,17 @@
-// NG Menu
-// util/altstring.qh
-
-// used to extract 'string' strings from a normal string
-// INFO: the index into the altstring is the same like in a C array
-float( string s)	     			 Util_GetAltStringCount;
-string( string s, float c )  			 Util_GetAltStringItem;
-string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem;
-string( string pAlt, float pIndex )		 Util_DelAltStringItem;
-// insert a new item after the indexed (to insert an item at the front use -1)
-string( string pAlt, float pIndex, string pSet ) Util_InsAltStringItem;
-
-string( string pString ) 		Util_AltStringPrepare;
-string( string pAlt, string pPush ) 	Util_AltStringPush; // strzone
-string( string pAlt, string pPush ) 	Util_AltStringPushBack; // strzone
-string( string pAlt ) 			Util_GetAltStringTop;
-string( string pAlt ) 			Util_AltStringPop;	// strzone
+// NG Menu
+// util/altstring.qh
+
+// used to extract 'string' strings from a normal string
+// INFO: the index into the altstring is the same like in a C array
+float( string s)	     			 Util_GetAltStringCount;
+string( string s, float c )  			 Util_GetAltStringItem;
+string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem;
+string( string pAlt, float pIndex )		 Util_DelAltStringItem;
+// insert a new item after the indexed (to insert an item at the front use -1)
+string( string pAlt, float pIndex, string pSet ) Util_InsAltStringItem;
+
+string( string pString ) 		Util_AltStringPrepare;
+string( string pAlt, string pPush ) 	Util_AltStringPush; // strzone
+string( string pAlt, string pPush ) 	Util_AltStringPushBack; // strzone
+string( string pAlt ) 			Util_GetAltStringTop;
+string( string pAlt ) 			Util_AltStringPop;	// strzone


Property changes on: trunk/basezym/menuqc/util/altstring.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/nfunction.qc
===================================================================
--- trunk/basezym/menuqc/util/nfunction.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/nfunction.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,9 +1,9 @@
-// NG Menu
-// util/nfunction.qc
-
-void() Util_NullFunction 	= {};
-bool() Util_TrueFunction 	= { return true; 	};
-bool() Util_FalseFunction	= { return false; 	};
-string() Util_StringFuntion	= { return "";		};
-vector() Util_VectorFunction	= { return '0 0 0';	};
-entity() Util_EntityFunction	= { return null_entity;	};
+// NG Menu
+// util/nfunction.qc
+
+void() Util_NullFunction 	= {};
+bool() Util_TrueFunction 	= { return true; 	};
+bool() Util_FalseFunction	= { return false; 	};
+string() Util_StringFuntion	= { return "";		};
+vector() Util_VectorFunction	= { return '0 0 0';	};
+entity() Util_EntityFunction	= { return null_entity;	};


Property changes on: trunk/basezym/menuqc/util/nfunction.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/property.qc
===================================================================
--- trunk/basezym/menuqc/util/property.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/property.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,275 +1,275 @@
-// NG Menu
-// util/property.qc
-
-#ifdef DEBUG
-	#define DebugValidate(str)	Property_Validate( str )
-#else
-	#define DebugValidate(str)  	true
-#endif
-
-/*
-===================
-Property_Create
-===================
-*/
-string() Property_Create =
-{
-	return String_Create();
-};
-
-string( string pString ) Property_Zone =
-{
-	return String_Zone( pString );
-};
-
-string( string pString ) Propery_Free =
-{
-	return String_Free( pString );
-};
-
-/*
-===================
-Property_Validate
-===================
-*/
-bool( string pString ) Property_Validate =
-{
-	local float lCount;
-
-	lCount = Util_GetAltStringCount( pString );
-	// check whether this is a valid property string
-	if( rint( lCount / 2 ) != lCount / 2 )
-#ifdef STRICTRULES
-		error( __FUNC__, "Invalid property string \"", pString , "\"!\n" );
-#else
-	{
-		dprint( __FUNC__, "Invalid property string \"", pString, "\"!\n" );
-		return false;
-	}
-#endif
-	return true;
-};
-
-/*
-===================
-Property_Exists
-===================
-*/
-bool( string pString, string pName ) Property_Exists =
-{
-	local float lCount;
-	local float lCounter;
-
-	if( !DebugValidate( pString ) )
-		return false;
-
-	lCount = Util_GetAltStringCount( pString );
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
-			return true;
-	return false;
-};
-
-/*
-===================
-Property_Register
-===================
-*/
-string( string pString, string pName, string pInitValue ) Property_Register =
-{
-	local float lCount;
-	local float lCounter;
-
-	if( !DebugValidate( pString ) )
-		return pString;
-
-	// If the entry already exists, do nothing (thus exit the function)
-	lCount = Util_GetAltStringCount( pString );
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
-			return pString;
-
-	// If it hasnt been added yet, create it
-	pString = Util_AltStringPush( pString, pInitValue );
-	pString = Util_AltStringPush( pString, pName );
-
-	return pString;
-}
-
-/*
-===================
-Property_Set
-===================
-*/
-string( string pString, string pName, string pValue ) Property_Set =
-{
-	local float lCount;
-	local float lCounter;
-
-	if( !DebugValidate( pString ) )
-		return pString;
-
-	// Found the entry and set it to the new value
-	lCount = Util_GetAltStringCount( pString );
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
-			return Util_SetAltStringItem( pString, lCounter + 1, pValue );
-
-	// If the property isnt found, it depends on DEBUG and STRICT
-#ifdef STRICTRULES
-	error( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#else
-	dprint( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#endif
-
-	return pString;
-};
-
-string( string pString, string pOldName, string pNewName ) Property_Rename =
-{
-	local float lCount;
-	local float lCounter;
-
-	if( !DebugValidate( pString ) )
-		return pString;
-
-	// Found the entry if it already exists
-	lCount = Util_GetAltStringCount( pString );
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pOldName )
-			return Util_SetAltStringItem( pString, lCounter, pNewName );
-
-	// If the property isnt found, it depends on DEBUG and STRICT
-#ifdef STRICTRULES
-	error( __FUNC__, "The property \"", pOldName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#else
-	dprint( __FUNC__, "The property \"", pOldName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#endif
-	return pString;
-};
-
-string( string pString, string pName )	Property_Delete =
-{
-	local float lCount;
-	local float lCounter;
-
-	if( !DebugValidate( pString ) )
-		return pString;
-
-	// Found the entry if it already exists
-	lCount = Util_GetAltStringCount( pString );
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName ) {
-			pString = Util_DelAltStringItem( pString, lCounter );
-			pString = Util_DelAltStringItem( pString, lCounter );
-			return pString;
-		}
-
-	// If the property isnt found, it depends on DEBUG and STRICT
-#ifdef STRICTRULES
-	error( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#else
-	dprint( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#endif
-	return pString;
-};
-
-/*
-===================
-Property_Set
-===================
-*/
-/*
-string( string pString, string pName, string pValue ) 	  Property_Set =
-{
-	local float lCount;
-	local float lCounter;
-	local float lProp;
-
-	// save pValue
-	pValue = strzone( pValue );
-
-	if( !DebugValidate( pString ) )
-		return pString;
-
-	// Found the entry if it already exists
-	lCount = Util_GetAltStringCount( pString );
-	lProp = -1;
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( Util_GetAltStringItem( pString, lCounter ) == pName ) {
-			lProp = lCounter;
-			break;
-		}
-
-	// If it hasnt been added yet, create it
-	if( lProp == -1 ) {
-		pString = Util_AltStringPush( pString, pValue );
-		pString = Util_AltStringPush( pString, pName );
-	} else
-		pString = Util_SetAltStringItem( pString, lProp + 1, pValue );
-
-	strunzone( pValue );
-	return pString;
-};
-*/
-
-/*
-===================
-Property_Get
-===================
-*/
-string( string pString, string pName )	Property_Get =
-{
-	local float lCount;
-	local float lCounter;
-
-	if( !DebugValidate( pString ) )
-		return pString;
-
-	// Found the entry and return its value
-	lCount = Util_GetAltStringCount( pString );
-	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
-		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
-			return Util_GetAltStringItem( pString, lCounter + 1);
-
-	// If the property isnt found, it depends on DEBUG and STRICT
-#ifdef STRICTRULES
-	error( "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#else
-	dprint( "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
-#endif
-
-	return String_Zone( "" );
-};
-
-/*
-===================
-Property_GetString
-===================
-*/
-string( string pString, string pName ) 	Property_GetString =
-{
-	return Property_Get( pString, pName );
-};
-
-/*
-===================
-Property_GetFloatProperty
-===================
-*/
-float( string pString, string pName ) 	Property_GetFloat =
-{
-	return stof( String_Normal( Property_Get( pString, pName ) ) );
-};
-
-vector( string pString, string pName ) 	Property_GetVector =
-{
-	return stov( String_Normal( Property_Get( pString, pName ) ) );
-};
-
-entity( string pString, string pName )  Property_GetEntity =
-{
-	return ftoe( Property_GetFloat( pString, pName ) );
-};
-
-#undef DebugValidate()
+// NG Menu
+// util/property.qc
+
+#ifdef DEBUG
+	#define DebugValidate(str)	Property_Validate( str )
+#else
+	#define DebugValidate(str)  	true
+#endif
+
+/*
+===================
+Property_Create
+===================
+*/
+string() Property_Create =
+{
+	return String_Create();
+};
+
+string( string pString ) Property_Zone =
+{
+	return String_Zone( pString );
+};
+
+string( string pString ) Propery_Free =
+{
+	return String_Free( pString );
+};
+
+/*
+===================
+Property_Validate
+===================
+*/
+bool( string pString ) Property_Validate =
+{
+	local float lCount;
+
+	lCount = Util_GetAltStringCount( pString );
+	// check whether this is a valid property string
+	if( rint( lCount / 2 ) != lCount / 2 )
+#ifdef STRICTRULES
+		error( __FUNC__, "Invalid property string \"", pString , "\"!\n" );
+#else
+	{
+		dprint( __FUNC__, "Invalid property string \"", pString, "\"!\n" );
+		return false;
+	}
+#endif
+	return true;
+};
+
+/*
+===================
+Property_Exists
+===================
+*/
+bool( string pString, string pName ) Property_Exists =
+{
+	local float lCount;
+	local float lCounter;
+
+	if( !DebugValidate( pString ) )
+		return false;
+
+	lCount = Util_GetAltStringCount( pString );
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
+			return true;
+	return false;
+};
+
+/*
+===================
+Property_Register
+===================
+*/
+string( string pString, string pName, string pInitValue ) Property_Register =
+{
+	local float lCount;
+	local float lCounter;
+
+	if( !DebugValidate( pString ) )
+		return pString;
+
+	// If the entry already exists, do nothing (thus exit the function)
+	lCount = Util_GetAltStringCount( pString );
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
+			return pString;
+
+	// If it hasnt been added yet, create it
+	pString = Util_AltStringPush( pString, pInitValue );
+	pString = Util_AltStringPush( pString, pName );
+
+	return pString;
+}
+
+/*
+===================
+Property_Set
+===================
+*/
+string( string pString, string pName, string pValue ) Property_Set =
+{
+	local float lCount;
+	local float lCounter;
+
+	if( !DebugValidate( pString ) )
+		return pString;
+
+	// Found the entry and set it to the new value
+	lCount = Util_GetAltStringCount( pString );
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
+			return Util_SetAltStringItem( pString, lCounter + 1, pValue );
+
+	// If the property isnt found, it depends on DEBUG and STRICT
+#ifdef STRICTRULES
+	error( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#else
+	dprint( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#endif
+
+	return pString;
+};
+
+string( string pString, string pOldName, string pNewName ) Property_Rename =
+{
+	local float lCount;
+	local float lCounter;
+
+	if( !DebugValidate( pString ) )
+		return pString;
+
+	// Found the entry if it already exists
+	lCount = Util_GetAltStringCount( pString );
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pOldName )
+			return Util_SetAltStringItem( pString, lCounter, pNewName );
+
+	// If the property isnt found, it depends on DEBUG and STRICT
+#ifdef STRICTRULES
+	error( __FUNC__, "The property \"", pOldName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#else
+	dprint( __FUNC__, "The property \"", pOldName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#endif
+	return pString;
+};
+
+string( string pString, string pName )	Property_Delete =
+{
+	local float lCount;
+	local float lCounter;
+
+	if( !DebugValidate( pString ) )
+		return pString;
+
+	// Found the entry if it already exists
+	lCount = Util_GetAltStringCount( pString );
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName ) {
+			pString = Util_DelAltStringItem( pString, lCounter );
+			pString = Util_DelAltStringItem( pString, lCounter );
+			return pString;
+		}
+
+	// If the property isnt found, it depends on DEBUG and STRICT
+#ifdef STRICTRULES
+	error( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#else
+	dprint( __FUNC__, "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#endif
+	return pString;
+};
+
+/*
+===================
+Property_Set
+===================
+*/
+/*
+string( string pString, string pName, string pValue ) 	  Property_Set =
+{
+	local float lCount;
+	local float lCounter;
+	local float lProp;
+
+	// save pValue
+	pValue = strzone( pValue );
+
+	if( !DebugValidate( pString ) )
+		return pString;
+
+	// Found the entry if it already exists
+	lCount = Util_GetAltStringCount( pString );
+	lProp = -1;
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( Util_GetAltStringItem( pString, lCounter ) == pName ) {
+			lProp = lCounter;
+			break;
+		}
+
+	// If it hasnt been added yet, create it
+	if( lProp == -1 ) {
+		pString = Util_AltStringPush( pString, pValue );
+		pString = Util_AltStringPush( pString, pName );
+	} else
+		pString = Util_SetAltStringItem( pString, lProp + 1, pValue );
+
+	strunzone( pValue );
+	return pString;
+};
+*/
+
+/*
+===================
+Property_Get
+===================
+*/
+string( string pString, string pName )	Property_Get =
+{
+	local float lCount;
+	local float lCounter;
+
+	if( !DebugValidate( pString ) )
+		return pString;
+
+	// Found the entry and return its value
+	lCount = Util_GetAltStringCount( pString );
+	for( lCounter = 0 ; lCounter < lCount ; lCounter += 2 )
+		if( String_Normal( Util_GetAltStringItem( pString, lCounter ) ) == pName )
+			return Util_GetAltStringItem( pString, lCounter + 1);
+
+	// If the property isnt found, it depends on DEBUG and STRICT
+#ifdef STRICTRULES
+	error( "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#else
+	dprint( "The property \"", pName, "\" hasn't been declared!\npString = \"", pString, "\"" );
+#endif
+
+	return String_Zone( "" );
+};
+
+/*
+===================
+Property_GetString
+===================
+*/
+string( string pString, string pName ) 	Property_GetString =
+{
+	return Property_Get( pString, pName );
+};
+
+/*
+===================
+Property_GetFloatProperty
+===================
+*/
+float( string pString, string pName ) 	Property_GetFloat =
+{
+	return stof( String_Normal( Property_Get( pString, pName ) ) );
+};
+
+vector( string pString, string pName ) 	Property_GetVector =
+{
+	return stov( String_Normal( Property_Get( pString, pName ) ) );
+};
+
+entity( string pString, string pName )  Property_GetEntity =
+{
+	return ftoe( Property_GetFloat( pString, pName ) );
+};
+
+#undef DebugValidate()


Property changes on: trunk/basezym/menuqc/util/property.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/property.qh
===================================================================
--- trunk/basezym/menuqc/util/property.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/property.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,27 +1,27 @@
-// NG Menu
-// util/property.qh
-
-// INFO: the property functions:
-// INFO: to save some entity fields I support property strings, which use altstrings to manage a dynamic
-// INFO: range of properties
-// INFO: "'nameOfProp''Value''nameOfProp''Value'.."
-// INFO: for speed reasons most of the Property_* functions assume that the property string has been validated
-// INFO: by Property_Validate
-// more or less generic functions
-string() 			Property_Create;
-string( string pString ) 	Property_Zone;
-string( string pString ) 	Propery_Free;
-bool( string pString ) 	Property_Validate;
-
-bool( string pString, string pName ) 				Property_Exists;
-string( string pString, string pName, string pInitValue ) 	Property_Register; // doesnt change anything if the property does already exist
-string( string pString, string pName, string pValue )	  	Property_Set; // errors if the property isnt found
-//string( string pString, string pName, string pValue ) 	  Property_Set; // if the property doesnt exist yet, it adds it
-string( string pString, string pOldName, string pNewName ) 	Property_Rename;
-string( string pString, string pName )			  	Property_Delete;
-
-string( string pString, string pName )	Property_Get;
-string( string pString, string pName ) 	Property_GetString;
-float( string pString, string pName ) 	Property_GetFloat;
-vector( string pString, string pName ) 	Property_GetVector;
-entity( string pString, string pName ) 	Property_GetEntity;
+// NG Menu
+// util/property.qh
+
+// INFO: the property functions:
+// INFO: to save some entity fields I support property strings, which use altstrings to manage a dynamic
+// INFO: range of properties
+// INFO: "'nameOfProp''Value''nameOfProp''Value'.."
+// INFO: for speed reasons most of the Property_* functions assume that the property string has been validated
+// INFO: by Property_Validate
+// more or less generic functions
+string() 			Property_Create;
+string( string pString ) 	Property_Zone;
+string( string pString ) 	Propery_Free;
+bool( string pString ) 	Property_Validate;
+
+bool( string pString, string pName ) 				Property_Exists;
+string( string pString, string pName, string pInitValue ) 	Property_Register; // doesnt change anything if the property does already exist
+string( string pString, string pName, string pValue )	  	Property_Set; // errors if the property isnt found
+//string( string pString, string pName, string pValue ) 	  Property_Set; // if the property doesnt exist yet, it adds it
+string( string pString, string pOldName, string pNewName ) 	Property_Rename;
+string( string pString, string pName )			  	Property_Delete;
+
+string( string pString, string pName )	Property_Get;
+string( string pString, string pName ) 	Property_GetString;
+float( string pString, string pName ) 	Property_GetFloat;
+vector( string pString, string pName ) 	Property_GetVector;
+entity( string pString, string pName ) 	Property_GetEntity;


Property changes on: trunk/basezym/menuqc/util/property.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/rect.qc
===================================================================
--- trunk/basezym/menuqc/util/rect.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/rect.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,189 +1,189 @@
-// NG Menu
-// util/rect.qc
-
-/*
-===================
-Util_InRect
-===================
-*/
-bool( vector pPoint, vector pPos, vector pSize ) Util_InRect =
-{
-	if( pPoint_x < pPos_x || pPoint_y < pPos_y || pPoint_x > pPos_x + pSize_x || pPoint_y > pPos_y + pSize_y )
-		return false;
-	return true;
-};
-
-bool( vector pPos1, vector pSize1, vector pPos2, vector pSize2 ) Util_RectInRect =
-{
-	local vector lFPos1, lFPos2;
-
-	lFPos1 = pPos1 + pSize1;
-	lFPos2 = pPos2 + pSize2;
-
-	if( pPos1_x <= lFPos2_x && pPos2_x <= lFPos1_x && pPos1_y <= lFPos2_y && pPos2_y <= lFPos1_y )
-		return false;
-	return true;
-};
-
-/*
-===================
-Util_ClipPoint
-===================
-*/
-/*
-vector( vector pPoint, vector pPos, vector pSize ) Util_ClipPoint =
-{
-	local vector lPoint;
-	lPoint_x = bound( pPos_x, pPoint_x, pPos_x + pSize_x );
-	lPoint_y = bound( pPos_y, pPoint_y, pPos_y + pSize_y );
-	lPoint_z = 0;
-
-	return lPoint;
-};
-*/
-
-vector( vector pPoint, vector pClipPos, vector pClipSize ) Util_GetClipDelta =
-{
-	local vector lPoint;
-	lPoint_x = bound( pClipPos_x, pPoint_x, pClipPos_x + pClipSize_x ) - pPoint_x;
-	lPoint_y = bound( pClipPos_y, pPoint_y, pClipPos_y + pClipSize_y ) - pPoint_y;
-	lPoint_z = 0;
-
-	return lPoint;
-};
-
-/*
-===================
-Util_ClipRect
-===================
-*/
-vector( vector pPos, vector pSize, vector pClipPos, vector pClipSize ) Util_ClipRect =
-{
-	vector lSize;
-
-	//DEBUG: Safe version
-	//lSize_x = bound( pClipPos_x, pPos_x + pSize_x, pClipPos_x + pClipSize_x ) - bound( pClipPos_x, pPos_x, pClipPos_x + pClipSize_x );
-	//lSize_y = bound( pClipPos_y, pPos_y + pSize_y, pClipPos_y + pClipSize_y ) - bound( pClipPos_y, pPos_y, pClipPos_y + pClipSize_y );
-	//lSize_x = min( pPos_x + pSize_x, pClipPos_x + pClipSize_x ) - max( pPos_x, pClipPos_x );
-	//lSize_y = min( pPos_y + pSize_y, pClipPos_y + pClipSize_y ) - max( pPos_y, pClipPos_y );
-	//INFO: we suppose pPos to be already clipped and pSize to have been adjusted(!!)
-	lSize_x = min( pPos_x + pSize_x, pClipPos_x + pClipSize_x ) - pPos_x;
-	lSize_y = min( pPos_y + pSize_y, pClipPos_y + pClipSize_y ) - pPos_y;
-	lSize_z = 0;
-
-	if( lSize_x <= 0 || lSize_y <= 0 )
-		return '0 0 0';
-
-	return lSize;
-};
-
-/*
-===================
-Util_ClipStack_Reset
-===================
-*/
-string( string pStack ) Util_ClipStack_Reset =
-{
-	String_Free( pStack );
-	return String_Create();
-};
-
-/*
-===================
-Util_ClipStack_Push
-===================
-*/
-string( string pStack, vector pPos, vector pSize ) Util_ClipStack_Push =
-{
-	local vector lOldPos, lOldSize, lDelta;
-
-	lOldPos = Util_ClipStack_GetPosition( pStack );
-	lOldSize = Util_ClipStack_GetSize( pStack );
-
-	if( pPos == '0 0 0' && pSize == '0 0 0' ) {
-		pPos  = lOldPos;
-		pSize = lOldSize;
-	} else if( lOldPos != '0 0 0' || lOldSize != '0 0 0'  ) {
-		lDelta = Util_GetClipDelta( pPos, lOldPos, lOldSize );
-		pPos = pPos + lDelta;
-		pSize = Util_ClipRect( pPos, pSize - lDelta, lOldPos, lOldSize );
-	}
-
-	pStack = Util_AltStringPush( pStack, vtos( pSize ) );
-	pStack = Util_AltStringPush( pStack, vtos( pPos ) );
-
-	return pStack;
-};
-
-/*
-===================
-Util_ClipStack_Pop
-===================
-*/
-string( string pStack ) Util_ClipStack_Pop =
-{
-	pStack = Util_AltStringPop( pStack );
-	pStack = Util_AltStringPop( pStack );
-	return pStack;
-};
-
-/*
-===================
-Util_ClipStack_GetPosition
-===================
-*/
-vector( string pStack ) Util_ClipStack_GetPosition =
-{
-	return stov( String_Normal( Util_GetAltStringItem( pStack, 0 ) ) );
-};
-
-/*
-===================
-Util_ClipStack_GetSize
-===================
-*/
-vector( string pStack ) Util_ClipStack_GetSize =
-{
-	return stov( String_Normal( Util_GetAltStringItem( pStack, 1 ) ) );
-};
-
-/*
-===================
-Util_OriginStack_Reset
-===================
-*/
-string( string pStack ) Util_OriginStack_Reset =
-{
-	String_Free( pStack );
-	return String_Create();
-};
-
-/*
-===================
-Util_OriginStack_Push
-===================
-*/
-string( string pStack, vector pOrigin ) Util_OriginStack_Push =
-{
-	return Util_AltStringPush( pStack, vtos( pOrigin ) );
-};
-
-/*
-===================
-Util_OriginStack_Pop
-===================
-*/
-string( string pStack ) Util_OriginStack_Pop =
-{
-	return Util_AltStringPop( pStack );
-};
-
-/*
-===================
-Util_OriginStack_Get
-===================
-*/
-vector( string pStack ) Util_OriginStack_Get =
-{
-	return stov( String_Normal( Util_GetAltStringTop( pStack ) ) );
-};
+// NG Menu
+// util/rect.qc
+
+/*
+===================
+Util_InRect
+===================
+*/
+bool( vector pPoint, vector pPos, vector pSize ) Util_InRect =
+{
+	if( pPoint_x < pPos_x || pPoint_y < pPos_y || pPoint_x > pPos_x + pSize_x || pPoint_y > pPos_y + pSize_y )
+		return false;
+	return true;
+};
+
+bool( vector pPos1, vector pSize1, vector pPos2, vector pSize2 ) Util_RectInRect =
+{
+	local vector lFPos1, lFPos2;
+
+	lFPos1 = pPos1 + pSize1;
+	lFPos2 = pPos2 + pSize2;
+
+	if( pPos1_x <= lFPos2_x && pPos2_x <= lFPos1_x && pPos1_y <= lFPos2_y && pPos2_y <= lFPos1_y )
+		return false;
+	return true;
+};
+
+/*
+===================
+Util_ClipPoint
+===================
+*/
+/*
+vector( vector pPoint, vector pPos, vector pSize ) Util_ClipPoint =
+{
+	local vector lPoint;
+	lPoint_x = bound( pPos_x, pPoint_x, pPos_x + pSize_x );
+	lPoint_y = bound( pPos_y, pPoint_y, pPos_y + pSize_y );
+	lPoint_z = 0;
+
+	return lPoint;
+};
+*/
+
+vector( vector pPoint, vector pClipPos, vector pClipSize ) Util_GetClipDelta =
+{
+	local vector lPoint;
+	lPoint_x = bound( pClipPos_x, pPoint_x, pClipPos_x + pClipSize_x ) - pPoint_x;
+	lPoint_y = bound( pClipPos_y, pPoint_y, pClipPos_y + pClipSize_y ) - pPoint_y;
+	lPoint_z = 0;
+
+	return lPoint;
+};
+
+/*
+===================
+Util_ClipRect
+===================
+*/
+vector( vector pPos, vector pSize, vector pClipPos, vector pClipSize ) Util_ClipRect =
+{
+	vector lSize;
+
+	//DEBUG: Safe version
+	//lSize_x = bound( pClipPos_x, pPos_x + pSize_x, pClipPos_x + pClipSize_x ) - bound( pClipPos_x, pPos_x, pClipPos_x + pClipSize_x );
+	//lSize_y = bound( pClipPos_y, pPos_y + pSize_y, pClipPos_y + pClipSize_y ) - bound( pClipPos_y, pPos_y, pClipPos_y + pClipSize_y );
+	//lSize_x = min( pPos_x + pSize_x, pClipPos_x + pClipSize_x ) - max( pPos_x, pClipPos_x );
+	//lSize_y = min( pPos_y + pSize_y, pClipPos_y + pClipSize_y ) - max( pPos_y, pClipPos_y );
+	//INFO: we suppose pPos to be already clipped and pSize to have been adjusted(!!)
+	lSize_x = min( pPos_x + pSize_x, pClipPos_x + pClipSize_x ) - pPos_x;
+	lSize_y = min( pPos_y + pSize_y, pClipPos_y + pClipSize_y ) - pPos_y;
+	lSize_z = 0;
+
+	if( lSize_x <= 0 || lSize_y <= 0 )
+		return '0 0 0';
+
+	return lSize;
+};
+
+/*
+===================
+Util_ClipStack_Reset
+===================
+*/
+string( string pStack ) Util_ClipStack_Reset =
+{
+	String_Free( pStack );
+	return String_Create();
+};
+
+/*
+===================
+Util_ClipStack_Push
+===================
+*/
+string( string pStack, vector pPos, vector pSize ) Util_ClipStack_Push =
+{
+	local vector lOldPos, lOldSize, lDelta;
+
+	lOldPos = Util_ClipStack_GetPosition( pStack );
+	lOldSize = Util_ClipStack_GetSize( pStack );
+
+	if( pPos == '0 0 0' && pSize == '0 0 0' ) {
+		pPos  = lOldPos;
+		pSize = lOldSize;
+	} else if( lOldPos != '0 0 0' || lOldSize != '0 0 0'  ) {
+		lDelta = Util_GetClipDelta( pPos, lOldPos, lOldSize );
+		pPos = pPos + lDelta;
+		pSize = Util_ClipRect( pPos, pSize - lDelta, lOldPos, lOldSize );
+	}
+
+	pStack = Util_AltStringPush( pStack, vtos( pSize ) );
+	pStack = Util_AltStringPush( pStack, vtos( pPos ) );
+
+	return pStack;
+};
+
+/*
+===================
+Util_ClipStack_Pop
+===================
+*/
+string( string pStack ) Util_ClipStack_Pop =
+{
+	pStack = Util_AltStringPop( pStack );
+	pStack = Util_AltStringPop( pStack );
+	return pStack;
+};
+
+/*
+===================
+Util_ClipStack_GetPosition
+===================
+*/
+vector( string pStack ) Util_ClipStack_GetPosition =
+{
+	return stov( String_Normal( Util_GetAltStringItem( pStack, 0 ) ) );
+};
+
+/*
+===================
+Util_ClipStack_GetSize
+===================
+*/
+vector( string pStack ) Util_ClipStack_GetSize =
+{
+	return stov( String_Normal( Util_GetAltStringItem( pStack, 1 ) ) );
+};
+
+/*
+===================
+Util_OriginStack_Reset
+===================
+*/
+string( string pStack ) Util_OriginStack_Reset =
+{
+	String_Free( pStack );
+	return String_Create();
+};
+
+/*
+===================
+Util_OriginStack_Push
+===================
+*/
+string( string pStack, vector pOrigin ) Util_OriginStack_Push =
+{
+	return Util_AltStringPush( pStack, vtos( pOrigin ) );
+};
+
+/*
+===================
+Util_OriginStack_Pop
+===================
+*/
+string( string pStack ) Util_OriginStack_Pop =
+{
+	return Util_AltStringPop( pStack );
+};
+
+/*
+===================
+Util_OriginStack_Get
+===================
+*/
+vector( string pStack ) Util_OriginStack_Get =
+{
+	return stov( String_Normal( Util_GetAltStringTop( pStack ) ) );
+};


Property changes on: trunk/basezym/menuqc/util/rect.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/rect.qh
===================================================================
--- trunk/basezym/menuqc/util/rect.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/rect.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,27 +1,27 @@
-// NG Menu
-// util/rect.qh
-
-// rect utils
-// a rect def. consists of 2 vectors (pos & size)
-bool( vector pPoint, vector pPos, vector pSize ) Util_InRect;
-vector( vector pPoint, vector pClipPos, vector pClipSize ) Util_GetClipDelta;
-//vector( vector pPoint, vector pPos, vector pSize ) Util_ClipPoint;
-// clips the rect [pPos, pSize] against [pClipPos, pClipSize] retuns the clipped size
-vector( vector pPos, vector pSize, vector pClipPos, vector pClipSize ) Util_ClipRect;
-
-bool( vector pPos1, vector pSize1, vector pPos2, vector pSize2 ) Util_RectInRect;
-
-// clip stack functions
-string( string pStack ) Util_ClipStack_Reset;
-string( string pStack, vector pPos, vector pSize ) Util_ClipStack_Push;
-string( string pStack ) Util_ClipStack_Pop;
-
-vector( string pStack ) Util_ClipStack_GetPosition;
-vector( string pStack ) Util_ClipStack_GetSize;
-
-// origin stack functions
-string( string pStack ) Util_OriginStack_Reset;
-string( string pStack, vector pOrigin ) Util_OriginStack_Push;
-string( string pStack ) Util_OriginStack_Pop;
-
-vector( string pStack ) Util_OriginStack_Get;
+// NG Menu
+// util/rect.qh
+
+// rect utils
+// a rect def. consists of 2 vectors (pos & size)
+bool( vector pPoint, vector pPos, vector pSize ) Util_InRect;
+vector( vector pPoint, vector pClipPos, vector pClipSize ) Util_GetClipDelta;
+//vector( vector pPoint, vector pPos, vector pSize ) Util_ClipPoint;
+// clips the rect [pPos, pSize] against [pClipPos, pClipSize] retuns the clipped size
+vector( vector pPos, vector pSize, vector pClipPos, vector pClipSize ) Util_ClipRect;
+
+bool( vector pPos1, vector pSize1, vector pPos2, vector pSize2 ) Util_RectInRect;
+
+// clip stack functions
+string( string pStack ) Util_ClipStack_Reset;
+string( string pStack, vector pPos, vector pSize ) Util_ClipStack_Push;
+string( string pStack ) Util_ClipStack_Pop;
+
+vector( string pStack ) Util_ClipStack_GetPosition;
+vector( string pStack ) Util_ClipStack_GetSize;
+
+// origin stack functions
+string( string pStack ) Util_OriginStack_Reset;
+string( string pStack, vector pOrigin ) Util_OriginStack_Push;
+string( string pStack ) Util_OriginStack_Pop;
+
+vector( string pStack ) Util_OriginStack_Get;


Property changes on: trunk/basezym/menuqc/util/rect.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/string.qc
===================================================================
--- trunk/basezym/menuqc/util/string.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/string.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,134 +1,134 @@
-// NG Menu
-// util/string.qc
-
-/*
-===================
-String_Create
-===================
-*/
-string() String_Create =
-{
-	//return strzone( strcat( "Static, ", self.name ) );
-	return strzone( "" );
-};
-
-/*
-===================
-String_Make
-===================
-*/
-string( string pStr ) String_Zone =
-{
-	return strzone( pStr );
-};
-
-/*
-===================
-String_Normal
-===================
-*/
-string( string pStr ) String_Normal =
-{
-	local string lResult;
-
-	lResult = strcat( pStr );
-	strunzone( pStr );
-
-	return lResult;
-};
-
-/*
-===================
-String_Free
-===================
-*/
-string( string pStr ) String_Free =
-{
-	strunzone( pStr );
-	return "";
-};
-
-/*
-===================
-String_EntityCreate
-===================
-*/
-void( entity pEntity, .string pField ) String_EntityCreate =
-{
-	//pEntity.pField = strzone( strcat( "Field, ", pEntity.name ) );
-	pEntity.pField = strzone( "" );
-};
-
-/*
-===================
-String_EntityZone
-===================
-*/
-void( entity pEntity, .string pField ) String_EntityZone =
-{
-	pEntity.pField = strzone( pEntity.pField );
-};
-
-/*
-===================
-String_EntitySet
-===================
-*/
-void( entity pEntity, .string pField, string pSet ) String_EntitySet =
-{
-#ifdef AVOIDSTRZONES
-	if( pEntity.pField == pSet ) {
-		return;
-	}
-#endif
-
-	strunzone( pEntity.pField );
-	pEntity.pField = strzone( pSet );
-};
-
-/*
-===================
-String_EntityFree
-===================
-*/
-void( entity pEntity, .string pField ) String_EntityFree =
-{
-	strunzone( pEntity.pField );
-	pEntity.pField = "";
-};
-
-/*
-===================
-String_Append
-===================
-*/
-string( string pStr, string pApp ) String_Append =
-{
-	return String_Set( pStr, strcat( pStr, pApp ) );
-};
-
-/*
-===================
-String_Substring
-===================
-*/
-string( string pStr, float pStart, float pLength ) String_Substring =
-{
-	return strzone( substring( pStr, pStart, pLength ) );
-};
-
-/*
-===================
-String_Set
-===================
-*/
-string( string pStr, string pSet ) String_Set =
-{
-#ifdef AVOIDSTRZONES
-	if( pStr == pSet ) {
-		return pStr;
-	}
-#endif
-	strunzone( pStr );
-	return strzone( pSet );
-};
+// NG Menu
+// util/string.qc
+
+/*
+===================
+String_Create
+===================
+*/
+string() String_Create =
+{
+	//return strzone( strcat( "Static, ", self.name ) );
+	return strzone( "" );
+};
+
+/*
+===================
+String_Make
+===================
+*/
+string( string pStr ) String_Zone =
+{
+	return strzone( pStr );
+};
+
+/*
+===================
+String_Normal
+===================
+*/
+string( string pStr ) String_Normal =
+{
+	local string lResult;
+
+	lResult = strcat( pStr );
+	strunzone( pStr );
+
+	return lResult;
+};
+
+/*
+===================
+String_Free
+===================
+*/
+string( string pStr ) String_Free =
+{
+	strunzone( pStr );
+	return "";
+};
+
+/*
+===================
+String_EntityCreate
+===================
+*/
+void( entity pEntity, .string pField ) String_EntityCreate =
+{
+	//pEntity.pField = strzone( strcat( "Field, ", pEntity.name ) );
+	pEntity.pField = strzone( "" );
+};
+
+/*
+===================
+String_EntityZone
+===================
+*/
+void( entity pEntity, .string pField ) String_EntityZone =
+{
+	pEntity.pField = strzone( pEntity.pField );
+};
+
+/*
+===================
+String_EntitySet
+===================
+*/
+void( entity pEntity, .string pField, string pSet ) String_EntitySet =
+{
+#ifdef AVOIDSTRZONES
+	if( pEntity.pField == pSet ) {
+		return;
+	}
+#endif
+
+	strunzone( pEntity.pField );
+	pEntity.pField = strzone( pSet );
+};
+
+/*
+===================
+String_EntityFree
+===================
+*/
+void( entity pEntity, .string pField ) String_EntityFree =
+{
+	strunzone( pEntity.pField );
+	pEntity.pField = "";
+};
+
+/*
+===================
+String_Append
+===================
+*/
+string( string pStr, string pApp ) String_Append =
+{
+	return String_Set( pStr, strcat( pStr, pApp ) );
+};
+
+/*
+===================
+String_Substring
+===================
+*/
+string( string pStr, float pStart, float pLength ) String_Substring =
+{
+	return strzone( substring( pStr, pStart, pLength ) );
+};
+
+/*
+===================
+String_Set
+===================
+*/
+string( string pStr, string pSet ) String_Set =
+{
+#ifdef AVOIDSTRZONES
+	if( pStr == pSet ) {
+		return pStr;
+	}
+#endif
+	strunzone( pStr );
+	return strzone( pSet );
+};


Property changes on: trunk/basezym/menuqc/util/string.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/string.qh
===================================================================
--- trunk/basezym/menuqc/util/string.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/string.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,23 +1,23 @@
-// NG Menu
-// util/string.h
-
-// INFO: A function strzones all strings that are passed as params and strzones its return param if it
-// INFO: is a string (except if the function knows that the string passed is a zone string).
-// INFO: Generally, if you only call builtin functions, you can use a temp string
-// INFO: You should know that the VM has 16 temp string buffers, so if you could count how many it takes
-// INFO: before you have to strzone something
-// TODO: convert altstring and property
-string() 				String_Create;
-string( string pStr ) 			String_Zone;	// use this for constants
-string( string pStr ) 			String_Normal;	// strunzones pStr and returns a temp buffer version of it
-string( string pStr, string pSet ) 	String_Set;	// copies pSet to a new strzoned string
-string( string pStr ) String_Free;
-
-string( string pStr, string pApp ) 			String_Append;
-string( string pStr, float pStart, float pLength ) 	String_Substring;
-
-void( entity pEntity, .string pField ) 			String_EntityCreate;
-void( entity pEntity, .string pField ) 			String_EntityZone;
-void( entity pEntity, .string pField, string pSet ) 	String_EntitySet;
-void( entity pEntity, .string pField ) 			String_EntityFree;
-
+// NG Menu
+// util/string.h
+
+// INFO: A function strzones all strings that are passed as params and strzones its return param if it
+// INFO: is a string (except if the function knows that the string passed is a zone string).
+// INFO: Generally, if you only call builtin functions, you can use a temp string
+// INFO: You should know that the VM has 16 temp string buffers, so if you could count how many it takes
+// INFO: before you have to strzone something
+// TODO: convert altstring and property
+string() 				String_Create;
+string( string pStr ) 			String_Zone;	// use this for constants
+string( string pStr ) 			String_Normal;	// strunzones pStr and returns a temp buffer version of it
+string( string pStr, string pSet ) 	String_Set;	// copies pSet to a new strzoned string
+string( string pStr ) String_Free;
+
+string( string pStr, string pApp ) 			String_Append;
+string( string pStr, float pStart, float pLength ) 	String_Substring;
+
+void( entity pEntity, .string pField ) 			String_EntityCreate;
+void( entity pEntity, .string pField ) 			String_EntityZone;
+void( entity pEntity, .string pField, string pSet ) 	String_EntitySet;
+void( entity pEntity, .string pField ) 			String_EntityFree;
+


Property changes on: trunk/basezym/menuqc/util/string.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/text.qc
===================================================================
--- trunk/basezym/menuqc/util/text.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/text.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,59 +1,59 @@
-// NG Menu
-// util/text.qc
-
-//INFO: I only care about \n and \0 and the col if in wrapped mode
-vector( string pText, vector pLast ) Util_GetEndOfLine =
-{
-	local string lChar;
-
-	pLast_x = pLast_y;
-	pLast_z = 0;
-	while( 1 ) {
-		lChar = substring( pText, pLast_x, 1 );
-
-		// newline -> the current char isnt valid
-		if( lChar == "\n" ) {
-			// the next valid is char can only be after the \n
-			pLast_y = pLast_x + 1;
-			--pLast_x;
-			return pLast;
-		} else if( lChar == "" ) {
-			pLast_y = --pLast_x;
-			return pLast;
-		} else {
-			++pLast_x;
-			++pLast_z;
-		}
-	}
-};
-
-vector( string pText, vector pLast, float pWrapLength ) Util_GetEndOfWrappedLine =
-{
-	local string lChar;
-
-	pLast_x = pLast_y;
-	pLast_z = 0;
-	while( 1 ) {
-		lChar = substring( pText, pLast_x, 1 );
-
-		// newline -> the current char isnt valid
-		if( lChar == "\n" ) {
-			--pLast_x;
-			// the next valid is char can only be after the \n
-			pLast_y = pLast_x + 2;
-			return pLast;
-		} else if( lChar == "" ) {
-			pLast_y = --pLast_x;
-			return pLast;
-		} else {
-			++pLast_x;
-			++pLast_z;
-			if( !--pWrapLength ) {
-				// the current char is one too much
-				pLast_y = pLast_x;
-				--pLast_x;
-				return pLast;
-			}
-		}
-	}
-};
+// NG Menu
+// util/text.qc
+
+//INFO: I only care about \n and \0 and the col if in wrapped mode
+vector( string pText, vector pLast ) Util_GetEndOfLine =
+{
+	local string lChar;
+
+	pLast_x = pLast_y;
+	pLast_z = 0;
+	while( 1 ) {
+		lChar = substring( pText, pLast_x, 1 );
+
+		// newline -> the current char isnt valid
+		if( lChar == "\n" ) {
+			// the next valid is char can only be after the \n
+			pLast_y = pLast_x + 1;
+			--pLast_x;
+			return pLast;
+		} else if( lChar == "" ) {
+			pLast_y = --pLast_x;
+			return pLast;
+		} else {
+			++pLast_x;
+			++pLast_z;
+		}
+	}
+};
+
+vector( string pText, vector pLast, float pWrapLength ) Util_GetEndOfWrappedLine =
+{
+	local string lChar;
+
+	pLast_x = pLast_y;
+	pLast_z = 0;
+	while( 1 ) {
+		lChar = substring( pText, pLast_x, 1 );
+
+		// newline -> the current char isnt valid
+		if( lChar == "\n" ) {
+			--pLast_x;
+			// the next valid is char can only be after the \n
+			pLast_y = pLast_x + 2;
+			return pLast;
+		} else if( lChar == "" ) {
+			pLast_y = --pLast_x;
+			return pLast;
+		} else {
+			++pLast_x;
+			++pLast_z;
+			if( !--pWrapLength ) {
+				// the current char is one too much
+				pLast_y = pLast_x;
+				--pLast_x;
+				return pLast;
+			}
+		}
+	}
+};


Property changes on: trunk/basezym/menuqc/util/text.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/text.qh
===================================================================
--- trunk/basezym/menuqc/util/text.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/text.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,7 +1,7 @@
-// NG Menu
-// util/text.qh
-
-// text tool functions
-// returns a pair <end, nextstart, length>
-vector( string pText, vector pLast ) Util_GetEndOfLine;
-vector( string pText, vector pLast, float pWrapLength ) Util_GetEndOfWrappedLine;
+// NG Menu
+// util/text.qh
+
+// text tool functions
+// returns a pair <end, nextstart, length>
+vector( string pText, vector pLast ) Util_GetEndOfLine;
+vector( string pText, vector pLast, float pWrapLength ) Util_GetEndOfWrappedLine;


Property changes on: trunk/basezym/menuqc/util/text.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/uid.qc
===================================================================
--- trunk/basezym/menuqc/util/uid.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/uid.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,33 +1,33 @@
-// NG Menu
-// util/uid.qc
-
-// name format: "M_UID_" number
-
-var float _m_uid_counter = 0;
-string() Util_CreateUID =
-{
-	local string lName;
-
-	lName = strzone( strcat( "M_UID_", ftos( _m_uid_counter ) ) );
-	_m_uid_counter = _m_uid_counter + 1;
-	return lName;
-};
-
-string( float pNum ) Util_GetUIDName =
-{
-	local string lName;
-
-	lName = strzone( strcat( "M_UID_", ftos( pNum ) ) );
-	return lName;
-};
-
-float( string pUid ) Util_GetUIDNum =
-{
-	local string lNum;
-
-	lNum = substring( pUid, 6, 100000 );
-	return stof( lNum );
-};
-
-
-
+// NG Menu
+// util/uid.qc
+
+// name format: "M_UID_" number
+
+var float _m_uid_counter = 0;
+string() Util_CreateUID =
+{
+	local string lName;
+
+	lName = strzone( strcat( "M_UID_", ftos( _m_uid_counter ) ) );
+	_m_uid_counter = _m_uid_counter + 1;
+	return lName;
+};
+
+string( float pNum ) Util_GetUIDName =
+{
+	local string lName;
+
+	lName = strzone( strcat( "M_UID_", ftos( pNum ) ) );
+	return lName;
+};
+
+float( string pUid ) Util_GetUIDNum =
+{
+	local string lNum;
+
+	lNum = substring( pUid, 6, 100000 );
+	return stof( lNum );
+};
+
+
+


Property changes on: trunk/basezym/menuqc/util/uid.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/uid.qh
===================================================================
--- trunk/basezym/menuqc/util/uid.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/uid.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,7 +1,7 @@
-// NG Menu
-// util/uid.qh
-
-// used to create unique names while the menu runs
-string()		Util_CreateUID;
-string( float pNum )	Util_GetUIDName;
-float( string pNum ) 	Util_GetUIDNum;
+// NG Menu
+// util/uid.qh
+
+// used to create unique names while the menu runs
+string()		Util_CreateUID;
+string( float pNum )	Util_GetUIDName;
+float( string pNum ) 	Util_GetUIDNum;


Property changes on: trunk/basezym/menuqc/util/uid.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/menuqc/util/util.qh
===================================================================
--- trunk/basezym/menuqc/util/util.qh	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/menuqc/util/util.qh	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,22 +1,22 @@
-// NG-Menu
-// util/util.qh
-
-// empty functions for every return type
-void() Util_NullFunction;
-bool() Util_TrueFunction;
-bool() Util_FalseFunction;
-string() Util_StringFuntion;
-vector() Util_VectorFunction;
-entity() Util_EntityFunction;
-
-// function typedefs
-
-typedef void() voidFunction;
-typedef float() floatFunction;
-typedef string() stringFunction;
-typedef vector() vectorFunction;
-
-
-
-
-
+// NG-Menu
+// util/util.qh
+
+// empty functions for every return type
+void() Util_NullFunction;
+bool() Util_TrueFunction;
+bool() Util_FalseFunction;
+string() Util_StringFuntion;
+vector() Util_VectorFunction;
+entity() Util_EntityFunction;
+
+// function typedefs
+
+typedef void() voidFunction;
+typedef float() floatFunction;
+typedef string() stringFunction;
+typedef vector() vectorFunction;
+
+
+
+
+


Property changes on: trunk/basezym/menuqc/util/util.qh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/actor.qc
===================================================================
--- trunk/basezym/progsqc/actor.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/actor.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,532 +1,532 @@
-
-// similar to .view_ofs but for weapon firing, note _x is multiplied by v_forward, _y is multiplied by v_right, and _z is multiplied by '0 0 1'
-.vector weapon_ofs;
-
-.entity actorpart_torso;
-.entity actorpart_head;
-.entity actorpart_weapon;
-.entity actorpart_viewweapon;
-.entity actorpart_hand;
-.entity actorpart_jetpacktrail;
-
-float ACTORTYPE_INVALID = 0;
-float ACTORTYPE_CLASS1 = 1;
-float ACTORTYPE_CLASS2 = 2;
-float ACTORTYPE_CLASS3 = 3;
-float ACTORTYPE_CLASS4 = 4;
-float ACTORTYPE_CLASS5 = 5;
-float ACTORTYPE_CLASS6 = 6;
-float ACTORTYPE_CLASS7 = 7;
-float ACTORTYPE_CLASS8 = 8;
-float ACTORTYPE_CLASS9 = 9;
-float ACTORTYPE_CLASS10 = 10;
-float ACTORTYPE_TOTAL = 11;
-
-.float actortype;
-
-// animations are stored as vectors of firstframe, endframe, framespersecond
-.vector actoranim_BOTH_DEATH1;
-.vector actoranim_BOTH_DEAD1;
-.vector actoranim_BOTH_DEATH2;
-.vector actoranim_BOTH_DEAD2;
-.vector actoranim_BOTH_DEATH3;
-.vector actoranim_BOTH_DEAD3;
-.vector actoranim_TORSO_GESTURE;
-.vector actoranim_TORSO_ATTACK;
-.vector actoranim_TORSO_ATTACK2;
-.vector actoranim_TORSO_DROP;
-.vector actoranim_TORSO_RAISE;
-.vector actoranim_TORSO_RELOAD;
-.vector actoranim_TORSO_STAND;
-.vector actoranim_TORSO_STAND2;
-.vector actoranim_LEGS_WALKCR;
-.vector actoranim_LEGS_WALK;
-.vector actoranim_LEGS_RUN;
-.vector actoranim_LEGS_BACK;
-.vector actoranim_LEGS_SWIM;
-.vector actoranim_LEGS_JUMP;
-.vector actoranim_LEGS_LAND;
-.vector actoranim_LEGS_JUMPB;
-.vector actoranim_LEGS_LANDB;
-.vector actoranim_LEGS_IDLE;
-.vector actoranim_LEGS_IDLECR;
-.vector actoranim_LEGS_TURN;
-
-void() actor_part_torso_think =
-{
-	if (self.owner.actorpart_torso != self)
-		remove(self);
-};
-
-void() actor_part_head_think =
-{
-	if (self.owner.actorpart_head != self)
-		remove(self);
-};
-
-void() actor_part_weapon_think =
-{
-	if (self.owner.actorpart_weapon != self)
-		remove(self);
-};
-
-void() actor_part_viewweapon_think =
-{
-	if (self.owner.actorpart_viewweapon != self)
-		remove(self);
-};
-
-void() actor_part_hand_think =
-{
-	if (self.owner.actorpart_hand != self)
-		remove(self);
-};
-
-.string modeldir;
-.string modelext;
-.entity playerclass;
-void() actor_setup =
-{
-	local vector v;
-	self.movetype = MOVETYPE_WALK;
-	self.solid = SOLID_SLIDEBOX;
-	self.takedamage = DAMAGE_AIM;
-	self.ammo_shells = 0;
-	self.ammo_nails = 0;
-	self.ammo_rockets = 0;
-	self.ammo_cells = 0;
-	self.deadflag = DEAD_NO;
-
-	if (self.actorpart_torso == world)
-	{
-		self.actorpart_torso = spawn();
-		self.actorpart_torso.owner = self;
-		self.actorpart_torso.classname = "actorpart_torso";
-		self.actorpart_torso.think = actor_part_torso_think;
-		self.actorpart_torso.nextthink = time;
-		self.actorpart_head = spawn();
-		self.actorpart_head.owner = self;
-		self.actorpart_head.classname = "actorpart_head";
-		self.actorpart_head.think = actor_part_head_think;
-		self.actorpart_head.nextthink = time;
-		self.actorpart_weapon = spawn();
-		self.actorpart_weapon.owner = self;
-		self.actorpart_weapon.classname = "actorpart_weapon";
-		self.actorpart_weapon.think = actor_part_weapon_think;
-		self.actorpart_weapon.nextthink = time;
-		self.actorpart_viewweapon = spawn();
-		self.actorpart_viewweapon.owner = self;
-		self.actorpart_viewweapon.classname = "actorpart_viewweapon";
-		self.actorpart_viewweapon.think = actor_part_viewweapon_think;
-		self.actorpart_viewweapon.nextthink = time;
-		self.actorpart_hand = spawn();
-		self.actorpart_hand.owner = self;
-		self.actorpart_hand.classname = "actorpart_hand";
-		self.actorpart_hand.think = actor_part_hand_think;
-		self.actorpart_hand.nextthink = time;
-		
-		self.actorpart_jetpacktrail = spawn();
-	}
-	setmodel(self.actorpart_jetpacktrail,"models/players/jetpack_tracer.mdl");
-	setattachment(self.actorpart_jetpacktrail, self.actorpart_torso, "tag_jetpack");
-	self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects | EF_NODRAW;
-	
-	setmodel(self, strcat(self.playerclass.modeldir, "/lower", self.playerclass.modelext));
-	setmodel(self.actorpart_torso, strcat(self.playerclass.modeldir, "/upper", self.playerclass.modelext));
-	setmodel(self.actorpart_head, strcat(self.playerclass.modeldir, "/head", self.playerclass.modelext));
-	//setmodel(self.actorpart_hand,"models/weapons/hand.md3");
-	self.actorpart_weapon.model = ""; // will be changed by weapon code as needed
-	self.actorpart_viewweapon.model = ""; // will be changed by weapon code as needed
-	
-	self.scale = self.scaleratio;
-	setsize(self, self.boxmin, self.boxmax);
-
-	// it's ok if this bone is missing as long as the torso model is made
-	// relative to the legs origin, but that prevents any chance of leaning
-	// over from the code side (still possible in animations)
-	setattachment(self.actorpart_torso, self, "tag_torso");
-	// it's sort of ok if this bone is missing
-	setattachment(self.actorpart_head, self.actorpart_torso, "tag_head");
-	// if weapon tag is missing, bip01 r hand is used instead (probably quite wrong)
-	setattachment(self.actorpart_weapon, self.actorpart_torso, "tag_weapon");
-	if (!self.actorpart_weapon.tag_index)
-		setattachment(self.actorpart_weapon, self.actorpart_torso, "bip01 r hand");
-	// model seen in first person while holding weapon
-	self.actorpart_viewweapon.viewmodelforclient = self;
-	self.actorpart_hand.viewmodelforclient = self;
-};
-
-void() actor_gib =
-{
- 	// not used
-	local float c;
-	c = 0;
-	while (c < 5)
-	{
-		c = c + 1;
-		decor_spawn(world, strcat(self.playerclass.modeldir, strcat("/gib", self.playerclass.modelext)), '-4 -4 -4', '4 4 4', 150);
-	}
-
-	// TODO: drop inventory
-
-	// these entities will remove themselves
-	self.actorpart_torso = world;
-	self.actorpart_head = world;
-	self.actorpart_weapon = world;
-	self.actorpart_viewweapon = world;
-
-	// FIXME: turn self into a gib using decor_spawn
-};
-
-void(string weapmodel, string viewweapmodel) actor_setweaponmodel =
-{
-	setmodel(self.actorpart_weapon, weapmodel);
-	setmodel(self.actorpart_viewweapon, viewweapmodel);
-};
-
-void(vector offset) actor_setviewmodeloffset =
-{
-	offset = self.weapon_ofs - self.view_ofs + offset; // default '10 4 -10'
-	offset_y = offset_y * -1;
-	setorigin(self.actorpart_viewweapon, offset);
-}
-
-
-void(float force) player_selectlegsanim;
-
-void() actor_update =
-{
-	//local string s1, s2, s3;
-	//s1 = ftos(self.button0);
-	//s2 = ftos(self.button3);
-	//s3 = ftos(self.weaponstate);
-	//centerprint(self, "actor_update ", s1, " ", s2, " ", s3);
-	
-	player_selectlegsanim(FALSE);
-	anim_update(self);
-	anim_update(self.actorpart_torso);
-	if (self.deadflag)
-	{
-		self.actorpart_viewweapon.model = "";
-		self.actorpart_torso.angles = '0 0 0';
-		self.actorpart_head.angles = '0 0 0';
-		self.angles_x = 0;
-		self.angles_z = 0;
-	}
-	else
-	{
-		anim_update(self.actorpart_viewweapon);
-		// update legs (self)
-		if (self.anim_type == ANIMTYPE_STAND || self.anim_type == ANIMTYPE_FALL)
-			self.angles = self.v_angle_y * '0 1 0';
-		else if (self.anim_type == ANIMTYPE_WALKBACK || self.anim_type == ANIMTYPE_RUNBACK)
-			self.angles = vectoyaw(self.velocity * -1) * '0 1 0';
-		else
-			self.angles = vectoyaw(self.velocity) * '0 1 0';
-		// update torso (relative to legs)
-		self.actorpart_torso.angles_x = bound(-30, self.v_angle_x * -1, 30);
-		self.actorpart_torso.angles_y = self.v_angle_y - self.angles_y;
-		// update head (relative to torso)
-		self.actorpart_head.angles_x = bound(-60, self.v_angle_x * -1, 60) - self.actorpart_torso.angles_x;
-	}
-};
-
-void(float newstate) weapon_state;
-void(float secondary) weapon_fire;
-
-.float weapon_oldbutton0;
-.float weapon_oldbutton3;
-.float weapon_oldbutton7;
-.float lowerguntime;
-void(float animdone) viewweapon_animframefunc =
-{
-	local entity oldself;
-	local float f1;
-	local float f2;
-	oldself = self;
-	self = self.owner;
-	
-	Inventory_GetItemInfo(self, self.weaponitem);
-	if (animdone)
-	{
-		if (self.weaponstate == WS_LOWER)
-		{
-			if (time >= self.lowerguntime)
-			{				
-				actor_setviewmodeloffset(iteminfo_viewmodeloffset);
-				self.viewmodelchange_x = 0;
-				self.viewmodelchange_z = -20;
-				self.weaponitem = self.switchweaponitem;
-				Inventory_GetItemInfo(self, self.weaponitem);
-				actor_setweaponmodel(iteminfo_model, iteminfo_weapon_viewmodel);
-
-				weapon_state(WS_RAISE);
-			}
-		}
-		else if (self.weaponstate == WS_RELOAD)
-		{
-			if (iteminfo_ammotype >= 0)
-			{
-				f1 = min(iteminfo_ammomax - iteminfo_ammo, iteminfo_ammoinventory);
-				if (f1 > 0)
-				{
-					Inventory_ModifyItem(self, self.weaponitem, 0, f1);
-					Inventory_ModifyItem(self, iteminfo_ammotype, 0 - f1, 0);
-				}
-			}
-			weapon_state(WS_IDLE);
-		}
-		else if (self.weaponstate == WS_TURNON)
-		{
-			// NOTE: should match Item_Spawn code
-			weapon_state(WS_IDLE);
-		}
-		else if (self.weaponstate == WS_TURNOFF)
-		{
-			weapon_state(WS_IDLE);
-		}
-		else
-			weapon_state(WS_IDLE);
-	}
-	if (self.weaponstate == WS_IDLE)
-	{
-		if (!iteminfo_weapon_canraise)
-		{
-			f1 = Inventory_GetBestWeapon(self);
-			if (f1 >= 0)
-				self.switchweaponitem = f1;
-		}
-		if (self.switchweaponitem != self.weaponitem)
-			weapon_state(WS_LOWER);
-		else if (time < self.lowerguntime)
-		{
-			//bprint("lowering\n");
-			weapon_state(WS_LOWER);
-		}
-		else if ((iteminfo_ammo <= iteminfo_ammo1minimumtofire) && (cvar("g_autoreload")) && (iteminfo_ammoinventory >= 1))
-			weapon_state(WS_RELOAD);
-		else if (self.button4 && ((iteminfo_ammo < iteminfo_ammomax && iteminfo_ammoinventory >= 1)))
-			weapon_state(WS_RELOAD);
-		else if (self.button0 && iteminfo_weapon_canfire1 && (!self.weapon_oldbutton0 || !(iteminfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
-			weapon_state(WS_FIRE1);
-		else if (self.button3 && iteminfo_weapon_canfire2 && (!self.weapon_oldbutton3 || !(iteminfo_ammo2fireflags & FIREFLAG_SEMIAUTOMATIC)))
-			weapon_state(WS_FIRE2);
-		else if (self.button7)
-		{
-		 	Inventory_GetItemInfo(self, self.itemselected);
-			if ((!iteminfo_ammo1noprojectile) && iteminfo_weapon_canfire1 && iteminfo_weapon_canfire2 && (!self.weapon_oldbutton7 || !(iteminfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
-			{
-			   	weapon_state(WS_FIRE3);
-			}
-			else if (iteminfo_ammo1fireflags & FIREFLAG_JETPACK)
-			{
-			    Inventory_ModifyItem(self, self.itemselected, 0 - iteminfo_ammo1minimumtofire, 0);
-				self.jetpack_fuel = iteminfo_quantity;
-			   	if (!self.jetpackactive)
-				{
-			   	   sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jetpack.wav"), 1, ATTN_NORM);
-				   self.jetpackactive = TRUE;
-				}
-			}
-		}
-	}
-	self.weapon_oldbutton0 = self.button0;
-	self.weapon_oldbutton3 = self.button3;
-	self.weapon_oldbutton7 = self.button7;
-	self = oldself;
-};
-
-void(float animdone) torso_animframefunc =
-{
-	local entity oldself;
-	if (!animdone)
-		return;
-	oldself = self;
-	self = self.owner;
-	Inventory_GetItemInfo(self, self.weaponitem);
-	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
-	self = oldself;
-};
-
-void(float newstate) weapon_state =
-{
-	self.weaponstate = newstate;
-	Inventory_GetItemInfo(self, self.weaponitem);
-		   
-	if (newstate == WS_IDLE)
-	{
-		if (self.weaponsound_cycle >= 5) // templeofnoise
-		{
-			self.weaponsound_cycle = 0; // templeofnoise
-		}
-		else if ((self.weaponsound_cycle != 0) && (!self.button0)) // templeofnoise: stop minigun whirling sound (actually only for primary attack)
-		{
-			sound(self, CHAN_WEAPON2, "weapons/minigun_whirlend.wav", 0.5, ATTN_NORM); // templeofnoise
-			self.weaponsound_cycle = 0; // templeofnoise
-		}
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_idle, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-	else if (newstate == WS_FIRE1)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_fire1, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
-		self.viewmodelchange = self.viewmodelchange + iteminfo_ammo1viewmodelpush;
-		self.viewmodelchange_y = self.viewmodelchange_y + crandom();
-		//bprint("weapon_state ");bprint(ftos(newstate));bprint(":");bprint(vtos(iteminfo_weapon_viewmodelanim_fire1));bprint(" ");bprint(ftos(self.actorpart_torso.anim_frametime));bprint("\n");
-		weapon_fire(FALSE);
-	}
-	else if (newstate == WS_FIRE2)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_fire2, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
-		self.viewmodelchange = self.viewmodelchange + iteminfo_ammo2viewmodelpush;
-		weapon_fire(TRUE);
-	}
-	else if (newstate == WS_FIRE3)
-	{
-	 	Inventory_GetItemInfo(self, self.itemselected);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
-		weapon_fire(FALSE);
-	}
-	else if (newstate == WS_RELOAD)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_reload, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_RELOAD, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-	else if (newstate == WS_LOWER)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_lower, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_DROP, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-	else if (newstate == WS_RAISE)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_raise, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_RAISE, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-	else if (newstate == WS_TURNON)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_turnon, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_IDLE, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-	else if (newstate == WS_TURNOFF)
-	{
-		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_turnoff, ANIMTYPE_IDLE, viewweapon_animframefunc);
-		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_IDLE, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-};
-
-void(float intensity) weapon_recoil =
-{
-	self.punchangle_x = (random() * 2 - 1) * intensity;
-	self.punchangle_y = (random() * 2 - 1) * intensity;
-};
-
-void(float secondary) weapon_fire =
-{
-	local vector shotorg;
-	local vector shotdir;
-	local vector shotdamage;
-	local float shotdamagetype;
-	local float shotlifetime;
-	local float shotprojflags;
-	local float shotfireflags;
-	local float shotexplflags;
-	local float numberof;
-	local float recoil;
-	local float mintofire;
-	local string shotmodel;
-	local string shotfiresound;
-	local string shotexplodesound;
-	local string shotbouncesound;
-	local vector muzzle1tagorigin, muzzle2tagorigin, muzzle3tagorigin;
-	local string tracermodel;
-	local float tracer;
-	local float modelscale;
-	local float projhealth;
-	local float projmass;
-	local vector projcolormod;
-	muzzle1tagorigin = muzzle2tagorigin = muzzle3tagorigin = self.origin + self.weapon_ofs_x * v_forward + self.weapon_ofs_y * v_right + self.weapon_ofs_z * '0 0 1';
-	makevectors(self.v_angle);
-	if (secondary)
-	{
-		shotorg = muzzle2tagorigin; // overridden on hagar
-		shotdir = iteminfo_ammo2speeds;
-		shotdamage = iteminfo_ammo2damage;
-		shotdamagetype = iteminfo_ammo2damagetype;
-		shotlifetime = iteminfo_ammo2lifetime;
-		shotprojflags = iteminfo_ammo2projflags;
-		shotfireflags = iteminfo_ammo2fireflags;
-		shotexplflags = iteminfo_ammo2explflags;
-		shotmodel = iteminfo_ammo2model;
-		shotfiresound = iteminfo_ammo2firesound;
-		shotexplodesound = iteminfo_ammo2explodesound;
-		shotbouncesound = iteminfo_ammo2bouncesound;
-		numberof = iteminfo_ammo2numberof;
-		recoil = iteminfo_ammo2recoil;
-		mintofire = iteminfo_ammo2minimumtofire;
-		tracer = iteminfo_ammo2tracer;
-		tracermodel = iteminfo_ammo2tracermodel;
-		modelscale = iteminfo_ammo2modelscale;
-		projhealth = iteminfo_ammo2health;
-		projmass = iteminfo_ammo2mass;
-		projcolormod = iteminfo_ammo2colormod;
-	}
-	else
-	{
-		shotorg = muzzle1tagorigin;
-		shotdir = iteminfo_ammo1speeds;
-		shotdamage = iteminfo_ammo1damage;
-		shotdamagetype = iteminfo_ammo1damagetype;
-		shotlifetime = iteminfo_ammo1lifetime;
-		shotprojflags = iteminfo_ammo1projflags;
-		shotfireflags = iteminfo_ammo1fireflags;
-		shotexplflags = iteminfo_ammo1explflags;
-		shotmodel = iteminfo_ammo1model;
-		shotfiresound = iteminfo_ammo1firesound;
-		shotexplodesound = iteminfo_ammo1explodesound;
-		shotbouncesound = iteminfo_ammo1bouncesound;
-		numberof = iteminfo_ammo1numberof;
-		recoil = iteminfo_ammo1recoil;
-		mintofire = iteminfo_ammo1minimumtofire;
-		tracer = iteminfo_ammo1tracer;
-		tracermodel = iteminfo_ammo1tracermodel;
-		projhealth = iteminfo_ammo1health;
-		projmass = iteminfo_ammo1mass;
-		projcolormod = iteminfo_ammo1colormod;
-	}
-
-	if (self.unlimitedinventory == 0)
-	if (iteminfo_ammotype < ITEMTYPE_AMMO1) // then it's an item
-	{
-	   Inventory_ModifyItem(self, self.itemselected, 0 - mintofire, 0);
-	}
-	else
-	{
-	   Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire);
-	}
-	   
-	weapon_recoil(recoil);
-	
-	while (numberof != 0)
-	{
-		  weapon_fireprojectile(shotmodel, shotorg, shotdir, shotdamage, shotdamagetype, shotlifetime, shotprojflags, shotfireflags, shotexplflags, shotfiresound, shotexplodesound, shotbouncesound, tracer, tracermodel, modelscale, projhealth, projmass, projcolormod);	
-		  numberof = numberof - 1;
-	}
-};
-
-
-// only called at spawn
-void(entity character, float weaponitemtype) weapon_setup =
-{
-	Inventory_GetItemInfo(character, weaponitemtype);
-	self.weaponitem = weaponitemtype;
-	self.switchweaponitem = self.weaponitem;
-	
-	actor_setweaponmodel(iteminfo_model, iteminfo_weapon_viewmodel);
-	actor_setviewmodeloffset(iteminfo_viewmodeloffset);
-	self.viewmodelchange = iteminfo_viewmodeloffset;
-	
-	weapon_state(WS_IDLE);
-};
-
+
+// similar to .view_ofs but for weapon firing, note _x is multiplied by v_forward, _y is multiplied by v_right, and _z is multiplied by '0 0 1'
+.vector weapon_ofs;
+
+.entity actorpart_torso;
+.entity actorpart_head;
+.entity actorpart_weapon;
+.entity actorpart_viewweapon;
+.entity actorpart_hand;
+.entity actorpart_jetpacktrail;
+
+float ACTORTYPE_INVALID = 0;
+float ACTORTYPE_CLASS1 = 1;
+float ACTORTYPE_CLASS2 = 2;
+float ACTORTYPE_CLASS3 = 3;
+float ACTORTYPE_CLASS4 = 4;
+float ACTORTYPE_CLASS5 = 5;
+float ACTORTYPE_CLASS6 = 6;
+float ACTORTYPE_CLASS7 = 7;
+float ACTORTYPE_CLASS8 = 8;
+float ACTORTYPE_CLASS9 = 9;
+float ACTORTYPE_CLASS10 = 10;
+float ACTORTYPE_TOTAL = 11;
+
+.float actortype;
+
+// animations are stored as vectors of firstframe, endframe, framespersecond
+.vector actoranim_BOTH_DEATH1;
+.vector actoranim_BOTH_DEAD1;
+.vector actoranim_BOTH_DEATH2;
+.vector actoranim_BOTH_DEAD2;
+.vector actoranim_BOTH_DEATH3;
+.vector actoranim_BOTH_DEAD3;
+.vector actoranim_TORSO_GESTURE;
+.vector actoranim_TORSO_ATTACK;
+.vector actoranim_TORSO_ATTACK2;
+.vector actoranim_TORSO_DROP;
+.vector actoranim_TORSO_RAISE;
+.vector actoranim_TORSO_RELOAD;
+.vector actoranim_TORSO_STAND;
+.vector actoranim_TORSO_STAND2;
+.vector actoranim_LEGS_WALKCR;
+.vector actoranim_LEGS_WALK;
+.vector actoranim_LEGS_RUN;
+.vector actoranim_LEGS_BACK;
+.vector actoranim_LEGS_SWIM;
+.vector actoranim_LEGS_JUMP;
+.vector actoranim_LEGS_LAND;
+.vector actoranim_LEGS_JUMPB;
+.vector actoranim_LEGS_LANDB;
+.vector actoranim_LEGS_IDLE;
+.vector actoranim_LEGS_IDLECR;
+.vector actoranim_LEGS_TURN;
+
+void() actor_part_torso_think =
+{
+	if (self.owner.actorpart_torso != self)
+		remove(self);
+};
+
+void() actor_part_head_think =
+{
+	if (self.owner.actorpart_head != self)
+		remove(self);
+};
+
+void() actor_part_weapon_think =
+{
+	if (self.owner.actorpart_weapon != self)
+		remove(self);
+};
+
+void() actor_part_viewweapon_think =
+{
+	if (self.owner.actorpart_viewweapon != self)
+		remove(self);
+};
+
+void() actor_part_hand_think =
+{
+	if (self.owner.actorpart_hand != self)
+		remove(self);
+};
+
+.string modeldir;
+.string modelext;
+.entity playerclass;
+void() actor_setup =
+{
+	local vector v;
+	self.movetype = MOVETYPE_WALK;
+	self.solid = SOLID_SLIDEBOX;
+	self.takedamage = DAMAGE_AIM;
+	self.ammo_shells = 0;
+	self.ammo_nails = 0;
+	self.ammo_rockets = 0;
+	self.ammo_cells = 0;
+	self.deadflag = DEAD_NO;
+
+	if (self.actorpart_torso == world)
+	{
+		self.actorpart_torso = spawn();
+		self.actorpart_torso.owner = self;
+		self.actorpart_torso.classname = "actorpart_torso";
+		self.actorpart_torso.think = actor_part_torso_think;
+		self.actorpart_torso.nextthink = time;
+		self.actorpart_head = spawn();
+		self.actorpart_head.owner = self;
+		self.actorpart_head.classname = "actorpart_head";
+		self.actorpart_head.think = actor_part_head_think;
+		self.actorpart_head.nextthink = time;
+		self.actorpart_weapon = spawn();
+		self.actorpart_weapon.owner = self;
+		self.actorpart_weapon.classname = "actorpart_weapon";
+		self.actorpart_weapon.think = actor_part_weapon_think;
+		self.actorpart_weapon.nextthink = time;
+		self.actorpart_viewweapon = spawn();
+		self.actorpart_viewweapon.owner = self;
+		self.actorpart_viewweapon.classname = "actorpart_viewweapon";
+		self.actorpart_viewweapon.think = actor_part_viewweapon_think;
+		self.actorpart_viewweapon.nextthink = time;
+		self.actorpart_hand = spawn();
+		self.actorpart_hand.owner = self;
+		self.actorpart_hand.classname = "actorpart_hand";
+		self.actorpart_hand.think = actor_part_hand_think;
+		self.actorpart_hand.nextthink = time;
+		
+		self.actorpart_jetpacktrail = spawn();
+	}
+	setmodel(self.actorpart_jetpacktrail,"models/players/jetpack_tracer.mdl");
+	setattachment(self.actorpart_jetpacktrail, self.actorpart_torso, "tag_jetpack");
+	self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects | EF_NODRAW;
+	
+	setmodel(self, strcat(self.playerclass.modeldir, "/lower", self.playerclass.modelext));
+	setmodel(self.actorpart_torso, strcat(self.playerclass.modeldir, "/upper", self.playerclass.modelext));
+	setmodel(self.actorpart_head, strcat(self.playerclass.modeldir, "/head", self.playerclass.modelext));
+	//setmodel(self.actorpart_hand,"models/weapons/hand.md3");
+	self.actorpart_weapon.model = ""; // will be changed by weapon code as needed
+	self.actorpart_viewweapon.model = ""; // will be changed by weapon code as needed
+	
+	self.scale = self.scaleratio;
+	setsize(self, self.boxmin, self.boxmax);
+
+	// it's ok if this bone is missing as long as the torso model is made
+	// relative to the legs origin, but that prevents any chance of leaning
+	// over from the code side (still possible in animations)
+	setattachment(self.actorpart_torso, self, "tag_torso");
+	// it's sort of ok if this bone is missing
+	setattachment(self.actorpart_head, self.actorpart_torso, "tag_head");
+	// if weapon tag is missing, bip01 r hand is used instead (probably quite wrong)
+	setattachment(self.actorpart_weapon, self.actorpart_torso, "tag_weapon");
+	if (!self.actorpart_weapon.tag_index)
+		setattachment(self.actorpart_weapon, self.actorpart_torso, "bip01 r hand");
+	// model seen in first person while holding weapon
+	self.actorpart_viewweapon.viewmodelforclient = self;
+	self.actorpart_hand.viewmodelforclient = self;
+};
+
+void() actor_gib =
+{
+ 	// not used
+	local float c;
+	c = 0;
+	while (c < 5)
+	{
+		c = c + 1;
+		decor_spawn(world, strcat(self.playerclass.modeldir, strcat("/gib", self.playerclass.modelext)), '-4 -4 -4', '4 4 4', 150);
+	}
+
+	// TODO: drop inventory
+
+	// these entities will remove themselves
+	self.actorpart_torso = world;
+	self.actorpart_head = world;
+	self.actorpart_weapon = world;
+	self.actorpart_viewweapon = world;
+
+	// FIXME: turn self into a gib using decor_spawn
+};
+
+void(string weapmodel, string viewweapmodel) actor_setweaponmodel =
+{
+	setmodel(self.actorpart_weapon, weapmodel);
+	setmodel(self.actorpart_viewweapon, viewweapmodel);
+};
+
+void(vector offset) actor_setviewmodeloffset =
+{
+	offset = self.weapon_ofs - self.view_ofs + offset; // default '10 4 -10'
+	offset_y = offset_y * -1;
+	setorigin(self.actorpart_viewweapon, offset);
+}
+
+
+void(float force) player_selectlegsanim;
+
+void() actor_update =
+{
+	//local string s1, s2, s3;
+	//s1 = ftos(self.button0);
+	//s2 = ftos(self.button3);
+	//s3 = ftos(self.weaponstate);
+	//centerprint(self, "actor_update ", s1, " ", s2, " ", s3);
+	
+	player_selectlegsanim(FALSE);
+	anim_update(self);
+	anim_update(self.actorpart_torso);
+	if (self.deadflag)
+	{
+		self.actorpart_viewweapon.model = "";
+		self.actorpart_torso.angles = '0 0 0';
+		self.actorpart_head.angles = '0 0 0';
+		self.angles_x = 0;
+		self.angles_z = 0;
+	}
+	else
+	{
+		anim_update(self.actorpart_viewweapon);
+		// update legs (self)
+		if (self.anim_type == ANIMTYPE_STAND || self.anim_type == ANIMTYPE_FALL)
+			self.angles = self.v_angle_y * '0 1 0';
+		else if (self.anim_type == ANIMTYPE_WALKBACK || self.anim_type == ANIMTYPE_RUNBACK)
+			self.angles = vectoyaw(self.velocity * -1) * '0 1 0';
+		else
+			self.angles = vectoyaw(self.velocity) * '0 1 0';
+		// update torso (relative to legs)
+		self.actorpart_torso.angles_x = bound(-30, self.v_angle_x * -1, 30);
+		self.actorpart_torso.angles_y = self.v_angle_y - self.angles_y;
+		// update head (relative to torso)
+		self.actorpart_head.angles_x = bound(-60, self.v_angle_x * -1, 60) - self.actorpart_torso.angles_x;
+	}
+};
+
+void(float newstate) weapon_state;
+void(float secondary) weapon_fire;
+
+.float weapon_oldbutton0;
+.float weapon_oldbutton3;
+.float weapon_oldbutton7;
+.float lowerguntime;
+void(float animdone) viewweapon_animframefunc =
+{
+	local entity oldself;
+	local float f1;
+	local float f2;
+	oldself = self;
+	self = self.owner;
+	
+	Inventory_GetItemInfo(self, self.weaponitem);
+	if (animdone)
+	{
+		if (self.weaponstate == WS_LOWER)
+		{
+			if (time >= self.lowerguntime)
+			{				
+				actor_setviewmodeloffset(iteminfo_viewmodeloffset);
+				self.viewmodelchange_x = 0;
+				self.viewmodelchange_z = -20;
+				self.weaponitem = self.switchweaponitem;
+				Inventory_GetItemInfo(self, self.weaponitem);
+				actor_setweaponmodel(iteminfo_model, iteminfo_weapon_viewmodel);
+
+				weapon_state(WS_RAISE);
+			}
+		}
+		else if (self.weaponstate == WS_RELOAD)
+		{
+			if (iteminfo_ammotype >= 0)
+			{
+				f1 = min(iteminfo_ammomax - iteminfo_ammo, iteminfo_ammoinventory);
+				if (f1 > 0)
+				{
+					Inventory_ModifyItem(self, self.weaponitem, 0, f1);
+					Inventory_ModifyItem(self, iteminfo_ammotype, 0 - f1, 0);
+				}
+			}
+			weapon_state(WS_IDLE);
+		}
+		else if (self.weaponstate == WS_TURNON)
+		{
+			// NOTE: should match Item_Spawn code
+			weapon_state(WS_IDLE);
+		}
+		else if (self.weaponstate == WS_TURNOFF)
+		{
+			weapon_state(WS_IDLE);
+		}
+		else
+			weapon_state(WS_IDLE);
+	}
+	if (self.weaponstate == WS_IDLE)
+	{
+		if (!iteminfo_weapon_canraise)
+		{
+			f1 = Inventory_GetBestWeapon(self);
+			if (f1 >= 0)
+				self.switchweaponitem = f1;
+		}
+		if (self.switchweaponitem != self.weaponitem)
+			weapon_state(WS_LOWER);
+		else if (time < self.lowerguntime)
+		{
+			//bprint("lowering\n");
+			weapon_state(WS_LOWER);
+		}
+		else if ((iteminfo_ammo <= iteminfo_ammo1minimumtofire) && (cvar("g_autoreload")) && (iteminfo_ammoinventory >= 1))
+			weapon_state(WS_RELOAD);
+		else if (self.button4 && ((iteminfo_ammo < iteminfo_ammomax && iteminfo_ammoinventory >= 1)))
+			weapon_state(WS_RELOAD);
+		else if (self.button0 && iteminfo_weapon_canfire1 && (!self.weapon_oldbutton0 || !(iteminfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
+			weapon_state(WS_FIRE1);
+		else if (self.button3 && iteminfo_weapon_canfire2 && (!self.weapon_oldbutton3 || !(iteminfo_ammo2fireflags & FIREFLAG_SEMIAUTOMATIC)))
+			weapon_state(WS_FIRE2);
+		else if (self.button7)
+		{
+		 	Inventory_GetItemInfo(self, self.itemselected);
+			if ((!iteminfo_ammo1noprojectile) && iteminfo_weapon_canfire1 && iteminfo_weapon_canfire2 && (!self.weapon_oldbutton7 || !(iteminfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
+			{
+			   	weapon_state(WS_FIRE3);
+			}
+			else if (iteminfo_ammo1fireflags & FIREFLAG_JETPACK)
+			{
+			    Inventory_ModifyItem(self, self.itemselected, 0 - iteminfo_ammo1minimumtofire, 0);
+				self.jetpack_fuel = iteminfo_quantity;
+			   	if (!self.jetpackactive)
+				{
+			   	   sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jetpack.wav"), 1, ATTN_NORM);
+				   self.jetpackactive = TRUE;
+				}
+			}
+		}
+	}
+	self.weapon_oldbutton0 = self.button0;
+	self.weapon_oldbutton3 = self.button3;
+	self.weapon_oldbutton7 = self.button7;
+	self = oldself;
+};
+
+void(float animdone) torso_animframefunc =
+{
+	local entity oldself;
+	if (!animdone)
+		return;
+	oldself = self;
+	self = self.owner;
+	Inventory_GetItemInfo(self, self.weaponitem);
+	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
+	self = oldself;
+};
+
+void(float newstate) weapon_state =
+{
+	self.weaponstate = newstate;
+	Inventory_GetItemInfo(self, self.weaponitem);
+		   
+	if (newstate == WS_IDLE)
+	{
+		if (self.weaponsound_cycle >= 5) // templeofnoise
+		{
+			self.weaponsound_cycle = 0; // templeofnoise
+		}
+		else if ((self.weaponsound_cycle != 0) && (!self.button0)) // templeofnoise: stop minigun whirling sound (actually only for primary attack)
+		{
+			sound(self, CHAN_WEAPON2, "weapons/minigun_whirlend.wav", 0.5, ATTN_NORM); // templeofnoise
+			self.weaponsound_cycle = 0; // templeofnoise
+		}
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_idle, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
+	}
+	else if (newstate == WS_FIRE1)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_fire1, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
+		self.viewmodelchange = self.viewmodelchange + iteminfo_ammo1viewmodelpush;
+		self.viewmodelchange_y = self.viewmodelchange_y + crandom();
+		//bprint("weapon_state ");bprint(ftos(newstate));bprint(":");bprint(vtos(iteminfo_weapon_viewmodelanim_fire1));bprint(" ");bprint(ftos(self.actorpart_torso.anim_frametime));bprint("\n");
+		weapon_fire(FALSE);
+	}
+	else if (newstate == WS_FIRE2)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_fire2, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
+		self.viewmodelchange = self.viewmodelchange + iteminfo_ammo2viewmodelpush;
+		weapon_fire(TRUE);
+	}
+	else if (newstate == WS_FIRE3)
+	{
+	 	Inventory_GetItemInfo(self, self.itemselected);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
+		weapon_fire(FALSE);
+	}
+	else if (newstate == WS_RELOAD)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_reload, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_RELOAD, ANIMTYPE_IDLE, torso_animframefunc);
+	}
+	else if (newstate == WS_LOWER)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_lower, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_DROP, ANIMTYPE_IDLE, torso_animframefunc);
+	}
+	else if (newstate == WS_RAISE)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_raise, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_RAISE, ANIMTYPE_IDLE, torso_animframefunc);
+	}
+	else if (newstate == WS_TURNON)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_turnon, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_IDLE, ANIMTYPE_IDLE, torso_animframefunc);
+	}
+	else if (newstate == WS_TURNOFF)
+	{
+		anim_start(self.actorpart_viewweapon, iteminfo_weapon_viewmodelanim_turnoff, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_IDLE, ANIMTYPE_IDLE, torso_animframefunc);
+	}
+};
+
+void(float intensity) weapon_recoil =
+{
+	self.punchangle_x = (random() * 2 - 1) * intensity;
+	self.punchangle_y = (random() * 2 - 1) * intensity;
+};
+
+void(float secondary) weapon_fire =
+{
+	local vector shotorg;
+	local vector shotdir;
+	local vector shotdamage;
+	local float shotdamagetype;
+	local float shotlifetime;
+	local float shotprojflags;
+	local float shotfireflags;
+	local float shotexplflags;
+	local float numberof;
+	local float recoil;
+	local float mintofire;
+	local string shotmodel;
+	local string shotfiresound;
+	local string shotexplodesound;
+	local string shotbouncesound;
+	local vector muzzle1tagorigin, muzzle2tagorigin, muzzle3tagorigin;
+	local string tracermodel;
+	local float tracer;
+	local float modelscale;
+	local float projhealth;
+	local float projmass;
+	local vector projcolormod;
+	muzzle1tagorigin = muzzle2tagorigin = muzzle3tagorigin = self.origin + self.weapon_ofs_x * v_forward + self.weapon_ofs_y * v_right + self.weapon_ofs_z * '0 0 1';
+	makevectors(self.v_angle);
+	if (secondary)
+	{
+		shotorg = muzzle2tagorigin; // overridden on hagar
+		shotdir = iteminfo_ammo2speeds;
+		shotdamage = iteminfo_ammo2damage;
+		shotdamagetype = iteminfo_ammo2damagetype;
+		shotlifetime = iteminfo_ammo2lifetime;
+		shotprojflags = iteminfo_ammo2projflags;
+		shotfireflags = iteminfo_ammo2fireflags;
+		shotexplflags = iteminfo_ammo2explflags;
+		shotmodel = iteminfo_ammo2model;
+		shotfiresound = iteminfo_ammo2firesound;
+		shotexplodesound = iteminfo_ammo2explodesound;
+		shotbouncesound = iteminfo_ammo2bouncesound;
+		numberof = iteminfo_ammo2numberof;
+		recoil = iteminfo_ammo2recoil;
+		mintofire = iteminfo_ammo2minimumtofire;
+		tracer = iteminfo_ammo2tracer;
+		tracermodel = iteminfo_ammo2tracermodel;
+		modelscale = iteminfo_ammo2modelscale;
+		projhealth = iteminfo_ammo2health;
+		projmass = iteminfo_ammo2mass;
+		projcolormod = iteminfo_ammo2colormod;
+	}
+	else
+	{
+		shotorg = muzzle1tagorigin;
+		shotdir = iteminfo_ammo1speeds;
+		shotdamage = iteminfo_ammo1damage;
+		shotdamagetype = iteminfo_ammo1damagetype;
+		shotlifetime = iteminfo_ammo1lifetime;
+		shotprojflags = iteminfo_ammo1projflags;
+		shotfireflags = iteminfo_ammo1fireflags;
+		shotexplflags = iteminfo_ammo1explflags;
+		shotmodel = iteminfo_ammo1model;
+		shotfiresound = iteminfo_ammo1firesound;
+		shotexplodesound = iteminfo_ammo1explodesound;
+		shotbouncesound = iteminfo_ammo1bouncesound;
+		numberof = iteminfo_ammo1numberof;
+		recoil = iteminfo_ammo1recoil;
+		mintofire = iteminfo_ammo1minimumtofire;
+		tracer = iteminfo_ammo1tracer;
+		tracermodel = iteminfo_ammo1tracermodel;
+		projhealth = iteminfo_ammo1health;
+		projmass = iteminfo_ammo1mass;
+		projcolormod = iteminfo_ammo1colormod;
+	}
+
+	if (self.unlimitedinventory == 0)
+	if (iteminfo_ammotype < ITEMTYPE_AMMO1) // then it's an item
+	{
+	   Inventory_ModifyItem(self, self.itemselected, 0 - mintofire, 0);
+	}
+	else
+	{
+	   Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire);
+	}
+	   
+	weapon_recoil(recoil);
+	
+	while (numberof != 0)
+	{
+		  weapon_fireprojectile(shotmodel, shotorg, shotdir, shotdamage, shotdamagetype, shotlifetime, shotprojflags, shotfireflags, shotexplflags, shotfiresound, shotexplodesound, shotbouncesound, tracer, tracermodel, modelscale, projhealth, projmass, projcolormod);	
+		  numberof = numberof - 1;
+	}
+};
+
+
+// only called at spawn
+void(entity character, float weaponitemtype) weapon_setup =
+{
+	Inventory_GetItemInfo(character, weaponitemtype);
+	self.weaponitem = weaponitemtype;
+	self.switchweaponitem = self.weaponitem;
+	
+	actor_setweaponmodel(iteminfo_model, iteminfo_weapon_viewmodel);
+	actor_setviewmodeloffset(iteminfo_viewmodeloffset);
+	self.viewmodelchange = iteminfo_viewmodeloffset;
+	
+	weapon_state(WS_IDLE);
+};
+


Property changes on: trunk/basezym/progsqc/actor.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/bots.qc
===================================================================
--- trunk/basezym/progsqc/bots.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/bots.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,288 +1,288 @@
-
-float(entity targ) SInfront =
-{
-	local float dot;
-	local vector vec;
-
-	makevectors (self.angles);
-	vec = normalize (targ.origin - self.origin);
-	dot = vec * v_forward;
-
-	if (dot > 0.3)
-		return TRUE;
-	return FALSE;
-};
-
-void() SAim =
-{
-	local float dist;
-	local vector vec, desiredang, testang, diffang;
-
-	// get the desired angles to aim at
-	vec = (self.enemy.absmin + self.enemy.absmax) * 0.5;
-	desiredang = vectoangles(vec - (self.origin + self.view_ofs));
-	desiredang_x = 0-desiredang_x;
-
-	if (desiredang_y <= -180)
-		desiredang_y = desiredang_y + 360;
-	else if (desiredang_y >= 180)
-		desiredang_y = desiredang_y - 360;
-	if (desiredang_x <= -180)
-		desiredang_x = desiredang_x + 360;
-	else if (desiredang_x >= 180)
-		desiredang_x = desiredang_x - 360;
-
-	// calculate turn angles
-	testang = desiredang - self.v_angle;
-	testang_z = 0;
-
-	// turn
-	dist = vlen(testang * (5 * frametime));
-	if (vlen(normalize(testang) * 4) > dist)
-	{
-		diffang = normalize(testang) * 4;
-		dist = vlen(normalize(testang) * 4);
-	}
-	else
-		diffang = testang * (5 * frametime);
-	if (dist > vlen(testang))
-		diffang = testang;
-
-	self.v_angle = self.v_angle + diffang;
-	// self.angles_y = self.v_angle_y;
-};
-
-void() MoveToGoal =
-{
-	local vector vec, en, diff, dir;
-
-	vec = self.origin;
-	movetogoal(20);
-	en = self.origin;
-	self.origin = vec;
-
-	diff = en - self.origin;
-	if (diff == '0 0 0')
-		diff = self.enemy.origin - self.origin;
-
-	dir = normalize(diff);
-	dir = dir * cvar("sv_maxspeed");
-
-	makevectors(self.v_angle);
-	self.movement_x = dir * v_forward;
-	self.movement_y = dir * v_right;
-	self.movement_z = dir * v_up;
-};
-
-.float ai_strafetime;
-.vector ai_strafemove;
-void() ai_strafe =
-{
-	if (time >= self.ai_strafetime)
-	{
-		self.ai_strafetime = time + 2 + random() * 0.6;
-		self.ai_strafemove_x = (random() - 0.5) * (cvar("sv_maxspeed") * self.speedratio);
-		self.ai_strafemove_y = (random() - 0.5) * (cvar("sv_maxspeed") * self.speedratio);
-		self.ai_strafemove_z = 0;
-	}
-	self.movement = self.ai_strafemove;
-};
-
-.float ai_walktime;
-.vector ai_walkmove;
-void() ai_walk =
-{
- 	if (self.ai_walkmove_x > 0)
-	    self.ai_walkmove_x = self.ai_walkmove_x - 0.2;
-	makevectors(self.v_angle);
-	if (time >= self.ai_walktime)
-	{
-	    self.v_angle_y = self.v_angle_y + (100 * random());
-		self.ai_walktime = time + 15 + random() * 0.6;
-		self.ai_walkmove_x = 100; // random() * (cvar("sv_maxspeed") * self.speedratio);
-		self.ai_walkmove_y = 0;
-		self.ai_walkmove_z = 0;
-	}
-	self.movement = self.ai_walkmove;
-};
-
-void() ai_findenemy =
-{
-	local vector v1, v2;
-	local entity e;
-	if (self.enemy)
-		return;
-	v1 = self.origin + self.view_ofs;
-	e = findradius(v1, 1500);
-	while (e)
-	{
-		if (e.team != self.team)
-		if (e.takedamage)
-		if (!e.deadflag)
-		if (!(e.flags & FL_NOTARGET))
-		{
-			v2 = (e.absmin + e.absmax) * 0.5;
-			traceline(v1, v2, TRUE, self);
-			if (trace_fraction == 1 || trace_ent == e)
-				self.enemy = e;
-		}
-		e = e.chain;
-	}
-};
-
-void() bot_ai =
-{
-	local vector v1, v2;
-
-	if (self.aitype == AITYPE_1)
-	{
-		self.movement = '0 0 0';
-		self.button0 = self.button2 = self.button3 = self.button4 = 0;
-		if (!self.enemy)
-		{
-			ai_walk();
-			ai_findenemy();
-		}
-		else
-		{
-		 	//ai_strafe();
-			if (self.enemy.deadflag || !self.enemy.takedamage)
-			{
-				self.enemy = world;
-				return;
-			}
-			Inventory_GetItemInfo(self, self.weaponitem);
-			if (!iteminfo_weapon_canfire1)
-			if (!iteminfo_weapon_canfire2)
-			{
-				if (iteminfo_weapon_canreload)
-					self.button4 = 1;
-				else
-					self.switchweaponitem = Inventory_GetBestWeapon(self);
-			}
-			SAim();
-			v1 = self.origin + '0 0 16';
-			v2 = (self.enemy.absmin + self.enemy.absmax) * 0.5;
-			traceline(v1, v2, FALSE, self);
-			if ((trace_fraction == 1 || trace_ent == self.enemy) && SInfront(self.enemy))
-			{
-				if (iteminfo_weapon_canfire1)
-				{
-					if (iteminfo_weapon_canfire2)
-					{
-						if (random() < 0.05)
-							self.button3 = 1;
-						else
-							self.button0 = 1;
-					}
-					else
-						self.button0 = 1;
-				}
-				else if (iteminfo_weapon_canfire2)
-					self.button3 = 1;
-			}
-			MoveToGoal();
-		}
-	}
-};
-
-void() bot_npcthink =
-{
-	self.nextthink = time;
-	bot_ai();
-	SV_PlayerPhysics();
-	PlayerPreThink();
-	PlayerPostThink();
-};
-
-
-void() bot_serverframe =
-{
- 	   // keep spawning new bots
-}
-
-void() enemy_class2
-{
- 	if (cvar("g_gametype") == 1)
-	{
-		setorigin(self, self.origin + '0 0 1');
-		self.think = bot_npcthink;
-		self.nextthink = time;
-		self.team = cvar("g_defaultenemyteam");
-		self.unlimitedinventory = 1;
-		self.spawned = 1;
-		player_spawn(ACTORTYPE_CLASS5);
-	}
-};
-
-void() enemy_class3
-{
- 	if (cvar("g_gametype") == 1)
-	{
-		setorigin(self, self.origin + '0 0 1');
-		self.think = bot_npcthink;
-		self.nextthink = time;
-		self.team = cvar("g_defaultenemyteam");
-		self.unlimitedinventory = 1;
-		self.spawned = 1;
-		player_spawn(ACTORTYPE_CLASS6);
-	}
-};
-
-void() enemy_class4
-{
- 	if (cvar("g_gametype") == 1)
-	{
-		setorigin(self, self.origin + '0 0 1');
-		self.think = bot_npcthink;
-		self.nextthink = time;
-		self.team = cvar("g_defaultenemyteam");
-		self.unlimitedinventory = 1;
-		self.spawned = 1;
-		player_spawn(ACTORTYPE_CLASS7);
-	}
-};
-
-
-void() enemy_class5
-{
- 	if (cvar("g_gametype") == 1)
-	{
-		setorigin(self, self.origin + '0 0 1');
-		self.think = bot_npcthink;
-		self.nextthink = time;
-		self.team = cvar("g_defaultenemyteam");
-		self.unlimitedinventory = 1;
-		self.spawned = 1;
-		player_spawn(ACTORTYPE_CLASS8);
-	}
-};
-
-
-void() enemy_class6
-{
- 	if (cvar("g_gametype") == 1)
-	{
-		setorigin(self, self.origin + '0 0 1');
-		self.think = bot_npcthink;
-		self.nextthink = time;
-		self.team = cvar("g_defaultenemyteam");
-		self.unlimitedinventory = 1;
-		self.spawned = 1;
-		player_spawn(ACTORTYPE_CLASS9);
-	}
-};
-
-void() enemy_class7
-{
- 	if (cvar("g_gametype") == 1)
-	{
-		setorigin(self, self.origin + '0 0 1');
-		self.think = bot_npcthink;
-		self.nextthink = time;
-		self.team = cvar("g_defaultenemyteam");
-		self.unlimitedinventory = 1;
-		self.spawned = 1;
-		player_spawn(ACTORTYPE_CLASS10);
-	}
+
+float(entity targ) SInfront =
+{
+	local float dot;
+	local vector vec;
+
+	makevectors (self.angles);
+	vec = normalize (targ.origin - self.origin);
+	dot = vec * v_forward;
+
+	if (dot > 0.3)
+		return TRUE;
+	return FALSE;
+};
+
+void() SAim =
+{
+	local float dist;
+	local vector vec, desiredang, testang, diffang;
+
+	// get the desired angles to aim at
+	vec = (self.enemy.absmin + self.enemy.absmax) * 0.5;
+	desiredang = vectoangles(vec - (self.origin + self.view_ofs));
+	desiredang_x = 0-desiredang_x;
+
+	if (desiredang_y <= -180)
+		desiredang_y = desiredang_y + 360;
+	else if (desiredang_y >= 180)
+		desiredang_y = desiredang_y - 360;
+	if (desiredang_x <= -180)
+		desiredang_x = desiredang_x + 360;
+	else if (desiredang_x >= 180)
+		desiredang_x = desiredang_x - 360;
+
+	// calculate turn angles
+	testang = desiredang - self.v_angle;
+	testang_z = 0;
+
+	// turn
+	dist = vlen(testang * (5 * frametime));
+	if (vlen(normalize(testang) * 4) > dist)
+	{
+		diffang = normalize(testang) * 4;
+		dist = vlen(normalize(testang) * 4);
+	}
+	else
+		diffang = testang * (5 * frametime);
+	if (dist > vlen(testang))
+		diffang = testang;
+
+	self.v_angle = self.v_angle + diffang;
+	// self.angles_y = self.v_angle_y;
+};
+
+void() MoveToGoal =
+{
+	local vector vec, en, diff, dir;
+
+	vec = self.origin;
+	movetogoal(20);
+	en = self.origin;
+	self.origin = vec;
+
+	diff = en - self.origin;
+	if (diff == '0 0 0')
+		diff = self.enemy.origin - self.origin;
+
+	dir = normalize(diff);
+	dir = dir * cvar("sv_maxspeed");
+
+	makevectors(self.v_angle);
+	self.movement_x = dir * v_forward;
+	self.movement_y = dir * v_right;
+	self.movement_z = dir * v_up;
+};
+
+.float ai_strafetime;
+.vector ai_strafemove;
+void() ai_strafe =
+{
+	if (time >= self.ai_strafetime)
+	{
+		self.ai_strafetime = time + 2 + random() * 0.6;
+		self.ai_strafemove_x = (random() - 0.5) * (cvar("sv_maxspeed") * self.speedratio);
+		self.ai_strafemove_y = (random() - 0.5) * (cvar("sv_maxspeed") * self.speedratio);
+		self.ai_strafemove_z = 0;
+	}
+	self.movement = self.ai_strafemove;
+};
+
+.float ai_walktime;
+.vector ai_walkmove;
+void() ai_walk =
+{
+ 	if (self.ai_walkmove_x > 0)
+	    self.ai_walkmove_x = self.ai_walkmove_x - 0.2;
+	makevectors(self.v_angle);
+	if (time >= self.ai_walktime)
+	{
+	    self.v_angle_y = self.v_angle_y + (100 * random());
+		self.ai_walktime = time + 15 + random() * 0.6;
+		self.ai_walkmove_x = 100; // random() * (cvar("sv_maxspeed") * self.speedratio);
+		self.ai_walkmove_y = 0;
+		self.ai_walkmove_z = 0;
+	}
+	self.movement = self.ai_walkmove;
+};
+
+void() ai_findenemy =
+{
+	local vector v1, v2;
+	local entity e;
+	if (self.enemy)
+		return;
+	v1 = self.origin + self.view_ofs;
+	e = findradius(v1, 1500);
+	while (e)
+	{
+		if (e.team != self.team)
+		if (e.takedamage)
+		if (!e.deadflag)
+		if (!(e.flags & FL_NOTARGET))
+		{
+			v2 = (e.absmin + e.absmax) * 0.5;
+			traceline(v1, v2, TRUE, self);
+			if (trace_fraction == 1 || trace_ent == e)
+				self.enemy = e;
+		}
+		e = e.chain;
+	}
+};
+
+void() bot_ai =
+{
+	local vector v1, v2;
+
+	if (self.aitype == AITYPE_1)
+	{
+		self.movement = '0 0 0';
+		self.button0 = self.button2 = self.button3 = self.button4 = 0;
+		if (!self.enemy)
+		{
+			ai_walk();
+			ai_findenemy();
+		}
+		else
+		{
+		 	//ai_strafe();
+			if (self.enemy.deadflag || !self.enemy.takedamage)
+			{
+				self.enemy = world;
+				return;
+			}
+			Inventory_GetItemInfo(self, self.weaponitem);
+			if (!iteminfo_weapon_canfire1)
+			if (!iteminfo_weapon_canfire2)
+			{
+				if (iteminfo_weapon_canreload)
+					self.button4 = 1;
+				else
+					self.switchweaponitem = Inventory_GetBestWeapon(self);
+			}
+			SAim();
+			v1 = self.origin + '0 0 16';
+			v2 = (self.enemy.absmin + self.enemy.absmax) * 0.5;
+			traceline(v1, v2, FALSE, self);
+			if ((trace_fraction == 1 || trace_ent == self.enemy) && SInfront(self.enemy))
+			{
+				if (iteminfo_weapon_canfire1)
+				{
+					if (iteminfo_weapon_canfire2)
+					{
+						if (random() < 0.05)
+							self.button3 = 1;
+						else
+							self.button0 = 1;
+					}
+					else
+						self.button0 = 1;
+				}
+				else if (iteminfo_weapon_canfire2)
+					self.button3 = 1;
+			}
+			MoveToGoal();
+		}
+	}
+};
+
+void() bot_npcthink =
+{
+	self.nextthink = time;
+	bot_ai();
+	SV_PlayerPhysics();
+	PlayerPreThink();
+	PlayerPostThink();
+};
+
+
+void() bot_serverframe =
+{
+ 	   // keep spawning new bots
+}
+
+void() enemy_class2
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = cvar("g_defaultenemyteam");
+		self.unlimitedinventory = 1;
+		self.spawned = 1;
+		player_spawn(ACTORTYPE_CLASS5);
+	}
+};
+
+void() enemy_class3
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = cvar("g_defaultenemyteam");
+		self.unlimitedinventory = 1;
+		self.spawned = 1;
+		player_spawn(ACTORTYPE_CLASS6);
+	}
+};
+
+void() enemy_class4
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = cvar("g_defaultenemyteam");
+		self.unlimitedinventory = 1;
+		self.spawned = 1;
+		player_spawn(ACTORTYPE_CLASS7);
+	}
+};
+
+
+void() enemy_class5
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = cvar("g_defaultenemyteam");
+		self.unlimitedinventory = 1;
+		self.spawned = 1;
+		player_spawn(ACTORTYPE_CLASS8);
+	}
+};
+
+
+void() enemy_class6
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = cvar("g_defaultenemyteam");
+		self.unlimitedinventory = 1;
+		self.spawned = 1;
+		player_spawn(ACTORTYPE_CLASS9);
+	}
+};
+
+void() enemy_class7
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = cvar("g_defaultenemyteam");
+		self.unlimitedinventory = 1;
+		self.spawned = 1;
+		player_spawn(ACTORTYPE_CLASS10);
+	}
 };
\ No newline at end of file


Property changes on: trunk/basezym/progsqc/bots.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/damage.qc
===================================================================
--- trunk/basezym/progsqc/damage.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/damage.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,729 +1,729 @@
-
-float ACTOR_SHIELD_REGENDELAY = 0.5;
-.float armorregentime;
-.float armorregenplaysound;
-.float armorregenrate;
-.float armorregenmax;
-.float gibhealth;
-.float paintake;
-.void() th_gib;
-
-float DAMAGETYPE_UNKNOWN = 0;
-float DAMAGETYPE_FALL = 1;
-float DAMAGETYPE_WEAP1 = 2;
-float DAMAGETYPE_WEAP2 = 3;
-float DAMAGETYPE_WEAP3 = 4;
-float DAMAGETYPE_WEAP4 = 5;
-float DAMAGETYPE_WEAP5 = 6;
-float DAMAGETYPE_WEAP6 = 7;
-
-void(entity targ, entity attacker, float damagetype, float gibbed) PrintObituary =
-{
-	local float r;
-	local string m1;
-	local string m2;
-	local string m3;
-	local string m4;
-	if (targ.classname != "player")
-		return;
-	r = random();
-	m1 = "";
-	m2 = "";
-	m3 = "";
-	m4 = "";
-	if (targ == attacker)
-	{
-		m1 = targ.netname;
-		m2 = " became bored with life";
-	}
-	else if (teamplay && targ.team == attacker.team)
-	{
-		if (gibbed)
-		{
-			m1 = targ.netname;
-			m2 = " was destroyed by teammate ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-		else
-		{
-			m1 = targ.netname;
-			m2 = " was gunned down by teammate ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-	}
-	else if (damagetype == DAMAGETYPE_UNKNOWN)
-	{
-		m1 = targ.netname;
-		m2 = " died";
-	}
-	else if (damagetype == DAMAGETYPE_FALL)
-	{
-		m1 = targ.netname;
-		m2 = " met a flat world";
-	}
-	else if (damagetype == DAMAGETYPE_WEAP1)
-	{
-		m1 = targ.netname;
-		m2 = " now sports a new hole from ";
-		m3 = attacker.netname;
-		m4 = "";
-	}
-	else if (damagetype == DAMAGETYPE_WEAP2)
-	{
-		if (gibbed)
-		{
-			if (r < 0.33)
-			{
-				m1 = targ.netname;
-				m2 = " was disintegrated by ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-			else if (r < 0.66)
-			{
-				m1 = targ.netname;
-				m2 = " was vaporized by ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-			else
-			{
-				m1 = targ.netname;
-				m2 = " was melted by ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-		}
-		else
-		{
-			if (r < 0.25)
-			{
-				m1 = targ.netname;
-				m2 = " was singed by ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-			else if (r < 0.50)
-			{
-				m1 = targ.netname;
-				m2 = " was splashed by ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-			else if (r < 0.75)
-			{
-				m1 = targ.netname;
-				m2 = " bathed in plasma from ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-			else
-			{
-				m1 = targ.netname;
-				m2 = " was schooled in plasma dynamics by ";
-				m3 = attacker.netname;
-				m4 = "";
-			}
-		}
-	}
-	else if (damagetype == DAMAGETYPE_WEAP3)
-	{
-		if (r < 0.50)
-		{
-			m1 = targ.netname;
-			m2 = " was riddled with bullets from ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-		else if (r < 0.75)
-		{
-			m1 = targ.netname;
-			m2 = " was redecorated by ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-		else
-		{
-			m1 = targ.netname;
-			m2 = " was schooled in the minigun by ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-	}
-	else if (damagetype == DAMAGETYPE_WEAP4)
-	{
-		if (gibbed)
-		{
-			m1 = targ.netname;
-			m2 = " was blown apart by a volley from ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-		else
-		{
-			m1 = targ.netname;
-			m2 = " met a swarm of missiles from ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-	}
-	else if (damagetype == DAMAGETYPE_WEAP5)
-	{
-		if (gibbed)
-		{
-			m1 = targ.netname;
-			m2 = " was obliterated by ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-		else
-		{
-			m1 = targ.netname;
-			m2 = " blown into the afterlife by ";
-			m3 = attacker.netname;
-			m4 = "";
-		}
-	}
-	else if (damagetype == DAMAGETYPE_WEAP6)
-	{
-		m1 = targ.netname;
-		m2 = " was rendered absolutely dead by ";
-		m3 = attacker.netname;
-		m4 = "'s plasma railgun";
-	}
-	else
-	{
-		m1 = targ.netname;
-		m2 = " died from an unknown damagetype";
-	}
-	bprint(m1, m2, m3, m4, "\n");
-}
-
-void(entity targ, entity inflictor, entity attacker, float damagetype, float damage, vector location, vector force) T_Damage =
-{
-	local entity oldself;
-	local float save;
-	local float take;
-	local vector v;
-	if (!targ.takedamage)
-		return;
-	oldself = self;
-	self = targ;
-	
-	//bprint(vtos(self.velocity), " ");
-	//bprint(" ", vtos(force));
-	//bprint("/", ftos(self.mass));
-	v = force * (1 / self.mass);
-	//bprint("=", vtos(v), " ");
-	if (vlen(v) >= 0.1)
-	{
-		self.velocity = self.velocity + force * (1 / self.mass);
-		self.flags = self.flags - (self.flags & FL_ONGROUND);
-	}
-	//bprint(vtos(force), "\n");
-	
-	// save is how much was blocked by the target's armor or shield (if any)
-	save = min(self.armorvalue, damage * self.armortype);
-	take = damage - save;
-	if (!(self.flags & FL_GODMODE))
-	{
-		self.armorvalue = self.armorvalue - save;
-		self.health = self.health - take;
-		self.armorregentime = max(self.armorregentime, time + ACTOR_SHIELD_REGENDELAY);
-		self.armorregenplaysound = TRUE;
-	}
-	if (self.bloodtype == 1)
-	{
-		te_blood(location, force, take);
-		te_blood(location, force, save);
-	}
-	
-	/*
-	if (self.entitytype == ETYPE_HUMAN)
-	{
-		if (take >= 1)
-			te_blood(location, force, take);
-		if (save >= 1)
-			te_spark(location, '0 0 0' - force, save);
-	}
-	else if (self.entitytype == ETYPE_MECHANICAL)
-	*/
-	{
-		//if (damage >= 1)
-		//	te_spark(location, '0 0 0' - force, damage);
-		//if (damage >= 1)
-	}
-	if (self.deadflag == DEAD_NO)
-	{
-		if (self.health < self.gibhealth && self.th_gib)
-		{
-			PrintObituary(self, attacker, damagetype, TRUE);
-			self.deadflag = DEAD_DEAD;
-			self.solid = SOLID_CORPSE;
-			self.th_gib();
-		}
-		else if (self.health <= 0)
-		{
-			PrintObituary(self, attacker, damagetype, FALSE);
-			self.deadflag = DEAD_DYING;
-			self.solid = SOLID_CORPSE;
-			self.th_die();
-		}
-		else
-			self.th_pain(attacker, damage);
-	}
-	else if (self.deadflag == DEAD_DYING || self.deadflag == DEAD_DEAD)
-	{
-		if (self.health < self.gibhealth && self.th_gib)
-			self.th_gib();
-	}
-	//self.th_damage(inflictor, attacker, damagetype, damage, location, force);
-	self = oldself;
-};
-
-void(entity inflictor, entity attacker, float damagetype, vector damage, vector org) T_RadiusDamage =
-{
-	local float blastintensity, dist;
-	local vector nearest, force;
-	local entity ent, next;
-	//bprint(vtos(damage));
-	//bprint(": ");
-	ent = findradius(org, damage_z + 1);
-	while (ent)
-	{
-		next = ent.chain;
-		if (ent.takedamage)
-		if (ent != inflictor)
-		{
-			nearest_x = bound(ent.absmin_x, org_x, ent.absmax_x);
-			nearest_y = bound(ent.absmin_y, org_y, ent.absmax_y);
-			nearest_z = bound(ent.absmin_z, org_z, ent.absmax_z);
-			dist = vlen(nearest - org);
-			//bprint(etos(ent));
-			//bprint(":");
-			//bprint(ftos(dist));
-			//bprint(":");
-			if (dist < 0.1)
-				blastintensity = 1;
-			else if (damage_z > 0)
-				blastintensity = 1 - (dist / damage_z);
-			else
-				blastintensity = 0;
-			//bprint(ftos(blastintensity));
-			//bprint(" ");
-			if (blastintensity > 0)
-			{
-				force = normalize((ent.absmin + ent.absmax) * 0.5 - org) * (blastintensity * damage_y);
-				T_Damage(ent, inflictor, attacker, damagetype, blastintensity * damage_x, org, force);
-			}
-		}
-		ent = next;
-	}
-	//bprint("\n");
-};
-
-
-entity newmis;
-.entity realowner;
-.float damagetype;
-.vector damageinfo;
-
-float PROJFLAG_ANYIMPACT = 1;
-float PROJFLAG_CHARACTERIMPACT = 2;
-float PROJFLAG_RICOCHET = 4;
-float PROJFLAG_ROCKET = 8;
-float PROJFLAG_GLOW = 32;
-float PROJFLAG_STICK = 64;
-float PROJFLAG_LASERGUIDED = 128;
-float PROJFLAG_REMOTEDETONATE = 256;
-
-float FIREFLAG_MUZZLEFLASH = 1;
-float FIREFLAG_SEMIAUTOMATIC = 2;
-float FIREFLAG_ZOOM = 4;
-float FIREFLAG_HOOK = 8;
-float FIREFLAG_JETPACK = 16;
-
-float EXPLFLAG_EXPLODE = 1;
-float EXPLFLAG_EXPLODELARGE = 2;
-float EXPLFLAG_SNIPERRAIL = 4;
-float EXPLFLAG_PLASMA = 8;
-float EXPLFLAG_ASSAULTRAIL = 16;
-float EXPLFLAG_ELECTRICITY = 32;
-
-.float weaponsound_cycle; // templeofnoise: added for minigun routing sound, guess i'll use it for other sound specs also.
-
-void(string tracermodel, vector dir, vector org) fire_tracer =
-{
- 	local entity e;
-	e = spawn();
-	e.owner = self;
-	e.movetype = MOVETYPE_FLY;
-	e.solid = SOLID_BBOX;
-	e.think = SUB_Remove;
-	e.touch = SUB_Remove;
-	e.nextthink = time + 10;
-	e.velocity = dir;
-	e.angles = vectoangles(e.velocity);
-	setmodel (e, tracermodel);
-	setorigin (e, org);
-	setsize(e, '0 0 0', '0 0 0');
-	//e.lefty = 17;
-}
-
-void(entity attacker, float damage) projectile_pain =
-{
-	if (self.projflag  & PROJFLAG_STICK)
-	{
-		self.movetype = MOVETYPE_BOUNCE;
-		self.projflag = self.projflag - PROJFLAG_STICK;
-	}
-}
-
-void() projectile_die =
-{
-
-	local float r; // templeofnoise
-
-	if (self.weaponsound_cycle) // templeofnoise
-	{
-		r = random() ;
-		if (self.weaponsound_cycle == 2) // templeofnoise: limiting to 1/4
-		{
-			if (r < 0.1) self.noise = "weapons/bullet_ric1.wav"; // templeofnoise
-			else if (r < 0.2) self.noise = "weapons/bullet_ric2.wav"; // templeofnoise
-			else if (r < 0.3) self.noise = "weapons/bullet_ric3.wav"; // templeofnoise
-			else if (r < 0.4) self.noise = "weapons/bullet_ric4.wav"; // templeofnoise
-			else self.noise = ""; // templeofnoise: limiting again
-
-			if (self.noise != "") sound(self, CHAN_BODY, self.noise, 0.1, ATTN_NORM); // templeofnoise
-		}
-	}
-	else sound(self, CHAN_BODY, self.noise, 1, ATTN_NORM); // templeofnoise
-
-	if (self.damageinfo_z > 0)
-		T_RadiusDamage(self, self.realowner, self.damagetype, self.damageinfo, self.origin);
-	else if (other != world)
-		T_Damage(other, self, self.realowner, self.damagetype, self.damageinfo_x, self.origin, normalize(self.velocity) * self.damageinfo_y);
-	self.takedamage = DAMAGE_NO;
-	if (self.explflag & EXPLFLAG_EXPLODELARGE)
-	{
-		// LordHavoc: TE_TEI_BIGEXPLOSION
-		WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
-		WriteByte (MSG_BROADCAST, 78);
-		WriteCoord (MSG_BROADCAST, self.origin_x);
-		WriteCoord (MSG_BROADCAST, self.origin_y);
-		WriteCoord (MSG_BROADCAST, self.origin_z);
-		
-		remove(self);
-	}
-	else if (self.explflag & EXPLFLAG_EXPLODE)
-	{
-		te_explosion(self.origin);
-		remove(self);
-	}
-	else if (self.explflag & EXPLFLAG_SNIPERRAIL)
-	{
-		te_plasmaburn(self.origin);
-		remove(self);
-	}
-	else if (self.explflag & EXPLFLAG_ELECTRICITY)
-	{
-		WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
-		WriteByte (MSG_BROADCAST, 79);
-		WriteCoord (MSG_BROADCAST, self.origin_x);
-		WriteCoord (MSG_BROADCAST, self.origin_y);
-		WriteCoord (MSG_BROADCAST, self.origin_z);
-		WriteCoord (MSG_BROADCAST, 0);
-		WriteCoord (MSG_BROADCAST, 0);
-		WriteCoord (MSG_BROADCAST, 0);
-		WriteByte (MSG_BROADCAST, 155);
-		remove(self);
-	}
-	else if (self.explflag & EXPLFLAG_PLASMA)
-	{
-		te_knightspike(self.origin);
-		remove(self);
-	}
-	else if (self.explflag & EXPLFLAG_ASSAULTRAIL)
-	{
-		te_gunshotquad(self.origin);
-		remove(self);
-	}
-	else // metal projectile of some sort (bullet, shrapnel, railgun bolt, etc)
-	{
-		te_gunshot(self.origin);
-		remove(self);
-	}
-};
-
-//.vector oldvelocity;
-void() projectile_touch =
-{
-	if (self.projflag  & PROJFLAG_STICK)
-		self.movetype = MOVETYPE_NONE;
-
-	if (self.fireflag & FIREFLAG_HOOK)
-	{
-	   self.state = 1;
-	   self.nextthink = time;
-	   self.touch = SUB_Null;
-	   self.velocity = '0 0 0';
-	   self.movetype = MOVETYPE_NONE;
-	   self.rope_length = -1;
-	   return;
-	}
-		
-	if (self.owner)
-	{
-		if (other == self.owner)
-			return;
-		self.owner = world;
-	}
-	if (other.solid == SOLID_SLIDEBOX)
-	if (self.projflag & (PROJFLAG_CHARACTERIMPACT | PROJFLAG_ANYIMPACT))
-	{
-		self.th_die();
-		return;
-	}
-	if (self.projflag & PROJFLAG_RICOCHET)
-	{
-		//if (vlen(self.velocity - self.oldvelocity) >= vlen(self.oldvelocity) * 0.02)
-		traceline(self.origin, self.origin + self.velocity, FALSE, self);
-		if (trace_plane_normal * normalize(self.velocity) < -0.3)
-		{
-			//bprint("1\n");
-			self.th_die();
-			return;
-		}
-	}
-	else if (self.projflag & PROJFLAG_ANYIMPACT)
-	{
-		self.th_die();
-		return;
-	}
-	if (self.noise1 != "")
-		sound(self, CHAN_BODY, self.noise1, 1, ATTN_NORM); // templeofnoise: CHAN_BODY instead auto, bounces must override.
-};
-
-void() projectile_think =
-{
-	//self.oldvelocity = self.velocity;
-	self.nextthink = time;
-	if (time > self.cnt)
-	{
-		other = world;
-		self.th_die();
-		return;
-	}
-	if (self.projflag & PROJFLAG_LASERGUIDED)
-	{
-	    float velspeed,turnrate;
-		vector desireddir, olddir, newdir;
-		
-		makevectors(self.realowner.v_angle);
-		traceline(self.origin, self.realowner.origin + self.view_ofs + v_forward * 5000, FALSE, self);
-		
-		velspeed = vlen(self.velocity);
-		turnrate = 0.65; //cvar("g_balance_rocketlauncher_laserguided_turnrate");//0.65;						// how fast to turn
-		desireddir = normalize(trace_endpos - self.origin);		// get direction from my position to the laser target
-		olddir = normalize(self.velocity);					// get my current direction
-		newdir = normalize((olddir + desireddir * turnrate) * 0.5);	// take the average of the 2 directions; not the best method but simple & easy
-		self.velocity = newdir * velspeed;					// make me fly in the new direction at my flight speed
-		self.angles = vectoangles(self.velocity);			// turn model in the new flight direction
-	}
-	if (self.projflag & PROJFLAG_REMOTEDETONATE)
-	{
-	    if (self.realowner.button4)
-		{
-		   self.th_die();
-		}
-	}
-	if (self.fireflag & FIREFLAG_HOOK)
-	{
-	   	float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
-	 	vector dir, org, end;
-		makevectors(self.owner.v_angle);
-		org = self.owner.origin + self.owner.view_ofs + v_forward * 8 - v_right * 8 + v_up * -12;
-		if(self.rope_length < 0)
-							self.rope_length = vlen(org - self.origin);
-							
-		if(self.state == 1)
-		{
-		 	pullspeed = cvar("g_grapplehook_speed_pull");
-			rubberforce = cvar("g_grapplehook_force_rubber");
-			rubberforce_overstretch = cvar("g_grapplehook_force_rubber_overstretch");
-			minlength = cvar("g_grapplehook_length_min");
-			ropestretch = cvar("g_grapplehook_stretch");
-			ropeairfriction = cvar("g_grapplehook_airfriction");
-		
-			dir = self.origin - org;
-			dist = vlen(dir);
-			dir = normalize(dir);
-		
-			newlength = self.rope_length;
-
-			// first pull the rope...
-			newlength = max(newlength - pullspeed * frametime, minlength);
-
-			if(newlength < dist - ropestretch) // overstretched?
-			{
-				newlength = dist - ropestretch;
-				if(self.owner.velocity * dir < 0) // only if not already moving in hook direction
-					self.owner.velocity = self.owner.velocity + frametime * dir * rubberforce_overstretch;
-			}
-
-			if(!self.owner.button5) // crouch key = don't pull
-				self.rope_length = newlength;
-
-			// then pull the player
-			spd = bound(0, (dist - self.rope_length) / ropestretch, 1);
-			self.owner.velocity = self.owner.velocity * (1 - frametime * ropeairfriction);
-			self.owner.velocity = self.owner.velocity + frametime * dir * spd * rubberforce;
-		}
-		
-		makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0');
-		te_beam(self, self.origin + v_forward * (-9), org);
-	}
-}
-
-void(string modelname, vector shotorg, vector shotvel, vector damage, float damagtype, float lifetime, float PROJFLAGs, float FIREFLAGs, float EXPLFLAGs, string firesound, string explodesound, string bouncesound, float tracer, string tracermodel, float modelscale, float projhealth, float projmass, vector projcolormod) weapon_fireprojectile =
-{
-	local float r; // templeofnoise
-	
- 	newmis = spawn();
- 	newmis.classname = "projectile";
- 	newmis.solid = SOLID_BBOX;
- 	newmis.movetype = MOVETYPE_BOUNCE;
- 	newmis.damagetype = damagtype;
- 	newmis.damageinfo = damage;
-	shotvel = v_forward * shotvel_x + v_up * shotvel_y + shotvel_z * randomvec();
-	newmis.velocity = shotvel;
-	//newmis.avelocity = avel;
- 	newmis.angles = vectoangles(shotvel);
- 	newmis.th_die = projectile_die;
-	newmis.th_pain = projectile_pain;
- 	newmis.touch = projectile_touch;
- 	newmis.think = projectile_think;
- 	newmis.nextthink = time;
- 	newmis.cnt = time + lifetime;
-	
- 	newmis.projflag = PROJFLAGs;
- 	newmis.fireflag = FIREFLAGs;
- 	newmis.explflag = EXPLFLAGs;
-	
- 	newmis.noise = explodesound;
- 	newmis.noise1 = bouncesound;
- 	newmis.owner = self; // initially same as realowner, cleared on first bounce so that it can hit owner
- 	newmis.realowner = self; // who owns this projectile
- 	setorigin(newmis, shotorg);
- 	setmodel(newmis, modelname);
- 	setsize(newmis, '0 0 0', '0 0 0');
-	newmis.scale = modelscale;
-	newmis.colormod = projcolormod;
-	newmis.health = projhealth;
-	newmis.mass = projmass;
-	if (newmis.health > 0)
-	{
-	   newmis.takedamage = DAMAGE_YES;
-	}
-
-	if (tracer > random())
-	{
-	   fire_tracer(tracermodel,shotvel,shotorg);
-	}
-	
-	if (firesound == "weapons/minigun_bulletfire1.wav") // templeofnoise: not so elegant checking a "string", FIXME with weapon check.
-	{
-		if (self.weaponsound_cycle == 0)
-		{
-			firesound = "weapons/minigun_bulletfire1.wav"; // templeofnoise
-			self.weaponsound_cycle = 1; // templeofnoise
-			sound(self, CHAN_WEAPON2, "weapons/minigun_whirlstart.wav", 0.5, ATTN_NORM); // templeofnoise
-		}
-		else if (self.weaponsound_cycle == 1)			// templeofnoise
-		{
-			firesound = "weapons/minigun_bulletfire2.wav"; // templeofnoise
-			self.weaponsound_cycle = 2; 				// templeofnoise
-		}
-		else if (self.weaponsound_cycle == 2)			// templeofnoise
-		{
-			firesound = "weapons/minigun_bulletfire3.wav"; // templeofnoise
-			self.weaponsound_cycle = 3; 				// templeofnoise
-		}
-		else if (self.weaponsound_cycle == 3)			// templeofnoise
-		{
-			firesound = "weapons/minigun_bulletfire4.wav"; // templeofnoise
-			self.weaponsound_cycle = 4; 				// templeofnoise
-		}
-		else if (self.weaponsound_cycle == 4)			// templeofnoise
-		{
-			firesound = "weapons/minigun_bulletfire1.wav"; // templeofnoise
-			self.weaponsound_cycle = 1; 				// templeofnoise
-		}
-
-		newmis.weaponsound_cycle = self.weaponsound_cycle; // templeofnoise
-	}
-	else if (firesound == "weapons/assaultrailgun_bulletfire1.wav") // templeofnoise: not so elegant checking a "string", FIXME with weapon check.
-	{
-		r = random(); // templeofnoise
-		if ((self.weaponsound_cycle == 0) || (self.weaponsound_cycle == 7)) // templeofnoise .. random, BUT NOT repeating last sound.
-		{
-			if (r < 0.5)
-			{
-				firesound = "weapons/assaultrailgun_bulletfire1.wav"; // templeofnoise
-				self.weaponsound_cycle = 5; 					// templeofnoise
-			}
-			else
-			{
-				firesound = "weapons/assaultrailgun_bulletfire2.wav"; // templeofnoise
-				self.weaponsound_cycle = 6; 					// templeofnoise
-			}
-		}
-		else if (self.weaponsound_cycle == 5)		// templeofnoise .. random, BUT NOT repeating last sound.
-		{
-			if (r < 0.5)
-			{
-				firesound = "weapons/assaultrailgun_bulletfire3.wav"; // templeofnoise
-				self.weaponsound_cycle = 7; 					// templeofnoise
-			}
-			else
-			{
-				firesound = "weapons/assaultrailgun_bulletfire2.wav"; // templeofnoise
-				self.weaponsound_cycle = 6; 					// templeofnoise
-			}
-		}
-		else if (self.weaponsound_cycle == 6)		// templeofnoise .. random, BUT NOT repeating last sound.
-		{
-			if (r < 0.5)
-			{
-				firesound = "weapons/assaultrailgun_bulletfire1.wav"; // templeofnoise
-				self.weaponsound_cycle = 5; 					// templeofnoise
-			}
-			else
-			{
-				firesound = "weapons/assaultrailgun_bulletfire3.wav"; // templeofnoise
-				self.weaponsound_cycle = 7; 					// templeofnoise
-			}
-		}
-		newmis.weaponsound_cycle = 2; // templeofnoise
-	}
-
-	sound(self, CHAN_WEAPON, firesound, 1, ATTN_NORM); // templeofnoise: 1) CHAN_WEAPON instead voice, selfexpl 2)"self", not "newmis" for spawner .. prevent wrong locations and sound overflow.
-
-	if (FIREFLAGs & FIREFLAG_HOOK)
-	{
-	    self.hook = newmis;
-		newmis.state = 0;
-	}
-	
-	if (FIREFLAGs & FIREFLAG_MUZZLEFLASH)
-		te_smallflash(shotorg);
-	if (PROJFLAGs & PROJFLAG_ROCKET)
-		newmis.movetype = MOVETYPE_BOUNCEMISSILE;
-	if (PROJFLAGs & PROJFLAG_GLOW)
-		newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_NOSHADOW; // | EF_BRIGHTFIELD; Add once Zymotic gamemode has support for this
-};
-
-
+
+float ACTOR_SHIELD_REGENDELAY = 0.5;
+.float armorregentime;
+.float armorregenplaysound;
+.float armorregenrate;
+.float armorregenmax;
+.float gibhealth;
+.float paintake;
+.void() th_gib;
+
+float DAMAGETYPE_UNKNOWN = 0;
+float DAMAGETYPE_FALL = 1;
+float DAMAGETYPE_WEAP1 = 2;
+float DAMAGETYPE_WEAP2 = 3;
+float DAMAGETYPE_WEAP3 = 4;
+float DAMAGETYPE_WEAP4 = 5;
+float DAMAGETYPE_WEAP5 = 6;
+float DAMAGETYPE_WEAP6 = 7;
+
+void(entity targ, entity attacker, float damagetype, float gibbed) PrintObituary =
+{
+	local float r;
+	local string m1;
+	local string m2;
+	local string m3;
+	local string m4;
+	if (targ.classname != "player")
+		return;
+	r = random();
+	m1 = "";
+	m2 = "";
+	m3 = "";
+	m4 = "";
+	if (targ == attacker)
+	{
+		m1 = targ.netname;
+		m2 = " became bored with life";
+	}
+	else if (teamplay && targ.team == attacker.team)
+	{
+		if (gibbed)
+		{
+			m1 = targ.netname;
+			m2 = " was destroyed by teammate ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+		else
+		{
+			m1 = targ.netname;
+			m2 = " was gunned down by teammate ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+	}
+	else if (damagetype == DAMAGETYPE_UNKNOWN)
+	{
+		m1 = targ.netname;
+		m2 = " died";
+	}
+	else if (damagetype == DAMAGETYPE_FALL)
+	{
+		m1 = targ.netname;
+		m2 = " met a flat world";
+	}
+	else if (damagetype == DAMAGETYPE_WEAP1)
+	{
+		m1 = targ.netname;
+		m2 = " now sports a new hole from ";
+		m3 = attacker.netname;
+		m4 = "";
+	}
+	else if (damagetype == DAMAGETYPE_WEAP2)
+	{
+		if (gibbed)
+		{
+			if (r < 0.33)
+			{
+				m1 = targ.netname;
+				m2 = " was disintegrated by ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+			else if (r < 0.66)
+			{
+				m1 = targ.netname;
+				m2 = " was vaporized by ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+			else
+			{
+				m1 = targ.netname;
+				m2 = " was melted by ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+		}
+		else
+		{
+			if (r < 0.25)
+			{
+				m1 = targ.netname;
+				m2 = " was singed by ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+			else if (r < 0.50)
+			{
+				m1 = targ.netname;
+				m2 = " was splashed by ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+			else if (r < 0.75)
+			{
+				m1 = targ.netname;
+				m2 = " bathed in plasma from ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+			else
+			{
+				m1 = targ.netname;
+				m2 = " was schooled in plasma dynamics by ";
+				m3 = attacker.netname;
+				m4 = "";
+			}
+		}
+	}
+	else if (damagetype == DAMAGETYPE_WEAP3)
+	{
+		if (r < 0.50)
+		{
+			m1 = targ.netname;
+			m2 = " was riddled with bullets from ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+		else if (r < 0.75)
+		{
+			m1 = targ.netname;
+			m2 = " was redecorated by ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+		else
+		{
+			m1 = targ.netname;
+			m2 = " was schooled in the minigun by ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+	}
+	else if (damagetype == DAMAGETYPE_WEAP4)
+	{
+		if (gibbed)
+		{
+			m1 = targ.netname;
+			m2 = " was blown apart by a volley from ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+		else
+		{
+			m1 = targ.netname;
+			m2 = " met a swarm of missiles from ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+	}
+	else if (damagetype == DAMAGETYPE_WEAP5)
+	{
+		if (gibbed)
+		{
+			m1 = targ.netname;
+			m2 = " was obliterated by ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+		else
+		{
+			m1 = targ.netname;
+			m2 = " blown into the afterlife by ";
+			m3 = attacker.netname;
+			m4 = "";
+		}
+	}
+	else if (damagetype == DAMAGETYPE_WEAP6)
+	{
+		m1 = targ.netname;
+		m2 = " was rendered absolutely dead by ";
+		m3 = attacker.netname;
+		m4 = "'s plasma railgun";
+	}
+	else
+	{
+		m1 = targ.netname;
+		m2 = " died from an unknown damagetype";
+	}
+	bprint(m1, m2, m3, m4, "\n");
+}
+
+void(entity targ, entity inflictor, entity attacker, float damagetype, float damage, vector location, vector force) T_Damage =
+{
+	local entity oldself;
+	local float save;
+	local float take;
+	local vector v;
+	if (!targ.takedamage)
+		return;
+	oldself = self;
+	self = targ;
+	
+	//bprint(vtos(self.velocity), " ");
+	//bprint(" ", vtos(force));
+	//bprint("/", ftos(self.mass));
+	v = force * (1 / self.mass);
+	//bprint("=", vtos(v), " ");
+	if (vlen(v) >= 0.1)
+	{
+		self.velocity = self.velocity + force * (1 / self.mass);
+		self.flags = self.flags - (self.flags & FL_ONGROUND);
+	}
+	//bprint(vtos(force), "\n");
+	
+	// save is how much was blocked by the target's armor or shield (if any)
+	save = min(self.armorvalue, damage * self.armortype);
+	take = damage - save;
+	if (!(self.flags & FL_GODMODE))
+	{
+		self.armorvalue = self.armorvalue - save;
+		self.health = self.health - take;
+		self.armorregentime = max(self.armorregentime, time + ACTOR_SHIELD_REGENDELAY);
+		self.armorregenplaysound = TRUE;
+	}
+	if (self.bloodtype == 1)
+	{
+		te_blood(location, force, take);
+		te_blood(location, force, save);
+	}
+	
+	/*
+	if (self.entitytype == ETYPE_HUMAN)
+	{
+		if (take >= 1)
+			te_blood(location, force, take);
+		if (save >= 1)
+			te_spark(location, '0 0 0' - force, save);
+	}
+	else if (self.entitytype == ETYPE_MECHANICAL)
+	*/
+	{
+		//if (damage >= 1)
+		//	te_spark(location, '0 0 0' - force, damage);
+		//if (damage >= 1)
+	}
+	if (self.deadflag == DEAD_NO)
+	{
+		if (self.health < self.gibhealth && self.th_gib)
+		{
+			PrintObituary(self, attacker, damagetype, TRUE);
+			self.deadflag = DEAD_DEAD;
+			self.solid = SOLID_CORPSE;
+			self.th_gib();
+		}
+		else if (self.health <= 0)
+		{
+			PrintObituary(self, attacker, damagetype, FALSE);
+			self.deadflag = DEAD_DYING;
+			self.solid = SOLID_CORPSE;
+			self.th_die();
+		}
+		else
+			self.th_pain(attacker, damage);
+	}
+	else if (self.deadflag == DEAD_DYING || self.deadflag == DEAD_DEAD)
+	{
+		if (self.health < self.gibhealth && self.th_gib)
+			self.th_gib();
+	}
+	//self.th_damage(inflictor, attacker, damagetype, damage, location, force);
+	self = oldself;
+};
+
+void(entity inflictor, entity attacker, float damagetype, vector damage, vector org) T_RadiusDamage =
+{
+	local float blastintensity, dist;
+	local vector nearest, force;
+	local entity ent, next;
+	//bprint(vtos(damage));
+	//bprint(": ");
+	ent = findradius(org, damage_z + 1);
+	while (ent)
+	{
+		next = ent.chain;
+		if (ent.takedamage)
+		if (ent != inflictor)
+		{
+			nearest_x = bound(ent.absmin_x, org_x, ent.absmax_x);
+			nearest_y = bound(ent.absmin_y, org_y, ent.absmax_y);
+			nearest_z = bound(ent.absmin_z, org_z, ent.absmax_z);
+			dist = vlen(nearest - org);
+			//bprint(etos(ent));
+			//bprint(":");
+			//bprint(ftos(dist));
+			//bprint(":");
+			if (dist < 0.1)
+				blastintensity = 1;
+			else if (damage_z > 0)
+				blastintensity = 1 - (dist / damage_z);
+			else
+				blastintensity = 0;
+			//bprint(ftos(blastintensity));
+			//bprint(" ");
+			if (blastintensity > 0)
+			{
+				force = normalize((ent.absmin + ent.absmax) * 0.5 - org) * (blastintensity * damage_y);
+				T_Damage(ent, inflictor, attacker, damagetype, blastintensity * damage_x, org, force);
+			}
+		}
+		ent = next;
+	}
+	//bprint("\n");
+};
+
+
+entity newmis;
+.entity realowner;
+.float damagetype;
+.vector damageinfo;
+
+float PROJFLAG_ANYIMPACT = 1;
+float PROJFLAG_CHARACTERIMPACT = 2;
+float PROJFLAG_RICOCHET = 4;
+float PROJFLAG_ROCKET = 8;
+float PROJFLAG_GLOW = 32;
+float PROJFLAG_STICK = 64;
+float PROJFLAG_LASERGUIDED = 128;
+float PROJFLAG_REMOTEDETONATE = 256;
+
+float FIREFLAG_MUZZLEFLASH = 1;
+float FIREFLAG_SEMIAUTOMATIC = 2;
+float FIREFLAG_ZOOM = 4;
+float FIREFLAG_HOOK = 8;
+float FIREFLAG_JETPACK = 16;
+
+float EXPLFLAG_EXPLODE = 1;
+float EXPLFLAG_EXPLODELARGE = 2;
+float EXPLFLAG_SNIPERRAIL = 4;
+float EXPLFLAG_PLASMA = 8;
+float EXPLFLAG_ASSAULTRAIL = 16;
+float EXPLFLAG_ELECTRICITY = 32;
+
+.float weaponsound_cycle; // templeofnoise: added for minigun routing sound, guess i'll use it for other sound specs also.
+
+void(string tracermodel, vector dir, vector org) fire_tracer =
+{
+ 	local entity e;
+	e = spawn();
+	e.owner = self;
+	e.movetype = MOVETYPE_FLY;
+	e.solid = SOLID_BBOX;
+	e.think = SUB_Remove;
+	e.touch = SUB_Remove;
+	e.nextthink = time + 10;
+	e.velocity = dir;
+	e.angles = vectoangles(e.velocity);
+	setmodel (e, tracermodel);
+	setorigin (e, org);
+	setsize(e, '0 0 0', '0 0 0');
+	//e.lefty = 17;
+}
+
+void(entity attacker, float damage) projectile_pain =
+{
+	if (self.projflag  & PROJFLAG_STICK)
+	{
+		self.movetype = MOVETYPE_BOUNCE;
+		self.projflag = self.projflag - PROJFLAG_STICK;
+	}
+}
+
+void() projectile_die =
+{
+
+	local float r; // templeofnoise
+
+	if (self.weaponsound_cycle) // templeofnoise
+	{
+		r = random() ;
+		if (self.weaponsound_cycle == 2) // templeofnoise: limiting to 1/4
+		{
+			if (r < 0.1) self.noise = "weapons/bullet_ric1.wav"; // templeofnoise
+			else if (r < 0.2) self.noise = "weapons/bullet_ric2.wav"; // templeofnoise
+			else if (r < 0.3) self.noise = "weapons/bullet_ric3.wav"; // templeofnoise
+			else if (r < 0.4) self.noise = "weapons/bullet_ric4.wav"; // templeofnoise
+			else self.noise = ""; // templeofnoise: limiting again
+
+			if (self.noise != "") sound(self, CHAN_BODY, self.noise, 0.1, ATTN_NORM); // templeofnoise
+		}
+	}
+	else sound(self, CHAN_BODY, self.noise, 1, ATTN_NORM); // templeofnoise
+
+	if (self.damageinfo_z > 0)
+		T_RadiusDamage(self, self.realowner, self.damagetype, self.damageinfo, self.origin);
+	else if (other != world)
+		T_Damage(other, self, self.realowner, self.damagetype, self.damageinfo_x, self.origin, normalize(self.velocity) * self.damageinfo_y);
+	self.takedamage = DAMAGE_NO;
+	if (self.explflag & EXPLFLAG_EXPLODELARGE)
+	{
+		// LordHavoc: TE_TEI_BIGEXPLOSION
+		WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
+		WriteByte (MSG_BROADCAST, 78);
+		WriteCoord (MSG_BROADCAST, self.origin_x);
+		WriteCoord (MSG_BROADCAST, self.origin_y);
+		WriteCoord (MSG_BROADCAST, self.origin_z);
+		
+		remove(self);
+	}
+	else if (self.explflag & EXPLFLAG_EXPLODE)
+	{
+		te_explosion(self.origin);
+		remove(self);
+	}
+	else if (self.explflag & EXPLFLAG_SNIPERRAIL)
+	{
+		te_plasmaburn(self.origin);
+		remove(self);
+	}
+	else if (self.explflag & EXPLFLAG_ELECTRICITY)
+	{
+		WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
+		WriteByte (MSG_BROADCAST, 79);
+		WriteCoord (MSG_BROADCAST, self.origin_x);
+		WriteCoord (MSG_BROADCAST, self.origin_y);
+		WriteCoord (MSG_BROADCAST, self.origin_z);
+		WriteCoord (MSG_BROADCAST, 0);
+		WriteCoord (MSG_BROADCAST, 0);
+		WriteCoord (MSG_BROADCAST, 0);
+		WriteByte (MSG_BROADCAST, 155);
+		remove(self);
+	}
+	else if (self.explflag & EXPLFLAG_PLASMA)
+	{
+		te_knightspike(self.origin);
+		remove(self);
+	}
+	else if (self.explflag & EXPLFLAG_ASSAULTRAIL)
+	{
+		te_gunshotquad(self.origin);
+		remove(self);
+	}
+	else // metal projectile of some sort (bullet, shrapnel, railgun bolt, etc)
+	{
+		te_gunshot(self.origin);
+		remove(self);
+	}
+};
+
+//.vector oldvelocity;
+void() projectile_touch =
+{
+	if (self.projflag  & PROJFLAG_STICK)
+		self.movetype = MOVETYPE_NONE;
+
+	if (self.fireflag & FIREFLAG_HOOK)
+	{
+	   self.state = 1;
+	   self.nextthink = time;
+	   self.touch = SUB_Null;
+	   self.velocity = '0 0 0';
+	   self.movetype = MOVETYPE_NONE;
+	   self.rope_length = -1;
+	   return;
+	}
+		
+	if (self.owner)
+	{
+		if (other == self.owner)
+			return;
+		self.owner = world;
+	}
+	if (other.solid == SOLID_SLIDEBOX)
+	if (self.projflag & (PROJFLAG_CHARACTERIMPACT | PROJFLAG_ANYIMPACT))
+	{
+		self.th_die();
+		return;
+	}
+	if (self.projflag & PROJFLAG_RICOCHET)
+	{
+		//if (vlen(self.velocity - self.oldvelocity) >= vlen(self.oldvelocity) * 0.02)
+		traceline(self.origin, self.origin + self.velocity, FALSE, self);
+		if (trace_plane_normal * normalize(self.velocity) < -0.3)
+		{
+			//bprint("1\n");
+			self.th_die();
+			return;
+		}
+	}
+	else if (self.projflag & PROJFLAG_ANYIMPACT)
+	{
+		self.th_die();
+		return;
+	}
+	if (self.noise1 != "")
+		sound(self, CHAN_BODY, self.noise1, 1, ATTN_NORM); // templeofnoise: CHAN_BODY instead auto, bounces must override.
+};
+
+void() projectile_think =
+{
+	//self.oldvelocity = self.velocity;
+	self.nextthink = time;
+	if (time > self.cnt)
+	{
+		other = world;
+		self.th_die();
+		return;
+	}
+	if (self.projflag & PROJFLAG_LASERGUIDED)
+	{
+	    float velspeed,turnrate;
+		vector desireddir, olddir, newdir;
+		
+		makevectors(self.realowner.v_angle);
+		traceline(self.origin, self.realowner.origin + self.view_ofs + v_forward * 5000, FALSE, self);
+		
+		velspeed = vlen(self.velocity);
+		turnrate = 0.65; //cvar("g_balance_rocketlauncher_laserguided_turnrate");//0.65;						// how fast to turn
+		desireddir = normalize(trace_endpos - self.origin);		// get direction from my position to the laser target
+		olddir = normalize(self.velocity);					// get my current direction
+		newdir = normalize((olddir + desireddir * turnrate) * 0.5);	// take the average of the 2 directions; not the best method but simple & easy
+		self.velocity = newdir * velspeed;					// make me fly in the new direction at my flight speed
+		self.angles = vectoangles(self.velocity);			// turn model in the new flight direction
+	}
+	if (self.projflag & PROJFLAG_REMOTEDETONATE)
+	{
+	    if (self.realowner.button4)
+		{
+		   self.th_die();
+		}
+	}
+	if (self.fireflag & FIREFLAG_HOOK)
+	{
+	   	float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
+	 	vector dir, org, end;
+		makevectors(self.owner.v_angle);
+		org = self.owner.origin + self.owner.view_ofs + v_forward * 8 - v_right * 8 + v_up * -12;
+		if(self.rope_length < 0)
+							self.rope_length = vlen(org - self.origin);
+							
+		if(self.state == 1)
+		{
+		 	pullspeed = cvar("g_grapplehook_speed_pull");
+			rubberforce = cvar("g_grapplehook_force_rubber");
+			rubberforce_overstretch = cvar("g_grapplehook_force_rubber_overstretch");
+			minlength = cvar("g_grapplehook_length_min");
+			ropestretch = cvar("g_grapplehook_stretch");
+			ropeairfriction = cvar("g_grapplehook_airfriction");
+		
+			dir = self.origin - org;
+			dist = vlen(dir);
+			dir = normalize(dir);
+		
+			newlength = self.rope_length;
+
+			// first pull the rope...
+			newlength = max(newlength - pullspeed * frametime, minlength);
+
+			if(newlength < dist - ropestretch) // overstretched?
+			{
+				newlength = dist - ropestretch;
+				if(self.owner.velocity * dir < 0) // only if not already moving in hook direction
+					self.owner.velocity = self.owner.velocity + frametime * dir * rubberforce_overstretch;
+			}
+
+			if(!self.owner.button5) // crouch key = don't pull
+				self.rope_length = newlength;
+
+			// then pull the player
+			spd = bound(0, (dist - self.rope_length) / ropestretch, 1);
+			self.owner.velocity = self.owner.velocity * (1 - frametime * ropeairfriction);
+			self.owner.velocity = self.owner.velocity + frametime * dir * spd * rubberforce;
+		}
+		
+		makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0');
+		te_beam(self, self.origin + v_forward * (-9), org);
+	}
+}
+
+void(string modelname, vector shotorg, vector shotvel, vector damage, float damagtype, float lifetime, float PROJFLAGs, float FIREFLAGs, float EXPLFLAGs, string firesound, string explodesound, string bouncesound, float tracer, string tracermodel, float modelscale, float projhealth, float projmass, vector projcolormod) weapon_fireprojectile =
+{
+	local float r; // templeofnoise
+	
+ 	newmis = spawn();
+ 	newmis.classname = "projectile";
+ 	newmis.solid = SOLID_BBOX;
+ 	newmis.movetype = MOVETYPE_BOUNCE;
+ 	newmis.damagetype = damagtype;
+ 	newmis.damageinfo = damage;
+	shotvel = v_forward * shotvel_x + v_up * shotvel_y + shotvel_z * randomvec();
+	newmis.velocity = shotvel;
+	//newmis.avelocity = avel;
+ 	newmis.angles = vectoangles(shotvel);
+ 	newmis.th_die = projectile_die;
+	newmis.th_pain = projectile_pain;
+ 	newmis.touch = projectile_touch;
+ 	newmis.think = projectile_think;
+ 	newmis.nextthink = time;
+ 	newmis.cnt = time + lifetime;
+	
+ 	newmis.projflag = PROJFLAGs;
+ 	newmis.fireflag = FIREFLAGs;
+ 	newmis.explflag = EXPLFLAGs;
+	
+ 	newmis.noise = explodesound;
+ 	newmis.noise1 = bouncesound;
+ 	newmis.owner = self; // initially same as realowner, cleared on first bounce so that it can hit owner
+ 	newmis.realowner = self; // who owns this projectile
+ 	setorigin(newmis, shotorg);
+ 	setmodel(newmis, modelname);
+ 	setsize(newmis, '0 0 0', '0 0 0');
+	newmis.scale = modelscale;
+	newmis.colormod = projcolormod;
+	newmis.health = projhealth;
+	newmis.mass = projmass;
+	if (newmis.health > 0)
+	{
+	   newmis.takedamage = DAMAGE_YES;
+	}
+
+	if (tracer > random())
+	{
+	   fire_tracer(tracermodel,shotvel,shotorg);
+	}
+	
+	if (firesound == "weapons/minigun_bulletfire1.wav") // templeofnoise: not so elegant checking a "string", FIXME with weapon check.
+	{
+		if (self.weaponsound_cycle == 0)
+		{
+			firesound = "weapons/minigun_bulletfire1.wav"; // templeofnoise
+			self.weaponsound_cycle = 1; // templeofnoise
+			sound(self, CHAN_WEAPON2, "weapons/minigun_whirlstart.wav", 0.5, ATTN_NORM); // templeofnoise
+		}
+		else if (self.weaponsound_cycle == 1)			// templeofnoise
+		{
+			firesound = "weapons/minigun_bulletfire2.wav"; // templeofnoise
+			self.weaponsound_cycle = 2; 				// templeofnoise
+		}
+		else if (self.weaponsound_cycle == 2)			// templeofnoise
+		{
+			firesound = "weapons/minigun_bulletfire3.wav"; // templeofnoise
+			self.weaponsound_cycle = 3; 				// templeofnoise
+		}
+		else if (self.weaponsound_cycle == 3)			// templeofnoise
+		{
+			firesound = "weapons/minigun_bulletfire4.wav"; // templeofnoise
+			self.weaponsound_cycle = 4; 				// templeofnoise
+		}
+		else if (self.weaponsound_cycle == 4)			// templeofnoise
+		{
+			firesound = "weapons/minigun_bulletfire1.wav"; // templeofnoise
+			self.weaponsound_cycle = 1; 				// templeofnoise
+		}
+
+		newmis.weaponsound_cycle = self.weaponsound_cycle; // templeofnoise
+	}
+	else if (firesound == "weapons/assaultrailgun_bulletfire1.wav") // templeofnoise: not so elegant checking a "string", FIXME with weapon check.
+	{
+		r = random(); // templeofnoise
+		if ((self.weaponsound_cycle == 0) || (self.weaponsound_cycle == 7)) // templeofnoise .. random, BUT NOT repeating last sound.
+		{
+			if (r < 0.5)
+			{
+				firesound = "weapons/assaultrailgun_bulletfire1.wav"; // templeofnoise
+				self.weaponsound_cycle = 5; 					// templeofnoise
+			}
+			else
+			{
+				firesound = "weapons/assaultrailgun_bulletfire2.wav"; // templeofnoise
+				self.weaponsound_cycle = 6; 					// templeofnoise
+			}
+		}
+		else if (self.weaponsound_cycle == 5)		// templeofnoise .. random, BUT NOT repeating last sound.
+		{
+			if (r < 0.5)
+			{
+				firesound = "weapons/assaultrailgun_bulletfire3.wav"; // templeofnoise
+				self.weaponsound_cycle = 7; 					// templeofnoise
+			}
+			else
+			{
+				firesound = "weapons/assaultrailgun_bulletfire2.wav"; // templeofnoise
+				self.weaponsound_cycle = 6; 					// templeofnoise
+			}
+		}
+		else if (self.weaponsound_cycle == 6)		// templeofnoise .. random, BUT NOT repeating last sound.
+		{
+			if (r < 0.5)
+			{
+				firesound = "weapons/assaultrailgun_bulletfire1.wav"; // templeofnoise
+				self.weaponsound_cycle = 5; 					// templeofnoise
+			}
+			else
+			{
+				firesound = "weapons/assaultrailgun_bulletfire3.wav"; // templeofnoise
+				self.weaponsound_cycle = 7; 					// templeofnoise
+			}
+		}
+		newmis.weaponsound_cycle = 2; // templeofnoise
+	}
+
+	sound(self, CHAN_WEAPON, firesound, 1, ATTN_NORM); // templeofnoise: 1) CHAN_WEAPON instead voice, selfexpl 2)"self", not "newmis" for spawner .. prevent wrong locations and sound overflow.
+
+	if (FIREFLAGs & FIREFLAG_HOOK)
+	{
+	    self.hook = newmis;
+		newmis.state = 0;
+	}
+	
+	if (FIREFLAGs & FIREFLAG_MUZZLEFLASH)
+		te_smallflash(shotorg);
+	if (PROJFLAGs & PROJFLAG_ROCKET)
+		newmis.movetype = MOVETYPE_BOUNCEMISSILE;
+	if (PROJFLAGs & PROJFLAG_GLOW)
+		newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_NOSHADOW; // | EF_BRIGHTFIELD; Add once Zymotic gamemode has support for this
+};
+
+


Property changes on: trunk/basezym/progsqc/damage.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/decors.qc
===================================================================
--- trunk/basezym/progsqc/decors.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/decors.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,31 +1,31 @@
-
-void() decor_disappear =
-{
-	self.model = "";
-	self.effects = 0;
-	self.pflags = 0;
-	if (self.classname == "decor")
-		remove(self);
-};
-
-void(entity e, string modelname, vector decormins, vector decormaxs, float scatter) decor_spawn =
-{
-	local vector v;
-	if (!e)
-	{
-		e = spawn();
-		e.classname = "decor";
-	}
-	e.takedamage = FALSE;
-	e.solid = SOLID_TRIGGER;
-	e.movetype = MOVETYPE_BOUNCE;
-	setmodel(e, modelname);
-	setsize(e, decormins, decormaxs);
-	v = randompos(self.mins, self.maxs) + self.origin;
-	setorigin(e, v);
-	e.velocity = self.velocity + randomvec() * scatter;
-	e.think = decor_disappear;
-	e.nextthink = time + random() * 30 + 30;
-};
-
-
+
+void() decor_disappear =
+{
+	self.model = "";
+	self.effects = 0;
+	self.pflags = 0;
+	if (self.classname == "decor")
+		remove(self);
+};
+
+void(entity e, string modelname, vector decormins, vector decormaxs, float scatter) decor_spawn =
+{
+	local vector v;
+	if (!e)
+	{
+		e = spawn();
+		e.classname = "decor";
+	}
+	e.takedamage = FALSE;
+	e.solid = SOLID_TRIGGER;
+	e.movetype = MOVETYPE_BOUNCE;
+	setmodel(e, modelname);
+	setsize(e, decormins, decormaxs);
+	v = randompos(self.mins, self.maxs) + self.origin;
+	setorigin(e, v);
+	e.velocity = self.velocity + randomvec() * scatter;
+	e.think = decor_disappear;
+	e.nextthink = time + random() * 30 + 30;
+};
+
+


Property changes on: trunk/basezym/progsqc/decors.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/defs.qc
===================================================================
--- trunk/basezym/progsqc/defs.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/defs.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,716 +1,716 @@
-
-/*
-==============================================================================
-
-			SOURCE FOR GLOBALVARS_T C STRUCTURE
-
-==============================================================================
-*/
-
-//
-// system globals
-//
-entity		self;
-entity		other;
-entity		world;
-float		time;
-float		frametime;
-
-float		force_retouch;		// force all entities to touch triggers
-								// next frame.  this is needed because
-								// non-moving things don't normally scan
-								// for triggers, and when a trigger is
-								// created (like a teleport trigger), it
-								// needs to catch everything.
-								// decremented each frame, so set to 2
-								// to guarantee everything is touched
-string		mapname;
-
-float		deathmatch;
-float		coop;
-float		teamplay;
-
-float		serverflags;		// propagated from level to level, used to
-								// keep track of completed episodes
-
-float		total_secrets;
-float		total_monsters;
-
-float		found_secrets;		// number of secrets found
-float		killed_monsters;	// number of monsters killed
-
-
-// spawnparms are used to encode information about clients across server
-// level changes
-float		parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
-
-//
-// global variables set by built in functions
-//
-vector		v_forward, v_up, v_right;	// set by makevectors()
-
-// set by traceline / tracebox
-float		trace_allsolid;
-float		trace_startsolid;
-float		trace_fraction;
-vector		trace_endpos;
-vector		trace_plane_normal;
-float		trace_plane_dist;
-entity		trace_ent;
-float		trace_inopen;
-float		trace_inwater;
-
-entity		msg_entity;				// destination of single entity writes
-
-//
-// required prog functions
-//
-void() 		main;						// only for testing
-
-void()		StartFrame;
-
-void() 		PlayerPreThink;
-void() 		PlayerPostThink;
-
-void()		ClientKill;
-void()		ClientConnect;
-void() 		PutClientInServer;		// call after setting the parm1... parms
-void()		ClientDisconnect;
-
-void()		SetNewParms;			// called when a client first connects to
-									// a server. sets parms so they can be
-									// saved off for restarts
-
-void()		SetChangeParms;			// call to set parms for self so they can
-									// be saved for a level transition
-
-
-//================================================
-void		end_sys_globals;		// flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
-			SOURCE FOR ENTVARS_T C STRUCTURE
-
-==============================================================================
-*/
-
-//
-// system fields (*** = do not set in prog code, maintained by C code)
-//
-.float		modelindex;		// *** model index in the precached list
-.vector		absmin, absmax;	// *** origin + mins / maxs
-
-.float		ltime;			// local time for entity
-.float		movetype;
-.float		solid;
-
-.vector		origin;			// ***
-.vector		oldorigin;		// ***
-.vector		velocity;
-.vector		angles;
-.vector		avelocity;
-
-.vector		punchangle;		// temp angle adjust from damage or recoil
-
-.string		classname;		// spawn function
-.string		model;
-.float		frame;
-.float		skin;
-.float		effects;
-
-.vector		mins, maxs;		// bounding box extents reletive to origin
-.vector		size;			// maxs - mins
-
-.void()		touch;
-.void()		use;
-.void()		think;
-.void()		blocked;		// for doors or plats, called when can't push other
-
-.float		nextthink;
-.entity		groundentity;
-
-// stats
-.float		health;
-.float		frags;
-.float          weapon;                 // one of the IT_SHOTGUN, etc flags
-.string		weaponmodel;
-.float		weaponframe;
-.float		currentammo;
-.float          ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
-
-.float		items;			// bit flags
-
-.float		takedamage;
-.entity		chain;
-.float		deadflag;
-
-.vector		view_ofs;			// add to origin to get eye point
-
-
-.float		button0;		// fire
-.float		button1;		// use
-.float		button2;		// jump
-
-.float		impulse;		// weapon changes
-
-.float		fixangle;
-.vector		v_angle;		// view / targeting angle for players
-.float		idealpitch;		// calculated pitch angle for lookup up slopes
-
-
-.string		netname;
-
-.entity 	enemy;
-
-.float		flags;
-
-.float		colormap;
-.float		team;
-
-.float		max_health;		// players maximum health is stored here
-
-.float		teleport_time;	// don't back up
-
-.float		armortype;		// save this fraction of incoming damage
-.float		armorvalue;
-
-.float		waterlevel;		// 0 = not in, 1 = feet, 2 = wast, 3 = eyes
-.float		watertype;		// a contents value
-
-.float		ideal_yaw;
-.float		yaw_speed;
-
-.entity		aiment;
-
-.entity 	goalentity;		// a movetarget or an enemy
-
-.float		spawnflags;
-
-.string		target;
-.string		targetname;
-
-// damage is accumulated through a frame. and sent as one single
-// message, so the super shotgun doesn't generate huge messages
-.float		dmg_take;
-.float		dmg_save;
-.entity		dmg_inflictor;
-
-.entity		owner;		// who launched a missile
-.vector		movedir;	// mostly for doors, but also used for waterjump
-
-.string		message;		// trigger messages
-
-.float		sounds;		// either a cd track number or sound number
-
-.string		noise, noise1, noise2, noise3;	// contains names of wavs to play
-
-//================================================
-void		end_sys_fields;			// flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
-				VARS NOT REFERENCED BY C CODE
-
-==============================================================================
-*/
-
-
-//
-// constants
-//
-
-float   FALSE                           = 0;
-float   TRUE                            = 1;
-
-// edict.flags
-float   FL_FLY                          = 1;
-float   FL_SWIM                         = 2;
-float   FL_CLIENT                       = 8;    // set for all client edicts
-float   FL_INWATER                      = 16;   // for enter / leave water splash
-float   FL_MONSTER                      = 32;
-float   FL_GODMODE                      = 64;   // player cheat
-float   FL_NOTARGET                     = 128;  // player cheat
-float   FL_ITEM                         = 256;  // extra wide size for bonus items
-float   FL_ONGROUND                     = 512;  // standing on something
-float	FL_PARTIALGROUND		= 1024;	// not all corners are valid
-float	FL_WATERJUMP			= 2048;	// player jumping out of water
-float	FL_JUMPRELEASED			= 4096;	// for jump debouncing
-
-// edict.movetype values
-float	MOVETYPE_NONE			= 0;	// never moves
-//float MOVETYPE_ANGLENOCLIP            = 1;
-//float	MOVETYPE_ANGLECLIP		= 2;
-float	MOVETYPE_WALK			= 3;	// players only
-float	MOVETYPE_STEP			= 4;	// discrete, not real time unless fall
-float	MOVETYPE_FLY			= 5;
-float	MOVETYPE_TOSS			= 6;	// gravity
-float	MOVETYPE_PUSH			= 7;	// no clip to world, push and crush
-float	MOVETYPE_NOCLIP			= 8;
-float	MOVETYPE_FLYMISSILE		= 9;	// fly with extra size against monsters
-float	MOVETYPE_BOUNCE			= 10;
-float	MOVETYPE_BOUNCEMISSILE	= 11;
-
-// edict.solid values
-float   SOLID_NOT                       = 0;    // no interaction with other objects
-float	SOLID_TRIGGER			= 1;	// touch on edge, but not blocking
-float   SOLID_BBOX                      = 2;    // touch on edge, block
-float	SOLID_SLIDEBOX			= 3;	// touch on edge, but not an onground
-float   SOLID_BSP                       = 4;    // bsp clip, touch on edge, block
-
-// range values
-float   RANGE_MELEE                     = 0;
-float   RANGE_NEAR                      = 1;
-float   RANGE_MID                       = 2;
-float   RANGE_FAR                       = 3;
-
-// deadflag values
-
-float   DEAD_NO                         = 0; // alive
-float   DEAD_DYING                      = 1; // dying
-float   DEAD_DEAD                       = 2; // dead, waiting for buttons to be released
-float	DEAD_RESPAWNABLE                = 3; // dead, waiting for button to be pressed
-float	DEAD_RESPAWNING                 = 4; // dead, waiting for buttons to be released
-
-// takedamage values
-
-float   DAMAGE_NO                       = 0;
-float   DAMAGE_YES                      = 1;
-float   DAMAGE_AIM                      = 2;
-
-
-
-// items
-// float   IT_AXE                       = 4096;
-// float   IT_SHOTGUN                   = 1;
-// float   IT_SUPER_SHOTGUN             = 2;
-// float   IT_NAILGUN                   = 4;
-// float   IT_SUPER_NAILGUN             = 8;
-// float   IT_GRENADE_LAUNCHER          = 16;
-// float   IT_ROCKET_LAUNCHER           = 32;
-// float   IT_LIGHTNING                 = 64;
-// float   IT_EXTRA_WEAPON              = 128;
-
-float   IT_WEAPON1                      = 4096;
-float   IT_WEAPON2                      = 1;
-float   IT_WEAPON3                      = 2;
-float   IT_WEAPON4                      = 4;
-float   IT_WEAPON5                      = 8;
-float   IT_WEAPON6                      = 16;
-float   IT_WEAPON7                      = 32;
-float   IT_WEAPON8                      = 64;
-float   IT_WEAPON9                      = 128;
-float   IT_WEAPON10                     = 8388608;
-
-float   IT_SHELLS                       = 256;
-float   IT_NAILS                        = 512;
-float   IT_ROCKETS                      = 1024;
-float   IT_CELLS                        = 2048;
-
-float   IT_ARMOR1                       = 8192;
-float   IT_ARMOR2                       = 16384;
-float   IT_ARMOR3                       = 32768;
-float	IT_SUPERHEALTH			= 65536;
-
-float   IT_KEY1                         = 131072;
-float   IT_KEY2                         = 262144;
-
-float   IT_INVISIBILITY                 = 524288;
-float   IT_INVULNERABILITY              = 1048576;
-float   IT_SUIT                         = 2097152;
-float   IT_QUAD                         = 4194304;
-
-// see modecheck.qc for deathmatch and teamplay settings
-
-// point content values
-
-float	CONTENT_EMPTY			= -1;
-float	CONTENT_SOLID			= -2;
-float	CONTENT_WATER			= -3;
-float	CONTENT_SLIME			= -4;
-float	CONTENT_LAVA			= -5;
-float	CONTENT_SKY				= -6;
-
-float	STATE_TOP		= 0;
-float	STATE_BOTTOM	= 1;
-float	STATE_UP		= 2;
-float	STATE_DOWN		= 3;
-
-vector	VEC_ORIGIN = '0 0 0';
-vector	VEC_HULL_MIN = '-16 -16 -24';
-vector	VEC_HULL_MAX = '16 16 32';
-
-vector	VEC_HULL2_MIN = '-32 -32 -24';
-vector	VEC_HULL2_MAX = '32 32 64';
-
-// protocol bytes
-float	SVC_TEMPENTITY		= 23;
-float	SVC_KILLEDMONSTER	= 27;
-float	SVC_FOUNDSECRET		= 28;
-float	SVC_INTERMISSION	= 30;
-float	SVC_FINALE			= 31;
-float	SVC_CDTRACK			= 32;
-float	SVC_SELLSCREEN		= 33;
-
-
-//float   TE_SPIKE                = 0;
-//float   TE_SUPERSPIKE           = 1;
-//float   TE_GUNSHOT              = 2;
-//float   TE_EXPLOSION            = 3;
-//float   TE_TAREXPLOSION         = 4;
-//float   TE_LIGHTNING1           = 5;
-//float   TE_LIGHTNING2           = 6;
-//float   TE_WIZSPIKE             = 7;
-//float   TE_KNIGHTSPIKE          = 8;
-//float   TE_LIGHTNING3           = 9;
-//float   TE_LAVASPLASH           = 10;
-//float   TE_TELEPORT             = 11;
-//float   TE_EXPLOSION2           = 12; // mission pack #2 explosion
-//                                      // takes a color range
-//                                      // 2 bytes:
-//                                      // first color
-//                                      // # of colors in the range
-//float   TE_BEAM                 = 13; // mission pack #2 thing
-//                                      // like TE_LIGHTNING etc,
-//                                      // but uses progs/beam.mdl
-
-// sound channels
-// channel 0 never willingly overrides
-// other channels (1-7) allways override a playing sound on that channel
-float	CHAN_AUTO		= 0;
-float	CHAN_WEAPON		= 1;
-float	CHAN_VOICE		= 2;
-float	CHAN_ITEM		= 3;
-float	CHAN_BODY		= 4;
-
-// added for Dark Places
-float   CHAN_SPEECH             = 5;
-float   CHAN_FOOT               = 6;
-float   CHAN_WEAPON2            = 7;
-
-float	ATTN_NONE		= 0;
-float	ATTN_NORM		= 1;
-float	ATTN_IDLE		= 2;
-float	ATTN_STATIC		= 3;
-
-// update types
-
-float	UPDATE_GENERAL	= 0;
-float	UPDATE_STATIC	= 1;
-float	UPDATE_BINARY	= 2;
-float	UPDATE_TEMP		= 3;
-
-// entity effects
-
-float	EF_BRIGHTFIELD	= 1;
-float	EF_MUZZLEFLASH 	= 2;
-float	EF_BRIGHTLIGHT 	= 4;
-float	EF_DIMLIGHT 	= 8;
-
-
-// messages
-float	MSG_BROADCAST	= 0;		// unreliable to all
-float	MSG_ONE			= 1;		// reliable to one (msg_entity)
-float	MSG_ALL			= 2;		// reliable to all
-float	MSG_INIT		= 3;		// write to the init string
-
-
-//================================================
-
-//
-// globals
-//
-//float	movedist;
-//float	gameover;		// set when a rule exits
-
-//string	string_null;	// null string, nothing should be held here
-//float	empty_float;
-
-entity	newmis;			// launch_spike sets this after spawning it
-
-//entity	activator;		// the entity that activated a trigger or brush
-
-//entity	damage_attacker;	// set by T_Damage
-//float	framecount;
-
-float		skill;
-
-//================================================
-
-//
-// world fields (FIXME: make globals)
-//
-//.string		wad;
-//.string 	map;
-//.float		worldtype;	// 0=medieval 1=metal 2=base
-
-//================================================
-
-//.string		killtarget;
-
-//
-// quakeed fields
-//
-//.float		light_lev;		// not used by game, but parsed by light util
-//.float		style;
-
-
-//
-// monster ai
-//
-//.void()		th_stand;
-//.void()		th_walk;
-//.void()		th_run;
-//.float()	th_missile; // LordHavoc: changed from void() to float(), returns true if attacking
-//.void()		th_melee;
-.void(entity attacker, float damage)		th_pain;
-.void()		th_die;
-
-//.entity		oldenemy;		// mad at this player before taking damage
-
-.float		speed;
-
-.float	lefty;
-
-//.float	search_time;
-//.float	attack_state;
-
-float	AS_STRAIGHT		= 1;
-float	AS_SLIDING		= 2;
-float	AS_MELEE		= 3;
-float	AS_MISSILE		= 4;
-
-// .gravity field added in Quake 1.07 (Scourge of Armagon)
-.float          gravity;
-
-//.float 		attack_finished;
-//.float		pain_finished;
-
-//.float		invincible_finished;
-//.float		invisible_finished;
-//.float		super_damage_finished;
-//.float		radsuit_finished;
-
-//.float		invincible_time, invincible_sound;
-//.float		invisible_time, invisible_sound;
-//.float		super_time, super_sound;
-//.float		rad_time;
-//.float		fly_sound;
-
-//.float		axhitme;
-
-//.float		show_hostile;	// set to time+0.2 whenever a client fires a weapon or takes damage.  Used to alert monsters that otherwise would let the player go
-//.float		jump_flag;		// player jump flag
-//.float		swim_flag;		// player swimming sound flag
-//.float		air_finished;	// when time > air_finished, start drowning
-//.string		deathtype;		// keeps track of how the player died
-//.float		bodyhealth;		// used by corpse code
-//.float		iscorpse;		// used by corpse code
-
-//.vector		dest, dest1, dest2, dest3, dest4, dest5;
-
-
-//.entity		flame;			// the flame burning this thing
-
-//.float		doobits;		// set if this should do obit on death
-
-//.vector bodymins, bodymaxs, headmins, headmaxs;
-
-//.vector		rotate;
-//.string		group;
-
-// counts of how many keys this player/bot has
-//.float		keys_silver;
-//.float		keys_gold;
-
-//.float		havocattack;
-//.float		havocpickup;
-//.float(entity player, entity item) pickupevalfunc; // returns rating for item considering player's condition (don't pick up health if it's not needed, etc)
-//.float		shoulddodge;
-//.float		dangerrating;
-
-// called whenever damage is done, if not supplied there is no visible effect.
-//.void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) bleedfunc;
-
-//
-// object stuff
-//
-//.string		mdl;
-//.vector		mangle;			// angle at start
-
-.vector		oldorigin;		// only used by secret door
-
-//.float		t_length, t_width;
-
-
-//
-// doors, etc
-//
-//.vector		dest, dest1, dest2;
-//.float		wait;			// time from firing to restarting
-//.float		delay;			// time from activation to firing
-//.entity		trigger_field;	// door's trigger entity
-//.string		noise4;
-
-//
-// monsters
-//
-//.float 		pausetime;
-//.entity 	movetarget;
-
-//
-// doors
-//
-//.float		aflag;
-//.float		dmg;			// damage done by door when hit
-
-//
-// misc
-//
-.float		cnt; 			// misc flag
-//.float		cnt2;			// another counter
-//.float		count2;			// yet another count
-
-//
-// subs
-//
-.void()		think1;
-
-//
-// triggers
-//
-//.float		count;			// for counting triggers
-
-
-//
-// plats / doors / buttons
-//
-//.float		lip;
-//.float		state;
-//.vector		pos1, pos2;		// top and bottom positions
-.float		height;
-
-//
-// sounds
-//
-//.float		waitmin, waitmax;
-
-
-
-
-//===========================================================================
-
-
-//
-// builtin functions
-//
-
-void(vector ang)	makevectors		= #1;		// sets v_forward, etc globals
-void(entity e, vector o) setorigin	= #2;
-void(entity e, string m) setmodel	= #3;		// set movetype and solid first
-void(entity e, vector min, vector max) setsize = #4;
-// #5 was removed
-void() break						= #6;
-float() random						= #7;		// returns 0 - 1
-void(entity e, float chan, string samp, float vol, float atten) sound = #8;
-vector(vector v) normalize			= #9;
-void(string e, ...) error				= #10;
-void(string e, ...) objerror				= #11;
-float(vector v) vlen				= #12;
-float(vector v) vectoyaw			= #13;
-entity() spawn						= #14;
-void(entity e) remove				= #15;
-
-// sets trace_* globals
-// nomonsters can be:
-// An entity will also be ignored for testing if forent == test,
-// forent->owner == test, or test->owner == forent
-// a forent of world is ignored
-void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
-
-entity() checkclient				= #17;	// returns a client to look for
-entity(entity start, .string fld, string match) find = #18;
-string(string s) precache_sound		= #19;
-string(string s) precache_model		= #20;
-void(entity client, string s, ...)stuffcmd = #21; // DarkPlaces note: can take multiple strings
-entity(vector org, float rad) findradius = #22;
-void(string s, ...) bprint				= #23; // DarkPlaces note: can take multiple strings
-void(entity client, string s, ...) sprint = #24; // DarkPlaces note: can take multiple strings
-void(string s, ...) dprint				= #25; // DarkPlaces note: can take multiple strings
-string(float f) ftos				= #26;
-string(vector v) vtos				= #27;
-void() coredump						= #28;		// prints all edicts
-void() traceon						= #29;		// turns statment trace on
-void() traceoff						= #30;
-void(entity e) eprint				= #31;		// prints an entire edict
-float(float yaw, float dist) walkmove	= #32;	// returns TRUE or FALSE
-// #33 was removed
-float() droptofloor= #34;	// TRUE if landed on floor
-void(float style, string value) lightstyle = #35;
-float(float v) rint					= #36;		// round to nearest int
-float(float v) floor				= #37;		// largest integer <= v
-float(float v) ceil					= #38;		// smallest integer >= v
-// #39 was removed
-float(entity e) checkbottom			= #40;		// true if self is on ground
-float(vector v) pointcontents		= #41;		// returns a CONTENT_*
-// #42 was removed
-float(float f) fabs = #43;
-vector(entity e, float speed) aim = #44;		// returns the shooting vector
-float(string s, ...) cvar = #45;						// return cvar.value
-void(string s, ...) localcmd = #46;					// put string into local que  // DarkPlaces note: can take multiple strings
-entity(entity e) nextent = #47;					// for looping through all ents
-void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
-void() ChangeYaw = #49;						// turn towards self.ideal_yaw
-											// at self.yaw_speed
-// #50 was removed
-vector(vector v) vectoangles			= #51;
-
-//
-// direct client message generation
-//
-void(float to, float f) WriteByte		= #52;
-void(float to, float f) WriteChar		= #53;
-void(float to, float f) WriteShort		= #54;
-void(float to, float f) WriteLong		= #55;
-void(float to, float f) WriteCoord		= #56;
-void(float to, float f) WriteAngle		= #57;
-void(float to, string s) WriteString	= #58;
-void(float to, entity s) WriteEntity	= #59;
-
-//
-// broadcast client message generation
-//
-
-// void(float f) bWriteByte		= #59;
-// void(float f) bWriteChar		= #60;
-// void(float f) bWriteShort		= #61;
-// void(float f) bWriteLong		= #62;
-// void(float f) bWriteCoord		= #63;
-// void(float f) bWriteAngle		= #64;
-// void(string s) bWriteString	= #65;
-// void(entity e) bWriteEntity = #66;
-
-void(float step) movetogoal				= #67;
-
-string(string s) precache_file		= #68;	// no effect except for -copy
-void(entity e) makestatic		= #69;
-void(string s) changelevel = #70;
-
-//#71 was removed
-
-void(string var, string val) cvar_set = #72;	// sets cvar.value
-
-void(entity client, string s, ...) centerprint = #73; // DarkPlaces note: can take multiple strings
-
-void(vector pos, string samp, float vol, float atten) ambientsound = #74;
-
-string(string s) precache_model2	= #75;		// registered version only
-string(string s) precache_sound2	= #76;		// registered version only
-string(string s) precache_file2		= #77;		// registered version only
-
-void(entity e) setspawnparms		= #78;		// set parm1... to the values at level start for coop respawn
-
+
+/*
+==============================================================================
+
+			SOURCE FOR GLOBALVARS_T C STRUCTURE
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity		self;
+entity		other;
+entity		world;
+float		time;
+float		frametime;
+
+float		force_retouch;		// force all entities to touch triggers
+								// next frame.  this is needed because
+								// non-moving things don't normally scan
+								// for triggers, and when a trigger is
+								// created (like a teleport trigger), it
+								// needs to catch everything.
+								// decremented each frame, so set to 2
+								// to guarantee everything is touched
+string		mapname;
+
+float		deathmatch;
+float		coop;
+float		teamplay;
+
+float		serverflags;		// propagated from level to level, used to
+								// keep track of completed episodes
+
+float		total_secrets;
+float		total_monsters;
+
+float		found_secrets;		// number of secrets found
+float		killed_monsters;	// number of monsters killed
+
+
+// spawnparms are used to encode information about clients across server
+// level changes
+float		parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
+
+//
+// global variables set by built in functions
+//
+vector		v_forward, v_up, v_right;	// set by makevectors()
+
+// set by traceline / tracebox
+float		trace_allsolid;
+float		trace_startsolid;
+float		trace_fraction;
+vector		trace_endpos;
+vector		trace_plane_normal;
+float		trace_plane_dist;
+entity		trace_ent;
+float		trace_inopen;
+float		trace_inwater;
+
+entity		msg_entity;				// destination of single entity writes
+
+//
+// required prog functions
+//
+void() 		main;						// only for testing
+
+void()		StartFrame;
+
+void() 		PlayerPreThink;
+void() 		PlayerPostThink;
+
+void()		ClientKill;
+void()		ClientConnect;
+void() 		PutClientInServer;		// call after setting the parm1... parms
+void()		ClientDisconnect;
+
+void()		SetNewParms;			// called when a client first connects to
+									// a server. sets parms so they can be
+									// saved off for restarts
+
+void()		SetChangeParms;			// call to set parms for self so they can
+									// be saved for a level transition
+
+
+//================================================
+void		end_sys_globals;		// flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+			SOURCE FOR ENTVARS_T C STRUCTURE
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float		modelindex;		// *** model index in the precached list
+.vector		absmin, absmax;	// *** origin + mins / maxs
+
+.float		ltime;			// local time for entity
+.float		movetype;
+.float		solid;
+
+.vector		origin;			// ***
+.vector		oldorigin;		// ***
+.vector		velocity;
+.vector		angles;
+.vector		avelocity;
+
+.vector		punchangle;		// temp angle adjust from damage or recoil
+
+.string		classname;		// spawn function
+.string		model;
+.float		frame;
+.float		skin;
+.float		effects;
+
+.vector		mins, maxs;		// bounding box extents reletive to origin
+.vector		size;			// maxs - mins
+
+.void()		touch;
+.void()		use;
+.void()		think;
+.void()		blocked;		// for doors or plats, called when can't push other
+
+.float		nextthink;
+.entity		groundentity;
+
+// stats
+.float		health;
+.float		frags;
+.float          weapon;                 // one of the IT_SHOTGUN, etc flags
+.string		weaponmodel;
+.float		weaponframe;
+.float		currentammo;
+.float          ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
+
+.float		items;			// bit flags
+
+.float		takedamage;
+.entity		chain;
+.float		deadflag;
+
+.vector		view_ofs;			// add to origin to get eye point
+
+
+.float		button0;		// fire
+.float		button1;		// use
+.float		button2;		// jump
+
+.float		impulse;		// weapon changes
+
+.float		fixangle;
+.vector		v_angle;		// view / targeting angle for players
+.float		idealpitch;		// calculated pitch angle for lookup up slopes
+
+
+.string		netname;
+
+.entity 	enemy;
+
+.float		flags;
+
+.float		colormap;
+.float		team;
+
+.float		max_health;		// players maximum health is stored here
+
+.float		teleport_time;	// don't back up
+
+.float		armortype;		// save this fraction of incoming damage
+.float		armorvalue;
+
+.float		waterlevel;		// 0 = not in, 1 = feet, 2 = wast, 3 = eyes
+.float		watertype;		// a contents value
+
+.float		ideal_yaw;
+.float		yaw_speed;
+
+.entity		aiment;
+
+.entity 	goalentity;		// a movetarget or an enemy
+
+.float		spawnflags;
+
+.string		target;
+.string		targetname;
+
+// damage is accumulated through a frame. and sent as one single
+// message, so the super shotgun doesn't generate huge messages
+.float		dmg_take;
+.float		dmg_save;
+.entity		dmg_inflictor;
+
+.entity		owner;		// who launched a missile
+.vector		movedir;	// mostly for doors, but also used for waterjump
+
+.string		message;		// trigger messages
+
+.float		sounds;		// either a cd track number or sound number
+
+.string		noise, noise1, noise2, noise3;	// contains names of wavs to play
+
+//================================================
+void		end_sys_fields;			// flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+				VARS NOT REFERENCED BY C CODE
+
+==============================================================================
+*/
+
+
+//
+// constants
+//
+
+float   FALSE                           = 0;
+float   TRUE                            = 1;
+
+// edict.flags
+float   FL_FLY                          = 1;
+float   FL_SWIM                         = 2;
+float   FL_CLIENT                       = 8;    // set for all client edicts
+float   FL_INWATER                      = 16;   // for enter / leave water splash
+float   FL_MONSTER                      = 32;
+float   FL_GODMODE                      = 64;   // player cheat
+float   FL_NOTARGET                     = 128;  // player cheat
+float   FL_ITEM                         = 256;  // extra wide size for bonus items
+float   FL_ONGROUND                     = 512;  // standing on something
+float	FL_PARTIALGROUND		= 1024;	// not all corners are valid
+float	FL_WATERJUMP			= 2048;	// player jumping out of water
+float	FL_JUMPRELEASED			= 4096;	// for jump debouncing
+
+// edict.movetype values
+float	MOVETYPE_NONE			= 0;	// never moves
+//float MOVETYPE_ANGLENOCLIP            = 1;
+//float	MOVETYPE_ANGLECLIP		= 2;
+float	MOVETYPE_WALK			= 3;	// players only
+float	MOVETYPE_STEP			= 4;	// discrete, not real time unless fall
+float	MOVETYPE_FLY			= 5;
+float	MOVETYPE_TOSS			= 6;	// gravity
+float	MOVETYPE_PUSH			= 7;	// no clip to world, push and crush
+float	MOVETYPE_NOCLIP			= 8;
+float	MOVETYPE_FLYMISSILE		= 9;	// fly with extra size against monsters
+float	MOVETYPE_BOUNCE			= 10;
+float	MOVETYPE_BOUNCEMISSILE	= 11;
+
+// edict.solid values
+float   SOLID_NOT                       = 0;    // no interaction with other objects
+float	SOLID_TRIGGER			= 1;	// touch on edge, but not blocking
+float   SOLID_BBOX                      = 2;    // touch on edge, block
+float	SOLID_SLIDEBOX			= 3;	// touch on edge, but not an onground
+float   SOLID_BSP                       = 4;    // bsp clip, touch on edge, block
+
+// range values
+float   RANGE_MELEE                     = 0;
+float   RANGE_NEAR                      = 1;
+float   RANGE_MID                       = 2;
+float   RANGE_FAR                       = 3;
+
+// deadflag values
+
+float   DEAD_NO                         = 0; // alive
+float   DEAD_DYING                      = 1; // dying
+float   DEAD_DEAD                       = 2; // dead, waiting for buttons to be released
+float	DEAD_RESPAWNABLE                = 3; // dead, waiting for button to be pressed
+float	DEAD_RESPAWNING                 = 4; // dead, waiting for buttons to be released
+
+// takedamage values
+
+float   DAMAGE_NO                       = 0;
+float   DAMAGE_YES                      = 1;
+float   DAMAGE_AIM                      = 2;
+
+
+
+// items
+// float   IT_AXE                       = 4096;
+// float   IT_SHOTGUN                   = 1;
+// float   IT_SUPER_SHOTGUN             = 2;
+// float   IT_NAILGUN                   = 4;
+// float   IT_SUPER_NAILGUN             = 8;
+// float   IT_GRENADE_LAUNCHER          = 16;
+// float   IT_ROCKET_LAUNCHER           = 32;
+// float   IT_LIGHTNING                 = 64;
+// float   IT_EXTRA_WEAPON              = 128;
+
+float   IT_WEAPON1                      = 4096;
+float   IT_WEAPON2                      = 1;
+float   IT_WEAPON3                      = 2;
+float   IT_WEAPON4                      = 4;
+float   IT_WEAPON5                      = 8;
+float   IT_WEAPON6                      = 16;
+float   IT_WEAPON7                      = 32;
+float   IT_WEAPON8                      = 64;
+float   IT_WEAPON9                      = 128;
+float   IT_WEAPON10                     = 8388608;
+
+float   IT_SHELLS                       = 256;
+float   IT_NAILS                        = 512;
+float   IT_ROCKETS                      = 1024;
+float   IT_CELLS                        = 2048;
+
+float   IT_ARMOR1                       = 8192;
+float   IT_ARMOR2                       = 16384;
+float   IT_ARMOR3                       = 32768;
+float	IT_SUPERHEALTH			= 65536;
+
+float   IT_KEY1                         = 131072;
+float   IT_KEY2                         = 262144;
+
+float   IT_INVISIBILITY                 = 524288;
+float   IT_INVULNERABILITY              = 1048576;
+float   IT_SUIT                         = 2097152;
+float   IT_QUAD                         = 4194304;
+
+// see modecheck.qc for deathmatch and teamplay settings
+
+// point content values
+
+float	CONTENT_EMPTY			= -1;
+float	CONTENT_SOLID			= -2;
+float	CONTENT_WATER			= -3;
+float	CONTENT_SLIME			= -4;
+float	CONTENT_LAVA			= -5;
+float	CONTENT_SKY				= -6;
+
+float	STATE_TOP		= 0;
+float	STATE_BOTTOM	= 1;
+float	STATE_UP		= 2;
+float	STATE_DOWN		= 3;
+
+vector	VEC_ORIGIN = '0 0 0';
+vector	VEC_HULL_MIN = '-16 -16 -24';
+vector	VEC_HULL_MAX = '16 16 32';
+
+vector	VEC_HULL2_MIN = '-32 -32 -24';
+vector	VEC_HULL2_MAX = '32 32 64';
+
+// protocol bytes
+float	SVC_TEMPENTITY		= 23;
+float	SVC_KILLEDMONSTER	= 27;
+float	SVC_FOUNDSECRET		= 28;
+float	SVC_INTERMISSION	= 30;
+float	SVC_FINALE			= 31;
+float	SVC_CDTRACK			= 32;
+float	SVC_SELLSCREEN		= 33;
+
+
+//float   TE_SPIKE                = 0;
+//float   TE_SUPERSPIKE           = 1;
+//float   TE_GUNSHOT              = 2;
+//float   TE_EXPLOSION            = 3;
+//float   TE_TAREXPLOSION         = 4;
+//float   TE_LIGHTNING1           = 5;
+//float   TE_LIGHTNING2           = 6;
+//float   TE_WIZSPIKE             = 7;
+//float   TE_KNIGHTSPIKE          = 8;
+//float   TE_LIGHTNING3           = 9;
+//float   TE_LAVASPLASH           = 10;
+//float   TE_TELEPORT             = 11;
+//float   TE_EXPLOSION2           = 12; // mission pack #2 explosion
+//                                      // takes a color range
+//                                      // 2 bytes:
+//                                      // first color
+//                                      // # of colors in the range
+//float   TE_BEAM                 = 13; // mission pack #2 thing
+//                                      // like TE_LIGHTNING etc,
+//                                      // but uses progs/beam.mdl
+
+// sound channels
+// channel 0 never willingly overrides
+// other channels (1-7) allways override a playing sound on that channel
+float	CHAN_AUTO		= 0;
+float	CHAN_WEAPON		= 1;
+float	CHAN_VOICE		= 2;
+float	CHAN_ITEM		= 3;
+float	CHAN_BODY		= 4;
+
+// added for Dark Places
+float   CHAN_SPEECH             = 5;
+float   CHAN_FOOT               = 6;
+float   CHAN_WEAPON2            = 7;
+
+float	ATTN_NONE		= 0;
+float	ATTN_NORM		= 1;
+float	ATTN_IDLE		= 2;
+float	ATTN_STATIC		= 3;
+
+// update types
+
+float	UPDATE_GENERAL	= 0;
+float	UPDATE_STATIC	= 1;
+float	UPDATE_BINARY	= 2;
+float	UPDATE_TEMP		= 3;
+
+// entity effects
+
+float	EF_BRIGHTFIELD	= 1;
+float	EF_MUZZLEFLASH 	= 2;
+float	EF_BRIGHTLIGHT 	= 4;
+float	EF_DIMLIGHT 	= 8;
+
+
+// messages
+float	MSG_BROADCAST	= 0;		// unreliable to all
+float	MSG_ONE			= 1;		// reliable to one (msg_entity)
+float	MSG_ALL			= 2;		// reliable to all
+float	MSG_INIT		= 3;		// write to the init string
+
+
+//================================================
+
+//
+// globals
+//
+//float	movedist;
+//float	gameover;		// set when a rule exits
+
+//string	string_null;	// null string, nothing should be held here
+//float	empty_float;
+
+entity	newmis;			// launch_spike sets this after spawning it
+
+//entity	activator;		// the entity that activated a trigger or brush
+
+//entity	damage_attacker;	// set by T_Damage
+//float	framecount;
+
+float		skill;
+
+//================================================
+
+//
+// world fields (FIXME: make globals)
+//
+//.string		wad;
+//.string 	map;
+//.float		worldtype;	// 0=medieval 1=metal 2=base
+
+//================================================
+
+//.string		killtarget;
+
+//
+// quakeed fields
+//
+//.float		light_lev;		// not used by game, but parsed by light util
+//.float		style;
+
+
+//
+// monster ai
+//
+//.void()		th_stand;
+//.void()		th_walk;
+//.void()		th_run;
+//.float()	th_missile; // LordHavoc: changed from void() to float(), returns true if attacking
+//.void()		th_melee;
+.void(entity attacker, float damage)		th_pain;
+.void()		th_die;
+
+//.entity		oldenemy;		// mad at this player before taking damage
+
+.float		speed;
+
+.float	lefty;
+
+//.float	search_time;
+//.float	attack_state;
+
+float	AS_STRAIGHT		= 1;
+float	AS_SLIDING		= 2;
+float	AS_MELEE		= 3;
+float	AS_MISSILE		= 4;
+
+// .gravity field added in Quake 1.07 (Scourge of Armagon)
+.float          gravity;
+
+//.float 		attack_finished;
+//.float		pain_finished;
+
+//.float		invincible_finished;
+//.float		invisible_finished;
+//.float		super_damage_finished;
+//.float		radsuit_finished;
+
+//.float		invincible_time, invincible_sound;
+//.float		invisible_time, invisible_sound;
+//.float		super_time, super_sound;
+//.float		rad_time;
+//.float		fly_sound;
+
+//.float		axhitme;
+
+//.float		show_hostile;	// set to time+0.2 whenever a client fires a weapon or takes damage.  Used to alert monsters that otherwise would let the player go
+//.float		jump_flag;		// player jump flag
+//.float		swim_flag;		// player swimming sound flag
+//.float		air_finished;	// when time > air_finished, start drowning
+//.string		deathtype;		// keeps track of how the player died
+//.float		bodyhealth;		// used by corpse code
+//.float		iscorpse;		// used by corpse code
+
+//.vector		dest, dest1, dest2, dest3, dest4, dest5;
+
+
+//.entity		flame;			// the flame burning this thing
+
+//.float		doobits;		// set if this should do obit on death
+
+//.vector bodymins, bodymaxs, headmins, headmaxs;
+
+//.vector		rotate;
+//.string		group;
+
+// counts of how many keys this player/bot has
+//.float		keys_silver;
+//.float		keys_gold;
+
+//.float		havocattack;
+//.float		havocpickup;
+//.float(entity player, entity item) pickupevalfunc; // returns rating for item considering player's condition (don't pick up health if it's not needed, etc)
+//.float		shoulddodge;
+//.float		dangerrating;
+
+// called whenever damage is done, if not supplied there is no visible effect.
+//.void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) bleedfunc;
+
+//
+// object stuff
+//
+//.string		mdl;
+//.vector		mangle;			// angle at start
+
+.vector		oldorigin;		// only used by secret door
+
+//.float		t_length, t_width;
+
+
+//
+// doors, etc
+//
+//.vector		dest, dest1, dest2;
+//.float		wait;			// time from firing to restarting
+//.float		delay;			// time from activation to firing
+//.entity		trigger_field;	// door's trigger entity
+//.string		noise4;
+
+//
+// monsters
+//
+//.float 		pausetime;
+//.entity 	movetarget;
+
+//
+// doors
+//
+//.float		aflag;
+//.float		dmg;			// damage done by door when hit
+
+//
+// misc
+//
+.float		cnt; 			// misc flag
+//.float		cnt2;			// another counter
+//.float		count2;			// yet another count
+
+//
+// subs
+//
+.void()		think1;
+
+//
+// triggers
+//
+//.float		count;			// for counting triggers
+
+
+//
+// plats / doors / buttons
+//
+//.float		lip;
+//.float		state;
+//.vector		pos1, pos2;		// top and bottom positions
+.float		height;
+
+//
+// sounds
+//
+//.float		waitmin, waitmax;
+
+
+
+
+//===========================================================================
+
+
+//
+// builtin functions
+//
+
+void(vector ang)	makevectors		= #1;		// sets v_forward, etc globals
+void(entity e, vector o) setorigin	= #2;
+void(entity e, string m) setmodel	= #3;		// set movetype and solid first
+void(entity e, vector min, vector max) setsize = #4;
+// #5 was removed
+void() break						= #6;
+float() random						= #7;		// returns 0 - 1
+void(entity e, float chan, string samp, float vol, float atten) sound = #8;
+vector(vector v) normalize			= #9;
+void(string e, ...) error				= #10;
+void(string e, ...) objerror				= #11;
+float(vector v) vlen				= #12;
+float(vector v) vectoyaw			= #13;
+entity() spawn						= #14;
+void(entity e) remove				= #15;
+
+// sets trace_* globals
+// nomonsters can be:
+// An entity will also be ignored for testing if forent == test,
+// forent->owner == test, or test->owner == forent
+// a forent of world is ignored
+void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
+
+entity() checkclient				= #17;	// returns a client to look for
+entity(entity start, .string fld, string match) find = #18;
+string(string s) precache_sound		= #19;
+string(string s) precache_model		= #20;
+void(entity client, string s, ...)stuffcmd = #21; // DarkPlaces note: can take multiple strings
+entity(vector org, float rad) findradius = #22;
+void(string s, ...) bprint				= #23; // DarkPlaces note: can take multiple strings
+void(entity client, string s, ...) sprint = #24; // DarkPlaces note: can take multiple strings
+void(string s, ...) dprint				= #25; // DarkPlaces note: can take multiple strings
+string(float f) ftos				= #26;
+string(vector v) vtos				= #27;
+void() coredump						= #28;		// prints all edicts
+void() traceon						= #29;		// turns statment trace on
+void() traceoff						= #30;
+void(entity e) eprint				= #31;		// prints an entire edict
+float(float yaw, float dist) walkmove	= #32;	// returns TRUE or FALSE
+// #33 was removed
+float() droptofloor= #34;	// TRUE if landed on floor
+void(float style, string value) lightstyle = #35;
+float(float v) rint					= #36;		// round to nearest int
+float(float v) floor				= #37;		// largest integer <= v
+float(float v) ceil					= #38;		// smallest integer >= v
+// #39 was removed
+float(entity e) checkbottom			= #40;		// true if self is on ground
+float(vector v) pointcontents		= #41;		// returns a CONTENT_*
+// #42 was removed
+float(float f) fabs = #43;
+vector(entity e, float speed) aim = #44;		// returns the shooting vector
+float(string s, ...) cvar = #45;						// return cvar.value
+void(string s, ...) localcmd = #46;					// put string into local que  // DarkPlaces note: can take multiple strings
+entity(entity e) nextent = #47;					// for looping through all ents
+void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
+void() ChangeYaw = #49;						// turn towards self.ideal_yaw
+											// at self.yaw_speed
+// #50 was removed
+vector(vector v) vectoangles			= #51;
+
+//
+// direct client message generation
+//
+void(float to, float f) WriteByte		= #52;
+void(float to, float f) WriteChar		= #53;
+void(float to, float f) WriteShort		= #54;
+void(float to, float f) WriteLong		= #55;
+void(float to, float f) WriteCoord		= #56;
+void(float to, float f) WriteAngle		= #57;
+void(float to, string s) WriteString	= #58;
+void(float to, entity s) WriteEntity	= #59;
+
+//
+// broadcast client message generation
+//
+
+// void(float f) bWriteByte		= #59;
+// void(float f) bWriteChar		= #60;
+// void(float f) bWriteShort		= #61;
+// void(float f) bWriteLong		= #62;
+// void(float f) bWriteCoord		= #63;
+// void(float f) bWriteAngle		= #64;
+// void(string s) bWriteString	= #65;
+// void(entity e) bWriteEntity = #66;
+
+void(float step) movetogoal				= #67;
+
+string(string s) precache_file		= #68;	// no effect except for -copy
+void(entity e) makestatic		= #69;
+void(string s) changelevel = #70;
+
+//#71 was removed
+
+void(string var, string val) cvar_set = #72;	// sets cvar.value
+
+void(entity client, string s, ...) centerprint = #73; // DarkPlaces note: can take multiple strings
+
+void(vector pos, string samp, float vol, float atten) ambientsound = #74;
+
+string(string s) precache_model2	= #75;		// registered version only
+string(string s) precache_sound2	= #76;		// registered version only
+string(string s) precache_file2		= #77;		// registered version only
+
+void(entity e) setspawnparms		= #78;		// set parm1... to the values at level start for coop respawn
+


Property changes on: trunk/basezym/progsqc/defs.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/dpextensions.qc
===================================================================
--- trunk/basezym/progsqc/dpextensions.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/dpextensions.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,1215 +1,1215 @@
-
-//DarkPlaces supported extension list, draft version 1.04
-
-//definitions that id Software left out
-//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
-float MOVE_NORMAL = 0; // same as FALSE
-float MOVE_NOMONSTERS = 1; // same as TRUE
-float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-
-//checkextension function
-//idea: expected by almost everyone
-//darkplaces implementation: LordHavoc
-float(string s) checkextension = #99;
-//description:
-//check if (cvar("pr_checkextension")) before calling this, this is the only
-//guarenteed extension to be present in the extension system, it allows you
-//to check if an extension is available, by name, to check for an extension
-//use code like this:
-//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
-//if (cvar("pr_checkextension"))
-//if (checkextension("DP_SV_SETCOLOR"))
-//	ext_setcolor = TRUE;
-//from then on you can check ext_setcolor to know if that extension is available
-
-//DP_BUTTONCHAT
-//idea: Vermeulen
-//darkplaces implementation: LordHavoc
-//field definitions:
-//.float buttonchat;
-//description:
-//true if the player is currently chatting (in messagemode, menus or console)
-
-//DP_BUTTONUSE
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//field definitions:
-//.float buttonuse;
-//client console commands:
-//+use
-//-use
-//description:
-//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
-
-// LordHavoc: HIGHLY experimental, do not implement this in other engines
-//DP_CGAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//SVC definitions:
-float svc_cgame = 50; // [short] length [bytes] data
-//description:
-//contains network messages to client gamecode.
-
-//DP_CL_LOADSKY
-//idea: Nehahra, LordHavoc
-//darkplaces implementation: LordHavoc
-//client console commands:
-//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
-//description:
-//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
-
-//DP_CON_SET
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
-
-//DP_CON_SETA
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
-
-//DP_CON_ALIASPARAMETERS
-//idea: many
-//darkplaces implementation: Black
-//description:
-//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
-
-//DP_CON_EXPANDCVAR
-//idea: many, PHP
-//darkplaces implementation: Black
-//description:
-//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
-
-//DP_CON_STARTMAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
-
-//DP_EF_ADDITIVE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_ADDITIVE     = 32;
-//description:
-//additive blending when this object is rendered
-
-//DP_EF_BLUE
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_BLUE         = 64;
-//description:
-//entity emits blue light (used for quad)
-
-//DP_EF_FLAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_FLAME        = 1024;
-//description:
-//entity is on fire
-
-//DP_EF_FULLBRIGHT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_FULLBRIGHT   = 512;
-//description:
-//entity is always brightly lit
-
-//DP_EF_NODEPTHTEST
-//idea: Supa
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_NODEPTHTEST       = 8192;
-//description:
-//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
-
-//DP_EF_NODRAW
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_NODRAW       = 16;
-//description:
-//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
-
-//DP_EF_NOSHADOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_NOSHADOW     = 4096;
-//description:
-//realtime lights will not cast shadows from this entity (but can still illuminate it)
-
-//DP_EF_RED
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_RED          = 128;
-//description:
-//entity emits red light (used for invulnerability)
-
-//DP_EF_STARDUST
-//idea: MythWorks Inc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float   EF_STARDUST     = 2048;
-//description:
-//entity emits bouncing sparkles in every direction
-
-//DP_ENT_ALPHA
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//fields:
-.float alpha;
-//description:
-//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
-
-//DP_ENT_COLORMOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definition:
-.vector colormod;
-//description:
-//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal).
-
-//DP_ENT_CUSTOMCOLORMAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number.
-
-/*
-//NOTE: no longer supported by darkplaces because all entities are delta compressed now
-//DP_ENT_DELTACOMPRESS // no longer supported
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float EF_DELTA = 8388608;
-//description:
-//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc).
-*/
-
-//DP_ENT_EXTERIORMODELTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//fields:
-//.entity exteriormodeltoclient;
-//description:
-//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown.  Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
-
-//DP_ENT_GLOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-//.float glow_color;
-.float glow_size;
-//.float glow_trail;
-//description:
-//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
-
-//DP_ENT_LOWPRECISION
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float EF_LOWPRECISION = 4194304;
-//description:
-//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
-
-//DP_ENT_SCALE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float scale;
-//description:
-//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller.
-
-//DP_ENT_VIEWMODEL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity viewmodelforclient;
-//description:
-//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)...  the entity is not visible to any other client.
-
-//DP_GFX_EXTERNALTEXTURES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//loads external textures found in various directories (tenebrae compatible)...
-/*
-in all examples .tga is merely the base texture, it can be any of these:
-.tga (base texture)
-_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha)
-_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend)
-_shirt.tga (same idea as pants, but for shirt color)
-_diffuse.tga (this may be used instead of base texture for per pixel lighting)
-_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale))
-_norm.tga (normalmap texture for per pixel lighting)
-_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility)
-_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility)
-
-due to glquake's incomplete Targa(r) loader, this section describes
-required Targa(r) features support:
-types:
-type 1 (uncompressed 8bit paletted with 24bit/32bit palette)
-type 2 (uncompressed 24bit/32bit true color, glquake supported this)
-type 3 (uncompressed 8bit greyscale)
-type 9 (RLE compressed 8bit paletted with 24bit/32bit palette)
-type 10 (RLE compressed 24bit/32bit true color, glquake supported this)
-type 11 (RLE compressed 8bit greyscale)
-attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
-
-image formats guarenteed to be supported: tga, pcx, lmp
-image formats that are optional: png, jpg
-
-mdl/spr/spr32 examples:
-skins are named _A (A being a number) and skingroups are named like _A_B
-these act as suffixes on the model name...
-example names for skin _2_1 of model "progs/armor.mdl":
-game/override/progs/armor.mdl_2_1.tga
-game/textures/progs/armor.mdl_2_1.tga
-game/progs/armor.mdl_2_1.tga
-example names for skin _0 of the model "progs/armor.mdl":
-game/override/progs/armor.mdl_0.tga
-game/textures/progs/armor.mdl_0.tga
-game/progs/armor.mdl_0.tga
-note that there can be more skins files (of the _0 naming) than the mdl
-contains, this is only useful to save space in the .mdl file if classic quake
-compatibility is not a concern.
-
-bsp/md2/md3 examples:
-example names for the texture "quake" of model "maps/start.bsp":
-game/override/quake.tga
-game/textures/quake.tga
-game/quake.tga
-
-sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
-game/override/gfx/conchars.tga
-game/textures/gfx/conchars.tga
-game/gfx/conchars.tga
-*/
-
-//DP_GFX_FOG
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
-//description:
-//global fog for the map, can not be changed by QC
-
-//DP_GFX_QUAKE3MODELTAGS
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity tag_entity; // entity this is attached to (call setattachment to set this)
-.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
-//builtin definitions:
-void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
-//description:
-//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
-//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
-//note 3: attaching to world turns off attachment
-//note 4: the entity that this is attached to must be visible for this to work
-//note 5: if an entity is attached to the player entity it will not be drawn in first person.
-
-//DP_GFX_SKINFILES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as:
-//progs/test.md3_0.skin
-//progs/test.md3_1.skin
-//...
-//
-//these files contain replace commands (replace meshname shadername), example:
-//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement
-//replace "teamstripes" "progs/test/redstripes.tga"
-//replace "visor" "common/nodraw" // this makes the visor mesh invisible
-////it is not possible to rename tags using this format
-//
-//Or the Quake3 syntax (100% compatible with Quake3's .skin files):
-//helmet,progs/test/helmet1.tga // this is a mesh shader replacement
-//teamstripes,progs/test/redstripes.tga
-//visor,common/nodraw // this makes the visor mesh invisible
-//tag_camera, // this defines that the first tag in the model is called tag_camera
-//tag_test, // this defines that the second tag in the model is called tag_test
-//
-//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible.
-//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
-//other commands might be added someday but it is not expected.
-
-//DP_GFX_SKYBOX
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
-//description:
-//global skybox for the map, can not be changed by QC
-
-//DP_HALFLIFE_MAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30).
-
-//DP_HALFLIFE_MAP_CVAR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//cvars:
-//halflifebsp 0/1
-//description:
-//engine sets this cvar when loading a map to indicate if it is halflife format or not.
-
-//DP_HALFLIFE_SPRITE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//simply indicates that the engine supports HalfLife sprites.
-
-//DP_INPUTBUTTONS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float button3;
-.float button4;
-.float button5;
-.float button6;
-.float button7;
-//.float button8;
-//description:
-//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
-
-//DP_LITSPRITES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
-
-//DP_LITSUPPORT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
-//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course...  see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
-
-//DP_MONSTERWALK
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player.
-
-//DP_MOVETYPEBOUNCEMISSILE
-//idea: id Software
-//darkplaces implementation: id Software
-//movetype definitions:
-//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
-//description:
-//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
-
-//DP_MOVETYPEFOLLOW
-//idea: id Software, LordHavoc (redesigned)
-//darkplaces implementation: LordHavoc
-//movetype definitions:
-float MOVETYPE_FOLLOW = 12;
-//description:
-//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:
-//aiment - the entity this is attached to.
-//punchangle - the original angles when the follow began.
-//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
-//v_angle - the relative angles.
-//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:
-//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
-//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid
-//hole.aiment = bmodel; // make the hole follow bmodel
-//hole.punchangle = bmodel.angles; // the original angles of bmodel
-//hole.view_ofs = hole.origin - bmodel.origin; // relative origin
-//hole.v_angle = hole.angles - bmodel.angles; // relative angles
-
-//DP_QC_CHANGEPITCH
-//idea: id Software
-//darkplaces implementation: id Software
-//field definitions:
-.float idealpitch;
-//.float pitch_speed;
-//builtin definitions:
-void(entity ent) changepitch = #63;
-//description:
-//equivilant to changeyaw, ent is normally self. (this was a Q2 builtin)
-
-//DP_QC_COPYENTITY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity from, entity to) copyentity = #400;
-//description:
-//copies all data in the entity to another entity.
-
-//DP_QC_CVAR_STRING
-//idea: VorteX
-//DarkPlaces implementation: VorteX, LordHavoc
-//builtin definitions:
-string(string s, ...) cvar_string = #448;
-//description:
-//returns the value of a cvar, as a tempstring.
-
-//DP_QC_ETOS
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-string(entity ent) etos = #65;
-//description:
-//prints "entity 1" or similar into a string. (this was a Q2 builtin)
-
-//DP_QC_FINDCHAIN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.string fld, string match) findchain = #402;
-//description:
-//similar to find() but returns a chain of entities like findradius.
-
-//DP_QC_FINDCHAINFLAGS
-//idea: Sajt
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.float fld, float match) findchainflags = #450;
-//description:
-//similar to findflags() but returns a chain of entities like findradius.
-
-//DP_QC_FINDCHAINFLOAT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.entity fld, entity match) findchainentity = #403;
-entity(.float fld, float match) findchainfloat = #403;
-//description:
-//similar to findentity()/findfloat() but returns a chain of entities like findradius.
-
-//DP_QC_FINDFLAGS
-//idea: Sajt
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(entity start, .float fld, float match) findflags = #449;
-//description:
-//finds an entity with the specified flag set in the field, similar to find()
-
-//DP_QC_FINDFLOAT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(entity start, .entity fld, entity match) findentity = #98;
-entity(entity start, .float fld, float match) findfloat = #98;
-//description:
-//finds an entity or float field value, similar to find(), but for entity and float fields.
-
-//DP_QC_FS_SEARCH
-//idea: Black
-//darkplaces implementation: Black
-//builtin definitions:
-float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
-void(float handle) search_end = #445;
-float(float handle) search_getsize = #446;
-string(float handle, float num) search_getfilename = #447;
-//description:
-//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
-//search_end frees a search slot (also done at progs reload).
-//search_getsize returns how many filenames were found.
-//search_getfilename returns a filename from the search.
-
-//DP_QC_GETLIGHT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector(vector org) getlight = #92;
-//description:
-//returns the lighting at the requested location (in color), 0-255 range (can exceed 255).
-
-//DP_QC_GETSURFACE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(entity e, float s) getsurfacenumpoints = #434;
-vector(entity e, float s, float n) getsurfacepoint = #435;
-vector(entity e, float s) getsurfacenormal = #436;
-string(entity e, float s) getsurfacetexture = #437;
-float(entity e, vector p) getsurfacenearpoint = #438;
-vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
-//description:
-//functions to query surface information.
-
-//DP_QC_GETTAGINFO
-//idea: VorteX, LordHavoc (somebody else?)
-//DarkPlaces implementation: VorteX
-//builtin definitions:
-float(entity ent, string tagname) gettagindex = #451;
-vector(entity ent, float tagindex) gettaginfo = #452;
-//description:
-//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
-//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
-
-//DP_QC_MINMAXBOUND
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(float a, float b) min = #94;
-float(float a, float b, float c) min3 = #94;
-float(float a, float b, float c, float d) min4 = #94;
-float(float a, float b, float c, float d, float e) min5 = #94;
-float(float a, float b, float c, float d, float e, float f) min6 = #94;
-float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
-float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
-float(float a, float b) max = #95;
-float(float a, float b, float c) max3 = #95;
-float(float a, float b, float c, float d) max4 = #95;
-float(float a, float b, float c, float d, float e) max5 = #95;
-float(float a, float b, float c, float d, float e, float f) max6 = #95;
-float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
-float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
-float(float minimum, float val, float maximum) bound = #96;
-//description:
-//min returns the lowest of all the supplied numbers.
-//max returns the highest of all the supplied numbers.
-//bound clamps the value to the range and returns it.
-
-//DP_QC_MULTIPLETEMPSTRINGS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//this extension makes all builtins returning tempstrings (ftos for example) cycle through a pool of multiple tempstrings (at least 16), allowing multiple ftos results to be gathered before putting them to use, normal quake only had 1 tempstring, causing many headaches.  Note that for longer term storage (or compatibility on engines having FRIK_FILE but not this extension) the FRIK_FILE extension's strzone/strunzone builtins provide similar functionality (slower though).
-
-//DP_QC_RANDOMVEC
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector() randomvec = #91;
-//description:
-//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
-
-//DP_QC_SINCOSSQRTPOW
-//idea: id Software, LordHavoc
-//darkplaces implementation: id Software, LordHavoc
-//builtin definitions:
-float(float val) sin = #60;
-float(float val) cos = #61;
-float(float val) sqrt = #62;
-float(float a, float b) pow = #97;
-//description:
-//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
-
-//DP_QC_TRACEBOX
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
-//description:
-//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
-
-//DP_QC_TRACETOSS
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-void(entity ent, entity ignore) tracetoss = #64;
-//description:
-//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
-
-//DP_QC_TRACE_MOVETYPE_HITMODEL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_HITMODEL = 4;
-//description:
-//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
-
-//DP_QC_TRACE_MOVETYPE_WORLDONLY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_WORLDONLY = 3;
-//description:
-//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
-
-//DP_QC_VECTORVECTORS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector dir) vectorvectors = #432;
-//description:
-//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles.
-
-//DP_QUAKE2_MODEL
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake2 .md2 files.
-
-//DP_QUAKE2_SPRITE
-//idea: LordHavoc
-//darkplaces implementation: Elric
-//description:
-//shows that the engine supports Quake2 .sp2 files.
-
-//DP_QUAKE3_MAP
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake3 .bsp files.
-
-//DP_QUAKE3_MODEL
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake3 .md3 files.
-
-//DP_REGISTERCVAR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(string name, string value) registercvar = #93;
-//description:
-//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
-//NOTE: DP_CON_SET is much better.
-
-//DP_SND_DIRECTIONLESSATTNNONE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
-
-//DP_SND_FAKETRACKS
-//idea: requested
-//darkplaces implementation: Elric
-//description:
-//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
-//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
-
-//DP_SND_OGGVORBIS
-//idea: Transfusion
-//darkplaces implementation: Elric
-//description:
-//the engine supports loading Ogg Vorbis sound files.  Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
-
-//DP_SND_STEREOWAV
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//the engine supports stereo WAV files.  (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
-
-//DP_SOLIDCORPSE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//solid definitions:
-float SOLID_CORPSE = 5;
-//description:
-//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline.
-
-//DP_SPRITE32
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//the engine supports .spr32 sprites.
-
-//DP_SV_BOTCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constants:
-float CLIENTTYPE_DISCONNECTED = 0;
-float CLIENTTYPE_REAL = 1;
-float CLIENTTYPE_BOT = 2;
-float CLIENTTYPE_NOTACLIENT = 3;
-//builtin definitions:
-entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available
-float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants
-//description:
-//spawns a client with no network connection, to allow bots to use client slots with no hacks.
-//How to use:
-/*
-	// to spawn a bot
-	local entity oldself;
-	oldself = self;
-	self = spawnclient();
-	if (!self)
-	{
-		bprint("Can not add bot, server full.\n");
-		self = oldself;
-		return;
-	}
-	self.netname = "Yoyobot";
-	self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants
-	ClientConnect();
-	PutClientInServer();
-	self = oldself;
-
-	// to remove all bots
-	local entity head;
-	head = find(world, classname, "player");
-	while (head)
-	{
-		if (clienttype(head) == CLIENTTYPE_BOT)
-			dropclient(head);
-		head = find(head, classname, "player");
-	}
-
-	// to identify if a client is a bot (for example in PlayerPreThink)
-	if (clienttype(self) == CLIENTTYPE_BOT)
-		botthink();
-*/
-//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT
-//How it works:
-//creates a new client, calls SetNewParms and stores the parms, and returns the client.
-//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually
-//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is).
-//parms work the same on bot clients as they do on real clients, and do carry from level to level
-
-//DP_SV_CLIENTCOLORS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//.float clientcolors; // colors of the client (format: pants + shirt * 16)
-//description:
-//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
-
-//DP_SV_CLIENTNAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
-
-//DP_SV_DRAWONLYTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-//.entity drawonlytoclient;
-//description:
-//the entity is only visible to the specified client.
-
-//DP_SV_DROPCLIENT
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity clent) dropclient = #453;
-//description:
-//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
-
-//DP_SV_EFFECT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
-//SVC definitions:
-//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
-//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate
-//description:
-//clientside playback of simple custom sprite effects (explosion sprites, etc).
-
-//DP_SV_NODRAWTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-//.entity nodrawtoclient;
-//description:
-//the entity is not visible to the specified client.
-
-//DP_SV_PING
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-//.float ping;
-//description:
-//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
-
-//DP_SV_PUNCHVECTOR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.vector punchvector;
-//description:
-//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
-
-//DP_SV_PLAYERPHYSICS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.vector movement;
-//cvar definitions:
-//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
-//engine-called QC prototypes:
-//void() SV_PlayerPhysics;
-//description:
-//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
-
-//DP_SV_PRECACHEANYTIME
-//idea: id Software (Quake2)
-//darkplaces implementation: LordHavoc
-//description:
-//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
-
-//DP_SV_ROTATINGBMODEL
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
-//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
-
-//DP_SV_SETCOLOR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity ent, float colors) setcolor = #401;
-//engine called QC functions (optional):
-//void(float color) SV_ChangeTeam;
-//description:
-//setcolor sets the color on a client and updates internal color information accordingly (equivilant to stuffing a "color" command but immediate)
-//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.
-//the color format is pants + shirt * 16 (0-255 potentially)
-
-//DP_SV_SLOWMO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//cvars:
-//"slowmo" (0+, default 1)
-//description:
-//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
-//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
-
-//DP_SV_WRITEUNTERMINATEDSTRING
-//idea: shadowalker
-//darkplaces implementation: Sajt
-//builtin definitions:
-void(float to, string s) WriteUnterminatedString = #456;
-//description:
-//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
-
-//DP_TE_BLOOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector velocity, float howmany) te_blood = #405;
-//temp entity definitions:
-float TE_BLOOD = 50;
-//protocol:
-//vector origin
-//byte xvelocity (-128 to +127)
-//byte yvelocity (-128 to +127)
-//byte zvelocity (-128 to +127)
-//byte count (0 to 255, how much blood)
-//description:
-//creates a blood effect.
-
-//DP_TE_BLOODSHOWER
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
-//temp entity definitions:
-//float TE_BLOODSHOWER = 52;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//coord explosionspeed (velocity of blood particles flying out of the center)
-//short count (number of blood particles)
-//description:
-//creates an exploding shower of blood, for making gibbings more convincing.
-
-//DP_TE_CUSTOMFLASH
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
-//temp entity definitions:
-//float TE_CUSTOMFLASH = 73;
-//protocol:
-//vector origin
-//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius)
-//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime)
-//byte red (0.0 to 1.0 converted to 0-255)
-//byte green (0.0 to 1.0 converted to 0-255)
-//byte blue (0.0 to 1.0 converted to 0-255)
-//description:
-//creates a customized light flash.
-
-//DP_TE_EXPLOSIONRGB
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector color) te_explosionrgb = #407;
-//temp entity definitions:
-//float TE_EXPLOSIONRGB = 53;
-//protocol:
-//vector origin
-//byte red (0.0 to 1.0 converted to 0 to 255)
-//byte green (0.0 to 1.0 converted to 0 to 255)
-//byte blue (0.0 to 1.0 converted to 0 to 255)
-//description:
-//creates a colored explosion effect.
-
-//DP_TE_FLAMEJET
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector vel, float howmany) te_flamejet = #457;
-//temp entity definitions:
-//float TE_FLAMEJET = 74;
-//protocol:
-//vector origin
-//vector velocity
-//byte count (0 to 255, how many flame particles)
-//description:
-//creates a single puff of flame particles.  (not very useful really)
-
-//DP_TE_PARTICLECUBE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
-//temp entity definitions:
-//float TE_PARTICLECUBE = 54;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity
-//short count
-//byte color (palette color)
-//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?)
-//coord randomvel (how much to jitter the velocity)
-//description:
-//creates a cloud of particles, useful for forcefields but quite customizable.
-
-//DP_TE_PARTICLERAIN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
-//temp entity definitions:
-//float TE_PARTICLERAIN = 55;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity (velocity of particles)
-//short count (number of particles)
-//byte color (8bit palette color)
-//description:
-//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube.
-
-//DP_TE_PARTICLESNOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
-//temp entity definitions:
-//float TE_PARTICLERAIN = 56;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity (velocity of particles)
-//short count (number of particles)
-//byte color (8bit palette color)
-//description:
-//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
-
-//DP_TE_PLASMABURN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_plasmaburn = #433;
-//temp entity definitions:
-//float TE_PLASMABURN = 75;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2) and marks the walls.
-
-//DP_TE_QUADEFFECTS1
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_gunshotquad = #412;
-void(vector org) te_spikequad = #413;
-void(vector org) te_superspikequad = #414;
-void(vector org) te_explosionquad = #415;
-//temp entity definitions:
-//float   TE_GUNSHOTQUAD  = 57; // [vector] origin
-//float   TE_SPIKEQUAD    = 58; // [vector] origin
-//float   TE_SUPERSPIKEQUAD = 59; // [vector] origin
-//float   TE_EXPLOSIONQUAD = 70; // [vector] origin
-//protocol:
-//vector origin
-//description:
-//all of these just take a location, and are equivilant in function (but not appearance :) to the original TE_GUNSHOT, etc.
-
-//DP_TE_SMALLFLASH
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_smallflash = #416;
-//temp entity definitions:
-//float TE_SMALLFLASH = 72;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2).
-
-//DP_TE_SPARK
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector vel, float howmany) te_spark = #411;
-//temp entity definitions:
-//float TE_SPARK = 51;
-//protocol:
-//vector origin
-//byte xvelocity (-128 to 127)
-//byte yvelocity (-128 to 127)
-//byte zvelocity (-128 to 127)
-//byte count (number of sparks)
-//description:
-//creates a shower of sparks and a smoke puff.
-
-//DP_TE_STANDARDEFFECTBUILTINS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_gunshot = #418;
-void(vector org) te_spike = #419;
-void(vector org) te_superspike = #420;
-void(vector org) te_explosion = #421;
-void(vector org) te_tarexplosion = #422;
-void(vector org) te_wizspike = #423;
-void(vector org) te_knightspike = #424;
-void(vector org) te_lavasplash = #425;
-void(vector org) te_teleport = #426;
-void(vector org, float color, float colorlength) te_explosion2 = #427;
-void(entity own, vector start, vector end) te_lightning1 = #428;
-void(entity own, vector start, vector end) te_lightning2 = #429;
-void(entity own, vector start, vector end) te_lightning3 = #430;
-void(entity own, vector start, vector end) te_beam = #431;
-//description:
-//to make life easier on mod coders.
-
-//DP_VIEWZOOM
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float viewzoom;
-//description:
-//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
-
-//FRIK_FILE
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(string s) stof = #81; // get numerical value from a string
-float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
-void(float fhandle) fclose = #111; // closes a file
-string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
-void(float fhandle, string s) fputs = #113; // writes a line of text to the end of the file
-float(string s) strlen = #114; // returns how many characters are in a string
-string(string s1, string s2, ...) strcat = #115; // concatenates two strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
-string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring
-vector(string s) stov = #117; // returns vector value from a string
-string(string s) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
-void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
-//constants:
-float FILE_READ = 0;
-float FILE_APPEND = 1;
-float FILE_WRITE = 2;
-//cvars:
-//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
-//description:
-//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
-
-//KRIMZON_SV_PARSECLIENTCOMMAND
-//idea: KrimZon
-//darkplaces implementation: KrimZon, LordHavoc
-//engine-called QC prototypes:
-//void(string s) SV_ParseClientCommand;
-//builtin definitions:
-void(entity e, string s) clientcommand = #440;
-float(string s) tokenize = #441;
-string(float n) argv = #442;
-//description:
-//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
-
-//NEH_CMD_PLAY2
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports the "play2" console command (plays a sound without spatialization).
-
-//NEH_RESTOREGAME
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//engine-called QC prototypes:
-//void() RestoreGame;
-//description:
-//when a savegame is loaded, this function is called
-
-//NEXUIZ_PLAYERMODEL
-//idea: Nexuiz
-//darkplaces implementation: Black
-//console commands:
-//playermodel <name> - FIXME: EXAMPLE NEEDED
-//playerskin <name> - FIXME: EXAMPLE NEEDED
-//field definitions:
-//.string playermodel; // name of player model sent by client
-//.string playerskin; // name of player skin sent by client
-//description:
-//these client properties are used by Nexuiz.
-
-//NXQ_GFX_LETTERBOX
-//idea: nxQuake
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
-
-//PRYDON_CLIENTCURSOR
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//effects bit:
-float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
-//field definitions:
-//.float cursor_active; // true if cl_prydoncursor mode is on
-//.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
-//.vector cursor_trace_start; // position of camera
-.vector cursor_trace_endpos; // position of cursor in world (as traced from camera)
-.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt)
-//cvar definitions:
-//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented)
-//description:
-//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit.
-//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen.
-//the clientside trace skips transparent entities (except those marked EF_SELECTABLE).
-//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2).
-//intended to be used by Prydon Gate.
-
-//TENEBRAE_GFX_DLIGHTS
-//idea: Tenebrae
-//darkplaces implementation: LordHavoc
-//fields:
-//.float light_lev; // radius (does not affect brightness), typical value 350
-//.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast)
-//.float style; // light style (like normal light entities, flickering torches or switchable, etc)
-.float pflags; // flags (see PFLAGS_ constants)
-.vector angles; // orientation of the light
-.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
-//constants:
-float PFLAGS_NOSHADOW = 1; // light does not cast shadows
-float PFLAGS_CORONA = 2; // light has a corona flare
-float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!)
-//description:
-//more powerful dynamic light settings
-//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
-//changes compared to tenebrae (because they're too 'leet' for standards):
-//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
-//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
-
-//TW_SV_STEPCONTROL
-//idea: Transfusion
-//darkplaces implementation: LordHavoc
-//cvars:
-//sv_jumpstep (0/1, default 1)
-//sv_stepheight (default 18)
-//description:
-//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
-
+
+//DarkPlaces supported extension list, draft version 1.04
+
+//definitions that id Software left out
+//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
+float MOVE_NORMAL = 0; // same as FALSE
+float MOVE_NOMONSTERS = 1; // same as TRUE
+float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+
+//checkextension function
+//idea: expected by almost everyone
+//darkplaces implementation: LordHavoc
+float(string s) checkextension = #99;
+//description:
+//check if (cvar("pr_checkextension")) before calling this, this is the only
+//guarenteed extension to be present in the extension system, it allows you
+//to check if an extension is available, by name, to check for an extension
+//use code like this:
+//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
+//if (cvar("pr_checkextension"))
+//if (checkextension("DP_SV_SETCOLOR"))
+//	ext_setcolor = TRUE;
+//from then on you can check ext_setcolor to know if that extension is available
+
+//DP_BUTTONCHAT
+//idea: Vermeulen
+//darkplaces implementation: LordHavoc
+//field definitions:
+//.float buttonchat;
+//description:
+//true if the player is currently chatting (in messagemode, menus or console)
+
+//DP_BUTTONUSE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+//.float buttonuse;
+//client console commands:
+//+use
+//-use
+//description:
+//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
+
+// LordHavoc: HIGHLY experimental, do not implement this in other engines
+//DP_CGAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//SVC definitions:
+float svc_cgame = 50; // [short] length [bytes] data
+//description:
+//contains network messages to client gamecode.
+
+//DP_CL_LOADSKY
+//idea: Nehahra, LordHavoc
+//darkplaces implementation: LordHavoc
+//client console commands:
+//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
+//description:
+//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
+
+//DP_CON_SET
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_SETA
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_ALIASPARAMETERS
+//idea: many
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
+
+//DP_CON_EXPANDCVAR
+//idea: many, PHP
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
+
+//DP_CON_STARTMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
+
+//DP_EF_ADDITIVE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_ADDITIVE     = 32;
+//description:
+//additive blending when this object is rendered
+
+//DP_EF_BLUE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_BLUE         = 64;
+//description:
+//entity emits blue light (used for quad)
+
+//DP_EF_FLAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_FLAME        = 1024;
+//description:
+//entity is on fire
+
+//DP_EF_FULLBRIGHT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_FULLBRIGHT   = 512;
+//description:
+//entity is always brightly lit
+
+//DP_EF_NODEPTHTEST
+//idea: Supa
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NODEPTHTEST       = 8192;
+//description:
+//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
+
+//DP_EF_NODRAW
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NODRAW       = 16;
+//description:
+//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
+
+//DP_EF_NOSHADOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NOSHADOW     = 4096;
+//description:
+//realtime lights will not cast shadows from this entity (but can still illuminate it)
+
+//DP_EF_RED
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_RED          = 128;
+//description:
+//entity emits red light (used for invulnerability)
+
+//DP_EF_STARDUST
+//idea: MythWorks Inc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_STARDUST     = 2048;
+//description:
+//entity emits bouncing sparkles in every direction
+
+//DP_ENT_ALPHA
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//fields:
+.float alpha;
+//description:
+//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
+
+//DP_ENT_COLORMOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definition:
+.vector colormod;
+//description:
+//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal).
+
+//DP_ENT_CUSTOMCOLORMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number.
+
+/*
+//NOTE: no longer supported by darkplaces because all entities are delta compressed now
+//DP_ENT_DELTACOMPRESS // no longer supported
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_DELTA = 8388608;
+//description:
+//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc).
+*/
+
+//DP_ENT_EXTERIORMODELTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//fields:
+//.entity exteriormodeltoclient;
+//description:
+//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown.  Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
+
+//DP_ENT_GLOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+//.float glow_color;
+.float glow_size;
+//.float glow_trail;
+//description:
+//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
+
+//DP_ENT_LOWPRECISION
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_LOWPRECISION = 4194304;
+//description:
+//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
+
+//DP_ENT_SCALE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float scale;
+//description:
+//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller.
+
+//DP_ENT_VIEWMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity viewmodelforclient;
+//description:
+//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)...  the entity is not visible to any other client.
+
+//DP_GFX_EXTERNALTEXTURES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//loads external textures found in various directories (tenebrae compatible)...
+/*
+in all examples .tga is merely the base texture, it can be any of these:
+.tga (base texture)
+_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha)
+_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend)
+_shirt.tga (same idea as pants, but for shirt color)
+_diffuse.tga (this may be used instead of base texture for per pixel lighting)
+_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale))
+_norm.tga (normalmap texture for per pixel lighting)
+_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility)
+_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility)
+
+due to glquake's incomplete Targa(r) loader, this section describes
+required Targa(r) features support:
+types:
+type 1 (uncompressed 8bit paletted with 24bit/32bit palette)
+type 2 (uncompressed 24bit/32bit true color, glquake supported this)
+type 3 (uncompressed 8bit greyscale)
+type 9 (RLE compressed 8bit paletted with 24bit/32bit palette)
+type 10 (RLE compressed 24bit/32bit true color, glquake supported this)
+type 11 (RLE compressed 8bit greyscale)
+attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
+
+image formats guarenteed to be supported: tga, pcx, lmp
+image formats that are optional: png, jpg
+
+mdl/spr/spr32 examples:
+skins are named _A (A being a number) and skingroups are named like _A_B
+these act as suffixes on the model name...
+example names for skin _2_1 of model "progs/armor.mdl":
+game/override/progs/armor.mdl_2_1.tga
+game/textures/progs/armor.mdl_2_1.tga
+game/progs/armor.mdl_2_1.tga
+example names for skin _0 of the model "progs/armor.mdl":
+game/override/progs/armor.mdl_0.tga
+game/textures/progs/armor.mdl_0.tga
+game/progs/armor.mdl_0.tga
+note that there can be more skins files (of the _0 naming) than the mdl
+contains, this is only useful to save space in the .mdl file if classic quake
+compatibility is not a concern.
+
+bsp/md2/md3 examples:
+example names for the texture "quake" of model "maps/start.bsp":
+game/override/quake.tga
+game/textures/quake.tga
+game/quake.tga
+
+sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
+game/override/gfx/conchars.tga
+game/textures/gfx/conchars.tga
+game/gfx/conchars.tga
+*/
+
+//DP_GFX_FOG
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
+//description:
+//global fog for the map, can not be changed by QC
+
+//DP_GFX_QUAKE3MODELTAGS
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity tag_entity; // entity this is attached to (call setattachment to set this)
+.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
+//builtin definitions:
+void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
+//description:
+//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
+//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
+//note 3: attaching to world turns off attachment
+//note 4: the entity that this is attached to must be visible for this to work
+//note 5: if an entity is attached to the player entity it will not be drawn in first person.
+
+//DP_GFX_SKINFILES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as:
+//progs/test.md3_0.skin
+//progs/test.md3_1.skin
+//...
+//
+//these files contain replace commands (replace meshname shadername), example:
+//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement
+//replace "teamstripes" "progs/test/redstripes.tga"
+//replace "visor" "common/nodraw" // this makes the visor mesh invisible
+////it is not possible to rename tags using this format
+//
+//Or the Quake3 syntax (100% compatible with Quake3's .skin files):
+//helmet,progs/test/helmet1.tga // this is a mesh shader replacement
+//teamstripes,progs/test/redstripes.tga
+//visor,common/nodraw // this makes the visor mesh invisible
+//tag_camera, // this defines that the first tag in the model is called tag_camera
+//tag_test, // this defines that the second tag in the model is called tag_test
+//
+//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible.
+//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
+//other commands might be added someday but it is not expected.
+
+//DP_GFX_SKYBOX
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
+//description:
+//global skybox for the map, can not be changed by QC
+
+//DP_HALFLIFE_MAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30).
+
+//DP_HALFLIFE_MAP_CVAR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//cvars:
+//halflifebsp 0/1
+//description:
+//engine sets this cvar when loading a map to indicate if it is halflife format or not.
+
+//DP_HALFLIFE_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife sprites.
+
+//DP_INPUTBUTTONS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float button3;
+.float button4;
+.float button5;
+.float button6;
+.float button7;
+//.float button8;
+//description:
+//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
+
+//DP_LITSPRITES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
+
+//DP_LITSUPPORT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
+//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course...  see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
+
+//DP_MONSTERWALK
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player.
+
+//DP_MOVETYPEBOUNCEMISSILE
+//idea: id Software
+//darkplaces implementation: id Software
+//movetype definitions:
+//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
+//description:
+//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
+
+//DP_MOVETYPEFOLLOW
+//idea: id Software, LordHavoc (redesigned)
+//darkplaces implementation: LordHavoc
+//movetype definitions:
+float MOVETYPE_FOLLOW = 12;
+//description:
+//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:
+//aiment - the entity this is attached to.
+//punchangle - the original angles when the follow began.
+//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
+//v_angle - the relative angles.
+//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:
+//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
+//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid
+//hole.aiment = bmodel; // make the hole follow bmodel
+//hole.punchangle = bmodel.angles; // the original angles of bmodel
+//hole.view_ofs = hole.origin - bmodel.origin; // relative origin
+//hole.v_angle = hole.angles - bmodel.angles; // relative angles
+
+//DP_QC_CHANGEPITCH
+//idea: id Software
+//darkplaces implementation: id Software
+//field definitions:
+.float idealpitch;
+//.float pitch_speed;
+//builtin definitions:
+void(entity ent) changepitch = #63;
+//description:
+//equivilant to changeyaw, ent is normally self. (this was a Q2 builtin)
+
+//DP_QC_COPYENTITY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity from, entity to) copyentity = #400;
+//description:
+//copies all data in the entity to another entity.
+
+//DP_QC_CVAR_STRING
+//idea: VorteX
+//DarkPlaces implementation: VorteX, LordHavoc
+//builtin definitions:
+string(string s, ...) cvar_string = #448;
+//description:
+//returns the value of a cvar, as a tempstring.
+
+//DP_QC_ETOS
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+string(entity ent) etos = #65;
+//description:
+//prints "entity 1" or similar into a string. (this was a Q2 builtin)
+
+//DP_QC_FINDCHAIN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.string fld, string match) findchain = #402;
+//description:
+//similar to find() but returns a chain of entities like findradius.
+
+//DP_QC_FINDCHAINFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.float fld, float match) findchainflags = #450;
+//description:
+//similar to findflags() but returns a chain of entities like findradius.
+
+//DP_QC_FINDCHAINFLOAT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.entity fld, entity match) findchainentity = #403;
+entity(.float fld, float match) findchainfloat = #403;
+//description:
+//similar to findentity()/findfloat() but returns a chain of entities like findradius.
+
+//DP_QC_FINDFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .float fld, float match) findflags = #449;
+//description:
+//finds an entity with the specified flag set in the field, similar to find()
+
+//DP_QC_FINDFLOAT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .entity fld, entity match) findentity = #98;
+entity(entity start, .float fld, float match) findfloat = #98;
+//description:
+//finds an entity or float field value, similar to find(), but for entity and float fields.
+
+//DP_QC_FS_SEARCH
+//idea: Black
+//darkplaces implementation: Black
+//builtin definitions:
+float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void(float handle) search_end = #445;
+float(float handle) search_getsize = #446;
+string(float handle, float num) search_getfilename = #447;
+//description:
+//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
+//search_end frees a search slot (also done at progs reload).
+//search_getsize returns how many filenames were found.
+//search_getfilename returns a filename from the search.
+
+//DP_QC_GETLIGHT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector(vector org) getlight = #92;
+//description:
+//returns the lighting at the requested location (in color), 0-255 range (can exceed 255).
+
+//DP_QC_GETSURFACE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(entity e, float s) getsurfacenumpoints = #434;
+vector(entity e, float s, float n) getsurfacepoint = #435;
+vector(entity e, float s) getsurfacenormal = #436;
+string(entity e, float s) getsurfacetexture = #437;
+float(entity e, vector p) getsurfacenearpoint = #438;
+vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
+//description:
+//functions to query surface information.
+
+//DP_QC_GETTAGINFO
+//idea: VorteX, LordHavoc (somebody else?)
+//DarkPlaces implementation: VorteX
+//builtin definitions:
+float(entity ent, string tagname) gettagindex = #451;
+vector(entity ent, float tagindex) gettaginfo = #452;
+//description:
+//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
+//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
+
+//DP_QC_MINMAXBOUND
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(float a, float b) min = #94;
+float(float a, float b, float c) min3 = #94;
+float(float a, float b, float c, float d) min4 = #94;
+float(float a, float b, float c, float d, float e) min5 = #94;
+float(float a, float b, float c, float d, float e, float f) min6 = #94;
+float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
+float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
+float(float a, float b) max = #95;
+float(float a, float b, float c) max3 = #95;
+float(float a, float b, float c, float d) max4 = #95;
+float(float a, float b, float c, float d, float e) max5 = #95;
+float(float a, float b, float c, float d, float e, float f) max6 = #95;
+float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
+float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
+float(float minimum, float val, float maximum) bound = #96;
+//description:
+//min returns the lowest of all the supplied numbers.
+//max returns the highest of all the supplied numbers.
+//bound clamps the value to the range and returns it.
+
+//DP_QC_MULTIPLETEMPSTRINGS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//this extension makes all builtins returning tempstrings (ftos for example) cycle through a pool of multiple tempstrings (at least 16), allowing multiple ftos results to be gathered before putting them to use, normal quake only had 1 tempstring, causing many headaches.  Note that for longer term storage (or compatibility on engines having FRIK_FILE but not this extension) the FRIK_FILE extension's strzone/strunzone builtins provide similar functionality (slower though).
+
+//DP_QC_RANDOMVEC
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector() randomvec = #91;
+//description:
+//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
+
+//DP_QC_SINCOSSQRTPOW
+//idea: id Software, LordHavoc
+//darkplaces implementation: id Software, LordHavoc
+//builtin definitions:
+float(float val) sin = #60;
+float(float val) cos = #61;
+float(float val) sqrt = #62;
+float(float a, float b) pow = #97;
+//description:
+//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
+
+//DP_QC_TRACEBOX
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+//description:
+//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
+
+//DP_QC_TRACETOSS
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+void(entity ent, entity ignore) tracetoss = #64;
+//description:
+//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
+
+//DP_QC_TRACE_MOVETYPE_HITMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_HITMODEL = 4;
+//description:
+//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
+
+//DP_QC_TRACE_MOVETYPE_WORLDONLY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_WORLDONLY = 3;
+//description:
+//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
+
+//DP_QC_VECTORVECTORS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector dir) vectorvectors = #432;
+//description:
+//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles.
+
+//DP_QUAKE2_MODEL
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake2 .md2 files.
+
+//DP_QUAKE2_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: Elric
+//description:
+//shows that the engine supports Quake2 .sp2 files.
+
+//DP_QUAKE3_MAP
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .bsp files.
+
+//DP_QUAKE3_MODEL
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .md3 files.
+
+//DP_REGISTERCVAR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string name, string value) registercvar = #93;
+//description:
+//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
+//NOTE: DP_CON_SET is much better.
+
+//DP_SND_DIRECTIONLESSATTNNONE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
+
+//DP_SND_FAKETRACKS
+//idea: requested
+//darkplaces implementation: Elric
+//description:
+//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
+//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
+
+//DP_SND_OGGVORBIS
+//idea: Transfusion
+//darkplaces implementation: Elric
+//description:
+//the engine supports loading Ogg Vorbis sound files.  Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
+
+//DP_SND_STEREOWAV
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports stereo WAV files.  (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
+
+//DP_SOLIDCORPSE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//solid definitions:
+float SOLID_CORPSE = 5;
+//description:
+//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline.
+
+//DP_SPRITE32
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports .spr32 sprites.
+
+//DP_SV_BOTCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constants:
+float CLIENTTYPE_DISCONNECTED = 0;
+float CLIENTTYPE_REAL = 1;
+float CLIENTTYPE_BOT = 2;
+float CLIENTTYPE_NOTACLIENT = 3;
+//builtin definitions:
+entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available
+float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants
+//description:
+//spawns a client with no network connection, to allow bots to use client slots with no hacks.
+//How to use:
+/*
+	// to spawn a bot
+	local entity oldself;
+	oldself = self;
+	self = spawnclient();
+	if (!self)
+	{
+		bprint("Can not add bot, server full.\n");
+		self = oldself;
+		return;
+	}
+	self.netname = "Yoyobot";
+	self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants
+	ClientConnect();
+	PutClientInServer();
+	self = oldself;
+
+	// to remove all bots
+	local entity head;
+	head = find(world, classname, "player");
+	while (head)
+	{
+		if (clienttype(head) == CLIENTTYPE_BOT)
+			dropclient(head);
+		head = find(head, classname, "player");
+	}
+
+	// to identify if a client is a bot (for example in PlayerPreThink)
+	if (clienttype(self) == CLIENTTYPE_BOT)
+		botthink();
+*/
+//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT
+//How it works:
+//creates a new client, calls SetNewParms and stores the parms, and returns the client.
+//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually
+//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is).
+//parms work the same on bot clients as they do on real clients, and do carry from level to level
+
+//DP_SV_CLIENTCOLORS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//.float clientcolors; // colors of the client (format: pants + shirt * 16)
+//description:
+//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
+
+//DP_SV_CLIENTNAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
+
+//DP_SV_DRAWONLYTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+//.entity drawonlytoclient;
+//description:
+//the entity is only visible to the specified client.
+
+//DP_SV_DROPCLIENT
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity clent) dropclient = #453;
+//description:
+//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
+
+//DP_SV_EFFECT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+//SVC definitions:
+//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
+//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate
+//description:
+//clientside playback of simple custom sprite effects (explosion sprites, etc).
+
+//DP_SV_NODRAWTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+//.entity nodrawtoclient;
+//description:
+//the entity is not visible to the specified client.
+
+//DP_SV_PING
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+//.float ping;
+//description:
+//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
+
+//DP_SV_PUNCHVECTOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector punchvector;
+//description:
+//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
+
+//DP_SV_PLAYERPHYSICS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector movement;
+//cvar definitions:
+//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
+//engine-called QC prototypes:
+//void() SV_PlayerPhysics;
+//description:
+//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
+
+//DP_SV_PRECACHEANYTIME
+//idea: id Software (Quake2)
+//darkplaces implementation: LordHavoc
+//description:
+//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
+
+//DP_SV_ROTATINGBMODEL
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
+//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
+
+//DP_SV_SETCOLOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity ent, float colors) setcolor = #401;
+//engine called QC functions (optional):
+//void(float color) SV_ChangeTeam;
+//description:
+//setcolor sets the color on a client and updates internal color information accordingly (equivilant to stuffing a "color" command but immediate)
+//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.
+//the color format is pants + shirt * 16 (0-255 potentially)
+
+//DP_SV_SLOWMO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//cvars:
+//"slowmo" (0+, default 1)
+//description:
+//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
+//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
+
+//DP_SV_WRITEUNTERMINATEDSTRING
+//idea: shadowalker
+//darkplaces implementation: Sajt
+//builtin definitions:
+void(float to, string s) WriteUnterminatedString = #456;
+//description:
+//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
+
+//DP_TE_BLOOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector velocity, float howmany) te_blood = #405;
+//temp entity definitions:
+float TE_BLOOD = 50;
+//protocol:
+//vector origin
+//byte xvelocity (-128 to +127)
+//byte yvelocity (-128 to +127)
+//byte zvelocity (-128 to +127)
+//byte count (0 to 255, how much blood)
+//description:
+//creates a blood effect.
+
+//DP_TE_BLOODSHOWER
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+//temp entity definitions:
+//float TE_BLOODSHOWER = 52;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//coord explosionspeed (velocity of blood particles flying out of the center)
+//short count (number of blood particles)
+//description:
+//creates an exploding shower of blood, for making gibbings more convincing.
+
+//DP_TE_CUSTOMFLASH
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
+//temp entity definitions:
+//float TE_CUSTOMFLASH = 73;
+//protocol:
+//vector origin
+//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius)
+//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime)
+//byte red (0.0 to 1.0 converted to 0-255)
+//byte green (0.0 to 1.0 converted to 0-255)
+//byte blue (0.0 to 1.0 converted to 0-255)
+//description:
+//creates a customized light flash.
+
+//DP_TE_EXPLOSIONRGB
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector color) te_explosionrgb = #407;
+//temp entity definitions:
+//float TE_EXPLOSIONRGB = 53;
+//protocol:
+//vector origin
+//byte red (0.0 to 1.0 converted to 0 to 255)
+//byte green (0.0 to 1.0 converted to 0 to 255)
+//byte blue (0.0 to 1.0 converted to 0 to 255)
+//description:
+//creates a colored explosion effect.
+
+//DP_TE_FLAMEJET
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_flamejet = #457;
+//temp entity definitions:
+//float TE_FLAMEJET = 74;
+//protocol:
+//vector origin
+//vector velocity
+//byte count (0 to 255, how many flame particles)
+//description:
+//creates a single puff of flame particles.  (not very useful really)
+
+//DP_TE_PARTICLECUBE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+//temp entity definitions:
+//float TE_PARTICLECUBE = 54;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity
+//short count
+//byte color (palette color)
+//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?)
+//coord randomvel (how much to jitter the velocity)
+//description:
+//creates a cloud of particles, useful for forcefields but quite customizable.
+
+//DP_TE_PARTICLERAIN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+//temp entity definitions:
+//float TE_PARTICLERAIN = 55;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity (velocity of particles)
+//short count (number of particles)
+//byte color (8bit palette color)
+//description:
+//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube.
+
+//DP_TE_PARTICLESNOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+//temp entity definitions:
+//float TE_PARTICLERAIN = 56;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity (velocity of particles)
+//short count (number of particles)
+//byte color (8bit palette color)
+//description:
+//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
+
+//DP_TE_PLASMABURN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_plasmaburn = #433;
+//temp entity definitions:
+//float TE_PLASMABURN = 75;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2) and marks the walls.
+
+//DP_TE_QUADEFFECTS1
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+//temp entity definitions:
+//float   TE_GUNSHOTQUAD  = 57; // [vector] origin
+//float   TE_SPIKEQUAD    = 58; // [vector] origin
+//float   TE_SUPERSPIKEQUAD = 59; // [vector] origin
+//float   TE_EXPLOSIONQUAD = 70; // [vector] origin
+//protocol:
+//vector origin
+//description:
+//all of these just take a location, and are equivilant in function (but not appearance :) to the original TE_GUNSHOT, etc.
+
+//DP_TE_SMALLFLASH
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_smallflash = #416;
+//temp entity definitions:
+//float TE_SMALLFLASH = 72;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2).
+
+//DP_TE_SPARK
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_spark = #411;
+//temp entity definitions:
+//float TE_SPARK = 51;
+//protocol:
+//vector origin
+//byte xvelocity (-128 to 127)
+//byte yvelocity (-128 to 127)
+//byte zvelocity (-128 to 127)
+//byte count (number of sparks)
+//description:
+//creates a shower of sparks and a smoke puff.
+
+//DP_TE_STANDARDEFFECTBUILTINS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float color, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+//description:
+//to make life easier on mod coders.
+
+//DP_VIEWZOOM
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float viewzoom;
+//description:
+//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
+
+//FRIK_FILE
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s) stof = #81; // get numerical value from a string
+float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
+void(float fhandle) fclose = #111; // closes a file
+string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
+void(float fhandle, string s) fputs = #113; // writes a line of text to the end of the file
+float(string s) strlen = #114; // returns how many characters are in a string
+string(string s1, string s2, ...) strcat = #115; // concatenates two strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
+string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring
+vector(string s) stov = #117; // returns vector value from a string
+string(string s) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
+void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
+//constants:
+float FILE_READ = 0;
+float FILE_APPEND = 1;
+float FILE_WRITE = 2;
+//cvars:
+//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
+//description:
+//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
+
+//KRIMZON_SV_PARSECLIENTCOMMAND
+//idea: KrimZon
+//darkplaces implementation: KrimZon, LordHavoc
+//engine-called QC prototypes:
+//void(string s) SV_ParseClientCommand;
+//builtin definitions:
+void(entity e, string s) clientcommand = #440;
+float(string s) tokenize = #441;
+string(float n) argv = #442;
+//description:
+//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
+
+//NEH_CMD_PLAY2
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "play2" console command (plays a sound without spatialization).
+
+//NEH_RESTOREGAME
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//engine-called QC prototypes:
+//void() RestoreGame;
+//description:
+//when a savegame is loaded, this function is called
+
+//NEXUIZ_PLAYERMODEL
+//idea: Nexuiz
+//darkplaces implementation: Black
+//console commands:
+//playermodel <name> - FIXME: EXAMPLE NEEDED
+//playerskin <name> - FIXME: EXAMPLE NEEDED
+//field definitions:
+//.string playermodel; // name of player model sent by client
+//.string playerskin; // name of player skin sent by client
+//description:
+//these client properties are used by Nexuiz.
+
+//NXQ_GFX_LETTERBOX
+//idea: nxQuake
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
+
+//PRYDON_CLIENTCURSOR
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
+//field definitions:
+//.float cursor_active; // true if cl_prydoncursor mode is on
+//.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
+//.vector cursor_trace_start; // position of camera
+.vector cursor_trace_endpos; // position of cursor in world (as traced from camera)
+.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt)
+//cvar definitions:
+//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented)
+//description:
+//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit.
+//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen.
+//the clientside trace skips transparent entities (except those marked EF_SELECTABLE).
+//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2).
+//intended to be used by Prydon Gate.
+
+//TENEBRAE_GFX_DLIGHTS
+//idea: Tenebrae
+//darkplaces implementation: LordHavoc
+//fields:
+//.float light_lev; // radius (does not affect brightness), typical value 350
+//.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast)
+//.float style; // light style (like normal light entities, flickering torches or switchable, etc)
+.float pflags; // flags (see PFLAGS_ constants)
+.vector angles; // orientation of the light
+.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
+//constants:
+float PFLAGS_NOSHADOW = 1; // light does not cast shadows
+float PFLAGS_CORONA = 2; // light has a corona flare
+float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!)
+//description:
+//more powerful dynamic light settings
+//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
+//changes compared to tenebrae (because they're too 'leet' for standards):
+//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
+//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
+
+//TW_SV_STEPCONTROL
+//idea: Transfusion
+//darkplaces implementation: LordHavoc
+//cvars:
+//sv_jumpstep (0/1, default 1)
+//sv_stepheight (default 18)
+//description:
+//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
+


Property changes on: trunk/basezym/progsqc/dpextensions.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/gamedefs.qc
===================================================================
--- trunk/basezym/progsqc/gamedefs.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/gamedefs.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,93 +1,93 @@
-
-// ladder info
-.float ladder_time;
-.entity ladder_entity;
-
-.float respawntime;
-
-.float itemitemtype;
-
-.float projflag;
-.float explflag;
-.float fireflag;
-
-.float itemselected;
-
-.float spawned;
-
-.vector viewmodelchange;
-.vector viewmodeldiff;
-
-.vector	pos1, pos2;
-.vector	mangle;
-.vector dest;
-.float state;
-.float		t_length, t_width;
-
-.entity		hook;
-.float rope_length;
-
-.float fade_time;
-.float fade_rate;
-.vector finaldest, finalangle;
-
-.string modeldir;
-.string modelext;
-.string sounddir;
-.entity playerclass;
-
-.float jumpspeed;
-.float speedratio;
-.float scaleratio;
-.vector boxmin;
-.vector boxmax;
-.float jetpack_fuel;
-.float jetpack_fuelmax;
-.float jetpack_fuelregenair;
-.float jetpack_fuelregenground;
-.float jetpack_acc;
-.float jetpack_accadd;
-.float jetpack_accbase;
-.float jetpack_maxupspeed;
-.float jetpack_maxmovespeed;
-.float jetpack_use;
-.float jetpackactive;
-
-.float bloodtype;
-.float gibtype;
-
-.float aitype;
-.float animationtype;
-.float team;
-.float classnum;
-
-float AITYPE_NONE = 0;
-float AITYPE_1 = 1;
-float AITYPE_2 = 2;
-
-// gravity scaling (engine feature)
-// TODO: move to defs.qc or dpextensions.qc or something else?
-.float gravity;
-
-// multiplayer variables
-float teamplay;
-float timelimit;
-float fraglimit;
-
-// SV_PlayerPhysics variables
-float sv_maxairspeed, sv_maxspeed, sv_friction, sv_accelerate, sv_airaccelerate, sv_stopspeed, sv_gravity;
-//float sv_edgefriction, cl_divspeed, cl_rollangle;
-
-
-// vector PL_MIN = stov(cvar_string("g_player_boxmin"));    NOTE: g_player changed to g_class#
-//vector PL_MAX = stov(cvar_string("g_player_boxmax"));
-//vector PL_VIEW_OFS = stov(cvar_string("g_player_viewofs"));
-//vector PL_WEAPON_OFS = stov(cvar_string("g_player_weaponofs"));
-//float PLAYER_HEALTH_START = cvar("g_player_healthstart");
-//float PLAYER_HEALTH_MAX = cvar("g_player_healthmax");
-//float PLAYER_SHIELD_START = cvar("g_player_shieldstart");
-//float PLAYER_SHIELD_MAX = cvar("g_player_shieldmax");
-//float PLAYER_SHIELD_REGENRATE = cvar("g_player_regenrate");
-//float PLAYER_SHIELD_REGENMAX = cvar("g_player_regenmax");
-
-float PLAYER_FALLDAMAGE = 30;
+
+// ladder info
+.float ladder_time;
+.entity ladder_entity;
+
+.float respawntime;
+
+.float itemitemtype;
+
+.float projflag;
+.float explflag;
+.float fireflag;
+
+.float itemselected;
+
+.float spawned;
+
+.vector viewmodelchange;
+.vector viewmodeldiff;
+
+.vector	pos1, pos2;
+.vector	mangle;
+.vector dest;
+.float state;
+.float		t_length, t_width;
+
+.entity		hook;
+.float rope_length;
+
+.float fade_time;
+.float fade_rate;
+.vector finaldest, finalangle;
+
+.string modeldir;
+.string modelext;
+.string sounddir;
+.entity playerclass;
+
+.float jumpspeed;
+.float speedratio;
+.float scaleratio;
+.vector boxmin;
+.vector boxmax;
+.float jetpack_fuel;
+.float jetpack_fuelmax;
+.float jetpack_fuelregenair;
+.float jetpack_fuelregenground;
+.float jetpack_acc;
+.float jetpack_accadd;
+.float jetpack_accbase;
+.float jetpack_maxupspeed;
+.float jetpack_maxmovespeed;
+.float jetpack_use;
+.float jetpackactive;
+
+.float bloodtype;
+.float gibtype;
+
+.float aitype;
+.float animationtype;
+.float team;
+.float classnum;
+
+float AITYPE_NONE = 0;
+float AITYPE_1 = 1;
+float AITYPE_2 = 2;
+
+// gravity scaling (engine feature)
+// TODO: move to defs.qc or dpextensions.qc or something else?
+.float gravity;
+
+// multiplayer variables
+float teamplay;
+float timelimit;
+float fraglimit;
+
+// SV_PlayerPhysics variables
+float sv_maxairspeed, sv_maxspeed, sv_friction, sv_accelerate, sv_airaccelerate, sv_stopspeed, sv_gravity;
+//float sv_edgefriction, cl_divspeed, cl_rollangle;
+
+
+// vector PL_MIN = stov(cvar_string("g_player_boxmin"));    NOTE: g_player changed to g_class#
+//vector PL_MAX = stov(cvar_string("g_player_boxmax"));
+//vector PL_VIEW_OFS = stov(cvar_string("g_player_viewofs"));
+//vector PL_WEAPON_OFS = stov(cvar_string("g_player_weaponofs"));
+//float PLAYER_HEALTH_START = cvar("g_player_healthstart");
+//float PLAYER_HEALTH_MAX = cvar("g_player_healthmax");
+//float PLAYER_SHIELD_START = cvar("g_player_shieldstart");
+//float PLAYER_SHIELD_MAX = cvar("g_player_shieldmax");
+//float PLAYER_SHIELD_REGENRATE = cvar("g_player_regenrate");
+//float PLAYER_SHIELD_REGENMAX = cvar("g_player_regenmax");
+
+float PLAYER_FALLDAMAGE = 30;


Property changes on: trunk/basezym/progsqc/gamedefs.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/inventory.qc
===================================================================
--- trunk/basezym/progsqc/inventory.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/inventory.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,896 +1,896 @@
-
-// if TRUE this entity will ignore ModifyItem attempts with negative values
-.float unlimitedinventory;
-
-float ITEMTYPE_NONE = -1;
-
-float ITEMTYPE_WEAP1 = 0;
-float ITEMTYPE_WEAP2 = 1;
-float ITEMTYPE_WEAP3 = 2;
-float ITEMTYPE_WEAP4 = 3;
-float ITEMTYPE_WEAP5 = 4;
-float ITEMTYPE_WEAP6 = 5;
-float ITEMTYPE_WEAP7 = 6;
-float ITEMTYPE_WEAP8 = 7;
-float ITEMTYPE_WEAP9 = 8;
-float ITEMTYPE_WEAP10 = 9;
-float ITEMTYPE_WEAP11 = 10;
-float ITEMTYPE_WEAP12 = 11;
-float ITEMTYPE_WEAP13 = 12;
-float ITEMTYPE_WEAP14 = 13;
-float ITEMTYPE_WEAP15 = 14;
-float ITEMTYPE_WEAP16 = 15;
-
-float ITEMTYPE_AI_WEAP1 = 16;
-float ITEMTYPE_AI_WEAP2 = 17;
-float ITEMTYPE_AI_WEAP3 = 18;
-float ITEMTYPE_AI_WEAP4 = 19;
-float ITEMTYPE_AI_WEAP5 = 20;
-float ITEMTYPE_AI_WEAP6 = 21;
-
-float ITEMTYPE_ITEM1 = 22;
-float ITEMTYPE_ITEM2 = 23;
-float ITEMTYPE_ITEM3 = 24;
-
-float ITEMTYPE_AMMO1 = 25;
-float ITEMTYPE_AMMO2 = 26;
-float ITEMTYPE_AMMO3 = 27;
-float ITEMTYPE_AMMO4 = 28;
-
-float ITEMTYPE_TOTAL = 29;
-
-float WS_IDLE = 0;
-float WS_FIRE1 = 1;
-float WS_FIRE2 = 2;
-float WS_FIRE3 = 4;
-float WS_RELOAD = 5;
-float WS_LOWER = 6;
-float WS_RAISE = 7;
-float WS_TURNON = 8;
-float WS_TURNOFF = 9;
-
-.float weaponitem;
-.float weaponstate;
-.float switchweaponitem;
-
-// current item stats
-float iteminfo_quantity;
-float iteminfo_ammo;
-float iteminfo_ammoinventory; // how much ammo is in inventory (can be loaded into the gun)
-
-// general information about the item
-string iteminfo_model;
-string iteminfo_pickupsound;
-string iteminfo_pickupmodel;
-vector iteminfo_viewmodeloffset;
-string iteminfo_name;
-float iteminfo_itemtype;
-float iteminfo_quantitymax;
-float iteminfo_rechargerate;
-float iteminfo_ammomax;
-float iteminfo_ammoinventorymax;
-float iteminfo_ammotype;
-
-float iteminfo_ammo1minimumtofire;
-float iteminfo_ammo2minimumtofire;
-float iteminfo_ammo1numberof;
-float iteminfo_ammo2numberof;
-float iteminfo_ammo1recoil;
-float iteminfo_ammo2recoil;
-vector iteminfo_ammo1damage;
-vector iteminfo_ammo2damage;
-float iteminfo_ammo1damagetype;
-float iteminfo_ammo2damagetype;
-vector iteminfo_ammo1speeds;
-vector iteminfo_ammo2speeds;
-float iteminfo_ammo1lifetime;
-float iteminfo_ammo2lifetime;
-float iteminfo_ammo1fireflags;
-float iteminfo_ammo2fireflags;
-float iteminfo_ammo1projflags;
-float iteminfo_ammo2projflags;
-float iteminfo_ammo1explflags;
-float iteminfo_ammo2explflags;
-string iteminfo_ammo1model;
-string iteminfo_ammo2model;
-string iteminfo_ammo1explodesound;
-string iteminfo_ammo2explodesound;
-string iteminfo_ammo1bouncesound;
-string iteminfo_ammo2bouncesound;
-string iteminfo_ammo1firesound;
-string iteminfo_ammo2firesound;
-float iteminfo_ammo1tracer;
-float iteminfo_ammo2tracer;
-string iteminfo_ammo1tracermodel;
-string iteminfo_ammo2tracermodel;
-float iteminfo_ammo1modelscale;
-float iteminfo_ammo2modelscale;
-float iteminfo_ammo1health;
-float iteminfo_ammo2health;
-float iteminfo_ammo1mass;
-float iteminfo_ammo2mass;
-vector iteminfo_ammo1colormod;
-vector iteminfo_ammo2colormod;
-vector iteminfo_ammo1viewmodelpush;
-vector iteminfo_ammo2viewmodelpush;
-float iteminfo_ammo1noprojectile;
-float iteminfo_ammo2noprojectile;
-
-// special information specific to weapon items
-string iteminfo_weapon_viewmodel;
-vector iteminfo_weapon_viewmodelanim_idle;
-vector iteminfo_weapon_viewmodelanim_fire1;
-vector iteminfo_weapon_viewmodelanim_fire2;
-vector iteminfo_weapon_viewmodelanim_reload;
-vector iteminfo_weapon_viewmodelanim_lower;
-vector iteminfo_weapon_viewmodelanim_raise;
-vector iteminfo_weapon_viewmodelanim_turnon;
-vector iteminfo_weapon_viewmodelanim_turnoff;
-float iteminfo_weapon_canfire1;
-float iteminfo_weapon_canfire2;
-float iteminfo_weapon_canreload;
-float iteminfo_weapon_canraise;
-float iteminfo_weapon_rank;
-
-// this array and functions depend on fteqcc arrays, but are easily replaced with a huge chunk of if else stuff if needed
-.vector inventory[ITEMTYPE_TOTAL];
-vector(entity character, float itemtype) Inventory_GetItem =
-{
-	if (itemtype < 0 || itemtype >= ITEMTYPE_TOTAL)
-		return '0 0 0';
-	return character.(inventory[itemtype]);
-};
-void(entity character, float itemtype, vector item) Inventory_SetItem =
-{
-	if (itemtype < 0 || itemtype >= ITEMTYPE_TOTAL)
-		return;
-	character.(inventory[itemtype]) = item;
-};
-void(entity character, float itemtype) Inventory_GetItemInfo =
-{
-	local vector item;
-	local entity e;
-	local float d;
-	if (itemtype < 0)
-	{
-	    bprint(iteminfo_name);
-		//error("itemtype = ",ftos(itemtype),"\n");
-	}
-	if (itemtype >= ITEMTYPE_TOTAL)
-		bprint(ftos(itemtype)," ", ftos(ITEMTYPE_TOTAL), " : itemtype >= ITEMTYPE_TOTAL\n");
-	iteminfo_itemtype = itemtype;
-	item = Inventory_GetItem(character, itemtype);
-	iteminfo_quantity = item_x;
-	iteminfo_ammo = item_y;
-	iteminfo_ammoinventory = 0;
-	
-	iteminfo_model = "";
-	iteminfo_pickupmodel = "";
-	iteminfo_viewmodeloffset = '0 0 0';
-	iteminfo_name = "unknown";
-	iteminfo_pickupsound = "";
-	iteminfo_quantitymax = 0;
-	iteminfo_rechargerate = 0;
-	iteminfo_ammomax = 0;
-	iteminfo_ammoinventorymax = 0;
-	iteminfo_ammotype = ITEMTYPE_NONE;
-	
-	iteminfo_ammo1minimumtofire = 0;
-	iteminfo_ammo1damagetype = DAMAGETYPE_UNKNOWN;
-	iteminfo_ammo1damage = '0 0 0';
-	iteminfo_ammo1speeds = '0 0 0';
-	iteminfo_ammo1lifetime = 10;
-	iteminfo_ammo1projflags = PROJFLAG_ANYIMPACT;
-	iteminfo_ammo1explflags = 0;
-	iteminfo_ammo1fireflags = 0;
-	iteminfo_ammo1model = "";
-	iteminfo_ammo1firesound = "";
-	iteminfo_ammo1explodesound = "";
-	iteminfo_ammo1bouncesound = "";
-	iteminfo_ammo1numberof = 1;
-	iteminfo_ammo1recoil = 0;
-	iteminfo_ammo1tracer = 0;
-	iteminfo_ammo1tracermodel = "";
-	iteminfo_ammo1modelscale = 1;
-	iteminfo_ammo1health = 0;
-	iteminfo_ammo1mass = 0;
-	iteminfo_ammo1colormod = '0 0 0';
-	iteminfo_ammo1viewmodelpush = '0 0 0';
-	iteminfo_ammo1noprojectile = 0;
-	iteminfo_ammo2minimumtofire = 0;
-	iteminfo_ammo2damagetype = DAMAGETYPE_UNKNOWN;
-	iteminfo_ammo2damage = '0 0 0';
-	iteminfo_ammo2speeds = '0 0 0';
-	iteminfo_ammo2lifetime = 10;
-	iteminfo_ammo2projflags = PROJFLAG_ANYIMPACT;
-	iteminfo_ammo2explflags = 0;
-	iteminfo_ammo2fireflags = 0;
-	iteminfo_ammo2model = "";
-	iteminfo_ammo2firesound = "";
-	iteminfo_ammo2explodesound = "";
-	iteminfo_ammo2bouncesound = "";
-	iteminfo_ammo2numberof = 1;
-	iteminfo_ammo2recoil = 0;
-	iteminfo_ammo2tracer = 0;
-	iteminfo_ammo2tracermodel = "";
-	iteminfo_ammo2modelscale = 1;
-	iteminfo_ammo2health = 0;
-	iteminfo_ammo2mass = 0;
-	iteminfo_ammo2colormod = '0 0 0';
-	iteminfo_ammo2viewmodelpush =  '0 0 0';
-	iteminfo_ammo2noprojectile = 0;
-	iteminfo_weapon_viewmodel = "";
-	iteminfo_weapon_viewmodelanim_idle = '0 0 1';
-	iteminfo_weapon_viewmodelanim_fire1 = '0 0 2';
-	iteminfo_weapon_viewmodelanim_fire2 = '0 0 2';
-	iteminfo_weapon_viewmodelanim_reload = '0 0 0';
-	iteminfo_weapon_viewmodelanim_lower = '0 0 2';
-	iteminfo_weapon_viewmodelanim_raise = '0 0 2';
-	iteminfo_weapon_viewmodelanim_turnon = '0 0 2';
-	iteminfo_weapon_viewmodelanim_turnoff = '0 0 2';
-	iteminfo_weapon_canfire1 = FALSE;
-	iteminfo_weapon_canfire2 = FALSE;
-	iteminfo_weapon_canreload = FALSE;
-	iteminfo_weapon_canraise = FALSE;
-	iteminfo_weapon_rank = 0;
-	
-	
-	if (itemtype < ITEMTYPE_AMMO1)
-	{
-	   	// set the settings for all weapons		  
-		iteminfo_quantitymax = 1;
-		iteminfo_pickupsound = "items/pickupweapon.wav";
-		iteminfo_weapon_viewmodelanim_idle = '0 0 30';
-		iteminfo_weapon_viewmodelanim_lower = '0 0 0';
-		iteminfo_weapon_viewmodelanim_raise = '0 0 0';
-		
-		string wname;
-		if (itemtype < ITEMTYPE_AI_WEAP1)
-		{
-		   wname = strcat("g_weap",ftos(itemtype + 1));
-		   iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
-		}
-		else if (itemtype < ITEMTYPE_ITEM1)
-		{
-		   wname = strcat("g_ai_weap",ftos(itemtype - ITEMTYPE_AI_WEAP1 + 1)); 
-		   iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
-		}
-		else
-		{
-	 		wname = strcat("g_item",ftos(itemtype - ITEMTYPE_ITEM1 + 1)); 
-		 	iteminfo_quantitymax = cvar(wname,"_quantitymax");
-			iteminfo_ammotype = itemtype;					  // so the firing code knows it's a item
-		}
-		
-		iteminfo_ammo1damagetype = DAMAGETYPE_WEAP1 + itemtype;
-		iteminfo_ammo2damagetype = DAMAGETYPE_WEAP1 + itemtype;
-		
-		iteminfo_name = cvar_string(wname);
-		iteminfo_model = cvar_string(wname,"_model");
-		iteminfo_weapon_viewmodel = cvar_string(wname,"_viewmodel");
-		iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
-		iteminfo_viewmodeloffset = stov(cvar_string(wname,"_viewmodeloffset"));
-		
-		iteminfo_rechargerate = cvar(wname,"_rechargerate");
-		
-		iteminfo_ammomax = cvar(wname,"_ammomax");
-		iteminfo_ammoinventorymax = cvar(wname,"_ammoinventorymax");
-		
-		iteminfo_ammo1damage = stov(cvar_string(wname,"_ammo1damage"));
-		iteminfo_ammo1speeds = stov(cvar_string(wname,"_ammo1speeds"));
-		iteminfo_ammo1model = cvar_string(wname,"_ammo1model");
-		iteminfo_ammo1firesound = cvar_string(wname,"_ammo1firesound");
-		//iteminfo_ammo1explodesound = strzone(cvar_string(wname,"_ammo1explodesound"));
-		
-		iteminfo_ammo1projflags = cvar(wname,"_ammo1projflags");
-		iteminfo_ammo1explflags = cvar(wname,"_ammo1explflags");
-		iteminfo_ammo1fireflags = cvar(wname,"_ammo1fireflags");
-		
-		iteminfo_ammo1noprojectile = cvar(wname,"_ammo1noprojectile");
-		
-		iteminfo_ammo1numberof = cvar(wname,"_ammo1numberof");
-		iteminfo_ammo1recoil = cvar(wname,"_ammo1recoil");
-		iteminfo_ammo1minimumtofire = cvar(wname,"_ammo1mintofire");
-		iteminfo_ammo1lifetime = cvar(wname,"_ammo1lifetime");
-		iteminfo_ammo1tracer = cvar(wname,"_ammo1tracer");
-		iteminfo_ammo1tracermodel = cvar_string(wname,"_ammo1tracermodel");
-		iteminfo_ammo1modelscale = cvar(wname,"_ammo1modelscale");
-		iteminfo_ammo1health = cvar(wname,"_ammo1health");
-		iteminfo_ammo1mass = cvar(wname,"_ammo1mass");
-		iteminfo_ammo1colormod = stov(cvar_string(wname,"_ammo1colormod"));
-		iteminfo_ammo1viewmodelpush = stov(cvar_string(wname,"_ammo1viewmodelpush"));
-		iteminfo_weapon_viewmodelanim_fire1 = stov(cvar_string(wname,"_fire1"));
-		
-		iteminfo_ammo2damage = stov(cvar_string(wname,"_ammo2damage"));
-		iteminfo_ammo2speeds = stov(cvar_string(wname,"_ammo2speeds"));
-		iteminfo_ammo2model = cvar_string(wname,"_ammo2model");
-		iteminfo_ammo2firesound = cvar_string(wname,"_ammo2firesound");
-		//iteminfo_ammo2explodesound = strzone(cvar_string(wname,"_ammo2explodesound"));
-		
-		iteminfo_ammo2projflags = cvar(wname,"_ammo2projflags");
-		iteminfo_ammo2explflags = cvar(wname,"_ammo2explflags");
-		iteminfo_ammo2fireflags = cvar(wname,"_ammo2fireflags");
-		
-		iteminfo_ammo2noprojectile = cvar(wname,"_ammo2noprojectile");
-		
-		iteminfo_ammo2numberof = cvar(wname,"_ammo2numberof");
-		iteminfo_ammo2recoil = cvar(wname,"_ammo2recoil");
-		iteminfo_ammo2minimumtofire = cvar(wname,"_ammo2mintofire");
-		iteminfo_ammo2lifetime = cvar(wname,"_ammo2lifetime");
-		iteminfo_ammo2tracer = cvar(wname,"_ammo2tracer");
-		iteminfo_ammo2tracermodel = cvar_string(wname,"_ammo2tracermodel");
-		iteminfo_ammo2modelscale = cvar(wname,"_ammo2modelscale");
-		iteminfo_ammo2health = cvar(wname,"_ammo2health");
-		iteminfo_ammo2mass = cvar(wname,"_ammo2mass");
-		iteminfo_ammo2colormod = stov(cvar_string(wname,"_ammo2colormod"));
-		iteminfo_ammo2viewmodelpush = stov(cvar_string(wname,"_ammo2viewmodelpush"));
-		iteminfo_weapon_viewmodelanim_fire2 = stov(cvar_string(wname,"_fire2"));
-	}
-	else if (itemtype < ITEMTYPE_TOTAL)
-	{
-		wname = strcat("g_ammo",ftos(itemtype - ITEMTYPE_AMMO1 + 1));
-		iteminfo_name = cvar_string(wname,"_name");
-		iteminfo_pickupsound = cvar_string(wname,"_pickupsound");
-		iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
-		iteminfo_quantitymax = cvar(wname,"_quantitymax");
-	}
-	else
-		bprint(ftos(itemtype)," Inventory_GetItemInfo: unknown itemtype\n");
-	
-	if (iteminfo_quantity >= 1)
-	{
-		if (iteminfo_ammotype == itemtype)
-		{
-			// usable items such as flares
-			iteminfo_ammo1minimumtofire = 1;
-			iteminfo_ammomax = iteminfo_ammo1minimumtofire;
-			if (iteminfo_quantity >= iteminfo_ammo1minimumtofire)
-			{
-				iteminfo_ammo = iteminfo_ammo1minimumtofire;
-				iteminfo_ammoinventory = iteminfo_quantity - iteminfo_ammo1minimumtofire;
-				iteminfo_weapon_canfire1 = TRUE;
-				iteminfo_weapon_canfire2 = TRUE;
-				iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2;
-				iteminfo_weapon_rank = iteminfo_quantity * iteminfo_ammo1damage_x;
-			}
-		}
-		else if (iteminfo_ammo1minimumtofire)
-		{
-			// weapons
-			if (iteminfo_ammotype >= 0)
-			{
-				item = Inventory_GetItem(character, iteminfo_ammotype);
-				iteminfo_ammoinventory = item_x;
-			}
-			iteminfo_weapon_canreload = (iteminfo_ammo < iteminfo_ammomax && iteminfo_ammoinventory >= 1);
-			iteminfo_weapon_canfire1 = iteminfo_ammo >= iteminfo_ammo1minimumtofire;
-			iteminfo_weapon_canfire2 = iteminfo_ammo >= iteminfo_ammo2minimumtofire;
-	
-			// fteqcc bug:
-			// these work
-			iteminfo_weapon_canraise = iteminfo_weapon_canfire1 + iteminfo_weapon_canfire2 + iteminfo_weapon_canreload;
-			//if (iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2 || iteminfo_weapon_canreload)
-			//	iteminfo_weapon_canraise = TRUE;
-			// these don't work
-			//iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || (iteminfo_weapon_canfire2 || iteminfo_weapon_canreload);
-			//iteminfo_weapon_canraise = (iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2) || iteminfo_weapon_canreload;
-			//iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2 || iteminfo_weapon_canreload;
-			if (iteminfo_weapon_canraise)
-				iteminfo_weapon_rank = (iteminfo_ammo + iteminfo_ammoinventory) * iteminfo_ammo1damage_x + (iteminfo_ammo + iteminfo_ammoinventory) * iteminfo_ammo2damage_x;
-		}
-		else
-		{
-			// ammo and other consumables, not usable
-		}
-	}
-	if (itemtype == character.weaponitem)
-	{
-		character.currentammo = 0;
-		character.ammo_shells = 0;
-		//character.ammo_nails = 0;
-		//character.ammo_rockets = 0;
-		character.ammo_cells = 0;
-		if (iteminfo_ammomax + iteminfo_ammoinventorymax)
-		{
-			character.currentammo = iteminfo_ammo * 200 / (iteminfo_ammomax + iteminfo_ammoinventorymax);
-			character.ammo_shells = iteminfo_ammoinventory * 200 / (iteminfo_ammomax + iteminfo_ammoinventorymax);
-		}
-		// character.ammo_nails is now set above as the item quantity when using items
-		//if (iteminfo_ammo2max + iteminfo_ammo2inventorymax)
-		//{
-		//	character.ammo_nails = character.jetpack_fuel; // iteminfo_ammo2 * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
-		//	character.ammo_rockets = 0; //iteminfo_ammo2inventory * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
-		//}
-	}
-	else if (itemtype == character.itemselected)
-	{
-	 	character.ammo_nails = iteminfo_quantity * 200 / (iteminfo_quantitymax);
-	}
-};
-
-void() Inventory_Precache =
-{
-	local float c;
-	c = 0;
-	while (c < ITEMTYPE_TOTAL)
-	{
-		Inventory_GetItemInfo(world, c);
-		if (iteminfo_model != "") precache_model(iteminfo_model);
-		if (iteminfo_ammo1model != "") precache_model(iteminfo_ammo1model);
-		if (iteminfo_ammo2model != "") precache_model(iteminfo_ammo2model);
-		if (iteminfo_ammo1tracermodel != "") precache_model(iteminfo_ammo1tracermodel);
-		if (iteminfo_ammo2tracermodel != "") precache_model(iteminfo_ammo2tracermodel);
-		if (iteminfo_pickupsound != "") precache_sound(iteminfo_pickupsound);
-		if (iteminfo_ammo1firesound != "") precache_sound(iteminfo_ammo1firesound);
-		if (iteminfo_ammo1explodesound != "") precache_sound(iteminfo_ammo1explodesound);
-		if (iteminfo_ammo1bouncesound != "") precache_sound(iteminfo_ammo1bouncesound);
-		if (iteminfo_ammo2firesound != "") precache_sound(iteminfo_ammo2firesound);
-		if (iteminfo_ammo2explodesound != "") precache_sound(iteminfo_ammo2explodesound);
-		if (iteminfo_ammo2bouncesound != "") precache_sound(iteminfo_ammo2bouncesound);
-		if (iteminfo_weapon_viewmodel != "") precache_model(iteminfo_weapon_viewmodel);
-		c = c + 1;
-	}
-
-	precache_sound ("weapons/minigun_bulletfire2.wav"); // templeofnoise: old style precache for additional sounds
-	precache_sound ("weapons/minigun_bulletfire3.wav"); // templeofnoise: old style precache for additional sounds
-	precache_sound ("weapons/minigun_bulletfire4.wav"); // templeofnoise: old style precache for additional sounds
-	precache_sound ("weapons/minigun_whirlstart.wav"); // templeofnoise: old style precache for additional sounds
-	precache_sound ("weapons/minigun_whirlend.wav"); // templeofnoise: old style precache for additional sounds
-	precache_sound ("weapons/bullet_ric2.wav"); // templeofnoise
-	precache_sound ("weapons/bullet_ric3.wav"); // templeofnoise
-	precache_sound ("weapons/bullet_ric4.wav"); // templeofnoise
-	precache_sound ("weapons/assaultrailgun_bulletfire2.wav"); // templeofnoise: old style precache for additional sounds
-	precache_sound ("weapons/assaultrailgun_bulletfire3.wav"); // templeofnoise: old style precache for additional sounds
-
-
-};
-
-float(entity character) Inventory_GetBestWeapon =
-{
-	local float best;
-	local float rank;
-	local float c;
-	best = -1;
-	rank = 0;
-	c = 0;
-	while (c < ITEMTYPE_TOTAL)
-	{
-		Inventory_GetItemInfo(character, c);
-		if (iteminfo_weapon_canraise)
-		if (rank < iteminfo_weapon_rank)
-		{
-			rank = iteminfo_weapon_rank;
-			best = c;
-		}
-		c = c + 1;
-	}
-	return best;
-};
-
-float(entity character) Inventory_GetBestItem =
-{
-	local float best;
-	local float rank;
-	local float c;
-	best = -1;
-	rank = 0;
-	c = ITEMTYPE_ITEM1;
-	while (c < ITEMTYPE_AMMO1)
-	{
-		Inventory_GetItemInfo(character, c);
-		if (iteminfo_weapon_canraise)
-			best = c;
-		c = c + 1;
-	}
-	return best;
-};
-
-vector(entity character, float itemtype, float adjustquantity, float adjustammo) Inventory_ModifyItem =
-{
-	local float olditemtype;
-	local vector item, olditem;
-	if (character.unlimitedinventory)
-	if (adjustquantity < 0)
-		adjustquantity = 0;
-	if (adjustquantity == 0)
-	if (adjustammo == 0)
-		return '0 0 0';
-	olditemtype = iteminfo_itemtype;
-	Inventory_GetItemInfo(character, itemtype);
-	item = Inventory_GetItem(character, itemtype);
-	olditem = item;
-	item_x = bound(0, item_x + adjustquantity, iteminfo_quantitymax);
-	item_y = bound(0, item_y + adjustammo, iteminfo_ammomax);
-	//item_z = bound(0, item_z + adjustammo2, iteminfo_ammo2max);
-	Inventory_SetItem(character, itemtype, item);
-	// update iteminfo for olditemtype
-	// (if olditemtype == itemtype then we want to update it because the item
-	//  has been modified, if olditemtype != itemtype then we need to restore
-	//  it to the olditemtype to avoid messing up things for the caller)
-	Inventory_GetItemInfo(character, olditemtype);
-	return item - olditem;
-};
-
-void(entity to, entity from) Inventory_CloneFromInventory =
-{
-	local float itemtype;
-	itemtype = 0;
-	while (itemtype < ITEMTYPE_TOTAL)
-	{
-		Inventory_SetItem(to, itemtype, Inventory_GetItem(from, itemtype));
-		itemtype = itemtype + 1;
-	}
-};
-
-void(entity to, entity from) Inventory_AddFromInventory =
-{
-	local float itemtype;
-	local vector item;
-	itemtype = 0;
-	while (itemtype < ITEMTYPE_TOTAL)
-	{
-		item = Inventory_GetItem(from, itemtype);
-		if (item != '0 0 0')
-			Inventory_ModifyItem(to, itemtype, item_x, item_y);
-		itemtype = itemtype + 1;
-	}
-};
-
-/*
-float ITEMTYPE_TOTAL3 = 60;
-.float inventory[ITEMTYPE_TOTAL3];
-vector(entity character, float itemtype) Inventory_GetItem =
-{
-	local vector v;
-	itemtype = itemtype * 3;
-	v_x = character.inventory[itemtype];
-	v_y = character.inventory[itemtype+1];
-	v_z = character.inventory[itemtype+2];
-	return v;
-};
-void(entity character, float itemtype, vector item) Inventory_SetItem =
-{
-	itemtype = itemtype * 3;
-	character.inventory[itemtype] = item_x;
-	character.inventory[itemtype+1] = item_y;
-	character.inventory[itemtype+2] = item_z;
-};
-*/
-
-void(entity character) Inventory_Clear =
-{
-	local float c;
-	for (c = 0;c < ITEMTYPE_TOTAL;c++)
-		Inventory_SetItem(self, c, '0 0 0');
-};
-
-void Item_Respawn (void)
-{
-	self.solid = SOLID_TRIGGER;	// allow it to be touched again
-	sound (self, CHAN_VOICE, "misc/itemrespawn.wav", 1, ATTN_NORM);	// play respawn sound
-	setorigin (self, self.origin);
-	self.alpha = 1;
-
-	// LordHavoc: replaced respawn stardust effect with a custom te_wizspike
-	te_wizspike(self.origin + self.mins_z * '0 0 1' + '0 0 48');
-}
-
-void() Item_Think =
-{
-	self.nextthink = time;
-	if (self.flags & FL_ONGROUND)
-	{
-		self.avelocity = '0 0 0';
-	}
-};
-
-void() Item_EnableOwner =
-{
-	self.owner = world;
-	self.think = Item_Think;
-	self.nextthink = time;
-};
-
-void() Item_Pickup =
-{
-	if (other.classname != "player")
-		return;
-	if (other.team != 1)
-	   	return;
-	sound(other, CHAN_AUTO, self.noise, 1, ATTN_NORM);
-	//bprint(self.netname,"\n");
-	
-	if (self.health)
-	   other.health = other.health + self.health;
-	else if (self.armorvalue)
-	   other.armorvalue = other.armorvalue + self.armorvalue;
-	else
-	{
-		Inventory_AddFromInventory(other, self);
-		if (self.itemitemtype < ITEMTYPE_AI_WEAP1)
-		   other.switchweaponitem = self.itemitemtype;
-	}
-	
-	if (self.respawntime > 0)
-	{
-		self.think = Item_Respawn;
-	   	self.solid = SOLID_NOT;
-	   	self.nextthink = time + self.respawntime;
-	   	self.alpha = 0.05;
-	   	setorigin (self, self.origin);
-	}
-	else
-	{
-	 	remove(self);
-	}
-};
-
-.float ispointable;
-void(float itemtype, float quantity, float ammo1, vector org, vector vel, float respawntim, float modelscale, entity own) Item_Spawn =
-{
-	Inventory_GetItemInfo(world, itemtype);
-	newmis = spawn();
-	newmis.owner = own;
-	newmis.respawntime = respawntim;
-	newmis.classname = "item";
-	newmis.netname = strzone(iteminfo_name);
-	newmis.itemitemtype = itemtype;
-	newmis.ispointable = TRUE;
-	newmis.solid = SOLID_TRIGGER;
-	newmis.movetype = MOVETYPE_BOUNCE;
-	newmis.velocity = vel;
-	newmis.angles = '25 0 0';
-	newmis.nextthink = time + 10;
-	newmis.think = Item_EnableOwner;
-	newmis.use = Item_Pickup;
-	newmis.mass = 25;
-	
-	newmis.health = 0;
-	newmis.armorvalue = 0;
-	
-	if (cvar("g_itemtouchpickup"))
-		newmis.touch = Item_Pickup;
-	newmis.noise = iteminfo_pickupsound;
-	setorigin(newmis, org);
-	setmodel(newmis, iteminfo_pickupmodel);
-	setsize(newmis, '-25 -25 -25', '8 8 8');
-	Inventory_ModifyItem(newmis, itemtype, quantity, ammo1);
-	
-	//newmis.effects = newmis.effects | EF_FULLBRIGHT;
-	newmis.scale = modelscale;
-};
-
-/*
-void() weapon_weap1 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP1,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-
-void() weapon_weap2 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP2,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-
-void() weapon_weap3 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP3,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-
-void() weapon_weap4 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP4,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-
-void() weapon_weap5 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP5,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-
-void() weapon_weap6 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP6,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-
-void() weapon_weap7 =
-{
- 	Item_Spawn(ITEMTYPE_WEAP7,1,100,self.origin,'0 0 0',10,1.5,world);
-}
-*/
-
-void() item_ammo1 =
-{
- 	Item_Spawn(ITEMTYPE_AMMO1,50,0,self.origin,'0 0 0',10,1,world);
-}
-void() item_ammo2 =
-{
- 	Item_Spawn(ITEMTYPE_AMMO2,50,0,self.origin,'0 0 0',10,1,world);
-}
-void() item_ammo3 =
-{
- 	Item_Spawn(ITEMTYPE_AMMO3,50,0,self.origin,'0 0 0',10,1,world);
-}
-void() item_ammo4 =
-{
- 	Item_Spawn(ITEMTYPE_AMMO4,50,0,self.origin,'0 0 0',10,1,world);
-}
-
-void() item_health1 =
-{
-	newmis = spawn();
-	newmis.health = 10;
-	newmis.owner = world;
-	newmis.respawntime = 5;
-	newmis.classname = "Health";
-	newmis.netname = "Health";
-	newmis.ispointable = TRUE;
-	newmis.solid = SOLID_TRIGGER;
-	newmis.movetype = MOVETYPE_TOSS;
-	newmis.velocity = '0 0 0';
-	newmis.angles = '0 0 0';
-	newmis.nextthink = time + 10;
-	newmis.think = Item_Think;
-	newmis.use = Item_Pickup;
-	if (cvar("g_itemtouchpickup"))
-		newmis.touch = Item_Pickup;
-	newmis.noise = "pickuphealth";
-	setorigin(newmis, self.origin);
-	setmodel(newmis, "models/items/health1.md3");
-	setsize(newmis, '-8 -8 -8', '8 8 8');
-	
-	newmis.effects = newmis.effects | EF_FULLBRIGHT;
-}
-
-void() item_health25 =
-{
-	newmis = spawn();
-	newmis.health = 25;
-	newmis.owner = world;
-	newmis.respawntime = 5;
-	newmis.classname = "Health";
-	newmis.netname = "Health";
-	newmis.ispointable = TRUE;
-	newmis.solid = SOLID_TRIGGER;
-	newmis.movetype = MOVETYPE_TOSS;
-	newmis.velocity = '0 0 0';
-	newmis.angles = '0 0 0';
-	newmis.nextthink = time + 10;
-	newmis.think = Item_Think;
-	newmis.use = Item_Pickup;
-	if (cvar("g_itemtouchpickup"))
-		newmis.touch = Item_Pickup;
-	newmis.noise = "pickuphealth";
-	setorigin(newmis, self.origin);
-	setmodel(newmis, "models/items/health25.md3");
-	setsize(newmis, '-8 -8 -8', '8 8 8');
-	
-	newmis.effects = newmis.effects | EF_FULLBRIGHT;
-}
-
-void() item_armor1 =
-{
-	newmis = spawn();
-	newmis.armorvalue = 5;
-	newmis.owner = world;
-	newmis.classname = "Armor";
-	newmis.netname = "Armor";
-	newmis.ispointable = TRUE;
-	newmis.solid = SOLID_TRIGGER;
-	newmis.movetype = MOVETYPE_TOSS;
-	newmis.velocity = '0 0 0';
-	newmis.angles = '0 0 0';
-	newmis.nextthink = time + 10;
-	newmis.think = Item_Think;
-	newmis.use = Item_Pickup;
-	if (cvar("g_itemtouchpickup"))
-		newmis.touch = Item_Pickup;
-	newmis.noise = "pickuphealth";
-	setorigin(newmis, self.origin);
-	setmodel(newmis, "models/items/armor1.md3");
-	setsize(newmis, '-8 -8 -8', '8 8 8');
-	
-	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
-}
-
-void() item_armor25 =
-{
-	newmis = spawn();
-	newmis.armorvalue = 25;
-	newmis.owner = world;
-	newmis.classname = "Armor";
-	newmis.netname = "Armor";
-	newmis.ispointable = TRUE;
-	newmis.solid = SOLID_TRIGGER;
-	newmis.movetype = MOVETYPE_TOSS;
-	newmis.velocity = '0 0 0';
-	newmis.angles = '0 0 0';
-	newmis.nextthink = time + 10;
-	newmis.think = Item_Think;
-	newmis.use = Item_Pickup;
-	if (cvar("g_itemtouchpickup"))
-		newmis.touch = Item_Pickup;
-	newmis.noise = "pickuphealth";
-	setorigin(newmis, self.origin);
-	setmodel(newmis, "models/items/armor25.md3");
-	setsize(newmis, '-8 -8 -8', '8 8 8');
-	
-	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
-}
-
-
-/*
-// _x = quantity, _y = ammo type, _z = ammo quantity
-.vector inventory_weap1;
-.float inventory_weap1_clip_steel;
-.vector inventory_weap2;
-.float inventory_weap2_clip;
-.vector inventory_weap3;
-.float inventory_weap3_clip_ap;
-.float inventory_weap3_clip_he;
-.vector inventory_weap4;
-.float inventory_weap4_clip_i;
-.vector inventory_weap5;
-.float inventory_weap5_clip_he;
-.vector inventory_weap6;
-.float inventory_weap6;
-
-void(entity character) Inventory_Clear =
-{
-	character.inventory_weap1 = '0 0 0';
-	character.inventory_weap1_clip_steel = 0;
-	character.inventory_weap2 = '0 0 0';
-	character.inventory_weap2_clip = 0;
-	character.inventory_weap3 = '0 0 0';
-	character.inventory_weap3_clip_ap = 0;
-	character.inventory_weap3_clip_he = 0;
-	character.inventory_weap4 = '0 0 0';
-	character.inventory_weap4_clip_i = 0;
-	character.inventory_weap5 = '0 0 0';
-	character.inventory_weap5_clip_he = 0;
-	character.inventory_weap6 = '0 0 0';
-	character.inventory_weap6_clip = 0;
-};
-
-float ITEMTYPE_EMPTY = 0;
-float ITEMTYPE_TOTAL = 6;
-
-float ITEMTYPERANGE_WEAPONS = '0 3 0';
-float ITEMTYPERANGE_BACKPACK = '3 16 0';
-float ITEMTYPERANGE_ALL = '0 32 0';
-float ITEMTYPERANGE = 32;
-
-// _x is an ITEMTYPE_ value, _y is another ITEMTYPE_ value for ammo type, _z is current ammo
-.vector inventory[ITEMTYPERANGE];
-
-void(entity character, vector inventoryrange) Inventory_Clear =
-{
-	local float c;
-	c = inventoryrange_x;
-	while (c < inventoryrange_y)
-	{
-		character.inventory[c] = '0 0 0';
-		c = c + 1;
-	}
-};
-
-// returns TRUE if item fit
-float(entity character, vector inventoryrange, float itemtype, float ammotype, float ammo) Inventory_AddItem =
-{
-	local float c;
-	c = inventoryrange_x;
-	while (c < inventoryrange_y)
-	{
-		if (!character.inventory[c]_x)
-		{
-			character.inventory[c]_x = itemtype;
-			character.inventory[c]_y = ammotype;
-			character.inventory[c]_z = ammo;
-			return TRUE;
-		}
-		c = c + 1;
-	}
-	return FALSE;
-};
-
-void(entity character,  Inventory
-*/
-
+
+// if TRUE this entity will ignore ModifyItem attempts with negative values
+.float unlimitedinventory;
+
+float ITEMTYPE_NONE = -1;
+
+float ITEMTYPE_WEAP1 = 0;
+float ITEMTYPE_WEAP2 = 1;
+float ITEMTYPE_WEAP3 = 2;
+float ITEMTYPE_WEAP4 = 3;
+float ITEMTYPE_WEAP5 = 4;
+float ITEMTYPE_WEAP6 = 5;
+float ITEMTYPE_WEAP7 = 6;
+float ITEMTYPE_WEAP8 = 7;
+float ITEMTYPE_WEAP9 = 8;
+float ITEMTYPE_WEAP10 = 9;
+float ITEMTYPE_WEAP11 = 10;
+float ITEMTYPE_WEAP12 = 11;
+float ITEMTYPE_WEAP13 = 12;
+float ITEMTYPE_WEAP14 = 13;
+float ITEMTYPE_WEAP15 = 14;
+float ITEMTYPE_WEAP16 = 15;
+
+float ITEMTYPE_AI_WEAP1 = 16;
+float ITEMTYPE_AI_WEAP2 = 17;
+float ITEMTYPE_AI_WEAP3 = 18;
+float ITEMTYPE_AI_WEAP4 = 19;
+float ITEMTYPE_AI_WEAP5 = 20;
+float ITEMTYPE_AI_WEAP6 = 21;
+
+float ITEMTYPE_ITEM1 = 22;
+float ITEMTYPE_ITEM2 = 23;
+float ITEMTYPE_ITEM3 = 24;
+
+float ITEMTYPE_AMMO1 = 25;
+float ITEMTYPE_AMMO2 = 26;
+float ITEMTYPE_AMMO3 = 27;
+float ITEMTYPE_AMMO4 = 28;
+
+float ITEMTYPE_TOTAL = 29;
+
+float WS_IDLE = 0;
+float WS_FIRE1 = 1;
+float WS_FIRE2 = 2;
+float WS_FIRE3 = 4;
+float WS_RELOAD = 5;
+float WS_LOWER = 6;
+float WS_RAISE = 7;
+float WS_TURNON = 8;
+float WS_TURNOFF = 9;
+
+.float weaponitem;
+.float weaponstate;
+.float switchweaponitem;
+
+// current item stats
+float iteminfo_quantity;
+float iteminfo_ammo;
+float iteminfo_ammoinventory; // how much ammo is in inventory (can be loaded into the gun)
+
+// general information about the item
+string iteminfo_model;
+string iteminfo_pickupsound;
+string iteminfo_pickupmodel;
+vector iteminfo_viewmodeloffset;
+string iteminfo_name;
+float iteminfo_itemtype;
+float iteminfo_quantitymax;
+float iteminfo_rechargerate;
+float iteminfo_ammomax;
+float iteminfo_ammoinventorymax;
+float iteminfo_ammotype;
+
+float iteminfo_ammo1minimumtofire;
+float iteminfo_ammo2minimumtofire;
+float iteminfo_ammo1numberof;
+float iteminfo_ammo2numberof;
+float iteminfo_ammo1recoil;
+float iteminfo_ammo2recoil;
+vector iteminfo_ammo1damage;
+vector iteminfo_ammo2damage;
+float iteminfo_ammo1damagetype;
+float iteminfo_ammo2damagetype;
+vector iteminfo_ammo1speeds;
+vector iteminfo_ammo2speeds;
+float iteminfo_ammo1lifetime;
+float iteminfo_ammo2lifetime;
+float iteminfo_ammo1fireflags;
+float iteminfo_ammo2fireflags;
+float iteminfo_ammo1projflags;
+float iteminfo_ammo2projflags;
+float iteminfo_ammo1explflags;
+float iteminfo_ammo2explflags;
+string iteminfo_ammo1model;
+string iteminfo_ammo2model;
+string iteminfo_ammo1explodesound;
+string iteminfo_ammo2explodesound;
+string iteminfo_ammo1bouncesound;
+string iteminfo_ammo2bouncesound;
+string iteminfo_ammo1firesound;
+string iteminfo_ammo2firesound;
+float iteminfo_ammo1tracer;
+float iteminfo_ammo2tracer;
+string iteminfo_ammo1tracermodel;
+string iteminfo_ammo2tracermodel;
+float iteminfo_ammo1modelscale;
+float iteminfo_ammo2modelscale;
+float iteminfo_ammo1health;
+float iteminfo_ammo2health;
+float iteminfo_ammo1mass;
+float iteminfo_ammo2mass;
+vector iteminfo_ammo1colormod;
+vector iteminfo_ammo2colormod;
+vector iteminfo_ammo1viewmodelpush;
+vector iteminfo_ammo2viewmodelpush;
+float iteminfo_ammo1noprojectile;
+float iteminfo_ammo2noprojectile;
+
+// special information specific to weapon items
+string iteminfo_weapon_viewmodel;
+vector iteminfo_weapon_viewmodelanim_idle;
+vector iteminfo_weapon_viewmodelanim_fire1;
+vector iteminfo_weapon_viewmodelanim_fire2;
+vector iteminfo_weapon_viewmodelanim_reload;
+vector iteminfo_weapon_viewmodelanim_lower;
+vector iteminfo_weapon_viewmodelanim_raise;
+vector iteminfo_weapon_viewmodelanim_turnon;
+vector iteminfo_weapon_viewmodelanim_turnoff;
+float iteminfo_weapon_canfire1;
+float iteminfo_weapon_canfire2;
+float iteminfo_weapon_canreload;
+float iteminfo_weapon_canraise;
+float iteminfo_weapon_rank;
+
+// this array and functions depend on fteqcc arrays, but are easily replaced with a huge chunk of if else stuff if needed
+.vector inventory[ITEMTYPE_TOTAL];
+vector(entity character, float itemtype) Inventory_GetItem =
+{
+	if (itemtype < 0 || itemtype >= ITEMTYPE_TOTAL)
+		return '0 0 0';
+	return character.(inventory[itemtype]);
+};
+void(entity character, float itemtype, vector item) Inventory_SetItem =
+{
+	if (itemtype < 0 || itemtype >= ITEMTYPE_TOTAL)
+		return;
+	character.(inventory[itemtype]) = item;
+};
+void(entity character, float itemtype) Inventory_GetItemInfo =
+{
+	local vector item;
+	local entity e;
+	local float d;
+	if (itemtype < 0)
+	{
+	    bprint(iteminfo_name);
+		//error("itemtype = ",ftos(itemtype),"\n");
+	}
+	if (itemtype >= ITEMTYPE_TOTAL)
+		bprint(ftos(itemtype)," ", ftos(ITEMTYPE_TOTAL), " : itemtype >= ITEMTYPE_TOTAL\n");
+	iteminfo_itemtype = itemtype;
+	item = Inventory_GetItem(character, itemtype);
+	iteminfo_quantity = item_x;
+	iteminfo_ammo = item_y;
+	iteminfo_ammoinventory = 0;
+	
+	iteminfo_model = "";
+	iteminfo_pickupmodel = "";
+	iteminfo_viewmodeloffset = '0 0 0';
+	iteminfo_name = "unknown";
+	iteminfo_pickupsound = "";
+	iteminfo_quantitymax = 0;
+	iteminfo_rechargerate = 0;
+	iteminfo_ammomax = 0;
+	iteminfo_ammoinventorymax = 0;
+	iteminfo_ammotype = ITEMTYPE_NONE;
+	
+	iteminfo_ammo1minimumtofire = 0;
+	iteminfo_ammo1damagetype = DAMAGETYPE_UNKNOWN;
+	iteminfo_ammo1damage = '0 0 0';
+	iteminfo_ammo1speeds = '0 0 0';
+	iteminfo_ammo1lifetime = 10;
+	iteminfo_ammo1projflags = PROJFLAG_ANYIMPACT;
+	iteminfo_ammo1explflags = 0;
+	iteminfo_ammo1fireflags = 0;
+	iteminfo_ammo1model = "";
+	iteminfo_ammo1firesound = "";
+	iteminfo_ammo1explodesound = "";
+	iteminfo_ammo1bouncesound = "";
+	iteminfo_ammo1numberof = 1;
+	iteminfo_ammo1recoil = 0;
+	iteminfo_ammo1tracer = 0;
+	iteminfo_ammo1tracermodel = "";
+	iteminfo_ammo1modelscale = 1;
+	iteminfo_ammo1health = 0;
+	iteminfo_ammo1mass = 0;
+	iteminfo_ammo1colormod = '0 0 0';
+	iteminfo_ammo1viewmodelpush = '0 0 0';
+	iteminfo_ammo1noprojectile = 0;
+	iteminfo_ammo2minimumtofire = 0;
+	iteminfo_ammo2damagetype = DAMAGETYPE_UNKNOWN;
+	iteminfo_ammo2damage = '0 0 0';
+	iteminfo_ammo2speeds = '0 0 0';
+	iteminfo_ammo2lifetime = 10;
+	iteminfo_ammo2projflags = PROJFLAG_ANYIMPACT;
+	iteminfo_ammo2explflags = 0;
+	iteminfo_ammo2fireflags = 0;
+	iteminfo_ammo2model = "";
+	iteminfo_ammo2firesound = "";
+	iteminfo_ammo2explodesound = "";
+	iteminfo_ammo2bouncesound = "";
+	iteminfo_ammo2numberof = 1;
+	iteminfo_ammo2recoil = 0;
+	iteminfo_ammo2tracer = 0;
+	iteminfo_ammo2tracermodel = "";
+	iteminfo_ammo2modelscale = 1;
+	iteminfo_ammo2health = 0;
+	iteminfo_ammo2mass = 0;
+	iteminfo_ammo2colormod = '0 0 0';
+	iteminfo_ammo2viewmodelpush =  '0 0 0';
+	iteminfo_ammo2noprojectile = 0;
+	iteminfo_weapon_viewmodel = "";
+	iteminfo_weapon_viewmodelanim_idle = '0 0 1';
+	iteminfo_weapon_viewmodelanim_fire1 = '0 0 2';
+	iteminfo_weapon_viewmodelanim_fire2 = '0 0 2';
+	iteminfo_weapon_viewmodelanim_reload = '0 0 0';
+	iteminfo_weapon_viewmodelanim_lower = '0 0 2';
+	iteminfo_weapon_viewmodelanim_raise = '0 0 2';
+	iteminfo_weapon_viewmodelanim_turnon = '0 0 2';
+	iteminfo_weapon_viewmodelanim_turnoff = '0 0 2';
+	iteminfo_weapon_canfire1 = FALSE;
+	iteminfo_weapon_canfire2 = FALSE;
+	iteminfo_weapon_canreload = FALSE;
+	iteminfo_weapon_canraise = FALSE;
+	iteminfo_weapon_rank = 0;
+	
+	
+	if (itemtype < ITEMTYPE_AMMO1)
+	{
+	   	// set the settings for all weapons		  
+		iteminfo_quantitymax = 1;
+		iteminfo_pickupsound = "items/pickupweapon.wav";
+		iteminfo_weapon_viewmodelanim_idle = '0 0 30';
+		iteminfo_weapon_viewmodelanim_lower = '0 0 0';
+		iteminfo_weapon_viewmodelanim_raise = '0 0 0';
+		
+		string wname;
+		if (itemtype < ITEMTYPE_AI_WEAP1)
+		{
+		   wname = strcat("g_weap",ftos(itemtype + 1));
+		   iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
+		}
+		else if (itemtype < ITEMTYPE_ITEM1)
+		{
+		   wname = strcat("g_ai_weap",ftos(itemtype - ITEMTYPE_AI_WEAP1 + 1)); 
+		   iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
+		}
+		else
+		{
+	 		wname = strcat("g_item",ftos(itemtype - ITEMTYPE_ITEM1 + 1)); 
+		 	iteminfo_quantitymax = cvar(wname,"_quantitymax");
+			iteminfo_ammotype = itemtype;					  // so the firing code knows it's a item
+		}
+		
+		iteminfo_ammo1damagetype = DAMAGETYPE_WEAP1 + itemtype;
+		iteminfo_ammo2damagetype = DAMAGETYPE_WEAP1 + itemtype;
+		
+		iteminfo_name = cvar_string(wname);
+		iteminfo_model = cvar_string(wname,"_model");
+		iteminfo_weapon_viewmodel = cvar_string(wname,"_viewmodel");
+		iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
+		iteminfo_viewmodeloffset = stov(cvar_string(wname,"_viewmodeloffset"));
+		
+		iteminfo_rechargerate = cvar(wname,"_rechargerate");
+		
+		iteminfo_ammomax = cvar(wname,"_ammomax");
+		iteminfo_ammoinventorymax = cvar(wname,"_ammoinventorymax");
+		
+		iteminfo_ammo1damage = stov(cvar_string(wname,"_ammo1damage"));
+		iteminfo_ammo1speeds = stov(cvar_string(wname,"_ammo1speeds"));
+		iteminfo_ammo1model = cvar_string(wname,"_ammo1model");
+		iteminfo_ammo1firesound = cvar_string(wname,"_ammo1firesound");
+		//iteminfo_ammo1explodesound = strzone(cvar_string(wname,"_ammo1explodesound"));
+		
+		iteminfo_ammo1projflags = cvar(wname,"_ammo1projflags");
+		iteminfo_ammo1explflags = cvar(wname,"_ammo1explflags");
+		iteminfo_ammo1fireflags = cvar(wname,"_ammo1fireflags");
+		
+		iteminfo_ammo1noprojectile = cvar(wname,"_ammo1noprojectile");
+		
+		iteminfo_ammo1numberof = cvar(wname,"_ammo1numberof");
+		iteminfo_ammo1recoil = cvar(wname,"_ammo1recoil");
+		iteminfo_ammo1minimumtofire = cvar(wname,"_ammo1mintofire");
+		iteminfo_ammo1lifetime = cvar(wname,"_ammo1lifetime");
+		iteminfo_ammo1tracer = cvar(wname,"_ammo1tracer");
+		iteminfo_ammo1tracermodel = cvar_string(wname,"_ammo1tracermodel");
+		iteminfo_ammo1modelscale = cvar(wname,"_ammo1modelscale");
+		iteminfo_ammo1health = cvar(wname,"_ammo1health");
+		iteminfo_ammo1mass = cvar(wname,"_ammo1mass");
+		iteminfo_ammo1colormod = stov(cvar_string(wname,"_ammo1colormod"));
+		iteminfo_ammo1viewmodelpush = stov(cvar_string(wname,"_ammo1viewmodelpush"));
+		iteminfo_weapon_viewmodelanim_fire1 = stov(cvar_string(wname,"_fire1"));
+		
+		iteminfo_ammo2damage = stov(cvar_string(wname,"_ammo2damage"));
+		iteminfo_ammo2speeds = stov(cvar_string(wname,"_ammo2speeds"));
+		iteminfo_ammo2model = cvar_string(wname,"_ammo2model");
+		iteminfo_ammo2firesound = cvar_string(wname,"_ammo2firesound");
+		//iteminfo_ammo2explodesound = strzone(cvar_string(wname,"_ammo2explodesound"));
+		
+		iteminfo_ammo2projflags = cvar(wname,"_ammo2projflags");
+		iteminfo_ammo2explflags = cvar(wname,"_ammo2explflags");
+		iteminfo_ammo2fireflags = cvar(wname,"_ammo2fireflags");
+		
+		iteminfo_ammo2noprojectile = cvar(wname,"_ammo2noprojectile");
+		
+		iteminfo_ammo2numberof = cvar(wname,"_ammo2numberof");
+		iteminfo_ammo2recoil = cvar(wname,"_ammo2recoil");
+		iteminfo_ammo2minimumtofire = cvar(wname,"_ammo2mintofire");
+		iteminfo_ammo2lifetime = cvar(wname,"_ammo2lifetime");
+		iteminfo_ammo2tracer = cvar(wname,"_ammo2tracer");
+		iteminfo_ammo2tracermodel = cvar_string(wname,"_ammo2tracermodel");
+		iteminfo_ammo2modelscale = cvar(wname,"_ammo2modelscale");
+		iteminfo_ammo2health = cvar(wname,"_ammo2health");
+		iteminfo_ammo2mass = cvar(wname,"_ammo2mass");
+		iteminfo_ammo2colormod = stov(cvar_string(wname,"_ammo2colormod"));
+		iteminfo_ammo2viewmodelpush = stov(cvar_string(wname,"_ammo2viewmodelpush"));
+		iteminfo_weapon_viewmodelanim_fire2 = stov(cvar_string(wname,"_fire2"));
+	}
+	else if (itemtype < ITEMTYPE_TOTAL)
+	{
+		wname = strcat("g_ammo",ftos(itemtype - ITEMTYPE_AMMO1 + 1));
+		iteminfo_name = cvar_string(wname,"_name");
+		iteminfo_pickupsound = cvar_string(wname,"_pickupsound");
+		iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
+		iteminfo_quantitymax = cvar(wname,"_quantitymax");
+	}
+	else
+		bprint(ftos(itemtype)," Inventory_GetItemInfo: unknown itemtype\n");
+	
+	if (iteminfo_quantity >= 1)
+	{
+		if (iteminfo_ammotype == itemtype)
+		{
+			// usable items such as flares
+			iteminfo_ammo1minimumtofire = 1;
+			iteminfo_ammomax = iteminfo_ammo1minimumtofire;
+			if (iteminfo_quantity >= iteminfo_ammo1minimumtofire)
+			{
+				iteminfo_ammo = iteminfo_ammo1minimumtofire;
+				iteminfo_ammoinventory = iteminfo_quantity - iteminfo_ammo1minimumtofire;
+				iteminfo_weapon_canfire1 = TRUE;
+				iteminfo_weapon_canfire2 = TRUE;
+				iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2;
+				iteminfo_weapon_rank = iteminfo_quantity * iteminfo_ammo1damage_x;
+			}
+		}
+		else if (iteminfo_ammo1minimumtofire)
+		{
+			// weapons
+			if (iteminfo_ammotype >= 0)
+			{
+				item = Inventory_GetItem(character, iteminfo_ammotype);
+				iteminfo_ammoinventory = item_x;
+			}
+			iteminfo_weapon_canreload = (iteminfo_ammo < iteminfo_ammomax && iteminfo_ammoinventory >= 1);
+			iteminfo_weapon_canfire1 = iteminfo_ammo >= iteminfo_ammo1minimumtofire;
+			iteminfo_weapon_canfire2 = iteminfo_ammo >= iteminfo_ammo2minimumtofire;
+	
+			// fteqcc bug:
+			// these work
+			iteminfo_weapon_canraise = iteminfo_weapon_canfire1 + iteminfo_weapon_canfire2 + iteminfo_weapon_canreload;
+			//if (iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2 || iteminfo_weapon_canreload)
+			//	iteminfo_weapon_canraise = TRUE;
+			// these don't work
+			//iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || (iteminfo_weapon_canfire2 || iteminfo_weapon_canreload);
+			//iteminfo_weapon_canraise = (iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2) || iteminfo_weapon_canreload;
+			//iteminfo_weapon_canraise = iteminfo_weapon_canfire1 || iteminfo_weapon_canfire2 || iteminfo_weapon_canreload;
+			if (iteminfo_weapon_canraise)
+				iteminfo_weapon_rank = (iteminfo_ammo + iteminfo_ammoinventory) * iteminfo_ammo1damage_x + (iteminfo_ammo + iteminfo_ammoinventory) * iteminfo_ammo2damage_x;
+		}
+		else
+		{
+			// ammo and other consumables, not usable
+		}
+	}
+	if (itemtype == character.weaponitem)
+	{
+		character.currentammo = 0;
+		character.ammo_shells = 0;
+		//character.ammo_nails = 0;
+		//character.ammo_rockets = 0;
+		character.ammo_cells = 0;
+		if (iteminfo_ammomax + iteminfo_ammoinventorymax)
+		{
+			character.currentammo = iteminfo_ammo * 200 / (iteminfo_ammomax + iteminfo_ammoinventorymax);
+			character.ammo_shells = iteminfo_ammoinventory * 200 / (iteminfo_ammomax + iteminfo_ammoinventorymax);
+		}
+		// character.ammo_nails is now set above as the item quantity when using items
+		//if (iteminfo_ammo2max + iteminfo_ammo2inventorymax)
+		//{
+		//	character.ammo_nails = character.jetpack_fuel; // iteminfo_ammo2 * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
+		//	character.ammo_rockets = 0; //iteminfo_ammo2inventory * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
+		//}
+	}
+	else if (itemtype == character.itemselected)
+	{
+	 	character.ammo_nails = iteminfo_quantity * 200 / (iteminfo_quantitymax);
+	}
+};
+
+void() Inventory_Precache =
+{
+	local float c;
+	c = 0;
+	while (c < ITEMTYPE_TOTAL)
+	{
+		Inventory_GetItemInfo(world, c);
+		if (iteminfo_model != "") precache_model(iteminfo_model);
+		if (iteminfo_ammo1model != "") precache_model(iteminfo_ammo1model);
+		if (iteminfo_ammo2model != "") precache_model(iteminfo_ammo2model);
+		if (iteminfo_ammo1tracermodel != "") precache_model(iteminfo_ammo1tracermodel);
+		if (iteminfo_ammo2tracermodel != "") precache_model(iteminfo_ammo2tracermodel);
+		if (iteminfo_pickupsound != "") precache_sound(iteminfo_pickupsound);
+		if (iteminfo_ammo1firesound != "") precache_sound(iteminfo_ammo1firesound);
+		if (iteminfo_ammo1explodesound != "") precache_sound(iteminfo_ammo1explodesound);
+		if (iteminfo_ammo1bouncesound != "") precache_sound(iteminfo_ammo1bouncesound);
+		if (iteminfo_ammo2firesound != "") precache_sound(iteminfo_ammo2firesound);
+		if (iteminfo_ammo2explodesound != "") precache_sound(iteminfo_ammo2explodesound);
+		if (iteminfo_ammo2bouncesound != "") precache_sound(iteminfo_ammo2bouncesound);
+		if (iteminfo_weapon_viewmodel != "") precache_model(iteminfo_weapon_viewmodel);
+		c = c + 1;
+	}
+
+	precache_sound ("weapons/minigun_bulletfire2.wav"); // templeofnoise: old style precache for additional sounds
+	precache_sound ("weapons/minigun_bulletfire3.wav"); // templeofnoise: old style precache for additional sounds
+	precache_sound ("weapons/minigun_bulletfire4.wav"); // templeofnoise: old style precache for additional sounds
+	precache_sound ("weapons/minigun_whirlstart.wav"); // templeofnoise: old style precache for additional sounds
+	precache_sound ("weapons/minigun_whirlend.wav"); // templeofnoise: old style precache for additional sounds
+	precache_sound ("weapons/bullet_ric2.wav"); // templeofnoise
+	precache_sound ("weapons/bullet_ric3.wav"); // templeofnoise
+	precache_sound ("weapons/bullet_ric4.wav"); // templeofnoise
+	precache_sound ("weapons/assaultrailgun_bulletfire2.wav"); // templeofnoise: old style precache for additional sounds
+	precache_sound ("weapons/assaultrailgun_bulletfire3.wav"); // templeofnoise: old style precache for additional sounds
+
+
+};
+
+float(entity character) Inventory_GetBestWeapon =
+{
+	local float best;
+	local float rank;
+	local float c;
+	best = -1;
+	rank = 0;
+	c = 0;
+	while (c < ITEMTYPE_TOTAL)
+	{
+		Inventory_GetItemInfo(character, c);
+		if (iteminfo_weapon_canraise)
+		if (rank < iteminfo_weapon_rank)
+		{
+			rank = iteminfo_weapon_rank;
+			best = c;
+		}
+		c = c + 1;
+	}
+	return best;
+};
+
+float(entity character) Inventory_GetBestItem =
+{
+	local float best;
+	local float rank;
+	local float c;
+	best = -1;
+	rank = 0;
+	c = ITEMTYPE_ITEM1;
+	while (c < ITEMTYPE_AMMO1)
+	{
+		Inventory_GetItemInfo(character, c);
+		if (iteminfo_weapon_canraise)
+			best = c;
+		c = c + 1;
+	}
+	return best;
+};
+
+vector(entity character, float itemtype, float adjustquantity, float adjustammo) Inventory_ModifyItem =
+{
+	local float olditemtype;
+	local vector item, olditem;
+	if (character.unlimitedinventory)
+	if (adjustquantity < 0)
+		adjustquantity = 0;
+	if (adjustquantity == 0)
+	if (adjustammo == 0)
+		return '0 0 0';
+	olditemtype = iteminfo_itemtype;
+	Inventory_GetItemInfo(character, itemtype);
+	item = Inventory_GetItem(character, itemtype);
+	olditem = item;
+	item_x = bound(0, item_x + adjustquantity, iteminfo_quantitymax);
+	item_y = bound(0, item_y + adjustammo, iteminfo_ammomax);
+	//item_z = bound(0, item_z + adjustammo2, iteminfo_ammo2max);
+	Inventory_SetItem(character, itemtype, item);
+	// update iteminfo for olditemtype
+	// (if olditemtype == itemtype then we want to update it because the item
+	//  has been modified, if olditemtype != itemtype then we need to restore
+	//  it to the olditemtype to avoid messing up things for the caller)
+	Inventory_GetItemInfo(character, olditemtype);
+	return item - olditem;
+};
+
+void(entity to, entity from) Inventory_CloneFromInventory =
+{
+	local float itemtype;
+	itemtype = 0;
+	while (itemtype < ITEMTYPE_TOTAL)
+	{
+		Inventory_SetItem(to, itemtype, Inventory_GetItem(from, itemtype));
+		itemtype = itemtype + 1;
+	}
+};
+
+void(entity to, entity from) Inventory_AddFromInventory =
+{
+	local float itemtype;
+	local vector item;
+	itemtype = 0;
+	while (itemtype < ITEMTYPE_TOTAL)
+	{
+		item = Inventory_GetItem(from, itemtype);
+		if (item != '0 0 0')
+			Inventory_ModifyItem(to, itemtype, item_x, item_y);
+		itemtype = itemtype + 1;
+	}
+};
+
+/*
+float ITEMTYPE_TOTAL3 = 60;
+.float inventory[ITEMTYPE_TOTAL3];
+vector(entity character, float itemtype) Inventory_GetItem =
+{
+	local vector v;
+	itemtype = itemtype * 3;
+	v_x = character.inventory[itemtype];
+	v_y = character.inventory[itemtype+1];
+	v_z = character.inventory[itemtype+2];
+	return v;
+};
+void(entity character, float itemtype, vector item) Inventory_SetItem =
+{
+	itemtype = itemtype * 3;
+	character.inventory[itemtype] = item_x;
+	character.inventory[itemtype+1] = item_y;
+	character.inventory[itemtype+2] = item_z;
+};
+*/
+
+void(entity character) Inventory_Clear =
+{
+	local float c;
+	for (c = 0;c < ITEMTYPE_TOTAL;c++)
+		Inventory_SetItem(self, c, '0 0 0');
+};
+
+void Item_Respawn (void)
+{
+	self.solid = SOLID_TRIGGER;	// allow it to be touched again
+	sound (self, CHAN_VOICE, "misc/itemrespawn.wav", 1, ATTN_NORM);	// play respawn sound
+	setorigin (self, self.origin);
+	self.alpha = 1;
+
+	// LordHavoc: replaced respawn stardust effect with a custom te_wizspike
+	te_wizspike(self.origin + self.mins_z * '0 0 1' + '0 0 48');
+}
+
+void() Item_Think =
+{
+	self.nextthink = time;
+	if (self.flags & FL_ONGROUND)
+	{
+		self.avelocity = '0 0 0';
+	}
+};
+
+void() Item_EnableOwner =
+{
+	self.owner = world;
+	self.think = Item_Think;
+	self.nextthink = time;
+};
+
+void() Item_Pickup =
+{
+	if (other.classname != "player")
+		return;
+	if (other.team != 1)
+	   	return;
+	sound(other, CHAN_AUTO, self.noise, 1, ATTN_NORM);
+	//bprint(self.netname,"\n");
+	
+	if (self.health)
+	   other.health = other.health + self.health;
+	else if (self.armorvalue)
+	   other.armorvalue = other.armorvalue + self.armorvalue;
+	else
+	{
+		Inventory_AddFromInventory(other, self);
+		if (self.itemitemtype < ITEMTYPE_AI_WEAP1)
+		   other.switchweaponitem = self.itemitemtype;
+	}
+	
+	if (self.respawntime > 0)
+	{
+		self.think = Item_Respawn;
+	   	self.solid = SOLID_NOT;
+	   	self.nextthink = time + self.respawntime;
+	   	self.alpha = 0.05;
+	   	setorigin (self, self.origin);
+	}
+	else
+	{
+	 	remove(self);
+	}
+};
+
+.float ispointable;
+void(float itemtype, float quantity, float ammo1, vector org, vector vel, float respawntim, float modelscale, entity own) Item_Spawn =
+{
+	Inventory_GetItemInfo(world, itemtype);
+	newmis = spawn();
+	newmis.owner = own;
+	newmis.respawntime = respawntim;
+	newmis.classname = "item";
+	newmis.netname = strzone(iteminfo_name);
+	newmis.itemitemtype = itemtype;
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_TRIGGER;
+	newmis.movetype = MOVETYPE_BOUNCE;
+	newmis.velocity = vel;
+	newmis.angles = '25 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_EnableOwner;
+	newmis.use = Item_Pickup;
+	newmis.mass = 25;
+	
+	newmis.health = 0;
+	newmis.armorvalue = 0;
+	
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = iteminfo_pickupsound;
+	setorigin(newmis, org);
+	setmodel(newmis, iteminfo_pickupmodel);
+	setsize(newmis, '-25 -25 -25', '8 8 8');
+	Inventory_ModifyItem(newmis, itemtype, quantity, ammo1);
+	
+	//newmis.effects = newmis.effects | EF_FULLBRIGHT;
+	newmis.scale = modelscale;
+};
+
+/*
+void() weapon_weap1 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP1,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+
+void() weapon_weap2 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP2,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+
+void() weapon_weap3 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP3,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+
+void() weapon_weap4 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP4,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+
+void() weapon_weap5 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP5,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+
+void() weapon_weap6 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP6,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+
+void() weapon_weap7 =
+{
+ 	Item_Spawn(ITEMTYPE_WEAP7,1,100,self.origin,'0 0 0',10,1.5,world);
+}
+*/
+
+void() item_ammo1 =
+{
+ 	Item_Spawn(ITEMTYPE_AMMO1,50,0,self.origin,'0 0 0',10,1,world);
+}
+void() item_ammo2 =
+{
+ 	Item_Spawn(ITEMTYPE_AMMO2,50,0,self.origin,'0 0 0',10,1,world);
+}
+void() item_ammo3 =
+{
+ 	Item_Spawn(ITEMTYPE_AMMO3,50,0,self.origin,'0 0 0',10,1,world);
+}
+void() item_ammo4 =
+{
+ 	Item_Spawn(ITEMTYPE_AMMO4,50,0,self.origin,'0 0 0',10,1,world);
+}
+
+void() item_health1 =
+{
+	newmis = spawn();
+	newmis.health = 10;
+	newmis.owner = world;
+	newmis.respawntime = 5;
+	newmis.classname = "Health";
+	newmis.netname = "Health";
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_TRIGGER;
+	newmis.movetype = MOVETYPE_TOSS;
+	newmis.velocity = '0 0 0';
+	newmis.angles = '0 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_Think;
+	newmis.use = Item_Pickup;
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = "pickuphealth";
+	setorigin(newmis, self.origin);
+	setmodel(newmis, "models/items/health1.md3");
+	setsize(newmis, '-8 -8 -8', '8 8 8');
+	
+	newmis.effects = newmis.effects | EF_FULLBRIGHT;
+}
+
+void() item_health25 =
+{
+	newmis = spawn();
+	newmis.health = 25;
+	newmis.owner = world;
+	newmis.respawntime = 5;
+	newmis.classname = "Health";
+	newmis.netname = "Health";
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_TRIGGER;
+	newmis.movetype = MOVETYPE_TOSS;
+	newmis.velocity = '0 0 0';
+	newmis.angles = '0 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_Think;
+	newmis.use = Item_Pickup;
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = "pickuphealth";
+	setorigin(newmis, self.origin);
+	setmodel(newmis, "models/items/health25.md3");
+	setsize(newmis, '-8 -8 -8', '8 8 8');
+	
+	newmis.effects = newmis.effects | EF_FULLBRIGHT;
+}
+
+void() item_armor1 =
+{
+	newmis = spawn();
+	newmis.armorvalue = 5;
+	newmis.owner = world;
+	newmis.classname = "Armor";
+	newmis.netname = "Armor";
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_TRIGGER;
+	newmis.movetype = MOVETYPE_TOSS;
+	newmis.velocity = '0 0 0';
+	newmis.angles = '0 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_Think;
+	newmis.use = Item_Pickup;
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = "pickuphealth";
+	setorigin(newmis, self.origin);
+	setmodel(newmis, "models/items/armor1.md3");
+	setsize(newmis, '-8 -8 -8', '8 8 8');
+	
+	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
+}
+
+void() item_armor25 =
+{
+	newmis = spawn();
+	newmis.armorvalue = 25;
+	newmis.owner = world;
+	newmis.classname = "Armor";
+	newmis.netname = "Armor";
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_TRIGGER;
+	newmis.movetype = MOVETYPE_TOSS;
+	newmis.velocity = '0 0 0';
+	newmis.angles = '0 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_Think;
+	newmis.use = Item_Pickup;
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = "pickuphealth";
+	setorigin(newmis, self.origin);
+	setmodel(newmis, "models/items/armor25.md3");
+	setsize(newmis, '-8 -8 -8', '8 8 8');
+	
+	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
+}
+
+
+/*
+// _x = quantity, _y = ammo type, _z = ammo quantity
+.vector inventory_weap1;
+.float inventory_weap1_clip_steel;
+.vector inventory_weap2;
+.float inventory_weap2_clip;
+.vector inventory_weap3;
+.float inventory_weap3_clip_ap;
+.float inventory_weap3_clip_he;
+.vector inventory_weap4;
+.float inventory_weap4_clip_i;
+.vector inventory_weap5;
+.float inventory_weap5_clip_he;
+.vector inventory_weap6;
+.float inventory_weap6;
+
+void(entity character) Inventory_Clear =
+{
+	character.inventory_weap1 = '0 0 0';
+	character.inventory_weap1_clip_steel = 0;
+	character.inventory_weap2 = '0 0 0';
+	character.inventory_weap2_clip = 0;
+	character.inventory_weap3 = '0 0 0';
+	character.inventory_weap3_clip_ap = 0;
+	character.inventory_weap3_clip_he = 0;
+	character.inventory_weap4 = '0 0 0';
+	character.inventory_weap4_clip_i = 0;
+	character.inventory_weap5 = '0 0 0';
+	character.inventory_weap5_clip_he = 0;
+	character.inventory_weap6 = '0 0 0';
+	character.inventory_weap6_clip = 0;
+};
+
+float ITEMTYPE_EMPTY = 0;
+float ITEMTYPE_TOTAL = 6;
+
+float ITEMTYPERANGE_WEAPONS = '0 3 0';
+float ITEMTYPERANGE_BACKPACK = '3 16 0';
+float ITEMTYPERANGE_ALL = '0 32 0';
+float ITEMTYPERANGE = 32;
+
+// _x is an ITEMTYPE_ value, _y is another ITEMTYPE_ value for ammo type, _z is current ammo
+.vector inventory[ITEMTYPERANGE];
+
+void(entity character, vector inventoryrange) Inventory_Clear =
+{
+	local float c;
+	c = inventoryrange_x;
+	while (c < inventoryrange_y)
+	{
+		character.inventory[c] = '0 0 0';
+		c = c + 1;
+	}
+};
+
+// returns TRUE if item fit
+float(entity character, vector inventoryrange, float itemtype, float ammotype, float ammo) Inventory_AddItem =
+{
+	local float c;
+	c = inventoryrange_x;
+	while (c < inventoryrange_y)
+	{
+		if (!character.inventory[c]_x)
+		{
+			character.inventory[c]_x = itemtype;
+			character.inventory[c]_y = ammotype;
+			character.inventory[c]_z = ammo;
+			return TRUE;
+		}
+		c = c + 1;
+	}
+	return FALSE;
+};
+
+void(entity character,  Inventory
+*/
+


Property changes on: trunk/basezym/progsqc/inventory.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/jumppads.qc
===================================================================
--- trunk/basezym/progsqc/jumppads.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/jumppads.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,202 +1,202 @@
-float PUSH_ONCE			= 1;
-float PUSH_SILENT		= 2;
-
-.float height;
-
-float trigger_push_calculatevelocity_flighttime;
-
-/*
-	trigger_push_calculatevelocity
-
-	Arguments:
-	  org - origin of the object which is to be pushed
-	  tgt - target entity (can be either a point or a model entity; if it is
-	        the latter, its midpoint is used)
-	  ht  - jump height, measured from the higher one of org and tgt's midpoint
-
-	Returns: velocity for the jump
-	the global trigger_push_calculatevelocity_flighttime is set to the total
-	jump time
- */
-
-vector(vector org, entity tgt, float ht) trigger_push_calculatevelocity =
-{
-	local float grav, sdist, zdist, vs, vz, jumpheight, trajsign;
-	local vector sdir, torg;
-
-	torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
-
-	grav = cvar("sv_gravity");
-
-	zdist = torg_z - org_z;
-	sdist = vlen(torg - org - zdist * '0 0 1');
-	sdir = normalize(torg - org - zdist * '0 0 1');
-
-	// how high do we need to push the player?
-	jumpheight = fabs(ht);
-	if(zdist > 0)
-		jumpheight = jumpheight + zdist;
-
-	/*
-		STOP.
-
-		You will not understand the following equations anyway...
-		But here is what I did to get them.
-
-		I used the functions
-
-		  s(t) = t * vs
-		  z(t) = t * vz - 1/2 grav t^2
-
-		and solved for:
-
-		  s(ti) = sdist
-		  z(ti) = zdist
-		  max(z, ti) = jumpheight
-
-		From these three equations, you will find the three parameters vs, vz
-		and ti.
-	 */
-
-	// push him so high...
-	vz = sqrt(2 * grav * jumpheight); // NOTE: sqrt(positive)!
-	if(ht < 0)
-		if(zdist < 0)
-			vz = -vz;
-
-	// how far to push him?
-	if(zdist == 0)
-	{
-		trigger_push_calculatevelocity_flighttime = sqrt(jumpheight * 8 / grav);
-		vs = sdist / trigger_push_calculatevelocity_flighttime;
-			// trajsign is ignored (the high point MUST be inside the jump!)
-	}
-	else
-	{
-		if(ht > 0)
-			trajsign = +1;
-		else
-			trajsign = -1;
-
-		// >0: the lower speed that achieves "it"
-		//     (parabola's maximum inside the jump)
-		// <0: the higher speed that achieves "it"
-		//     (parabola's maximum outside the jump)
-
-		vs = sqrt(jumpheight - zdist);
-		vs = sqrt(jumpheight) - trajsign * vs; // fteqcc sucks
-		vs = fabs(vs * sqrt(grav/2) / zdist);
-		//vs = fabs((sdist / zdist) * sqrt(grav/2) * (sqrt(jumpheight) - trajsign * sqrt(jumpheight - zdist)));
-		trigger_push_calculatevelocity_flighttime = 1 / vs;
-			// note: vs cannot be zero here. The difference between the sqrts is zero IFF zdist == 0, which we have excluded.
-		vs = vs * sdist;
-
-		// cases to test: "jump up", "jump down" with positive and negative height
-	}
-
-	// finally calculate the velocity
-	return sdir * vs + '0 0 1' * vz;
-}
-
-void() trigger_push_touch =
-{
- 	if (other.classname != "player")
-	    return;
-
-	if (!self.target)
-	{
-		other.velocity = self.movedir;
-		other.flags = other.flags - (other.flags & FL_ONGROUND);
-		return;
-	}
-	
-	te_smallflash(other.origin);
-
-	self.movedir = trigger_push_calculatevelocity(other.origin, self.enemy, self.height);
-
-	other.flags = other.flags - (other.flags & FL_ONGROUND);
-	
-	// reset tracking of oldvelocity for impact damage (sudden velocity changes)
-	other.oldvelocity = other.velocity = self.movedir;
-
-	if (self.spawnflags & PUSH_ONCE)
-	{
-		self.touch = SUB_Null;
-		self.think = SUB_Remove;
-		self.nextthink = time;
-	}
-};
-
-//.vector dest;
-
-void() trigger_push_findtarget =
-{
-	local vector org;
-	local float flighttime;
-
-	// first calculate a typical start point for the jump
-	org = (self.absmin + self.absmax) * 0.5;
-	org_z = self.absmax_z - self.boxmin_z;
-
-	if (self.target)
-	{
-		// find the target
-		self.enemy = find(world, targetname, self.target);
-		if (!self.enemy)
-		{
-			objerror("trigger_push: target not found\n");
-			remove(self);
-			return;
-		}
-
-		self.movedir = trigger_push_calculatevelocity(org, self.enemy, self.height);
-		flighttime = trigger_push_calculatevelocity_flighttime;
-	}
-	else
-		flighttime = 0;
-
-};
-
-/*
- * ENTITY PARAMETERS:
- *
- *   target:  target of jump
- *   height:  the absolute value is the height of the highest point of the jump
- *            trajectory above the higher one of the player and the target.
- *            the sign indicates whether the highest point is INSIDE (positive)
- *            or OUTSIDE (negative) of the jump trajectory. General rule: use
- *            positive values for targets mounted on the floor, and use negative
- *            values to target a point on the ceiling.
- *   movedir: if target is not set, this * speed * 10 is the velocity to be reached.
- */
-void() trigger_push =
-{
- 	bprint("BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO \n \n \n \n");
-
-	if (self.angles != '0 0 0')
-		SetMovedir ();
-
-	self.solid = SOLID_TRIGGER;
-	setmodel (self, self.model); // no precision needed
-	self.movetype = MOVETYPE_NONE;
-	self.modelindex = 0;
-	self.model = "";
-
-	self.touch = trigger_push_touch;
-
-	// normal push setup
-	if (!self.speed)
-		self.speed = 1000;
-	self.movedir = self.movedir * self.speed * 10;
-
-	if (self.target)
-		precache_sound ("misc/jumppad.wav");
-
-	// this must be called to spawn the teleport waypoints for bots
-	self.think = trigger_push_findtarget;
-	self.nextthink = time + 0.2;
-};
-
-void() target_push = {};
-void() info_notnull = {};
+float PUSH_ONCE			= 1;
+float PUSH_SILENT		= 2;
+
+.float height;
+
+float trigger_push_calculatevelocity_flighttime;
+
+/*
+	trigger_push_calculatevelocity
+
+	Arguments:
+	  org - origin of the object which is to be pushed
+	  tgt - target entity (can be either a point or a model entity; if it is
+	        the latter, its midpoint is used)
+	  ht  - jump height, measured from the higher one of org and tgt's midpoint
+
+	Returns: velocity for the jump
+	the global trigger_push_calculatevelocity_flighttime is set to the total
+	jump time
+ */
+
+vector(vector org, entity tgt, float ht) trigger_push_calculatevelocity =
+{
+	local float grav, sdist, zdist, vs, vz, jumpheight, trajsign;
+	local vector sdir, torg;
+
+	torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
+
+	grav = cvar("sv_gravity");
+
+	zdist = torg_z - org_z;
+	sdist = vlen(torg - org - zdist * '0 0 1');
+	sdir = normalize(torg - org - zdist * '0 0 1');
+
+	// how high do we need to push the player?
+	jumpheight = fabs(ht);
+	if(zdist > 0)
+		jumpheight = jumpheight + zdist;
+
+	/*
+		STOP.
+
+		You will not understand the following equations anyway...
+		But here is what I did to get them.
+
+		I used the functions
+
+		  s(t) = t * vs
+		  z(t) = t * vz - 1/2 grav t^2
+
+		and solved for:
+
+		  s(ti) = sdist
+		  z(ti) = zdist
+		  max(z, ti) = jumpheight
+
+		From these three equations, you will find the three parameters vs, vz
+		and ti.
+	 */
+
+	// push him so high...
+	vz = sqrt(2 * grav * jumpheight); // NOTE: sqrt(positive)!
+	if(ht < 0)
+		if(zdist < 0)
+			vz = -vz;
+
+	// how far to push him?
+	if(zdist == 0)
+	{
+		trigger_push_calculatevelocity_flighttime = sqrt(jumpheight * 8 / grav);
+		vs = sdist / trigger_push_calculatevelocity_flighttime;
+			// trajsign is ignored (the high point MUST be inside the jump!)
+	}
+	else
+	{
+		if(ht > 0)
+			trajsign = +1;
+		else
+			trajsign = -1;
+
+		// >0: the lower speed that achieves "it"
+		//     (parabola's maximum inside the jump)
+		// <0: the higher speed that achieves "it"
+		//     (parabola's maximum outside the jump)
+
+		vs = sqrt(jumpheight - zdist);
+		vs = sqrt(jumpheight) - trajsign * vs; // fteqcc sucks
+		vs = fabs(vs * sqrt(grav/2) / zdist);
+		//vs = fabs((sdist / zdist) * sqrt(grav/2) * (sqrt(jumpheight) - trajsign * sqrt(jumpheight - zdist)));
+		trigger_push_calculatevelocity_flighttime = 1 / vs;
+			// note: vs cannot be zero here. The difference between the sqrts is zero IFF zdist == 0, which we have excluded.
+		vs = vs * sdist;
+
+		// cases to test: "jump up", "jump down" with positive and negative height
+	}
+
+	// finally calculate the velocity
+	return sdir * vs + '0 0 1' * vz;
+}
+
+void() trigger_push_touch =
+{
+ 	if (other.classname != "player")
+	    return;
+
+	if (!self.target)
+	{
+		other.velocity = self.movedir;
+		other.flags = other.flags - (other.flags & FL_ONGROUND);
+		return;
+	}
+	
+	te_smallflash(other.origin);
+
+	self.movedir = trigger_push_calculatevelocity(other.origin, self.enemy, self.height);
+
+	other.flags = other.flags - (other.flags & FL_ONGROUND);
+	
+	// reset tracking of oldvelocity for impact damage (sudden velocity changes)
+	other.oldvelocity = other.velocity = self.movedir;
+
+	if (self.spawnflags & PUSH_ONCE)
+	{
+		self.touch = SUB_Null;
+		self.think = SUB_Remove;
+		self.nextthink = time;
+	}
+};
+
+//.vector dest;
+
+void() trigger_push_findtarget =
+{
+	local vector org;
+	local float flighttime;
+
+	// first calculate a typical start point for the jump
+	org = (self.absmin + self.absmax) * 0.5;
+	org_z = self.absmax_z - self.boxmin_z;
+
+	if (self.target)
+	{
+		// find the target
+		self.enemy = find(world, targetname, self.target);
+		if (!self.enemy)
+		{
+			objerror("trigger_push: target not found\n");
+			remove(self);
+			return;
+		}
+
+		self.movedir = trigger_push_calculatevelocity(org, self.enemy, self.height);
+		flighttime = trigger_push_calculatevelocity_flighttime;
+	}
+	else
+		flighttime = 0;
+
+};
+
+/*
+ * ENTITY PARAMETERS:
+ *
+ *   target:  target of jump
+ *   height:  the absolute value is the height of the highest point of the jump
+ *            trajectory above the higher one of the player and the target.
+ *            the sign indicates whether the highest point is INSIDE (positive)
+ *            or OUTSIDE (negative) of the jump trajectory. General rule: use
+ *            positive values for targets mounted on the floor, and use negative
+ *            values to target a point on the ceiling.
+ *   movedir: if target is not set, this * speed * 10 is the velocity to be reached.
+ */
+void() trigger_push =
+{
+ 	bprint("BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO \n \n \n \n");
+
+	if (self.angles != '0 0 0')
+		SetMovedir ();
+
+	self.solid = SOLID_TRIGGER;
+	setmodel (self, self.model); // no precision needed
+	self.movetype = MOVETYPE_NONE;
+	self.modelindex = 0;
+	self.model = "";
+
+	self.touch = trigger_push_touch;
+
+	// normal push setup
+	if (!self.speed)
+		self.speed = 1000;
+	self.movedir = self.movedir * self.speed * 10;
+
+	if (self.target)
+		precache_sound ("misc/jumppad.wav");
+
+	// this must be called to spawn the teleport waypoints for bots
+	self.think = trigger_push_findtarget;
+	self.nextthink = time + 0.2;
+};
+
+void() target_push = {};
+void() info_notnull = {};
 void() target_position = {};
\ No newline at end of file


Property changes on: trunk/basezym/progsqc/jumppads.qc
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/mapentities.qc
===================================================================
--- trunk/basezym/progsqc/mapentities.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/mapentities.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,444 +1,444 @@
-void() InitTrigger =
-{
-// trigger angles are used for one-way touches.  An angle of 0 is assumed
-// to mean no restrictions, so use a yaw of 360 instead.
-	if (self.movedir == '0 0 0')
-	if (self.angles != '0 0 0')
-		SetMovedir ();
-	self.solid = SOLID_TRIGGER;
-	setmodel (self, self.model);	// set size and link into world, no precision needed
-	self.movetype = MOVETYPE_NONE;
-	self.modelindex = 0;
-	self.model = "";
-};
-
-void() InitSolidBSPTrigger =
-{
-// trigger angles are used for one-way touches.  An angle of 0 is assumed
-// to mean no restrictions, so use a yaw of 360 instead.
-	if (self.movedir == '0 0 0')
-	if (self.angles != '0 0 0')
-		SetMovedir ();
-	self.solid = SOLID_BSP;
-	setmodel (self, self.model);	// set size and link into world, no precision needed
-	self.movetype = MOVETYPE_PUSH;
-//	self.modelindex = 0;
-	self.model = "";
-};
-
-
-
-void() func_ladder_touch =
-{
-	if (other.classname != "player")
-		return;
-	other.ladder_time = time + 0.1;
-	other.ladder_entity = self;
-};
-
-void() func_ladder =
-{
-	InitTrigger ();
-	self.touch = func_ladder_touch;
-};
-
-void() func_water =
-{
-	self.solid = SOLID_TRIGGER;
-	setmodel (self, self.model);	// set size and link into world
-	self.touch = func_ladder_touch;
-};
-
-
-
-
-void Teleport_Touch (void)
-{
-	entity head;
-
-	// Make teleport effect where the player left
-	sound (other, CHAN_ITEM, "misc/teleport.wav", 1, ATTN_NORM);
-	te_teleport (other.origin);
-
-	// Make teleport effect where the player arrived
-	sound (other, CHAN_ITEM, "misc/teleport.wav", 1, ATTN_NORM);
-	makevectors (self.enemy.mangle);
-	te_teleport (self.enemy.origin + v_forward * 32);
-
-	// Relocate the player
-	setorigin (other, self.enemy.origin + '0 0 1' * (1 - other.mins_z - 24));
-	other.angles = self.enemy.mangle;
-	other.fixangle = TRUE;
-	other.velocity = v_forward * vlen(other.velocity);
-
-	/*
-	// Kill anyone else in the teleporter box (NO MORE TDEATH)
-	if(other.takedamage)
-	{
-		vector deathmin;
-		vector deathmax;
-		float deathradius;
-		deathmin = other.absmin;
-		deathmax = other.absmax;
-		deathradius = max(vlen(deathmin), vlen(deathmax));
-		for(head = findradius(other.origin, deathradius); head; head = head.chain)
-			if(head != other)
-				if(head.takedamage)
-					if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
-					{
-						if ((other.classname == "player") && (other.health >= 1))
-							Damage (head, self, other, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
-						else if (other.health < 1) // corpses gib
-							Damage (head, self, other, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
-						else // dead bodies and monsters gib themselves instead of telefragging
-							Damage (other, self, other, 10000, DEATH_TELEFRAG, other.origin, '0 0 0');
-					}
-	}
-	*/
-
-	// hide myself a tic
-	other.effects = other.effects | EF_NODRAW;
-	other.teleport_time = time + cvar("sys_ticrate");
-
-	other.flags = other.flags - (other.flags & FL_ONGROUND);
-	// reset tracking of oldvelocity for impact damage (sudden velocity changes)
-	other.oldvelocity = other.velocity;
-}
-
-void info_teleport_destination (void)
-{
-	self.mangle = self.angles;
-	self.angles = '0 0 0';
-
-	//setorigin (self, self.origin + '0 0 27');	// To fix a mappers' habit as old as Quake
-	setorigin (self, self.origin);
-
-	if (!self.targetname)
-		objerror ("Teleport destination without a targetname");
-}
-
-void misc_teleporter_dest (void)
-{
-	info_teleport_destination();
-}
-
-void target_teleporter (void)
-{
-	info_teleport_destination();
-}
-
-void teleport_findtarget (void)
-{
-	// now enable touch
-	self.touch = Teleport_Touch;
-
-	self.enemy = find (world, targetname, self.target);
-	if (!self.enemy)
-	{
-		objerror ("Teleporter with nonexistant target");
-		remove(self);
-		return;
-	}
-
-	self.dest = self.enemy.origin;
-}
-
-void trigger_teleport (void)
-{
-	self.angles = '0 0 0';
-
-	self.solid = SOLID_TRIGGER;
-	self.movetype = MOVETYPE_NONE;
-
-	setmodel (self, self.model); // no precision needed
-
-	self.model = "";
-	self.modelindex = 0;
-
-	self.think = teleport_findtarget;
-	self.nextthink = time + 0.2;
-
-	if (!self.target)
-		objerror ("Teleporter with no target");
-}
-
-void() target_speaker =
-{
-if(self.noise) {
- precache_sound (self.noise);
- ambientsound (self.origin, self.noise, 1, ATTN_STATIC);
-}
-//remove(self);
-};
-
-
-void() rotating_blocked =
-{
-
-/*
-    if(self.dmg && other.takedamage != DAMAGE_NO) {
-        if(self.dmgtime2 < time) {
-            Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
-            self.dmgtime2 = time + self.dmgtime;
-        }
-
-        // Gib dead/dying stuff
-        if(other.deadflag != DEAD_NO)
-            Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
-    }
-*/
-}
-
-/*QUAKED func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
-Brush model that spins in place on one axis (default Z).
-speed   : speed to rotate (in degrees per second)
-noise   : path/name of looping .wav file to play.
-dmg     : Do this mutch dmg every .dmgtime intervall when blocked
-dmgtime : See above.
-*/
-
-void() func_rotating =
-{
-	if (self.noise)
-	{
-		precache_sound(self.noise);
-		ambientsound(self.origin, self.noise, 1, ATTN_IDLE);
-	}
-	if (!self.speed)
-		self.speed = 100;
-	// FIXME: test if this turns the right way, then remove this comment (negate as needed)
-	if (self.spawnflags & 4) // X (untested)
-		self.avelocity = '0 0 1' * self.speed;
-	// FIXME: test if this turns the right way, then remove this comment (negate as needed)
-	else if (self.spawnflags & 8) // Y (untested)
-		self.avelocity = '1 0 0' * self.speed;
-	// FIXME: test if this turns the right way, then remove this comment (negate as needed)
-	else // Z
-		self.avelocity = '0 1 0' * self.speed;
-		
-	self.solid = SOLID_BSP;
-	self.movetype = MOVETYPE_PUSH;
-
-	setmodel(self, self.model); // no lowprecision here! evil!
-	setsize(self, self.mins, self.maxs);
-	setorigin(self, self.origin);
-
-    self.blocked = rotating_blocked;
-
-	// wait for targets to spawn
-	self.nextthink = self.ltime + 999999999;
-	self.think = SUB_Null;
-};
-
-.entity trigger_field;
-
-void() plat_center_touch;
-void() plat_outside_touch;
-void() plat_trigger_use;
-void() plat_go_up;
-void() plat_go_down;
-void() plat_crush;
-float PLAT_LOW_TRIGGER = 1;
-
-void() plat_spawn_inside_trigger =
-{
-	local entity trigger;
-	local vector tmin, tmax;
-
-	trigger = spawn();
-	trigger.touch = plat_center_touch;
-	trigger.movetype = MOVETYPE_NONE;
-	trigger.solid = SOLID_TRIGGER;
-	trigger.enemy = self;
-
-	tmin = self.mins + '25 25 0';
-	tmax = self.maxs - '25 25 -8';
-	tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8);
-	if (self.spawnflags & PLAT_LOW_TRIGGER)
-		tmax_z = tmin_z + 8;
-
-	if (self.size_x <= 50)
-	{
-		tmin_x = (self.mins_x + self.maxs_x) / 2;
-		tmax_x = tmin_x + 1;
-	}
-	if (self.size_y <= 50)
-	{
-		tmin_y = (self.mins_y + self.maxs_y) / 2;
-		tmax_y = tmin_y + 1;
-	}
-
-	setsize (trigger, tmin, tmax);
-};
-
-void() plat_hit_top =
-{
-	sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
-	self.state = 1;
-	self.think = plat_go_down;
-	self.nextthink = self.ltime + 3;
-};
-
-void() plat_hit_bottom =
-{
-	sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
-	self.state = 2;
-};
-
-void() plat_go_down =
-{
-	sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
-	self.state = 3;
-	SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
-};
-
-void() plat_go_up =
-{
-	sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
-	self.state = 4;
-	SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
-};
-
-void() plat_center_touch =
-{
-	if (other.classname != "player")
-		return;
-
-	if (other.health <= 0)
-		return;
-
-	self = self.enemy;
-	if (self.state == 2)
-		plat_go_up ();
-	else if (self.state == 1)
-		self.nextthink = self.ltime + 1;	// delay going down
-};
-
-void() plat_outside_touch =
-{
-	if (other.classname != "player")
-		return;
-
-	if (other.health <= 0)
-		return;
-
-	self = self.enemy;
-	if (self.state == 1)
-		plat_go_down ();
-};
-
-void() plat_trigger_use =
-{
-	if (self.think)
-		return;		// allready activated
-	plat_go_down();
-};
-
-
-void() plat_crush =
-{
-/*
-    if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
-        Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
-    } else {
-        if((self.dmg) && (other.takedamage != DAMAGE_NO)) {   // Shall we bite?
-            Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
-            // Gib dead/dying stuff
-            if(other.deadflag != DEAD_NO)
-                Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
-        }
-
-        if (self.state == 4)
-            plat_go_down ();
-        else if (self.state == 3)
-            plat_go_up ();
-        else
-            objerror ("plat_crush: bad self.state\n");
-    }
-	*/
-};
-
-void() plat_use =
-{
-	self.use = SUB_Null;
-	if (self.state != 4)
-		objerror ("plat_use: not in up state");
-	plat_go_down();
-};
-
-
-.string sound1, sound2;
-
-void() func_plat =
-{
-	if (!self.t_length)
-		self.t_length = 80;
-	if (!self.t_width)
-		self.t_width = 10;
-
-	if (self.sounds == 0)
-		self.sounds = 2;
-
-	if (self.sounds == 1)
-	{
-		precache_sound ("plats/plat1.wav");
-		precache_sound ("plats/plat2.wav");
-		self.noise = "plats/plat1.wav";
-		self.noise1 = "plats/plat2.wav";
-	}
-
-	if (self.sounds == 2)
-	{
-		precache_sound ("plats/medplat1.wav");
-		precache_sound ("plats/medplat2.wav");
-		self.noise = "plats/medplat1.wav";
-		self.noise1 = "plats/medplat2.wav";
-	}
-
-	if (self.sound1)
-	{
-		precache_sound (self.sound1);
-		self.noise = self.sound1;
-	}
-	if (self.sound2)
-	{
-		precache_sound (self.sound2);
-		self.noise1 = self.sound2;
-	}
-
-	self.mangle = self.angles;
-	self.angles = '0 0 0';
-
-	self.classname = "plat";
-	self.solid = SOLID_BSP;
-	self.movetype = MOVETYPE_PUSH;
-	setorigin (self, self.origin);
-	setmodel (self, self.model); // precision set below
-	self.effects |= EF_LOWPRECISION;
-	setsize (self, self.mins , self.maxs);
-
-	self.blocked = plat_crush;
-
-	if (!self.speed)
-		self.speed = 150;
-
-	self.pos1 = self.origin;
-	self.pos2 = self.origin;
-	self.pos2_z = self.origin_z - self.size_z + 8;
-
-	self.use = plat_trigger_use;
-
-	plat_spawn_inside_trigger ();	// the "start moving" trigger
-
-	if (self.targetname)
-	{
-		self.state = 4;
-		self.use = plat_use;
-	}
-	else
-	{
-		setorigin (self, self.pos2);
-		self.state = 2;
-	}
-};
-
+void() InitTrigger =
+{
+// trigger angles are used for one-way touches.  An angle of 0 is assumed
+// to mean no restrictions, so use a yaw of 360 instead.
+	if (self.movedir == '0 0 0')
+	if (self.angles != '0 0 0')
+		SetMovedir ();
+	self.solid = SOLID_TRIGGER;
+	setmodel (self, self.model);	// set size and link into world, no precision needed
+	self.movetype = MOVETYPE_NONE;
+	self.modelindex = 0;
+	self.model = "";
+};
+
+void() InitSolidBSPTrigger =
+{
+// trigger angles are used for one-way touches.  An angle of 0 is assumed
+// to mean no restrictions, so use a yaw of 360 instead.
+	if (self.movedir == '0 0 0')
+	if (self.angles != '0 0 0')
+		SetMovedir ();
+	self.solid = SOLID_BSP;
+	setmodel (self, self.model);	// set size and link into world, no precision needed
+	self.movetype = MOVETYPE_PUSH;
+//	self.modelindex = 0;
+	self.model = "";
+};
+
+
+
+void() func_ladder_touch =
+{
+	if (other.classname != "player")
+		return;
+	other.ladder_time = time + 0.1;
+	other.ladder_entity = self;
+};
+
+void() func_ladder =
+{
+	InitTrigger ();
+	self.touch = func_ladder_touch;
+};
+
+void() func_water =
+{
+	self.solid = SOLID_TRIGGER;
+	setmodel (self, self.model);	// set size and link into world
+	self.touch = func_ladder_touch;
+};
+
+
+
+
+void Teleport_Touch (void)
+{
+	entity head;
+
+	// Make teleport effect where the player left
+	sound (other, CHAN_ITEM, "misc/teleport.wav", 1, ATTN_NORM);
+	te_teleport (other.origin);
+
+	// Make teleport effect where the player arrived
+	sound (other, CHAN_ITEM, "misc/teleport.wav", 1, ATTN_NORM);
+	makevectors (self.enemy.mangle);
+	te_teleport (self.enemy.origin + v_forward * 32);
+
+	// Relocate the player
+	setorigin (other, self.enemy.origin + '0 0 1' * (1 - other.mins_z - 24));
+	other.angles = self.enemy.mangle;
+	other.fixangle = TRUE;
+	other.velocity = v_forward * vlen(other.velocity);
+
+	/*
+	// Kill anyone else in the teleporter box (NO MORE TDEATH)
+	if(other.takedamage)
+	{
+		vector deathmin;
+		vector deathmax;
+		float deathradius;
+		deathmin = other.absmin;
+		deathmax = other.absmax;
+		deathradius = max(vlen(deathmin), vlen(deathmax));
+		for(head = findradius(other.origin, deathradius); head; head = head.chain)
+			if(head != other)
+				if(head.takedamage)
+					if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
+					{
+						if ((other.classname == "player") && (other.health >= 1))
+							Damage (head, self, other, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+						else if (other.health < 1) // corpses gib
+							Damage (head, self, other, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+						else // dead bodies and monsters gib themselves instead of telefragging
+							Damage (other, self, other, 10000, DEATH_TELEFRAG, other.origin, '0 0 0');
+					}
+	}
+	*/
+
+	// hide myself a tic
+	other.effects = other.effects | EF_NODRAW;
+	other.teleport_time = time + cvar("sys_ticrate");
+
+	other.flags = other.flags - (other.flags & FL_ONGROUND);
+	// reset tracking of oldvelocity for impact damage (sudden velocity changes)
+	other.oldvelocity = other.velocity;
+}
+
+void info_teleport_destination (void)
+{
+	self.mangle = self.angles;
+	self.angles = '0 0 0';
+
+	//setorigin (self, self.origin + '0 0 27');	// To fix a mappers' habit as old as Quake
+	setorigin (self, self.origin);
+
+	if (!self.targetname)
+		objerror ("Teleport destination without a targetname");
+}
+
+void misc_teleporter_dest (void)
+{
+	info_teleport_destination();
+}
+
+void target_teleporter (void)
+{
+	info_teleport_destination();
+}
+
+void teleport_findtarget (void)
+{
+	// now enable touch
+	self.touch = Teleport_Touch;
+
+	self.enemy = find (world, targetname, self.target);
+	if (!self.enemy)
+	{
+		objerror ("Teleporter with nonexistant target");
+		remove(self);
+		return;
+	}
+
+	self.dest = self.enemy.origin;
+}
+
+void trigger_teleport (void)
+{
+	self.angles = '0 0 0';
+
+	self.solid = SOLID_TRIGGER;
+	self.movetype = MOVETYPE_NONE;
+
+	setmodel (self, self.model); // no precision needed
+
+	self.model = "";
+	self.modelindex = 0;
+
+	self.think = teleport_findtarget;
+	self.nextthink = time + 0.2;
+
+	if (!self.target)
+		objerror ("Teleporter with no target");
+}
+
+void() target_speaker =
+{
+if(self.noise) {
+ precache_sound (self.noise);
+ ambientsound (self.origin, self.noise, 1, ATTN_STATIC);
+}
+//remove(self);
+};
+
+
+void() rotating_blocked =
+{
+
+/*
+    if(self.dmg && other.takedamage != DAMAGE_NO) {
+        if(self.dmgtime2 < time) {
+            Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+            self.dmgtime2 = time + self.dmgtime;
+        }
+
+        // Gib dead/dying stuff
+        if(other.deadflag != DEAD_NO)
+            Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+    }
+*/
+}
+
+/*QUAKED func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
+Brush model that spins in place on one axis (default Z).
+speed   : speed to rotate (in degrees per second)
+noise   : path/name of looping .wav file to play.
+dmg     : Do this mutch dmg every .dmgtime intervall when blocked
+dmgtime : See above.
+*/
+
+void() func_rotating =
+{
+	if (self.noise)
+	{
+		precache_sound(self.noise);
+		ambientsound(self.origin, self.noise, 1, ATTN_IDLE);
+	}
+	if (!self.speed)
+		self.speed = 100;
+	// FIXME: test if this turns the right way, then remove this comment (negate as needed)
+	if (self.spawnflags & 4) // X (untested)
+		self.avelocity = '0 0 1' * self.speed;
+	// FIXME: test if this turns the right way, then remove this comment (negate as needed)
+	else if (self.spawnflags & 8) // Y (untested)
+		self.avelocity = '1 0 0' * self.speed;
+	// FIXME: test if this turns the right way, then remove this comment (negate as needed)
+	else // Z
+		self.avelocity = '0 1 0' * self.speed;
+		
+	self.solid = SOLID_BSP;
+	self.movetype = MOVETYPE_PUSH;
+
+	setmodel(self, self.model); // no lowprecision here! evil!
+	setsize(self, self.mins, self.maxs);
+	setorigin(self, self.origin);
+
+    self.blocked = rotating_blocked;
+
+	// wait for targets to spawn
+	self.nextthink = self.ltime + 999999999;
+	self.think = SUB_Null;
+};
+
+.entity trigger_field;
+
+void() plat_center_touch;
+void() plat_outside_touch;
+void() plat_trigger_use;
+void() plat_go_up;
+void() plat_go_down;
+void() plat_crush;
+float PLAT_LOW_TRIGGER = 1;
+
+void() plat_spawn_inside_trigger =
+{
+	local entity trigger;
+	local vector tmin, tmax;
+
+	trigger = spawn();
+	trigger.touch = plat_center_touch;
+	trigger.movetype = MOVETYPE_NONE;
+	trigger.solid = SOLID_TRIGGER;
+	trigger.enemy = self;
+
+	tmin = self.mins + '25 25 0';
+	tmax = self.maxs - '25 25 -8';
+	tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8);
+	if (self.spawnflags & PLAT_LOW_TRIGGER)
+		tmax_z = tmin_z + 8;
+
+	if (self.size_x <= 50)
+	{
+		tmin_x = (self.mins_x + self.maxs_x) / 2;
+		tmax_x = tmin_x + 1;
+	}
+	if (self.size_y <= 50)
+	{
+		tmin_y = (self.mins_y + self.maxs_y) / 2;
+		tmax_y = tmin_y + 1;
+	}
+
+	setsize (trigger, tmin, tmax);
+};
+
+void() plat_hit_top =
+{
+	sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+	self.state = 1;
+	self.think = plat_go_down;
+	self.nextthink = self.ltime + 3;
+};
+
+void() plat_hit_bottom =
+{
+	sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
+	self.state = 2;
+};
+
+void() plat_go_down =
+{
+	sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+	self.state = 3;
+	SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
+};
+
+void() plat_go_up =
+{
+	sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
+	self.state = 4;
+	SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
+};
+
+void() plat_center_touch =
+{
+	if (other.classname != "player")
+		return;
+
+	if (other.health <= 0)
+		return;
+
+	self = self.enemy;
+	if (self.state == 2)
+		plat_go_up ();
+	else if (self.state == 1)
+		self.nextthink = self.ltime + 1;	// delay going down
+};
+
+void() plat_outside_touch =
+{
+	if (other.classname != "player")
+		return;
+
+	if (other.health <= 0)
+		return;
+
+	self = self.enemy;
+	if (self.state == 1)
+		plat_go_down ();
+};
+
+void() plat_trigger_use =
+{
+	if (self.think)
+		return;		// allready activated
+	plat_go_down();
+};
+
+
+void() plat_crush =
+{
+/*
+    if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
+        Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+    } else {
+        if((self.dmg) && (other.takedamage != DAMAGE_NO)) {   // Shall we bite?
+            Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+            // Gib dead/dying stuff
+            if(other.deadflag != DEAD_NO)
+                Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+        }
+
+        if (self.state == 4)
+            plat_go_down ();
+        else if (self.state == 3)
+            plat_go_up ();
+        else
+            objerror ("plat_crush: bad self.state\n");
+    }
+	*/
+};
+
+void() plat_use =
+{
+	self.use = SUB_Null;
+	if (self.state != 4)
+		objerror ("plat_use: not in up state");
+	plat_go_down();
+};
+
+
+.string sound1, sound2;
+
+void() func_plat =
+{
+	if (!self.t_length)
+		self.t_length = 80;
+	if (!self.t_width)
+		self.t_width = 10;
+
+	if (self.sounds == 0)
+		self.sounds = 2;
+
+	if (self.sounds == 1)
+	{
+		precache_sound ("plats/plat1.wav");
+		precache_sound ("plats/plat2.wav");
+		self.noise = "plats/plat1.wav";
+		self.noise1 = "plats/plat2.wav";
+	}
+
+	if (self.sounds == 2)
+	{
+		precache_sound ("plats/medplat1.wav");
+		precache_sound ("plats/medplat2.wav");
+		self.noise = "plats/medplat1.wav";
+		self.noise1 = "plats/medplat2.wav";
+	}
+
+	if (self.sound1)
+	{
+		precache_sound (self.sound1);
+		self.noise = self.sound1;
+	}
+	if (self.sound2)
+	{
+		precache_sound (self.sound2);
+		self.noise1 = self.sound2;
+	}
+
+	self.mangle = self.angles;
+	self.angles = '0 0 0';
+
+	self.classname = "plat";
+	self.solid = SOLID_BSP;
+	self.movetype = MOVETYPE_PUSH;
+	setorigin (self, self.origin);
+	setmodel (self, self.model); // precision set below
+	self.effects |= EF_LOWPRECISION;
+	setsize (self, self.mins , self.maxs);
+
+	self.blocked = plat_crush;
+
+	if (!self.speed)
+		self.speed = 150;
+
+	self.pos1 = self.origin;
+	self.pos2 = self.origin;
+	self.pos2_z = self.origin_z - self.size_z + 8;
+
+	self.use = plat_trigger_use;
+
+	plat_spawn_inside_trigger ();	// the "start moving" trigger
+
+	if (self.targetname)
+	{
+		self.state = 4;
+		self.use = plat_use;
+	}
+	else
+	{
+		setorigin (self, self.pos2);
+		self.state = 2;
+	}
+};
+


Property changes on: trunk/basezym/progsqc/mapentities.qc
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/basezym/progsqc/notes.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/basezym/progsqc/player.qc
===================================================================
--- trunk/basezym/progsqc/player.qc	2007-12-22 00:28:07 UTC (rev 93)
+++ trunk/basezym/progsqc/player.qc	2007-12-31 19:49:12 UTC (rev 94)
@@ -1,1248 +1,1248 @@
-.float jumpflag;
-.vector oldvelocity;
-.float jetpackacc;
-
-void(float impuls) player_impulse;
-void() bot_npcthink;
-
-
-entity(float actortyp, float aityp, string mdldir, string mdlext, string snddir) playerclass_spawn =
-{
-	local entity e;
-	e = spawn();
-	e.classname = "playerclass";
-	e.actortype = actortyp;
-	e.aitype = aityp;
-	e.modeldir = mdldir;
-	e.modelext = mdlext;
-	e.sounddir = snddir;
-	precache_model(strcat(e.modeldir, "/lower", e.modelext));
-	precache_model(strcat(e.modeldir, "/upper", e.modelext));
-	precache_model(strcat(e.modeldir, "/head", e.modelext));
-	precache_sound(strcat(e.sounddir, "/hardlanding.wav"));
-	precache_sound(strcat(e.sounddir, "/landing.wav"));
-	precache_sound(strcat(e.sounddir, "/jump.wav"));
-	precache_sound(strcat(e.sounddir, "/voice/pain.wav"));
-	precache_sound(strcat(e.sounddir, "/shieldregen.wav"));
-	return e;
-};
-
-void() playerclass_spawndefaultclasses =
-{
-	local entity pc;
-	local vector legsframesoffset;
-	
-	string cname;
-
-	local float newweapon;
-	local float classnumber;
-	local float i;
-	for (classnumber = 1;classnumber < ACTORTYPE_TOTAL;classnumber++)
-	{
-	 	  cname = strcat("g_class",ftos(classnumber));
-	
-		  pc = playerclass_spawn(classnumber, cvar(cname,"_aitype"), strzone(cvar_string(cname,"_model")), ".md3", strzone(cvar_string(cname,"_name")));
-		  
-		  pc.health = cvar(cname,"_healthstart");
-		  pc.max_health = cvar(cname,"_healthmax");
-		  pc.armorvalue = cvar(cname,"_shieldstart");
-		  pc.armortype = 1;
-		  pc.armorregenrate = cvar(cname,"_regenrate");
-		  pc.armorregenmax = cvar(cname,"_shieldmax");
-		  pc.gibhealth = cvar(cname,"_gibhealth");
-		  pc.paintake = 20;
-		  pc.unlimitedinventory = FALSE;
-		  pc.mass = cvar(cname,"_mass");
-		  
-		  pc.bloodtype = cvar(cname,"_bloodtype");
-		  pc.gibtype = cvar(cname,"_gibtype");
-		  
-		  pc.animationtype = cvar(cname,"_animationtype");
-		  
-		  pc.scaleratio = cvar(cname,"_scaleratio");
-		  
-		  pc.boxmin = stov(cvar_string(cname,"_boxmin"));
-		  pc.boxmax = stov(cvar_string(cname,"_boxmax"));
-		  
-		  pc.boxmin = pc.boxmin * pc.scaleratio;
-		  pc.boxmax = pc.boxmax * pc.scaleratio;
-		  
-		  setsize(pc, pc.boxmin, pc.boxmax);
-		  
-		  pc.view_ofs = stov(cvar_string(cname,"_viewofs"));
-		  pc.weapon_ofs = stov(cvar_string(cname,"_weaponofs"));
-		  
-		  pc.jumpspeed = cvar(cname,"_jumpspeed");
-		  pc.speedratio = cvar(cname,"_speedratio");
-		  
-		  if (pc.animationtype == 1)
-		  {
-	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 30 25';
-		  		pc.actoranim_BOTH_DEAD1    = '29 1 25';
-		  		pc.actoranim_BOTH_DEATH2   = '30 30 25';
-		  		pc.actoranim_BOTH_DEAD2    = '59 1 25';
-		  		pc.actoranim_BOTH_DEATH3   = '60 30 25';
-		  		pc.actoranim_BOTH_DEAD3    = '89 1 25';
-		  		pc.actoranim_TORSO_GESTURE = '90 45 20';
-		  		pc.actoranim_TORSO_ATTACK  = '135 6 15';
-		  		pc.actoranim_TORSO_ATTACK2 = '141 6 15';
-		 		pc.actoranim_TORSO_DROP    = '147 5 20';
-		  		pc.actoranim_TORSO_RAISE   = '151 5 20';
-		  		pc.actoranim_TORSO_RELOAD  = '156 1 15';
-		  		pc.actoranim_TORSO_STAND   = '156 1 15';
-		  		pc.actoranim_TORSO_STAND2  = '157 1 15';
-		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
-		  		pc.actoranim_LEGS_WALKCR   = '158 10 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_WALK     = '168 12 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_RUN      = '180 9 18' + legsframesoffset;
-		  		pc.actoranim_LEGS_BACK     = '189 10 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_SWIM     = '199 10 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_JUMP     = '209 6 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_LAND     = '215 1 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_JUMPB    = '218 8 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_LANDB    = '226 1 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_IDLE     = '227 5 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_IDLECR   = '236 5 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_TURN     = '245 7 15' + legsframesoffset;
-		 }
-		 else if (pc.animationtype == 2)
-		 {
-	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 30 25';
-		  		pc.actoranim_BOTH_DEAD1    = '29 1 25';
-		  		pc.actoranim_BOTH_DEATH2   = '30 30 25';
-		  		pc.actoranim_BOTH_DEAD2    = '59 1 25';
-		  		pc.actoranim_BOTH_DEATH3   = '60 30 25';
-		  		pc.actoranim_BOTH_DEAD3    = '89 1 25';
-		  		pc.actoranim_TORSO_GESTURE = '90 40 20';
-		  		pc.actoranim_TORSO_ATTACK  = '130 6 15';
-		  		pc.actoranim_TORSO_ATTACK2 = '130 6 15';
-		 		pc.actoranim_TORSO_DROP    = '142 5 20';
-		  		pc.actoranim_TORSO_RAISE   = '147 4 20';
-		  		pc.actoranim_TORSO_STAND   = '151 1 15';
-		  		pc.actoranim_TORSO_STAND2  = '152 1 15';
-		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
-		  		pc.actoranim_LEGS_WALKCR   = '153 9 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_WALK     = '170 13 18' + legsframesoffset;
-		  		pc.actoranim_LEGS_RUN      = '170 13 18' + legsframesoffset;
-		  		pc.actoranim_LEGS_BACK     = '183 10 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_SWIM     = '193 10 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_JUMP     = '203 9 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_LAND     = '212 5 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_JUMPB    = '217 9 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_LANDB    = '226 3 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_IDLE     = '229 10 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_IDLECR   = '239 8 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_TURN     = '247 7 15' + legsframesoffset;
-		 }
-		 else if (pc.animationtype == 3)
-		 {
-	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 24 25';
-		  		pc.actoranim_BOTH_DEAD1    = '23 1 25';
-		  		pc.actoranim_BOTH_DEATH2   = '24 52 25';
-		  		pc.actoranim_BOTH_DEAD2    = '75 1 25';
-		  		pc.actoranim_BOTH_DEATH3   = '76 17 25';
-		  		pc.actoranim_BOTH_DEAD3    = '92 1 25';
-		  		pc.actoranim_TORSO_GESTURE = '93 47 20';
-		  		pc.actoranim_TORSO_ATTACK  = '140 6 15';
-		  		pc.actoranim_TORSO_ATTACK2 = '146 6 15';
-		 		pc.actoranim_TORSO_DROP    = '152 5 20';
-		  		pc.actoranim_TORSO_RAISE   = '157 4 20';
-		  		pc.actoranim_TORSO_STAND   = '161 1 15';
-		  		pc.actoranim_TORSO_STAND2  = '162 1 15';
-		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
-		  		pc.actoranim_LEGS_WALKCR   = '163 10 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_WALK     = '173 13 18' + legsframesoffset;
-		  		pc.actoranim_LEGS_RUN      = '186 11 18' + legsframesoffset;
-		  		pc.actoranim_LEGS_BACK     = '197 10 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_SWIM     = '207 11 20' + legsframesoffset;
-		  		pc.actoranim_LEGS_JUMP     = '218 9 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_LAND     = '228 1 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_JUMPB    = '229 8 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_LANDB    = '237 1 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_IDLE     = '238 15 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_IDLECR   = '253 9 15' + legsframesoffset;
-		  		pc.actoranim_LEGS_TURN     = '262 9 15' + legsframesoffset;
-		 }
-		 
-		 Inventory_Clear(pc);
-		 
-		 for (i=1; i < ITEMTYPE_AI_WEAP1; i++)
-		 {
-		  	 if (cvar(cname,"_weapon",ftos(i)) != 0)
-		 	 {
-		  		newweapon = cvar(cname,"_weapon",ftos(i)) - 1;
-		  		Inventory_GetItemInfo(pc, newweapon);
-		  		Inventory_ModifyItem(pc, newweapon, 1, iteminfo_ammomax);
-		  		Inventory_ModifyItem(pc, ITEMTYPE_AMMO1 + newweapon, iteminfo_ammoinventorymax * 2, 0);
-		 	 }
-		 }
-		 
-		 for (i=1; i <= (ITEMTYPE_AMMO1 - ITEMTYPE_ITEM1); i++)
-		 {
-		  	 if (cvar(cname,"_item",ftos(i)) != 0)
-		 	 {
-		  		newweapon = cvar(cname,"_item",ftos(i)) - 1;
-		  		Inventory_GetItemInfo(pc, newweapon + ITEMTYPE_ITEM1);
-		  		Inventory_ModifyItem(pc, newweapon + ITEMTYPE_ITEM1, iteminfo_quantitymax, 0);
-		 	 }
-		 }
-		 
-		 for (i=1; i < ITEMTYPE_ITEM1 - ITEMTYPE_AI_WEAP1; i++)
-		 {
-		  	 if (cvar(cname,"_aiweapon",ftos(i)) != 0)
-		 	 {
-		  		newweapon = cvar(cname,"_aiweapon",ftos(i)) - 1 + ITEMTYPE_AI_WEAP1;
-		  		Inventory_GetItemInfo(pc, newweapon);
-		  		Inventory_ModifyItem(pc, newweapon, 1, iteminfo_ammomax);
-		 	 }
-		 }
-	}
-};
-
-entity(float type) playerclass_find =
-{
-	local entity pc;
-	pc = find(world, classname, "playerclass");
-	if (!pc)
-	{
-		playerclass_spawndefaultclasses();
-		pc = find(world, classname, "playerclass");
-	}
-	while (pc)
-	{
-		if (pc.actortype == type)
-			return pc;
-		pc = find(pc, classname, "playerclass");
-	}
-	return world;
-};
-
-void() player_die;
-void() player_gib;
-void(entity attacker, float damage) player_pain;
-void(float force) player_selectlegsanim;
-void(float type) player_spawn =
-{
-	local entity pc;
-	self.classname = "player";
-	self.actortype = type;
-	self.th_gib = player_gib;
-	self.th_die = player_die;
-	self.th_pain = player_pain;
-
-	Inventory_Clear(self);
-
-	pc = playerclass_find(type);
-	if (!pc)
-		objerror("No playerclass found");
-	self.playerclass = pc;
-	self.weapon_ofs = pc.weapon_ofs;
-	self.view_ofs = pc.view_ofs;
-	self.aitype = pc.aitype;
-	self.health = pc.health;
-	self.max_health = pc.max_health;
-	self.armorvalue = pc.armorvalue;
-	self.armortype = pc.armortype;
-	self.armorregenrate = pc.armorregenrate;
-	self.armorregenmax = pc.armorregenmax;
-	self.gibhealth = pc.gibhealth;
-	self.paintake = pc.paintake;
-	self.unlimitedinventory = pc.unlimitedinventory;
-	self.mass = pc.mass;
-	
-	self.bloodtype = pc.bloodtype;
-	self.gibtype = pc.gibtype;
-	
-	self.animationtype = pc.animationtype;
-	
-	self.scaleratio = pc.scaleratio;
-	
-	self.boxmin = pc.boxmin;
-	self.boxmax = pc.boxmax;
-	
-	self.jumpspeed = pc.jumpspeed;
-	self.speedratio = pc.speedratio;
-	
-	setsize (self, pc.mins, pc.maxs);
-	Inventory_CloneFromInventory(self, pc);
-	
-	actor_setup();
-	player_selectlegsanim(TRUE);
-	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
-	
-	self.itemselected = Inventory_GetBestItem(self);
-	weapon_setup(self, Inventory_GetBestWeapon(self));
-};
-
-/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
-The normal starting point for a level.
-*/
-void() info_player_start =
-{
-};
-
-/*
-saved out by quaked in region mode
-*/
-void() testplayerstart =
-{
-};
-
-/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
-potential spawning position for deathmatch games
-*/
-void() info_player_deathmatch =
-{
-};
-
-/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
-potential spawning position for coop games
-*/
-void() info_player_coop =
-{
-};
-
-entity() SelectSpawnPoint =
-{
-	local entity spot;
-	local string name;
-	local float r;
-
-	spot = world;
-	if (deathmatch)
-	{
-		name = "info_player_deathmatch";
-		spot = find(world, classname, name);
-	}
-	if (coop)
-	{
-		name = "info_player_coop";
-		spot = find(world, classname, name);
-	}
-	if (!spot)
-	{
-		name = "info_player_start";
-		spot = find(world, classname, name);
-	}
-	if (!spot)
-	{
-		name = "info_player_deathmatch";
-		spot = find(world, classname, name);
-	}
-	if (!spot)
-	{
-		name = "info_player_team1";
-		spot = find(world, classname, name);
-	}
-	if (!spot)
-		error ("No startpoint found\n");
-
-	r = random() * 100;
-	while (r > 0)
-	{
-		spot = find(spot, classname, name);
-		if (!spot) // wrap around to the first one
-			spot = find(spot, classname, name);
-		r = r - 1;
-	}
-
-	return spot;
-};
-
-
-/*
-=============
-PutClientInServer
-
-Called when a client spawns in the server
-=============
-*/
-void() PutClientInServer =
-{
-	local entity spot;
-
-	self.flags = FL_CLIENT;
-
-	spot = SelectSpawnPoint ();
-	self.angles = spot.angles;
-	setorigin (self, spot.origin + '0 0 1');
-
-	self.fixangle = TRUE;
-	self.v_angle = self.angles_x * '-1 0 0' + self.angles_y * '0 1 0';
-	self.nextthink = 0;
-	
-	stuffcmd(self, strcat("exec maps/", mapname, ".cfg\n"));
-	
-	self.team = cvar("g_playerteam");
-	//self.classnum = cvar("g_startclass");
-	
-	if (!self.spawned)
-	{
-	   self.health = 1;
-	   stuffcmd(self,"menu_showteamselect\n");
-	}
-	else
-	{
-	 	player_spawn(self.classnum);
-	}
-};
-
-/*
-=============
-SetNewParms
-=============
-*/
-void() SetNewParms =
-{
-
-};
-
-/*
-=============
-SetChangeParms
-=============
-*/
-void() SetChangeParms =
-{
-
-};
-
-/*
-=============
-ClientKill
-
-Called when a client types 'kill' in the console
-=============
-*/
-void() ClientKill =
-{
-
-};
-
-/*
-=============
-ClientConnect
-
-Called when a client connects to the server
-=============
-*/
-void() ClientConnect
-{
-	bprint (self.netname);
-	bprint (" entered the game\n");
-};
-
-/*
-=============
-ClientDisconnect
-
-Called when a client disconnects from the server
-=============
-*/
-void() ClientDisconnect =
-{
-	bprint (self.netname);
-	bprint (" left the game\n");
-};
-
-/*
-=============
-PlayerJump
-
-When you press the jump key
-=============
-*/
-void() PlayerJump =
-{
-};
-
-void() respawn =
-{
-	if (deathmatch || coop)
-	{
-		// TODO: spawn a corpse
-		PutClientInServer();
-	}
-	else
-		localcmd("restart\n");
-};
-
-/*
-=============
-PlayerPreThink
-
-Called every frame for each client before the physics are run
-=============
-*/
-.float deadtime;
-void() PlayerPreThink =
-{
-	if (!self.spawned)
-	{
-	   return;
-	}
-	if (self.flags & FL_CLIENT) // should really be client side
-	{
-	   self.viewmodelchange_x = self.viewmodelchange_x - (self.movement_x / 1000);
-	   self.viewmodelchange_y = self.viewmodelchange_y - (self.movement_y / 1000);
-	   self.viewmodelchange_z = self.viewmodelchange_z - (self.velocity_z / 2000);
-	
-	   Inventory_GetItemInfo(self, self.weaponitem);
-	   self.viewmodeldiff = iteminfo_viewmodeloffset - self.viewmodelchange;
-	   self.viewmodelchange = self.viewmodelchange + self.viewmodeldiff * 0.1;
-	   actor_setviewmodeloffset(self.viewmodelchange);
-	}
-	
-	if ((self.hook) && (!self.button7))
-	{
-	   if (self.hook.fireflag & FIREFLAG_HOOK)
-			remove(self.hook);
-	}
-	
-	Inventory_GetItemInfo(self, self.itemselected);
-	Inventory_ModifyItem(self, self.itemselected, 0 + iteminfo_rechargerate, 0);
-	Inventory_GetItemInfo(self, self.weaponitem);
-	Inventory_ModifyItem(self, self.weaponitem, 0, 0 + iteminfo_rechargerate);
-	
-	local float im;
-	if (self.flags & FL_CLIENT) // only real players can respawn, not NPCs
-	if (self.deadflag)
-	{
-		if (self.deadflag == DEAD_DYING)
-		if (time > self.deadtime + 1)
-			self.deadflag = DEAD_DEAD;
-		if (self.deadflag == DEAD_DEAD)
-		if (!self.button0)
-		if (!self.button2)
-		if (!self.button3)
-			self.deadflag = DEAD_RESPAWNABLE;
-		if (self.deadflag == DEAD_RESPAWNABLE)
-		if (self.button0 || self.button2 || self.button3)
-			respawn();
-	}
-	if (!self.deadflag)
-	if (self.flags & FL_ONGROUND)
-	{	
-		if (self.jumpflag || self.oldvelocity_z < -200)
-		{
-			if (self.oldvelocity_z < -500)
-			{
-				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/hardlanding.wav"), 1, ATTN_NORM);
-				T_Damage(self, world, world, DAMAGETYPE_FALL, PLAYER_FALLDAMAGE, self.origin + self.mins_z * '0 0 1', '0 0 0');
-				// this code made the player bounce on hard landings... why?
-				//self.velocity_z = self.velocity_z + self.oldvelocity_z * -1;
-			}
-			else
-				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/landing.wav"), 1, ATTN_NORM);
-		}
-		self.jumpflag = FALSE;
-		if (self.button2 || self.button5)
-		if (self.flags & FL_JUMPRELEASED)
-		{
-			sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jump.wav"), 1, ATTN_NORM);
-			anim_start(self, self.playerclass.actoranim_LEGS_JUMP, ANIMTYPE_JUMP, anim_nullfunc);
-			self.velocity_z = self.velocity_z + self.jumpspeed;
-			self.flags = self.flags - self.flags & (FL_ONGROUND | FL_JUMPRELEASED);
-			self.jumpflag = TRUE;
-		}
-	}
-	if (!self.deadflag)
-	{
-	   	if (self.button4)
-		{
-		    Inventory_GetItemInfo(self, self.weaponitem);
-		   	if (iteminfo_ammo1fireflags & FIREFLAG_ZOOM)
-		       self.viewzoom = 0.2;
-		}
-		else
-			self.viewzoom = 1;
-		if (self.button7 & self.jetpackactive)
-		{
-			if ((self.jetpack_fuel > 10) && (self.actorpart_jetpacktrail.effects & EF_NODRAW))
-			  	self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects - EF_NODRAW;
-			else if (self.jetpack_fuel < 10)
-			 	self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects | EF_NODRAW;
-		}
-		else
-		{
-			if (self.jetpackactive)
-			{
-			    self.jetpackacc = cvar("g_jetpack_accbase");
-				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jetpackstop.wav"), 1, ATTN_NORM);
-				self.jetpackactive = FALSE;
-				self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects | EF_NODRAW;
-			}
-		}
-	}
-	self.oldvelocity = self.velocity;
-	if (!self.button2)
-		self.flags = self.flags | FL_JUMPRELEASED;
-	if (self.impulse)
-	{
-		im = self.impulse;
-		self.impulse = 0;
-		player_impulse(im);
-	}
-};
-
-/*
-=============
-PlayerPostThink
-
-Called every frame for each client after the physics are run
-=============
-*/
-void() player_regen;
-.entity pointitem;
-.float oldbutton0;
-.float oldbutton3;
-.float pointitemannouncetime;
-void() PlayerPostThink =
-{	
-	if (!self.spawned)
-	{
-	   return;
-	}
-	local entity oldself;
-	player_regen();
-	
-	actor_update();
-	   
-	if (self.pointitem)
-	if (self.pointitem.classname != "")
-		self.pointitem.colormod = '1 1 1';
-	self.pointitem = world;
-	// note cursor_trace_ent does not work if the item model is missing!
-	if (self.deadflag == DEAD_NO)
-	if (self.cursor_trace_ent.ispointable)
-	if (vlen(self.cursor_trace_ent.origin - self.origin) < 100)
-		self.pointitem = trace_ent;
-	if (self.pointitem)
-	{
-		self.pointitem.colormod = '2 2 2';
-		self.lowerguntime = time + 0.4;
-		if (self.weaponstate == WS_LOWER)
-		if (self.pointitem.use)
-		{
-			if (self.button0 && !self.oldbutton0)
-			{
-				self.pointitem.colormod = '1 1 1';
-				other = self;
-				oldself = self;
-				self = self.pointitem;
-				self.use();
-				self = oldself;
-				if (self.pointitem.classname == "")
-					self.pointitem = world;
-			}
-			else if (self.pointitem.use == Item_Pickup)
-			{
-				if (time > self.pointitemannouncetime)
-				{
-					self.pointitemannouncetime = time + 0.5;
-					centerprint(self, "Click to pick up a ", self.pointitem.netname, "\n");
-				}
-			}
-		}
-	}
-	self.oldbutton0 = self.button0;
-	self.oldbutton3 = self.button3;
-};
-
-/*
-=============
-SV_PlayerPhysics
-
-Called every frame for each client before PlayerPreThink
-=============
-*/
-
-
-float sv_airaccel_sideways_friction = 0.3;
-float sv_airaccel_qw = 0.93;	 	
-		
-void() SV_PlayerPhysics =
-{
-	local vector wishvel, wishdir, v;
-	local float wishspeed, f;
-	float vel_z;
-	
-	self.movement = self.movement * self.speedratio;
-
-	if (self.movetype == MOVETYPE_NONE)
-		return;
-
-	if (self.punchangle != '0 0 0')
-	{
-		f = vlen(self.punchangle) - 10 * frametime;
-		if (f > 0)
-			self.punchangle = normalize(self.punchangle) * f;
-		else
-			self.punchangle = '0 0 0';
-	}
-
-	if (self.punchvector != '0 0 0')
-	{
-		f = vlen(self.punchvector) - 30 * frametime;
-		if (f > 0)
-			self.punchvector = normalize(self.punchvector) * f;
-		else
-			self.punchvector = '0 0 0';
-	}
-
-	// if dead, behave differently
-	if (self.deadflag)
-	{
-		if (self.waterlevel >= 2)
-		{
-			// water friction and gravity
-			self.velocity = (self.velocity - '0 0 1' * sv_gravity * frametime) * (1 - frametime * sv_friction);
-		}
-		else if (time < self.ladder_time && self.ladder_entity.classname == "func_water")
-		{
-			// swimming in func_water
-			self.velocity = self.velocity * (1 - frametime * sv_friction);
-		}
-		else if (self.flags & FL_ONGROUND)
-		{
-			// friction
-			if (self.velocity_x || self.velocity_y)
-			{
-				v = self.velocity;
-				v_z = 0;
-				f = vlen(v);
-				if (f < sv_stopspeed)
-					f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
-				else
-					f = 1 - frametime * sv_friction;
-				if (f > 0)
-					self.velocity = self.velocity * f;
-				else
-					self.velocity = '0 0 0';
-			}
-		}
-		return;
-	}
-
-	if (!self.fixangle)
-	{
-		// show 1/3 the pitch angle and all the roll angle
-		// LordHavoc: no real interest in porting V_CalcRoll
-		//self.angles_z = V_CalcRoll (self.angles, self.velocity)*4;
-		self.angles_x = 0;
-		self.angles_y = self.v_angle_y + self.punchangle_y;
-		self.angles_z = 0;
-	}
-
-	if (self.movetype == MOVETYPE_NOCLIP)
-	{
-		// noclipping or flying
-		self.velocity = self.velocity * (1 - frametime * sv_friction);
-		makevectors(self.v_angle);
-		//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
-		wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
-		// acceleration
-		wishdir = normalize(wishvel);
-		wishspeed = vlen(wishvel);
-		if (wishspeed > sv_maxspeed)
-			wishspeed = sv_maxspeed;
-		if (time >= self.teleport_time)
-		{
-			f = wishspeed - (self.velocity * wishdir);
-			if (f > 0)
-				self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
-		}
-	}
-	else if (self.waterlevel >= 2)
-	{
-		// swimming
-		makevectors(self.v_angle);
-		//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
-		wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
-		if (wishvel == '0 0 0')
-			wishvel = '0 0 -60'; // drift towards bottom
-
-		wishdir = normalize(wishvel);
-		wishspeed = vlen(wishvel);
-		if (wishspeed > sv_maxspeed)
-			wishspeed = sv_maxspeed;
-		wishspeed = wishspeed * 0.7;
-
-		// water friction
-		self.velocity = self.velocity * (1 - frametime * sv_friction);
-
-		// water acceleration
-		f = wishspeed - (self.velocity * wishdir);
-		if (f > 0)
-			self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
-	}
-	else if (time < self.ladder_time)
-	{
-		// on a func_ladder or swimming in func_water
-		self.velocity = self.velocity * (1 - frametime * sv_friction);
-		makevectors(self.v_angle);
-		//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
-		wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
-		if (self.gravity)
-			self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime;
-		else
-			self.velocity_z = self.velocity_z + sv_gravity * frametime;
-		if (self.ladder_entity.classname == "func_water")
-		{
-			f = vlen(wishvel);
-			if (f > self.ladder_entity.speed)
-				wishvel = wishvel * (self.ladder_entity.speed / f);
-
-			self.watertype = self.ladder_entity.skin;
-			f = self.ladder_entity.origin_z + self.ladder_entity.maxs_z;
-			if ((self.origin_z + self.maxs_z - 2) < f)
-				self.waterlevel = 3;
-			else if ((self.origin_z + (self.mins_z + self.maxs_z) * 0.5) < f)
-				self.waterlevel = 2;
-			else if ((self.origin_z + self.mins_z + 1) < f)
-				self.waterlevel = 1;
-			else
-			{
-				self.waterlevel = 0;
-				self.watertype = CONTENT_EMPTY;
-			}
-		}
-		// acceleration
-		wishdir = normalize(wishvel);
-		wishspeed = vlen(wishvel);
-		if (wishspeed > sv_maxspeed)
-			wishspeed = sv_maxspeed;
-		if (time >= self.teleport_time)
-		{
-			f = wishspeed - (self.velocity * wishdir);
-			if (f > 0)
-				self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
-		}
-	}
-	else if (self.flags & FL_ONGROUND)
-	{
-		// walking
-		makevectors(self.v_angle_y * '0 1 0');
-		wishvel = v_forward * self.movement_x + v_right * self.movement_y;
-		// friction
-		if (self.velocity_x || self.velocity_y)
-		{
-			v = self.velocity;
-			v_z = 0;
-			f = vlen(v);
-			if (f < sv_stopspeed)
-				f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
-			else
-				f = 1 - frametime * sv_friction;
-			if (f > 0)
-				self.velocity = self.velocity * f;
-			else
-				self.velocity = '0 0 0';
-		}
-		// acceleration
-		wishdir = normalize(wishvel);
-		wishspeed = vlen(wishvel);
-		if (wishspeed > sv_maxspeed)
-			wishspeed = sv_maxspeed;
-		if (time >= self.teleport_time)
-		{
-			f = wishspeed - (self.velocity * wishdir);
-			if (f > 0)
-				self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
-		}
-	}
-	else
-	{
-		// airborn
-		makevectors(self.v_angle_y * '0 1 0');
-		wishvel = v_forward * self.movement_x + v_right * self.movement_y;
-		// acceleration
-		wishdir = normalize(wishvel);
-		wishspeed = wishspeed + vlen(wishvel);
-		
-		if (self.jetpackactive && self.jetpack_fuel > 5)
-		{
-			self.movetype = MOVETYPE_FLY;
-			
-			if (self.velocity_z < cvar("g_jetpack_maxupspeed"))
-			{
-			  self.velocity_z = self.velocity_z + self.jetpackacc;
-			}
-			if (wishspeed > cvar("g_jetpack_maxmovespeed"))
-			   wishspeed = cvar("g_jetpack_maxmovespeed");
-		}
-		else 
-		{
-		 	self.jetpackactive = FALSE;
-		 	self.movetype = MOVETYPE_WALK;
-		 	if (wishspeed > sv_maxairspeed)
-			   wishspeed = sv_maxairspeed;
-		}
-		if (time >= self.teleport_time)
-		{
-			float vel_straight;
-			vector vel_perpend;
-			vel_straight = self.velocity * wishdir;
-			vel_z = self.velocity_z;
-			vel_perpend = self.velocity - vel_straight * wishdir - vel_z * '0 0 1';
-
-			f = wishspeed - vel_straight;
-			if(f > 0)
-				vel_straight = vel_straight + min(f, sv_airaccelerate * frametime * wishspeed) * sv_airaccel_qw;
-			if(wishspeed > 0)
-				vel_straight = vel_straight + min(wishspeed, sv_airaccelerate * frametime * wishspeed) * (1 - sv_airaccel_qw);
-
-			// anti-sideways friction to fix QW-style bunnyhopping
-			vel_perpend = vel_perpend * (1 - frametime * (wishspeed / sv_maxairspeed) * sv_airaccel_sideways_friction);
-
-			self.velocity = vel_straight * wishdir + vel_z * '0 0 1' + vel_perpend;
-		}
-	}
-};
-
-void(float animdone) player_dyingfunc =
-{
-	if (animdone)
-	{
-		self.deadflag = DEAD_DEAD;
-		self.anim_framefunc = anim_nullfunc;
-	}
-};
-
-void() player_die =
-{
-	self.deadtime = time;
-	local float c;
-	c = random() * 3;
-	if (c < 1)
-	{ 
-		anim_start(self, self.playerclass.actoranim_BOTH_DEATH1, ANIMTYPE_DYING, player_dyingfunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_BOTH_DEATH1, ANIMTYPE_DYING, anim_nullfunc);
-	}
-	else if (c < 2)
-	{
-		anim_start(self, self.playerclass.actoranim_BOTH_DEATH2, ANIMTYPE_DYING, player_dyingfunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_BOTH_DEATH2, ANIMTYPE_DYING, anim_nullfunc);
-	}
-	else
-	{
-		anim_start(self, self.playerclass.actoranim_BOTH_DEATH3, ANIMTYPE_DYING, player_dyingfunc);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_BOTH_DEATH3, ANIMTYPE_DYING, anim_nullfunc);
-	}
-};
-
-void() player_gib =
-{
-	self.deadflag = DEAD_DEAD;
-	
-	if (self.gibtype == 1)
-	{
-		te_bloodshower (self.origin + self.mins, self.origin + self.maxs, 50, 3000);	
-		// make a meaty mess
-		TossGib (world, "models/gibs/bloodyskull.md3", self.origin, '0 0 600',0);
-		TossGib (world, "models/gibs/gib1.md3", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/gib1.mdl", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/gib2.mdl", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/gib3.mdl", self.origin, self.velocity,0);
-		// these destory on impact
-		TossGib (world, "models/gibs/gib5.md3", self.origin, '-500 0 450',1);
-		TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 -500 450',1);
-		TossGib (world, "models/gibs/chunk.mdl", self.origin, '500 0 450',1);
-		TossGib (world, "models/gibs/chunk.mdl", self.origin, self.velocity,1);
-		TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 0 450',1);
-		sound (self, CHAN_VOICE, "misc/gib.wav", 1, ATTN_NORM);
-	}
-	else if (self.gibtype == 2)
-	{
-		te_explosion(self.origin);
-		TossGib (world, "models/gibs/m_gib1.md3", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/m_gib2.md3", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/m_gib3.md3", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/m_gib4.md3", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/m_gib5.md3", self.origin, self.velocity,0);
-		TossGib (world, "models/gibs/m_gib6.md3", self.origin, self.velocity,0);
-	}
-	
-	if (self.flags & FL_CLIENT)
-	   TossGib (self, "models/gibs/eye.md3", self.origin, self.velocity,0);
-	else
-	{
-		remove(self.actorpart_torso);
-		remove(self.actorpart_head);
-		remove(self.actorpart_weapon);
-		remove(self.actorpart_viewweapon);
-		remove(self);
-	}
-};
-
-void(entity attacker, float damage) player_pain =
-{
-	if (attacker.team != self.team)
-		self.enemy = attacker;
-	if (self.flags & FL_CLIENT)
-		self.enemy = attacker;
-	
-	if (damage >= self.paintake)
-	{
-		sound(self, CHAN_VOICE, strcat(self.playerclass.sounddir, "/voice/pain.wav"), 1, ATTN_NORM);
-		// TODO: anim
-	}
-};
-
-void() player_regen =
-{
-	if (time > self.armorregentime)
-	if (self.armorvalue < self.armorregenmax)
-	if (!self.deadflag)
-	{
-		if (self.armorregenplaysound)
-		{
-			sound(self, CHAN_AUTO, strcat(self.playerclass.sounddir, "/shieldregen.wav"), 1, ATTN_STATIC);
-			self.armorregenplaysound = FALSE;
-		}
-		self.armorvalue = min(self.armorvalue + frametime * self.armorregenrate, self.armorregenmax);
-	}
-};
-
-void(float force) player_selectlegsanim;
-
-void(float animtype, float force) player_legsanim =
-{
-	if (animtype == self.anim_type && !force)
-		return;
-	     if (animtype == ANIMTYPE_STAND      ) anim_start(self, self.playerclass.actoranim_LEGS_IDLE, animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_WALKFORWARD) anim_start(self, self.playerclass.actoranim_LEGS_WALK, animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_WALKBACK   ) anim_start(self, self.playerclass.actoranim_LEGS_BACK, animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_WALKLEFT   ) anim_start(self, self.playerclass.actoranim_LEGS_WALK, animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_WALKRIGHT  ) anim_start(self, self.playerclass.actoranim_LEGS_WALK, animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_RUNFORWARD ) anim_start(self, self.playerclass.actoranim_LEGS_RUN , animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_RUNBACK    ) anim_start(self, self.playerclass.actoranim_LEGS_BACK, animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_RUNLEFT    ) anim_start(self, self.playerclass.actoranim_LEGS_RUN , animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_RUNRIGHT   ) anim_start(self, self.playerclass.actoranim_LEGS_RUN , animtype, player_selectlegsanim);
-	else if (animtype == ANIMTYPE_FALL       ) anim_start(self, self.playerclass.actoranim_LEGS_JUMP, animtype, anim_nullfunc);
-	//else if (animtype == ANIMTYPE_DYING      ) anim_start(self, self.playerclass.actoranim_LEGS_JUMP, animtype, anim_nullfunc);
-};
-
-void(float force) player_selectlegsanim =
-{
-	local vector v;
-	local float best, s, animtype;
-	v = self.velocity;
-	v_z = 0;
-	makevectors(self.angles_y * '0 1 0');
-	// less than 1 unit per second uses the stand anim
-	best = 100;
-	animtype = ANIMTYPE_STAND;
-	s = self.velocity * v_forward;if (best < s) {best = s;animtype = ANIMTYPE_RUNFORWARD;}
-	s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_RUNBACK;}
-	s = self.velocity * v_right  ;if (best < s) {best = s;animtype = ANIMTYPE_RUNRIGHT;}
-	s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_RUNLEFT;}
-	if (animtype == ANIMTYPE_STAND)
-	{
-		best = 1;
-		s = self.velocity * v_forward;if (best < s) {best = s;animtype = ANIMTYPE_WALKFORWARD;}
-		s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_WALKBACK;}
-		s = self.velocity * v_right  ;if (best < s) {best = s;animtype = ANIMTYPE_WALKRIGHT;}
-		s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_WALKLEFT;}
-	}
-	if (!(self.flags & FL_ONGROUND))
-		animtype = ANIMTYPE_FALL;
-	if (self.deadflag & DEAD_DYING)
-		animtype = ANIMTYPE_DYING;
-	if (self.deadflag & DEAD_DEAD)
-	    animtype = ANIMTYPE_DEAD;
-	player_legsanim(animtype, force);
-};
-
-void(float animdone) player_repeatstandframe =
-{
-	if (animdone)
-		anim_start(self, self.playerclass.actoranim_LEGS_IDLE, ANIMTYPE_STAND, player_repeatstandframe);
-};
-
-void(entity e, vector point) printsurfaceinfo =
-{
-	local float surfnum, numpoints, vnum;
-	local string s;
-	local vector n;
-	surfnum = getsurfacenearpoint(e, point);
-	if (surfnum >= 0)
-	{
-		bprint("texture: ");
-		s = getsurfacetexture(e, surfnum);
-		bprint(s);
-		bprint(" normal: ");
-		n = getsurfacenormal(e, surfnum);
-		bprint(vtos(n));
-		bprint(" ");
-		numpoints = getsurfacenumpoints(e, surfnum);
-		bprint(ftos(numpoints));
-		bprint(" verts:");
-		vnum = 0;
-		while (vnum < numpoints)
-		{
-			bprint(" ");
-			n = getsurfacepoint(e, surfnum, vnum);
-			bprint(vtos(n));
-			vnum = vnum + 1;
-		}
-		bprint(" point tested: ");
-		bprint(vtos(point));
-		bprint(" nearest point on surface: ");
-		n = getsurfaceclippedpoint(e, surfnum, point);
-		bprint(vtos(n));
-		bprint("\n");
-	}
-};
-
-void(float impuls) player_impulse =
-{
-	local float c;
-	local float w;
-	local float select;
-	local entity oldself;
-	if (self.deadflag)
-		return;
-	if (cvar("sv_cheats"))
-	{
-		if (impuls == 16)
-		{
-			eprint(self.cursor_trace_ent);
-			return;
-		}
-		if (impuls == 15)
-		{
-			printsurfaceinfo(self.cursor_trace_ent, self.cursor_trace_endpos);
-			return;
-		}
-		if ((impuls >= 31) && (impuls < 30 + ACTORTYPE_TOTAL))
-		{
-			makevectors(self.v_angle);
-			newmis = spawn();
-			setorigin(newmis, self.origin + v_forward * 60);
-			newmis.angles = '0 1 0' * self.v_angle_y;
-			newmis.think = bot_npcthink;
-			newmis.nextthink = time;
-			oldself = self;
-			self = newmis;
-			self.team = cvar("g_defaultenemyteam");
-			self.unlimitedinventory = 1;
-			self.spawned = 1;
-			player_spawn(impuls - 30);
-			self = oldself;
-		}
-		if (impuls == 21)
-		{
-			c = 0;
-			vector item;
-			while (c < ITEMTYPE_TOTAL)
-			{
-			 	if (c == ITEMTYPE_WEAP1)
-				   bprint("User Weapons:    AT=Ammotype   Q=Quantity   A=Ammo","\n");
-			 	if (c == ITEMTYPE_AI_WEAP1)
-				   bprint("AI Weapons:","\n");
-			 	if (c == ITEMTYPE_ITEM1)
-				   bprint("Items:","\n");
-			 	if (c == ITEMTYPE_AMMO1)
-				   bprint("Ammo:","\n");
-				   
-				Inventory_GetItemInfo(self, c);
-				item = Inventory_GetItem(self, c);
-				bprint(ftos(c),".  AT:", ftos(iteminfo_ammotype)," Q:",ftos(item_x)," A:",ftos(item_y));
-				bprint("  ", iteminfo_name,"\n");
-				c = c + 1;
-			}
-		}
-		if (impuls == 20)
-		{
-			c = 0;
-			while (c < ITEMTYPE_AI_WEAP1)
-			{
-				Inventory_GetItemInfo(self, c);
-				Inventory_ModifyItem(self, c, iteminfo_quantitymax, iteminfo_ammomax);
-				c = c + 1;
-			}
-			self.switchweaponitem = Inventory_GetBestWeapon(self);
-		}
-	}
-	if (impuls >= 1 && impuls <= 9)
-	{
-		select = impuls;
-		w = 0;
-		while (select >= 0)
-		{
-			if (w >= ITEMTYPE_AI_WEAP1)
-				break;
-			Inventory_GetItemInfo(self, w);
-			if (iteminfo_weapon_canraise)
-			{
-				select = select - 1;
-				if (select == 0)
-				{
-				   self.switchweaponitem = w;
-				   //bprint(iteminfo_name,"\n");
-				   break;
-				}
-			}
-			w = w + 1;
-		}
-	}
-	if (impuls == 10)
-	{
-		w = self.switchweaponitem;
-		while (TRUE)
-		{
-			w = w + 1;
-			if (w >= ITEMTYPE_ITEM1)
-				w = 0;
-			if (w == self.switchweaponitem)
-				break;
-			Inventory_GetItemInfo(self, w);
-			if (iteminfo_weapon_canraise)
-			{
-				self.switchweaponitem = w;
-				//bprint(iteminfo_name,"\n");
-				break;
-			}
-		}
-	}
-	if (impuls == 12)
-	{
-		w = self.switchweaponitem;
-		while (TRUE)
-		{
-			w = w - 1;
-			if (w < 0)
-				w = ITEMTYPE_ITEM1 - 1;
-			if (w == self.switchweaponitem)
-				break;
-			Inventory_GetItemInfo(self, w);
-			if (iteminfo_weapon_canraise)
-			{
-				self.switchweaponitem = w;
-				//bprint(iteminfo_name,"\n");
-				break;
-			}
-		}
-	}
-	if (impuls == 13)
-	{
-		w = self.itemselected;
-		while (TRUE)
-		{
-			w = w + 1;
-			if (w >= ITEMTYPE_AMMO1)
-				w = ITEMTYPE_ITEM1;
-			if (w == self.itemselected)
-				break;
-			Inventory_GetItemInfo(self, w);
-			if (iteminfo_weapon_canraise)
-			{
-			   	//bprint(iteminfo_name,"\n");
-				self.itemselected = w;
-				break;
-			}
-		}
-	}
-};
-
+.float jumpflag;
+.vector oldvelocity;
+.float jetpackacc;
+
+void(float impuls) player_impulse;
+void() bot_npcthink;
+
+
+entity(float actortyp, float aityp, string mdldir, string mdlext, string snddir) playerclass_spawn =
+{
+	local entity e;
+	e = spawn();
+	e.classname = "playerclass";
+	e.actortype = actortyp;
+	e.aitype = aityp;
+	e.modeldir = mdldir;
+	e.modelext = mdlext;
+	e.sounddir = snddir;
+	precache_model(strcat(e.modeldir, "/lower", e.modelext));
+	precache_model(strcat(e.modeldir, "/upper", e.modelext));
+	precache_model(strcat(e.modeldir, "/head", e.modelext));
+	precache_sound(strcat(e.sounddir, "/hardlanding.wav"));
+	precache_sound(strcat(e.sounddir, "/landing.wav"));
+	precache_sound(strcat(e.sounddir, "/jump.wav"));
+	precache_sound(strcat(e.sounddir, "/voice/pain.wav"));
+	precache_sound(strcat(e.sounddir, "/shieldregen.wav"));
+	return e;
+};
+
+void() playerclass_spawndefaultclasses =
+{
+	local entity pc;
+	local vector legsframesoffset;
+	
+	string cname;
+
+	local float newweapon;
+	local float classnumber;
+	local float i;
+	for (classnumber = 1;classnumber < ACTORTYPE_TOTAL;classnumber++)
+	{
+	 	  cname = strcat("g_class",ftos(classnumber));
+	
+		  pc = playerclass_spawn(classnumber, cvar(cname,"_aitype"), strzone(cvar_string(cname,"_model")), ".md3", strzone(cvar_string(cname,"_name")));
+		  
+		  pc.health = cvar(cname,"_healthstart");
+		  pc.max_health = cvar(cname,"_healthmax");
+		  pc.armorvalue = cvar(cname,"_shieldstart");
+		  pc.armortype = 1;
+		  pc.armorregenrate = cvar(cname,"_regenrate");
+		  pc.armorregenmax = cvar(cname,"_shieldmax");
+		  pc.gibhealth = cvar(cname,"_gibhealth");
+		  pc.paintake = 20;
+		  pc.unlimitedinventory = FALSE;
+		  pc.mass = cvar(cname,"_mass");
+		  
+		  pc.bloodtype = cvar(cname,"_bloodtype");
+		  pc.gibtype = cvar(cname,"_gibtype");
+		  
+		  pc.animationtype = cvar(cname,"_animationtype");
+		  
+		  pc.scaleratio = cvar(cname,"_scaleratio");
+		  
+		  pc.boxmin = stov(cvar_string(cname,"_boxmin"));
+		  pc.boxmax = stov(cvar_string(cname,"_boxmax"));
+		  
+		  pc.boxmin = pc.boxmin * pc.scaleratio;
+		  pc.boxmax = pc.boxmax * pc.scaleratio;
+		  
+		  setsize(pc, pc.boxmin, pc.boxmax);
+		  
+		  pc.view_ofs = stov(cvar_string(cname,"_viewofs"));
+		  pc.weapon_ofs = stov(cvar_string(cname,"_weaponofs"));
+		  
+		  pc.jumpspeed = cvar(cname,"_jumpspeed");
+		  pc.speedratio = cvar(cname,"_speedratio");
+		  
+		  if (pc.animationtype == 1)
+		  {
+	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 30 25';
+		  		pc.actoranim_BOTH_DEAD1    = '29 1 25';
+		  		pc.actoranim_BOTH_DEATH2   = '30 30 25';
+		  		pc.actoranim_BOTH_DEAD2    = '59 1 25';
+		  		pc.actoranim_BOTH_DEATH3   = '60 30 25';
+		  		pc.actoranim_BOTH_DEAD3    = '89 1 25';
+		  		pc.actoranim_TORSO_GESTURE = '90 45 20';
+		  		pc.actoranim_TORSO_ATTACK  = '135 6 15';
+		  		pc.actoranim_TORSO_ATTACK2 = '141 6 15';
+		 		pc.actoranim_TORSO_DROP    = '147 5 20';
+		  		pc.actoranim_TORSO_RAISE   = '151 5 20';
+		  		pc.actoranim_TORSO_RELOAD  = '156 1 15';
+		  		pc.actoranim_TORSO_STAND   = '156 1 15';
+		  		pc.actoranim_TORSO_STAND2  = '157 1 15';
+		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
+		  		pc.actoranim_LEGS_WALKCR   = '158 10 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_WALK     = '168 12 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_RUN      = '180 9 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_BACK     = '189 10 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_SWIM     = '199 10 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMP     = '209 6 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LAND     = '215 1 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMPB    = '218 8 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LANDB    = '226 1 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLE     = '227 5 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLECR   = '236 5 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_TURN     = '245 7 15' + legsframesoffset;
+		 }
+		 else if (pc.animationtype == 2)
+		 {
+	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 30 25';
+		  		pc.actoranim_BOTH_DEAD1    = '29 1 25';
+		  		pc.actoranim_BOTH_DEATH2   = '30 30 25';
+		  		pc.actoranim_BOTH_DEAD2    = '59 1 25';
+		  		pc.actoranim_BOTH_DEATH3   = '60 30 25';
+		  		pc.actoranim_BOTH_DEAD3    = '89 1 25';
+		  		pc.actoranim_TORSO_GESTURE = '90 40 20';
+		  		pc.actoranim_TORSO_ATTACK  = '130 6 15';
+		  		pc.actoranim_TORSO_ATTACK2 = '130 6 15';
+		 		pc.actoranim_TORSO_DROP    = '142 5 20';
+		  		pc.actoranim_TORSO_RAISE   = '147 4 20';
+		  		pc.actoranim_TORSO_STAND   = '151 1 15';
+		  		pc.actoranim_TORSO_STAND2  = '152 1 15';
+		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
+		  		pc.actoranim_LEGS_WALKCR   = '153 9 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_WALK     = '170 13 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_RUN      = '170 13 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_BACK     = '183 10 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_SWIM     = '193 10 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMP     = '203 9 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LAND     = '212 5 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMPB    = '217 9 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LANDB    = '226 3 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLE     = '229 10 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLECR   = '239 8 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_TURN     = '247 7 15' + legsframesoffset;
+		 }
+		 else if (pc.animationtype == 3)
+		 {
+	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 24 25';
+		  		pc.actoranim_BOTH_DEAD1    = '23 1 25';
+		  		pc.actoranim_BOTH_DEATH2   = '24 52 25';
+		  		pc.actoranim_BOTH_DEAD2    = '75 1 25';
+		  		pc.actoranim_BOTH_DEATH3   = '76 17 25';
+		  		pc.actoranim_BOTH_DEAD3    = '92 1 25';
+		  		pc.actoranim_TORSO_GESTURE = '93 47 20';
+		  		pc.actoranim_TORSO_ATTACK  = '140 6 15';
+		  		pc.actoranim_TORSO_ATTACK2 = '146 6 15';
+		 		pc.actoranim_TORSO_DROP    = '152 5 20';
+		  		pc.actoranim_TORSO_RAISE   = '157 4 20';
+		  		pc.actoranim_TORSO_STAND   = '161 1 15';
+		  		pc.actoranim_TORSO_STAND2  = '162 1 15';
+		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
+		  		pc.actoranim_LEGS_WALKCR   = '163 10 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_WALK     = '173 13 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_RUN      = '186 11 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_BACK     = '197 10 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_SWIM     = '207 11 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMP     = '218 9 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LAND     = '228 1 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMPB    = '229 8 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LANDB    = '237 1 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLE     = '238 15 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLECR   = '253 9 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_TURN     = '262 9 15' + legsframesoffset;
+		 }
+		 
+		 Inventory_Clear(pc);
+		 
+		 for (i=1; i < ITEMTYPE_AI_WEAP1; i++)
+		 {
+		  	 if (cvar(cname,"_weapon",ftos(i)) != 0)
+		 	 {
+		  		newweapon = cvar(cname,"_weapon",ftos(i)) - 1;
+		  		Inventory_GetItemInfo(pc, newweapon);
+		  		Inventory_ModifyItem(pc, newweapon, 1, iteminfo_ammomax);
+		  		Inventory_ModifyItem(pc, ITEMTYPE_AMMO1 + newweapon, iteminfo_ammoinventorymax * 2, 0);
+		 	 }
+		 }
+		 
+		 for (i=1; i <= (ITEMTYPE_AMMO1 - ITEMTYPE_ITEM1); i++)
+		 {
+		  	 if (cvar(cname,"_item",ftos(i)) != 0)
+		 	 {
+		  		newweapon = cvar(cname,"_item",ftos(i)) - 1;
+		  		Inventory_GetItemInfo(pc, newweapon + ITEMTYPE_ITEM1);
+		  		Inventory_ModifyItem(pc, newweapon + ITEMTYPE_ITEM1, iteminfo_quantitymax, 0);
+		 	 }
+		 }
+		 
+		 for (i=1; i < ITEMTYPE_ITEM1 - ITEMTYPE_AI_WEAP1; i++)
+		 {
+		  	 if (cvar(cname,"_aiweapon",ftos(i)) != 0)
+		 	 {
+		  		newweapon = cvar(cname,"_aiweapon",ftos(i)) - 1 + ITEMTYPE_AI_WEAP1;
+		  		Inventory_GetItemInfo(pc, newweapon);
+		  		Inventory_ModifyItem(pc, newweapon, 1, iteminfo_ammomax);
+		 	 }
+		 }
+	}
+};
+
+entity(float type) playerclass_find =
+{
+	local entity pc;
+	pc = find(world, classname, "playerclass");
+	if (!pc)
+	{
+		playerclass_spawndefaultclasses();
+		pc = find(world, classname, "playerclass");
+	}
+	while (pc)
+	{
+		if (pc.actortype == type)
+			return pc;
+		pc = find(pc, classname, "playerclass");
+	}
+	return world;
+};
+
+void() player_die;
+void() player_gib;
+void(entity attacker, float damage) player_pain;
+void(float force) player_selectlegsanim;
+void(float type) player_spawn =
+{
+	local entity pc;
+	self.classname = "player";
+	self.actortype = type;
+	self.th_gib = player_gib;
+	self.th_die = player_die;
+	self.th_pain = player_pain;
+
+	Inventory_Clear(self);
+
+	pc = playerclass_find(type);
+	if (!pc)
+		objerror("No playerclass found");
+	self.playerclass = pc;
+	self.weapon_ofs = pc.weapon_ofs;
+	self.view_ofs = pc.view_ofs;
+	self.aitype = pc.aitype;
+	self.health = pc.health;
+	self.max_health = pc.max_health;
+	self.armorvalue = pc.armorvalue;
+	self.armortype = pc.armortype;
+	self.armorregenrate = pc.armorregenrate;
+	self.armorregenmax = pc.armorregenmax;
+	self.gibhealth = pc.gibhealth;
+	self.paintake = pc.paintake;
+	self.unlimitedinventory = pc.unlimitedinventory;
+	self.mass = pc.mass;
+	
+	self.bloodtype = pc.bloodtype;
+	self.gibtype = pc.gibtype;
+	
+	self.animationtype = pc.animationtype;
+	
+	self.scaleratio = pc.scaleratio;
+	
+	self.boxmin = pc.boxmin;
+	self.boxmax = pc.boxmax;
+	
+	self.jumpspeed = pc.jumpspeed;
+	self.speedratio = pc.speedratio;
+	
+	setsize (self, pc.mins, pc.maxs);
+	Inventory_CloneFromInventory(self, pc);
+	
+	actor_setup();
+	player_selectlegsanim(TRUE);
+	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
+	
+	self.itemselected = Inventory_GetBestItem(self);
+	weapon_setup(self, Inventory_GetBestWeapon(self));
+};
+
+/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
+The normal starting point for a level.
+*/
+void() info_player_start =
+{
+};
+
+/*
+saved out by quaked in region mode
+*/
+void() testplayerstart =
+{
+};
+
+/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
+potential spawning position for deathmatch games
+*/
+void() info_player_deathmatch =
+{
+};
+
+/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
+potential spawning position for coop games
+*/
+void() info_player_coop =
+{
+};
+
+entity() SelectSpawnPoint =
+{
+	local entity spot;
+	local string name;
+	local float r;
+
+	spot = world;
+	if (deathmatch)
+	{
+		name = "info_player_deathmatch";
+		spot = find(world, classname, name);
+	}
+	if (coop)
+	{
+		name = "info_player_coop";
+		spot = find(world, classname, name);
+	}
+	if (!spot)
+	{
+		name = "info_player_start";
+		spot = find(world, classname, name);
+	}
+	if (!spot)
+	{
+		name = "info_player_deathmatch";
+		spot = find(world, classname, name);
+	}
+	if (!spot)
+	{
+		name = "info_player_team1";
+		spot = find(world, classname, name);
+	}
+	if (!spot)
+		error ("No startpoint found\n");
+
+	r = random() * 100;
+	while (r > 0)
+	{
+		spot = find(spot, classname, name);
+		if (!spot) // wrap around to the first one
+			spot = find(spot, classname, name);
+		r = r - 1;
+	}
+
+	return spot;
+};
+
+
+/*
+=============
+PutClientInServer
+
+Called when a client spawns in the server
+=============
+*/
+void() PutClientInServer =
+{
+	local entity spot;
+
+	self.flags = FL_CLIENT;
+
+	spot = SelectSpawnPoint ();
+	self.angles = spot.angles;
+	setorigin (self, spot.origin + '0 0 1');
+
+	self.fixangle = TRUE;
+	self.v_angle = self.angles_x * '-1 0 0' + self.angles_y * '0 1 0';
+	self.nextthink = 0;
+	
+	stuffcmd(self, strcat("exec maps/", mapname, ".cfg\n"));
+	
+	self.team = cvar("g_playerteam");
+	//self.classnum = cvar("g_startclass");
+	
+	if (!self.spawned)
+	{
+	   self.health = 1;
+	   stuffcmd(self,"menu_showteamselect\n");
+	}
+	else
+	{
+	 	player_spawn(self.classnum);
+	}
+};
+
+/*
+=============
+SetNewParms
+=============
+*/
+void() SetNewParms =
+{
+
+};
+
+/*
+=============
+SetChangeParms
+=============
+*/
+void() SetChangeParms =
+{
+
+};
+
+/*
+=============
+ClientKill
+
+Called when a client types 'kill' in the console
+=============
+*/
+void() ClientKill =
+{
+
+};
+
+/*
+=============
+ClientConnect
+
+Called when a client connects to the server
+=============
+*/
+void() ClientConnect
+{
+	bprint (self.netname);
+	bprint (" entered the game\n");
+};
+
+/*
+=============
+ClientDisconnect
+
+Called when a client disconnects from the server
+=============
+*/
+void() ClientDisconnect =
+{
+	bprint (self.netname);
+	bprint (" left the game\n");
+};
+
+/*
+=============
+PlayerJump
+
+When you press the jump key
+=============
+*/
+void() PlayerJump =
+{
+};
+
+void() respawn =
+{
+	if (deathmatch || coop)
+	{
+		// TODO: spawn a corpse
+		PutClientInServer();
+	}
+	else
+		localcmd("restart\n");
+};
+
+/*
+=============
+PlayerPreThink
+
+Called every frame for each client before the physics are run
+=============
+*/
+.float deadtime;
+void() PlayerPreThink =
+{
+	if (!self.spawned)
+	{
+	   return;
+	}
+	if (self.flags & FL_CLIENT) // should really be client side
+	{
+	   self.viewmodelchange_x = self.viewmodelchange_x - (self.movement_x / 1000);
+	   self.viewmodelchange_y = self.viewmodelchange_y - (self.movement_y / 1000);
+	   self.viewmodelchange_z = self.viewmodelchange_z - (self.velocity_z / 2000);
+	
+	   Inventory_GetItemInfo(self, self.weaponitem);
+	   self.viewmodeldiff = iteminfo_viewmodeloffset - self.viewmodelchange;
+	   self.viewmodelchange = self.viewmodelchange + self.viewmodeldiff * 0.1;
+	   actor_setviewmodeloffset(self.viewmodelchange);
+	}
+	
+	if ((self.hook) && (!self.button7))
+	{
+	   if (self.hook.fireflag & FIREFLAG_HOOK)
+			remove(self.hook);
+	}
+	
+	Inventory_GetItemInfo(self, self.itemselected);
+	Inventory_ModifyItem(self, self.itemselected, 0 + iteminfo_rechargerate, 0);
+	Inventory_GetItemInfo(self, self.weaponitem);
+	Inventory_ModifyItem(self, self.weaponitem, 0, 0 + iteminfo_rechargerate);
+	
+	local float im;
+	if (self.flags & FL_CLIENT) // only real players can respawn, not NPCs
+	if (self.deadflag)
+	{
+		if (self.deadflag == DEAD_DYING)
+		if (time > self.deadtime + 1)
+			self.deadflag = DEAD_DEAD;
+		if (self.deadflag == DEAD_DEAD)
+		if (!self.button0)
+		if (!self.button2)
+		if (!self.button3)
+			self.deadflag = DEAD_RESPAWNABLE;
+		if (self.deadflag == DEAD_RESPAWNABLE)
+		if (self.button0 || self.button2 || self.button3)
+			respawn();
+	}
+	if (!self.deadflag)
+	if (self.flags & FL_ONGROUND)
+	{	
+		if (self.jumpflag || self.oldvelocity_z < -200)
+		{
+			if (self.oldvelocity_z < -500)
+			{
+				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/hardlanding.wav"), 1, ATTN_NORM);
+				T_Damage(self, world, world, DAMAGETYPE_FALL, PLAYER_FALLDAMAGE, self.origin + self.mins_z * '0 0 1', '0 0 0');
+				// this code made the player bounce on hard landings... why?
+				//self.velocity_z = self.velocity_z + self.oldvelocity_z * -1;
+			}
+			else
+				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/landing.wav"), 1, ATTN_NORM);
+		}
+		self.jumpflag = FALSE;
+		if (self.button2 || self.button5)
+		if (self.flags & FL_JUMPRELEASED)
+		{
+			sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jump.wav"), 1, ATTN_NORM);
+			anim_start(self, self.playerclass.actoranim_LEGS_JUMP, ANIMTYPE_JUMP, anim_nullfunc);
+			self.velocity_z = self.velocity_z + self.jumpspeed;
+			self.flags = self.flags - self.flags & (FL_ONGROUND | FL_JUMPRELEASED);
+			self.jumpflag = TRUE;
+		}
+	}
+	if (!self.deadflag)
+	{
+	   	if (self.button4)
+		{
+		    Inventory_GetItemInfo(self, self.weaponitem);
+		   	if (iteminfo_ammo1fireflags & FIREFLAG_ZOOM)
+		       self.viewzoom = 0.2;
+		}
+		else
+			self.viewzoom = 1;
+		if (self.button7 & self.jetpackactive)
+		{
+			if ((self.jetpack_fuel > 10) && (self.actorpart_jetpacktrail.effects & EF_NODRAW))
+			  	self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects - EF_NODRAW;
+			else if (self.jetpack_fuel < 10)
+			 	self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects | EF_NODRAW;
+		}
+		else
+		{
+			if (self.jetpackactive)
+			{
+			    self.jetpackacc = cvar("g_jetpack_accbase");
+				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jetpackstop.wav"), 1, ATTN_NORM);
+				self.jetpackactive = FALSE;
+				self.actorpart_jetpacktrail.effects = self.actorpart_jetpacktrail.effects | EF_NODRAW;
+			}
+		}
+	}
+	self.oldvelocity = self.velocity;
+	if (!self.button2)
+		self.flags = self.flags | FL_JUMPRELEASED;
+	if (self.impulse)
+	{
+		im = self.impulse;
+		self.impulse = 0;
+		player_impulse(im);
+	}
+};
+
+/*
+=============
+PlayerPostThink
+
+Called every frame for each client after the physics are run
+=============
+*/
+void() player_regen;
+.entity pointitem;
+.float oldbutton0;
+.float oldbutton3;
+.float pointitemannouncetime;
+void() PlayerPostThink =
+{	
+	if (!self.spawned)
+	{
+	   return;
+	}
+	local entity oldself;
+	player_regen();
+	
+	actor_update();
+	   
+	if (self.pointitem)
+	if (self.pointitem.classname != "")
+		self.pointitem.colormod = '1 1 1';
+	self.pointitem = world;
+	// note cursor_trace_ent does not work if the item model is missing!
+	if (self.deadflag == DEAD_NO)
+	if (self.cursor_trace_ent.ispointable)
+	if (vlen(self.cursor_trace_ent.origin - self.origin) < 100)
+		self.pointitem = trace_ent;
+	if (self.pointitem)
+	{
+		self.pointitem.colormod = '2 2 2';
+		self.lowerguntime = time + 0.4;
+		if (self.weaponstate == WS_LOWER)
+		if (self.pointitem.use)
+		{
+			if (self.button0 && !self.oldbutton0)
+			{
+				self.pointitem.colormod = '1 1 1';
+				other = self;
+				oldself = self;
+				self = self.pointitem;
+				self.use();
+				self = oldself;
+				if (self.pointitem.classname == "")
+					self.pointitem = world;
+			}
+			else if (self.pointitem.use == Item_Pickup)
+			{
+				if (time > self.pointitemannouncetime)
+				{
+					self.pointitemannouncetime = time + 0.5;
+					centerprint(self, "Click to pick up a ", self.pointitem.netname, "\n");
+				}
+			}
+		}
+	}
+	self.oldbutton0 = self.button0;
+	self.oldbutton3 = self.button3;
+};
+
+/*
+=============
+SV_PlayerPhysics
+
+Called every frame for each client before PlayerPreThink
+=============
+*/
+
+
+float sv_airaccel_sideways_friction = 0.3;
+float sv_airaccel_qw = 0.93;	 	
+		
+void() SV_PlayerPhysics =
+{
+	local vector wishvel, wishdir, v;
+	local float wishspeed, f;
+	float vel_z;
+	
+	self.movement = self.movement * self.speedratio;
+
+	if (self.movetype == MOVETYPE_NONE)
+		return;
+
+	if (self.punchangle != '0 0 0')
+	{
+		f = vlen(self.punchangle) - 10 * frametime;
+		if (f > 0)
+			self.punchangle = normalize(self.punchangle) * f;
+		else
+			self.punchangle = '0 0 0';
+	}
+
+	if (self.punchvector != '0 0 0')
+	{
+		f = vlen(self.punchvector) - 30 * frametime;
+		if (f > 0)
+			self.punchvector = normalize(self.punchvector) * f;
+		else
+			self.punchvector = '0 0 0';
+	}
+
+	// if dead, behave differently
+	if (self.deadflag)
+	{
+		if (self.waterlevel >= 2)
+		{
+			// water friction and gravity
+			self.velocity = (self.velocity - '0 0 1' * sv_gravity * frametime) * (1 - frametime * sv_friction);
+		}
+		else if (time < self.ladder_time && self.ladder_entity.classname == "func_water")
+		{
+			// swimming in func_water
+			self.velocity = self.velocity * (1 - frametime * sv_friction);
+		}
+		else if (self.flags & FL_ONGROUND)
+		{
+			// friction
+			if (self.velocity_x || self.velocity_y)
+			{
+				v = self.velocity;
+				v_z = 0;
+				f = vlen(v);
+				if (f < sv_stopspeed)
+					f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
+				else
+					f = 1 - frametime * sv_friction;
+				if (f > 0)
+					self.velocity = self.velocity * f;
+				else
+					self.velocity = '0 0 0';
+			}
+		}
+		return;
+	}
+
+	if (!self.fixangle)
+	{
+		// show 1/3 the pitch angle and all the roll angle
+		// LordHavoc: no real interest in porting V_CalcRoll
+		//self.angles_z = V_CalcRoll (self.angles, self.velocity)*4;
+		self.angles_x = 0;
+		self.angles_y = self.v_angle_y + self.punchangle_y;
+		self.angles_z = 0;
+	}
+
+	if (self.movetype == MOVETYPE_NOCLIP)
+	{
+		// noclipping or flying
+		self.velocity = self.velocity * (1 - frametime * sv_friction);
+		makevectors(self.v_angle);
+		//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
+		wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
+		// acceleration
+		wishdir = normalize(wishvel);
+		wishspeed = vlen(wishvel);
+		if (wishspeed > sv_maxspeed)
+			wishspeed = sv_maxspeed;
+		if (time >= self.teleport_time)
+		{
+			f = wishspeed - (self.velocity * wishdir);
+			if (f > 0)
+				self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
+		}
+	}
+	else if (self.waterlevel >= 2)
+	{
+		// swimming
+		makevectors(self.v_angle);
+		//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
+		wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
+		if (wishvel == '0 0 0')
+			wishvel = '0 0 -60'; // drift towards bottom
+
+		wishdir = normalize(wishvel);
+		wishspeed = vlen(wishvel);
+		if (wishspeed > sv_maxspeed)
+			wishspeed = sv_maxspeed;
+		wishspeed = wishspeed * 0.7;
+
+		// water friction
+		self.velocity = self.velocity * (1 - frametime * sv_friction);
+
+		// water acceleration
+		f = wishspeed - (self.velocity * wishdir);
+		if (f > 0)
+			self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
+	}
+	else if (time < self.ladder_time)
+	{
+		// on a func_ladder or swimming in func_water
+		self.velocity = self.velocity * (1 - frametime * sv_friction);
+		makevectors(self.v_angle);
+		//wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
+		wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
+		if (self.gravity)
+			self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime;
+		else
+			self.velocity_z = self.velocity_z + sv_gravity * frametime;
+		if (self.ladder_entity.classname == "func_water")
+		{
+			f = vlen(wishvel);
+			if (f > self.ladder_entity.speed)
+				wishvel = wishvel * (self.ladder_entity.speed / f);
+
+			self.watertype = self.ladder_entity.skin;
+			f = self.ladder_entity.origin_z + self.ladder_entity.maxs_z;
+			if ((self.origin_z + self.maxs_z - 2) < f)
+				self.waterlevel = 3;
+			else if ((self.origin_z + (self.mins_z + self.maxs_z) * 0.5) < f)
+				self.waterlevel = 2;
+			else if ((self.origin_z + self.mins_z + 1) < f)
+				self.waterlevel = 1;
+			else
+			{
+				self.waterlevel = 0;
+				self.watertype = CONTENT_EMPTY;
+			}
+		}
+		// acceleration
+		wishdir = normalize(wishvel);
+		wishspeed = vlen(wishvel);
+		if (wishspeed > sv_maxspeed)
+			wishspeed = sv_maxspeed;
+		if (time >= self.teleport_time)
+		{
+			f = wishspeed - (self.velocity * wishdir);
+			if (f > 0)
+				self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
+		}
+	}
+	else if (self.flags & FL_ONGROUND)
+	{
+		// walking
+		makevectors(self.v_angle_y * '0 1 0');
+		wishvel = v_forward * self.movement_x + v_right * self.movement_y;
+		// friction
+		if (self.velocity_x || self.velocity_y)
+		{
+			v = self.velocity;
+			v_z = 0;
+			f = vlen(v);
+			if (f < sv_stopspeed)
+				f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
+			else
+				f = 1 - frametime * sv_friction;
+			if (f > 0)
+				self.velocity = self.velocity * f;
+			else
+				self.velocity = '0 0 0';
+		}
+		// acceleration
+		wishdir = normalize(wishvel);
+		wishspeed = vlen(wishvel);
+		if (wishspeed > sv_maxspeed)
+			wishspeed = sv_maxspeed;
+		if (time >= self.teleport_time)
+		{
+			f = wishspeed - (self.velocity * wishdir);
+			if (f > 0)
+				self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
+		}
+	}
+	else
+	{
+		// airborn
+		makevectors(self.v_angle_y * '0 1 0');
+		wishvel = v_forward * self.movement_x + v_right * self.movement_y;
+		// acceleration
+		wishdir = normalize(wishvel);
+		wishspeed = wishspeed + vlen(wishvel);
+		
+		if (self.jetpackactive && self.jetpack_fuel > 5)
+		{
+			self.movetype = MOVETYPE_FLY;
+			
+			if (self.velocity_z < cvar("g_jetpack_maxupspeed"))
+			{
+			  self.velocity_z = self.velocity_z + self.jetpackacc;
+			}
+			if (wishspeed > cvar("g_jetpack_maxmovespeed"))
+			   wishspeed = cvar("g_jetpack_maxmovespeed");
+		}
+		else 
+		{
+		 	self.jetpackactive = FALSE;
+		 	self.movetype = MOVETYPE_WALK;
+		 	if (wishspeed > sv_maxairspeed)
+			   wishspeed = sv_maxairspeed;
+		}
+		if (time >= self.teleport_time)
+		{
+			float vel_straight;
+			vector vel_perpend;
+			vel_straight = self.velocity * wishdir;
+			vel_z = self.velocity_z;
+			vel_perpend = self.velocity - vel_straight * wishdir - vel_z * '0 0 1';
+
+			f = wishspeed - vel_straight;
+			if(f > 0)
+				vel_straight = vel_straight + min(f, sv_airaccelerate * frametime * wishspeed) * sv_airaccel_qw;
+			if(wishspeed > 0)
+				vel_straight = vel_straight + min(wishspeed, sv_airaccelerate * frametime * wishspeed) * (1 - sv_airaccel_qw);
+
+			// anti-sideways friction to fix QW-style bunnyhopping
+			vel_perpend = vel_perpend * (1 - frametime * (wishspeed / sv_maxairspeed) * sv_airaccel_sideways_friction);
+
+			self.velocity = vel_straight * wishdir + vel_z * '0 0 1' + vel_perpend;
+		}
+	}
+};
+
+void(float animdone) player_dyingfunc =
+{
+	if (animdone)
+	{
+		self.deadflag = DEAD_DEAD;
+		self.anim_framefunc = anim_nullfunc;
+	}
+};
+
+void() player_die =
+{
+	self.deadtime = time;
+	local float c;
+	c = random() * 3;
+	if (c < 1)
+	{ 
+		anim_start(self, self.playerclass.actoranim_BOTH_DEATH1, ANIMTYPE_DYING, player_dyingfunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_BOTH_DEATH1, ANIMTYPE_DYING, anim_nullfunc);
+	}
+	else if (c < 2)
+	{
+		anim_start(self, self.playerclass.actoranim_BOTH_DEATH2, ANIMTYPE_DYING, player_dyingfunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_BOTH_DEATH2, ANIMTYPE_DYING, anim_nullfunc);
+	}
+	else
+	{
+		anim_start(self, self.playerclass.actoranim_BOTH_DEATH3, ANIMTYPE_DYING, player_dyingfunc);
+		anim_start(self.actorpart_torso, self.playerclass.actoranim_BOTH_DEATH3, ANIMTYPE_DYING, anim_nullfunc);
+	}
+};
+
+void() player_gib =
+{
+	self.deadflag = DEAD_DEAD;
+	
+	if (self.gibtype == 1)
+	{
+		te_bloodshower (self.origin + self.mins, self.origin + self.maxs, 50, 3000);	
+		// make a meaty mess
+		TossGib (world, "models/gibs/bloodyskull.md3", self.origin, '0 0 600',0);
+		TossGib (world, "models/gibs/gib1.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/gib1.mdl", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/gib2.mdl", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/gib3.mdl", self.origin, self.velocity,0);
+		// these destory on impact
+		TossGib (world, "models/gibs/gib5.md3", self.origin, '-500 0 450',1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 -500 450',1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, '500 0 450',1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, self.velocity,1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 0 450',1);
+		sound (self, CHAN_VOICE, "misc/gib.wav", 1, ATTN_NORM);
+	}
+	else if (self.gibtype == 2)
+	{
+		te_explosion(self.origin);
+		TossGib (world, "models/gibs/m_gib1.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib2.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib3.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib4.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib5.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib6.md3", self.origin, self.velocity,0);
+	}
+	
+	if (self.flags & FL_CLIENT)
+	   TossGib (self, "models/gibs/eye.md3", self.origin, self.velocity,0);
+	else
+	{
+		remove(self.actorpart_torso);
+		remove(self.actorpart_head);
+		remove(self.actorpart_weapon);
+		remove(self.actorpart_viewweapon);
+		remove(self);
+	}
+};
+
+void(entity attacker, float damage) player_pain =
+{
+	if (attacker.team != self.team)
+		self.enemy = attacker;
+	if (self.flags & FL_CLIENT)
+		self.enemy = attacker;
+	
+	if (damage >= self.paintake)
+	{
+		sound(self, CHAN_VOICE, strcat(self.playerclass.sounddir, "/voice/pain.wav"), 1, ATTN_NORM);
+		// TODO: anim
+	}
+};
+
+void() player_regen =
+{
+	if (time > self.armorregentime)
+	if (self.armorvalue < self.armorregenmax)
+	if (!self.deadflag)
+	{
+		if (self.armorregenplaysound)
+		{
+			sound(self, CHAN_AUTO, strcat(self.playerclass.sounddir, "/shieldregen.wav"), 1, ATTN_STATIC);
+			self.armorregenplaysound = FALSE;
+		}
+		self.armorvalue = min(self.armorvalue + frametime * self.armorregenrate, self.armorregenmax);
+	}
+};
+
+void(float force) player_selectlegsanim;
+
+void(float animtype, float force) player_legsanim =
+{
+	if (animtype == self.anim_type && !force)
+		return;
+	     if (animtype == ANIMTYPE_STAND      ) anim_start(self, self.playerclass.actoranim_LEGS_IDLE, animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_WALKFORWARD) anim_start(self, self.playerclass.actoranim_LEGS_WALK, animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_WALKBACK   ) anim_start(self, self.playerclass.actoranim_LEGS_BACK, animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_WALKLEFT   ) anim_start(self, self.playerclass.actoranim_LEGS_WALK, animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_WALKRIGHT  ) anim_start(self, self.playerclass.actoranim_LEGS_WALK, animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_RUNFORWARD ) anim_start(self, self.playerclass.actoranim_LEGS_RUN , animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_RUNBACK    ) anim_start(self, self.playerclass.actoranim_LEGS_BACK, animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_RUNLEFT    ) anim_start(self, self.playerclass.actoranim_LEGS_RUN , animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_RUNRIGHT   ) anim_start(self, self.playerclass.actoranim_LEGS_RUN , animtype, player_selectlegsanim);
+	else if (animtype == ANIMTYPE_FALL       ) anim_start(self, self.playerclass.actoranim_LEGS_JUMP, animtype, anim_nullfunc);
+	//else if (animtype == ANIMTYPE_DYING      ) anim_start(self, self.playerclass.actoranim_LEGS_JUMP, animtype, anim_nullfunc);
+};
+
+void(float force) player_selectlegsanim =
+{
+	local vector v;
+	local float best, s, animtype;
+	v = self.velocity;
+	v_z = 0;
+	makevectors(self.angles_y * '0 1 0');
+	// less than 1 unit per second uses the stand anim
+	best = 100;
+	animtype = ANIMTYPE_STAND;
+	s = self.velocity * v_forward;if (best < s) {best = s;animtype = ANIMTYPE_RUNFORWARD;}
+	s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_RUNBACK;}
+	s = self.velocity * v_right  ;if (best < s) {best = s;animtype = ANIMTYPE_RUNRIGHT;}
+	s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_RUNLEFT;}
+	if (animtype == ANIMTYPE_STAND)
+	{
+		best = 1;
+		s = self.velocity * v_forward;if (best < s) {best = s;animtype = ANIMTYPE_WALKFORWARD;}
+		s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_WALKBACK;}
+		s = self.velocity * v_right  ;if (best < s) {best = s;animtype = ANIMTYPE_WALKRIGHT;}
+		s = s * -1                   ;if (best < s) {best = s;animtype = ANIMTYPE_WALKLEFT;}
+	}
+	if (!(self.flags & FL_ONGROUND))
+		animtype = ANIMTYPE_FALL;
+	if (self.deadflag & DEAD_DYING)
+		animtype = ANIMTYPE_DYING;
+	if (self.deadflag & DEAD_DEAD)
+	    animtype = ANIMTYPE_DEAD;
+	player_legsanim(animtype, force);
+};
+
+void(float animdone) player_repeatstandframe =
+{
+	if (animdone)
+		anim_start(self, self.playerclass.actoranim_LEGS_IDLE, ANIMTYPE_STAND, player_repeatstandframe);
+};
+
+void(entity e, vector point) printsurfaceinfo =
+{
+	local float surfnum, numpoints, vnum;
+	local string s;
+	local vector n;
+	surfnum = getsurfacenearpoint(e, point);
+	if (surfnum >= 0)
+	{
+		bprint("texture: ");
+		s = getsurfacetexture(e, surfnum);
+		bprint(s);
+		bprint(" normal: ");
+		n = getsurfacenormal(e, surfnum);
+		bprint(vtos(n));
+		bprint(" ");
+		numpoints = getsurfacenumpoints(e, surfnum);
+		bprint(ftos(numpoints));
+		bprint(" verts:");
+		vnum = 0;
+		while (vnum < numpoints)
+		{
+			bprint(" ");
+			n = getsurfacepoint(e, surfnum, vnum);
+			bprint(vtos(n));
+			vnum = vnum + 1;
+		}
+		bprint(" point tested: ");
+		bprint(vtos(point));
+		bprint(" nearest point on surface: ");
+		n = getsurfaceclippedpoint(e, surfnum, point);
+		bprint(vtos(n));
+		bprint("\n");
+	}
+};
+
+void(float impuls) player_impulse =
+{
+	local float c;
+	local float w;
+	local float select;
+	local entity oldself;
+	if (self.deadflag)
+		return;
+	if (cvar("sv_cheats"))
+	{
+		if (impuls == 16)
+		{
+			eprint(self.cursor_trace_ent);
+			return;
+		}
+		if (impuls == 15)
+		{
+			printsurfaceinfo(self.cursor_trace_ent, self.cursor_trace_endpos);
+			return;
+		}
+		if ((impuls >= 31) && (impuls < 30 + ACTORTYPE_TOTAL))
+		{
+			makevectors(self.v_angle);
+			newmis = spawn();
+			setorigin(newmis, self.origin + v_forward * 60);
+			newmis.angles = '0 1 0' * self.v_angle_y;
+			newmis.think = bot_npcthink;
+			newmis.nextthink = time;
+			oldself = self;
+			self = newmis;
+			self.team = cvar("g_defaultenemyteam");
+			self.unlimitedinventory = 1;
+			self.spawned = 1;
+			player_spawn(impuls - 30);
+			self = oldself;
+		}
+		if (impuls == 21)
+		{
+			c = 0;
+			vector item;
+			while (c < ITEMTYPE_TOTAL)
+			{
+			 	if (c == ITEMTYPE_WEAP1)
+				   bprint("User Weapons:    AT=Ammotype   Q=Quantity   A=Ammo","\n");
+			 	if (c == ITEMTYPE_AI_WEAP1)
+				   bprint("AI Weapons:","\n");
+			 	if (c == ITEMTYPE_ITEM1)
+				   bprint("Items:","