From cb94f564533e24d577f551a67b078289bc942870 Mon Sep 17 00:00:00 2001 From: blackhc Date: Mon, 28 Mar 2005 12:59:02 +0000 Subject: [PATCH] -Added maplist support -Changed color.qm to support the new DataContainer item -Moved more stuff out of data.menu to data/ -Rewrote Util_SetAltStringItem -More to follow... git-svn-id: svn://svn.icculus.org/nexuiz/trunk@344 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- scmenu/creategame.menu | 4 +- scmenu/creategame/basic.menu | 24 +- scmenu/creategame/maplist.menu | 26 +- scmenu/data.menu | 1439 +---------------- scmenu/data/game.menu | 280 ++++ scmenu/data/server.menu | 166 ++ scmenu/data/serverlist.menu | 15 + scmenu/data/weapon.menu | 994 ++++++++++++ scmenu/joingame.menu | 2 +- scmenu/options.menu | 8 +- scmenu/source/base/gfx.qh | 2 + scmenu/source/base/snd.qc | 1 + scmenu/source/control/data/base.qc | 6 +- scmenu/source/control/data/data.qh | 13 +- scmenu/source/control/data/textvalue.qc | 2 +- scmenu/source/control/data/value.qc | 2 +- scmenu/source/control/visual/list.qc | 16 +- scmenu/source/control/visual/switchbutton.qc | 5 - scmenu/source/custom/color.qm | 38 +- scmenu/source/custom/creategame.qm | 224 ++- scmenu/source/custom/creategame/creategame.qh | 40 +- scmenu/source/custom/creategame/maps.qc | 401 ++++- scmenu/source/menu.qc | 8 +- scmenu/source/menu.qh | 3 +- scmenu/source/todo | 1 + scmenu/source/util/altstring.qc | 40 +- scmenu/source/util/altstring.qh | 2 +- 27 files changed, 2108 insertions(+), 1654 deletions(-) create mode 100644 scmenu/data/game.menu create mode 100644 scmenu/data/server.menu create mode 100644 scmenu/data/serverlist.menu create mode 100644 scmenu/data/weapon.menu diff --git a/scmenu/creategame.menu b/scmenu/creategame.menu index 2524cfc3e..fc2b5e557 100644 --- a/scmenu/creategame.menu +++ b/scmenu/creategame.menu @@ -29,11 +29,11 @@ Item Layout CreateGame } Derive TextButton Configurations { - normal " Configurations " + normal " Game Settings " } Derive TextButton Advanced { - normal " Advanced " + normal " Weapon Settings " } } Item EventWindow Panel diff --git a/scmenu/creategame/basic.menu b/scmenu/creategame/basic.menu index 535bf52a0..b3456c223 100644 --- a/scmenu/creategame/basic.menu +++ b/scmenu/creategame/basic.menu @@ -32,7 +32,7 @@ Item Window BasicOptions { normal "<<" pos '20 5' - action Nex_Action_Map_Prev + action Nex_Action_MapSelector_Prev } Derive Label Name { @@ -45,11 +45,11 @@ Item Window BasicOptions normal ">>" pos '348 5' - action Nex_Action_Map_Next + action Nex_Action_MapSelector_Next } - Item Task_Job Job + Item Task_Job UpdateJob { - init Nex_Automation_UpdateMap + update Nex_MapSelector_UpdateMap } } Item Layout Settings @@ -78,7 +78,7 @@ Item Window BasicOptions Derive Nex_Option_EditBox Hostname { text "Server Name" - target "Data::CreateGame::Hostname::Text" + target "Data::Server::Hostname::Text" } Derive Nex_Composition Gametype { @@ -89,7 +89,7 @@ Item Window BasicOptions } Derive SwitchButton Switch { - target "Data::CreateGame::ServerProgs::Switch" + target "Data::Server::ServerProgs::Switch" action Nex_Action_TestOnChange } } @@ -102,31 +102,31 @@ Item Window BasicOptions } Derive SwitchButton Switch { - target "Data::CreateGame::PublicServer::Switch" + target "Data::Server::PublicServer::Switch" action Nex_Action_TestOnChange } } Derive Nex_Option_EditBox FragLimit { text "Frag Limit" - target "Data::CreateGame::FragLimit::Text" + target "Data::Server::FragLimit::Text" } Derive Nex_Option_EditBox TimeLimit { text "Time Limit" - target "Data::CreateGame::TimeLimit::Text" + target "Data::Server::TimeLimit::Text" } Derive Nex_Option_EditBox MaxPlayer { text "Max Players" - target "Data::CreateGame::MaxPlayers::Text" + target "Data::Server::MaxPlayers::Text" } Derive Nex_Line Seperator1 {} Derive Nex_Option_EditBox NumBots { text "Bot Count" - target "Data::CreateGame::NumBots::Text" + target "Data::Server::NumBots::Text" } Derive Nex_Composition BotSkill { @@ -137,7 +137,7 @@ Item Window BasicOptions } Derive SwitchButton Switch { - target "Data::CreateGame::BotSkill::Switch" + target "Data::Server::BotSkill::Switch" action Nex_Action_TestOnChange } } diff --git a/scmenu/creategame/maplist.menu b/scmenu/creategame/maplist.menu index 14bd90152..f1f8eb6df 100644 --- a/scmenu/creategame/maplist.menu +++ b/scmenu/creategame/maplist.menu @@ -15,7 +15,7 @@ Item Window MapList pos '0 20' size '400 500' - init Nex_Action_MapList_Init + target "::Data::Server::Map::List" } Derive Label CycleLabel { @@ -26,6 +26,8 @@ Item Window MapList { pos '450 20' size '400 450' + + target "::Data::Server::Map::Cycle" } Item Layout Panel { @@ -36,19 +38,33 @@ Item Window MapList Derive TextButton Add { - normal "Add" + normal "Add" + + action Nex_Action_Cycle_Add } Derive TextButton Remove { - normal "Remove" + normal "Remove" + + action Nex_Action_Cycle_Remove } Derive TextButton MoveUp { - normal "Move Up" + normal "Move Up" + + action Nex_Action_Cycle_MoveUp } Derive TextButton MoveDown { - normal "Move Down" + normal "Move Down" + + action Nex_Action_Cycle_MoveDown + } + Derive TextButton Clear + { + normal "Clear" + + action Nex_Action_Cycle_Clear } } } diff --git a/scmenu/data.menu b/scmenu/data.menu index be2052cec..0773c960c 100644 --- a/scmenu/data.menu +++ b/scmenu/data.menu @@ -5,1435 +5,18 @@ Item DataContainer Data { #define DataLink_ZeroOneValue Derive "::DataLink_ZeroOneValue" Value {} #define DataLink_OnOffSwitch Derive "::DataLink_OnOffSwitch" Switch {} - #include "menu/data/color.menu" + #include "menu/data/player.menu" - #include "menu/data/key.menu" - #include "menu/data/input.menu" - - Item Container CreateGame - { - Item Data_Nex_Map Map - { - defValue 0 - } - 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 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ServerProgs - { - cvarName "sv_progs" - defValue "progs.dat" - - Item DataLink_Nex_ModSwitch Switch - { - link "##up" - } - } - Item Data_CvarCreateSave NumBots - { - // TODO: add support for this in FrikQcc - cvarName "nex_numbots" - defValue 0 - - Item DataLink_Value Value - { - maxValue 16 - 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 "nex_botskill" - // from 0 to 3 - defValue 0 - - Item DataLink_ValueSwitch Switch - { - minValue 0 - stepValue 1 - maxValue 3 - descList "'Beginner''Easy''Medium''Hard'" - - link "##up" - } - } - Item Data_Cvar PublicServer - { - cvarName "sv_public" - defValue 1 - - Item DataLink_ValueSwitch Switch - { - maxValue 1 - descList "'Disabled''Enabled'" - - link "##up" - } - } - } - Item Container JoinGame - { - Item Data_Container QueryString - { - Item DataLink_Text Text - { - maxValue 1024 - link "##up" - } - } - } + #include "menu/data/color.menu" #include "menu/data/video.menu" - #include "menu/data/sound.menu" #include "menu/data/effects.menu" - - Item Container Server - { - 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 Casings - { - cvarName "g_casings" - defValue 0 - - [DataLink_OnOffSwitch] - } - Item Data_Cvar Health - { - cvarName "g_balance_health" - defValue 150 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar Gravity - { - cvarName "sv_gravity" - defValue 800 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar MaxSpeed - { - cvarName "sv_maxspeed" - defValue 400 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GameSpeed - { - cvarName "slowmo" - defValue 1 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar MaxAirSpeed - { - cvarName "g_balance_maxairspeed" - defValue 50 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar JumpHeight - { - cvarName "g_balance_jumpheight" - defValue 300 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HealthRegeneration - { - cvarName "g_balance_healthregen" - defValue 0.1 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ArmorRott - { - cvarName "g_balance_armorrott" - defValue 0.1 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar SelfDamagePercent - { - cvarName "g_balance_selfdamagepercent" - defValue 0.6 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar WeaponSwitchDelay - { - cvarName "g_balance_weaponswitchdelay" - defValue 0.3 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar Friction - { - cvarName "sv_friction" - defValue 5 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar Accelerate - { - cvarName "sv_accelerate" - defValue 5.5 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - } - Item Container Weapon - { - Item Data_Cvar LaserDamage - { - cvarName "g_balance_laser_damage" - defValue 15 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar LaserEdgeDamage - { - cvarName "g_balance_laser_edgedamage" - defValue 15 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar LaserForce - { - cvarName "g_balance_laser_force" - defValue 200 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar LaserRadius - { - cvarName "g_balance_laser_radius" - defValue 50 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar LaserSpeed - { - cvarName "g_balance_laser_speed" - defValue 1000 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ShotgunDamage - { - cvarName "g_balance_shotgun_damage" - defValue 3.5 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ShotgunBullets - { - cvarName "g_balance_shotgun_bullets" - defValue 10 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar UziDamage - { - cvarName "g_balance_uzi_damage" - defValue 4 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar UziSpread - { - cvarName "g_balance_uzi_spread" - defValue 0.1 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar UziSpread2 - { - cvarName "g_balance_uzi_spread2" - defValue 0.01 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar UziRefire - { - cvarName "g_balance_uzi_refire" - defValue 0.05 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherDamage - { - cvarName "g_balance_grenadelauncher_damage" - defValue 65 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherEdgeDamage - { - cvarName "g_balance_grenadelauncher_edgedamage" - defValue 45 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherForce - { - cvarName "g_balance_grenadelauncher_force" - defValue 400 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherRadius - { - cvarName "g_balance_grenadelauncher_radius" - defValue 140 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherSpeed - { - cvarName "g_balance_grenadelauncher_speed" - defValue 2000 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherSpeedUp - { - cvarName "g_balance_grenadelauncher_speed_up" - defValue 200 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherSpeed2 - { - cvarName "g_balance_grenadelauncher_speed2" - defValue 900 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar GrenadeLauncherSpeed2Up - { - cvarName "g_balance_grenadelauncher_speed2_up" - defValue 200 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroDamage - { - cvarName "g_balance_electro_damage" - defValue 90 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroEdgeDamage - { - cvarName "g_balance_electro_edgedamage" - defValue 45 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroForce - { - cvarName "g_balance_electro_force" - defValue 200 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroRadius - { - cvarName "g_balance_electro_radius" - defValue 100 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroRefire - { - cvarName "g_balance_electro_refire" - defValue 1 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroSpeed - { - cvarName "g_balance_electro_speed" - defValue 2000 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroBallSpeed - { - cvarName "g_balance_electro_ballspeed" - defValue 900 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar ElectroBallSpeedUp - { - cvarName "g_balance_electro_ballspeed_up" - defValue 200 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkDamage - { - cvarName "g_balance_crylink_damage" - defValue 20 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkEdgeDamage - { - cvarName "g_balance_crylink_edgedamage" - defValue 0 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkForce - { - cvarName "g_balance_crylink_force" - defValue 55 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkRadius - { - cvarName "g_balance_crylink_radius" - defValue 3 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkSpeed - { - cvarName "g_balance_crylink_speed" - defValue 1800 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkSpread - { - cvarName "g_balance_crylink_spread" - defValue 0.15 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar CryLinkRefire - { - cvarName "g_balance_crylink_refire" - defValue 0.4 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar NexDamage - { - cvarName "g_balance_nex_damage" - defValue 200 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarDamage - { - cvarName "g_balance_hagar_damage" - defValue 40 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarEdgeDamage - { - cvarName "g_balance_hagar_edgedamage" - defValue 15 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarForce - { - cvarName "g_balance_hagar_force" - defValue 100 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarRadius - { - cvarName "g_balance_hagar_radius" - defValue 70 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarSpeed - { - cvarName "g_balance_hagar_speed" - defValue 3000 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarSpeed2 - { - cvarName "g_balance_hagar_speed2" - defValue 1400 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar HagarSpeed2Up - { - cvarName "g_balance_hagar_speed2_up" - defValue 100 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar RocketLauncherDamage - { - cvarName "g_balance_rocketlauncher_damage" - defValue 130 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar RocketLauncherEdgeDamage - { - cvarName "g_balance_rocketlauncher_edgedamage" - defValue 50 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar RocketLauncherForce - { - cvarName "g_balance_rocketlauncher_force" - defValue 600 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar RocketLauncherRadius - { - cvarName "g_balance_rocketlauncher_radius" - defValue 170 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - Item Data_Cvar RocketLauncherSpeed - { - cvarName "g_balance_rocketlauncher_speed" - defValue 850 - - Item DataLink_Value Value - { - maxValue 999 - link "##up" - } - Item DataLink_Text Text - { - maxValue 3 - link "##down" - - Item DataLink_TextValue TextValue - { - link "##up prev" - } - } - } - } + #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" } diff --git a/scmenu/data/game.menu b/scmenu/data/game.menu new file mode 100644 index 000000000..07f64c934 --- /dev/null +++ b/scmenu/data/game.menu @@ -0,0 +1,280 @@ +// 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 Casings + { + cvarName "g_casings" + defValue 0 + + [DataLink_OnOffSwitch] + } + Item Data_Cvar Health + { + cvarName "g_balance_health" + defValue 150 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar Gravity + { + cvarName "sv_gravity" + defValue 800 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar MaxSpeed + { + cvarName "sv_maxspeed" + defValue 400 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GameSpeed + { + cvarName "slowmo" + defValue 1 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar MaxAirSpeed + { + cvarName "g_balance_maxairspeed" + defValue 50 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar JumpHeight + { + cvarName "g_balance_jumpheight" + defValue 300 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HealthRegeneration + { + cvarName "g_balance_healthregen" + defValue 0.1 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ArmorRott + { + cvarName "g_balance_armorrott" + defValue 0.1 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar SelfDamagePercent + { + cvarName "g_balance_selfdamagepercent" + defValue 0.6 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar WeaponSwitchDelay + { + cvarName "g_balance_weaponswitchdelay" + defValue 0.3 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar Friction + { + cvarName "sv_friction" + defValue 5 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar Accelerate + { + cvarName "sv_accelerate" + defValue 5.5 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } +} diff --git a/scmenu/data/server.menu b/scmenu/data/server.menu new file mode 100644 index 000000000..d154a1c05 --- /dev/null +++ b/scmenu/data/server.menu @@ -0,0 +1,166 @@ +// 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 + { + init Nex_ReadCycleList + } + } + + 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 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ServerProgs + { + cvarName "sv_progs" + defValue "progs.dat" + + Item DataLink_Nex_ModSwitch Switch + { + link "##up" + } + } + Item Data_CvarCreateSave NumBots + { + // ?? TODO: add support for this in Game QC? + cvarName "nex_numbots" + defValue 0 + + Item DataLink_Value Value + { + maxValue 16 + 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 "nex_botskill" + // from 0 to 3 + defValue 0 + + Item DataLink_ValueSwitch Switch + { + minValue 0 + stepValue 1 + maxValue 3 + descList "'Beginner''Easy''Medium''Hard'" + + link "##up" + } + } + Item Data_Cvar PublicServer + { + cvarName "sv_public" + defValue 1 + + Item DataLink_ValueSwitch Switch + { + maxValue 1 + descList "'Disabled''Enabled'" + + link "##up" + } + } +} diff --git a/scmenu/data/serverlist.menu b/scmenu/data/serverlist.menu new file mode 100644 index 000000000..8f49a00dc --- /dev/null +++ b/scmenu/data/serverlist.menu @@ -0,0 +1,15 @@ +// Property of Alientrap +// +// data/serverlist.menu + +Item DataContainer ServerList +{ + Item Data_Container QueryString + { + Item DataLink_Text Text + { + maxValue 1024 + link "##up" + } + } +} diff --git a/scmenu/data/weapon.menu b/scmenu/data/weapon.menu new file mode 100644 index 000000000..0a11f2ab6 --- /dev/null +++ b/scmenu/data/weapon.menu @@ -0,0 +1,994 @@ +// Property of Alientrap +// +// data/weapon.menu + +Item DataContainer Weapon +{ + Item Data_Cvar LaserDamage + { + cvarName "g_balance_laser_damage" + defValue 15 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar LaserEdgeDamage + { + cvarName "g_balance_laser_edgedamage" + defValue 15 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar LaserForce + { + cvarName "g_balance_laser_force" + defValue 200 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar LaserRadius + { + cvarName "g_balance_laser_radius" + defValue 50 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar LaserSpeed + { + cvarName "g_balance_laser_speed" + defValue 1000 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ShotgunDamage + { + cvarName "g_balance_shotgun_damage" + defValue 3.5 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ShotgunBullets + { + cvarName "g_balance_shotgun_bullets" + defValue 10 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar UziDamage + { + cvarName "g_balance_uzi_damage" + defValue 4 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar UziSpread + { + cvarName "g_balance_uzi_spread" + defValue 0.1 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar UziSpread2 + { + cvarName "g_balance_uzi_spread2" + defValue 0.01 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar UziRefire + { + cvarName "g_balance_uzi_refire" + defValue 0.05 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherDamage + { + cvarName "g_balance_grenadelauncher_damage" + defValue 65 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherEdgeDamage + { + cvarName "g_balance_grenadelauncher_edgedamage" + defValue 45 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherForce + { + cvarName "g_balance_grenadelauncher_force" + defValue 400 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherRadius + { + cvarName "g_balance_grenadelauncher_radius" + defValue 140 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherSpeed + { + cvarName "g_balance_grenadelauncher_speed" + defValue 2000 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherSpeedUp + { + cvarName "g_balance_grenadelauncher_speed_up" + defValue 200 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherSpeed2 + { + cvarName "g_balance_grenadelauncher_speed2" + defValue 900 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar GrenadeLauncherSpeed2Up + { + cvarName "g_balance_grenadelauncher_speed2_up" + defValue 200 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroDamage + { + cvarName "g_balance_electro_damage" + defValue 90 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroEdgeDamage + { + cvarName "g_balance_electro_edgedamage" + defValue 45 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroForce + { + cvarName "g_balance_electro_force" + defValue 200 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroRadius + { + cvarName "g_balance_electro_radius" + defValue 100 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroRefire + { + cvarName "g_balance_electro_refire" + defValue 1 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroSpeed + { + cvarName "g_balance_electro_speed" + defValue 2000 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroBallSpeed + { + cvarName "g_balance_electro_ballspeed" + defValue 900 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar ElectroBallSpeedUp + { + cvarName "g_balance_electro_ballspeed_up" + defValue 200 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkDamage + { + cvarName "g_balance_crylink_damage" + defValue 20 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkEdgeDamage + { + cvarName "g_balance_crylink_edgedamage" + defValue 0 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkForce + { + cvarName "g_balance_crylink_force" + defValue 55 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkRadius + { + cvarName "g_balance_crylink_radius" + defValue 3 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkSpeed + { + cvarName "g_balance_crylink_speed" + defValue 1800 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkSpread + { + cvarName "g_balance_crylink_spread" + defValue 0.15 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar CryLinkRefire + { + cvarName "g_balance_crylink_refire" + defValue 0.4 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar NexDamage + { + cvarName "g_balance_nex_damage" + defValue 200 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarDamage + { + cvarName "g_balance_hagar_damage" + defValue 40 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarEdgeDamage + { + cvarName "g_balance_hagar_edgedamage" + defValue 15 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarForce + { + cvarName "g_balance_hagar_force" + defValue 100 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarRadius + { + cvarName "g_balance_hagar_radius" + defValue 70 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarSpeed + { + cvarName "g_balance_hagar_speed" + defValue 3000 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarSpeed2 + { + cvarName "g_balance_hagar_speed2" + defValue 1400 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar HagarSpeed2Up + { + cvarName "g_balance_hagar_speed2_up" + defValue 100 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar RocketLauncherDamage + { + cvarName "g_balance_rocketlauncher_damage" + defValue 130 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar RocketLauncherEdgeDamage + { + cvarName "g_balance_rocketlauncher_edgedamage" + defValue 50 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar RocketLauncherForce + { + cvarName "g_balance_rocketlauncher_force" + defValue 600 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar RocketLauncherRadius + { + cvarName "g_balance_rocketlauncher_radius" + defValue 170 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } + Item Data_Cvar RocketLauncherSpeed + { + cvarName "g_balance_rocketlauncher_speed" + defValue 850 + + Item DataLink_Value Value + { + maxValue 999 + link "##up" + } + Item DataLink_Text Text + { + maxValue 3 + link "##down" + + Item DataLink_TextValue TextValue + { + link "##up prev" + } + } + } +} diff --git a/scmenu/joingame.menu b/scmenu/joingame.menu index c223bfb9a..feb284d00 100644 --- a/scmenu/joingame.menu +++ b/scmenu/joingame.menu @@ -34,7 +34,7 @@ Item Layout JoinGame Derive EditBox EditBox { size '700 12' - target "::Data::JoinGame::QueryString::Text" + target "::Data::ServerList::QueryString::Text" action Nex_Action_ExecuteQuery } diff --git a/scmenu/options.menu b/scmenu/options.menu index 9127788b9..439d93d19 100644 --- a/scmenu/options.menu +++ b/scmenu/options.menu @@ -99,10 +99,10 @@ Item Layout Options #include "menu/options/player.menu" #include "menu/options/color.menu" #include "menu/options/effects.menu" - #include "menu/options/Input.menu" - #include "menu/options/server.menu" - #include "menu/options/weapon.menu" - #include "menu/options/weapon2.menu" + #include "menu/options/input.menu" + //#include "menu/options/server.menu" + //#include "menu/options/weapon.menu" + //#include "menu/options/weapon2.menu" } } } \ No newline at end of file diff --git a/scmenu/source/base/gfx.qh b/scmenu/source/base/gfx.qh index 6a2da86b8..250b1b679 100644 --- a/scmenu/source/base/gfx.qh +++ b/scmenu/source/base/gfx.qh @@ -19,6 +19,8 @@ void() Gfx_Hide; void() Gfx_Update; void() Gfx_Draw; +float() Gfx_GetFPS; + bool( string pPic ) Gfx_IsCached; bool( string pPic ) Gfx_Precache; void( string pPic ) Gfx_Free; diff --git a/scmenu/source/base/snd.qc b/scmenu/source/base/snd.qc index d6ff49765..737fa8e70 100644 --- a/scmenu/source/base/snd.qc +++ b/scmenu/source/base/snd.qc @@ -27,3 +27,4 @@ void( string pSnd) Sound_Play = _Sound_DPrint( strcat( "Playing sound '", pSnd, "'\n" ) ); localsound( pSnd ); }; + diff --git a/scmenu/source/control/data/base.qc b/scmenu/source/control/data/base.qc index 78b2402b0..741fa1b71 100644 --- a/scmenu/source/control/data/base.qc +++ b/scmenu/source/control/data/base.qc @@ -128,10 +128,10 @@ void() Item_DataLink_Switch_Init = Item_GetOrdinal =================== */ -float( entity pDataLink, float pValue ) Item_DataLink_Switch_GetOrdinal = +float( entity pDataLink, float pValue ) DataLink_Switch_GetOrdinal = { - //if( !pDataLink ) - // crash(); + if( pDataLink.stepValue == 0.0 ) + return 0.0; return (pValue - pDataLink.minValue) / pDataLink.stepValue; }; diff --git a/scmenu/source/control/data/data.qh b/scmenu/source/control/data/data.qh index dd69e159a..f93af9f22 100644 --- a/scmenu/source/control/data/data.qh +++ b/scmenu/source/control/data/data.qh @@ -85,7 +85,7 @@ void() Item_DataLink_Value_Spawn; void() Item_DataLink_Switch_Init; void() Item_DataLink_Switch_Destroy; -float( entity pDataLink, float pValue ) Item_DataLink_Switch_GetOrdinal; +float( entity pDataLink, float pValue ) DataLink_Switch_GetOrdinal; // Item_DataLink_ValueSwitch [Item_DataLink_Switch] // the default value for stepValue is 1 @@ -101,23 +101,28 @@ void( float pEvent ) Item_DataLink_TextSwitch_DataEvent; void() Item_DataLink_TextSwitch_Destroy; void() Item_DataLink_TextSwitch_Spawn; -// Item_DataLink_FastResync [Item_DataLink] +// Item_DataLink_FastResync [Item_DataLink] d +// "Fast" in the sense of total performance - the data is resynced +// at most once per frame .float _presstime; // no more than once a frame? void() Item_DataLink_FastResync_Spawn; // Item_DataLink_TextValue [Item_DataLink] +// self: [string] -> link: [float] void() Item_DataLink_TextValue_Spawn; // Item_DataLink_TextTime [Item_DataLink] +// self: [string] -> link: [float] // hour:min:sec void() Item_DataLink_TextTime_Spawn; // Item_DataLink_AltString [Item_DataLink] -.float stepValue; // contains +// self: [string] -> link: [altstring item] +.float stepValue; // contains the index into link.value void() Item_DataLink_AltString_Spawn; // Item_DataLink_Router [Item_DataLink] -// sets value and _realValue of alll children to the float value of self._stepValue +// sets value and _realValue of all children to the float value of self._realValue void() Item_DataLink_Router_Spawn; diff --git a/scmenu/source/control/data/textvalue.qc b/scmenu/source/control/data/textvalue.qc index 921ea837a..d60e6832c 100644 --- a/scmenu/source/control/data/textvalue.qc +++ b/scmenu/source/control/data/textvalue.qc @@ -4,7 +4,7 @@ void( float pEvent ) Item_DataLink_TextValue_DataEvent = { Item_DataLink_Update(); - + if( pEvent == ITEM_DATALINK_SET ) { self._link._realValue = stof( self.value ); Raise_DataEvent( self._link, ITEM_DATALINK_SET ); diff --git a/scmenu/source/control/data/value.qc b/scmenu/source/control/data/value.qc index de56c62dd..d1791e705 100644 --- a/scmenu/source/control/data/value.qc +++ b/scmenu/source/control/data/value.qc @@ -12,7 +12,7 @@ void() Item_DataLink_Value_Clamp = self._realValue = self.maxValue; else if( self._realValue < self.minValue ) self._realValue = self.minValue; - else // clamp is to stepValue + else // clamp it to(?) stepValue self._realValue = self.minValue + self.stepValue * rint( ( self._realValue - self.minValue ) / self.stepValue ); }; diff --git a/scmenu/source/control/visual/list.qc b/scmenu/source/control/visual/list.qc index b5295ff88..384422d80 100644 --- a/scmenu/source/control/visual/list.qc +++ b/scmenu/source/control/visual/list.qc @@ -12,15 +12,16 @@ void() Item_List_Draw = if( !self._target ) return; + Raise_DataEvent( self._target, ITEM_DATALINK_GET ); lLines = floor( self.size_y / ( self.fontSize_y + 2 ) ); - lStart = max( 0, floor( Item_DataLink_Switch_GetOrdinal( self._target, self._target._realValue ) - lLines / 2 ) ); - lEnd = min( lStart + lLines, Item_DataLink_Switch_GetOrdinal( self._target, self._target.maxValue ) ); + lStart = max( 0, floor( DataLink_Switch_GetOrdinal( self._target, self._target._realValue ) - lLines / 2 ) ); + lEnd = min( lStart + lLines, DataLink_Switch_GetOrdinal( self._target, self._target.maxValue ) ); lPos = '0 1 0' + self.pos; for( lLine = lStart ; lLine <= lEnd ; lLine++ ) { local string lText; lText = Util_GetAltStringItem( self._target.descList, lLine ); - if( lLine == Item_DataLink_Switch_GetOrdinal( self._target, self._target._realValue ) ) { + if( lLine == DataLink_Switch_GetOrdinal( self._target, self._target._realValue ) ) { if( self._state == ITEM_STATE_SELECTED ) Menu_DrawString( lPos, lText, self.fontSize, self.colorSelected, self.alphas_y, self.drawFlags_y ); else if( self._state == ITEM_STATE_PRESSED ) @@ -54,9 +55,9 @@ void() Item_List_Update = local float lLines; lLines = floor( self.size_y / ( self.fontSize_y + 2 ) ); - lStart = max( 0, floor( Item_DataLink_Switch_GetOrdinal( self._target, self._target._realValue ) - lLines / 2 ) ); + lStart = max( 0, floor( DataLink_Switch_GetOrdinal( self._target, self._target._realValue ) - lLines / 2 ) ); lItem = floor( ( Menu_Cursor_Position_y - self.pos_y ) / ( self.fontSize_y + 2 ) ); - lItem = min( lStart + lItem, Item_DataLink_Switch_GetOrdinal( self._target, self._target.maxValue ) ); + lItem = min( lStart + lItem, DataLink_Switch_GetOrdinal( self._target, self._target.maxValue ) ); print( ftos( lItem ), "\n" ); @@ -80,8 +81,6 @@ bool( float pKey, float pAscii ) Item_List_Key = self._presstime = Timer_Time; self._target._realValue = self._target._realValue + 1; - if( self._target._realValue > self._target.maxValue ) - self._target._realValue = self._target.minValue; Raise_DataEvent( self._target, ITEM_DATALINK_SET ); CtCall_Action(); @@ -91,9 +90,6 @@ bool( float pKey, float pAscii ) Item_List_Key = self._presstime = Timer_Time; self._target._realValue = self._target._realValue - 1; - if( self._target._realValue < self._target.minValue ) - self._target._realValue = self._target.maxValue; - Raise_DataEvent( self._target, ITEM_DATALINK_SET ); CtCall_Action(); diff --git a/scmenu/source/control/visual/switchbutton.qc b/scmenu/source/control/visual/switchbutton.qc index db7792f35..ddcad8706 100644 --- a/scmenu/source/control/visual/switchbutton.qc +++ b/scmenu/source/control/visual/switchbutton.qc @@ -11,8 +11,6 @@ bool( float pKey, float pAscii ) Item_SwitchButton_Key = self._presstime = Timer_Time; self._target._realValue = self._target._realValue + 1; - if( self._target._realValue > self._target.maxValue ) - self._target._realValue = self._target.minValue; Raise_DataEvent( self._target, ITEM_DATALINK_SET ); CtCall_Action(); @@ -22,9 +20,6 @@ bool( float pKey, float pAscii ) Item_SwitchButton_Key = self._presstime = Timer_Time; self._target._realValue = self._target._realValue - 1; - if( self._target._realValue < self._target.minValue ) - self._target._realValue = self._target.maxValue; - Raise_DataEvent( self._target, ITEM_DATALINK_SET ); CtCall_Action(); diff --git a/scmenu/source/custom/color.qm b/scmenu/source/custom/color.qm index 11b6f6902..336825dc3 100644 --- a/scmenu/source/custom/color.qm +++ b/scmenu/source/custom/color.qm @@ -3,44 +3,10 @@ void() Nex_Action_Color_Cancel = { -#define ConCat(A,B) #A#B -#define Reset(pName) Raise_DataEvent(Menu_GetItem(ConCat("::Data::Color::",#pName)), ITEM_DATA_TEST_END) - Reset( "Brightness" ); - Reset( "Contrast" ); - Reset( "Gamma" ); - Reset( "HWGamma" ); - Reset( "Extended::Active" ); - Reset( "Extended::Low::Red" ); - Reset( "Extended::Low::Green" ); - Reset( "Extended::Low::Blue" ); - Reset( "Extended::Mid::Red" ); - Reset( "Extended::Mid::Green" ); - Reset( "Extended::Mid::Blue" ); - Reset( "Extended::High::Red" ); - Reset( "Extended::High::Green" ); - Reset( "Extended::High::Blue" ); -#undef ConCat -#undef Reset + Raise_DataEvent( Menu_GetItem( "::Data::Color" ), ITEM_DATA_TEST_END ); }; void() Nex_Action_Color_Reset = { -#define ConCat(A,B) #A#B -#define Reset(pName) Raise_DataEvent(Menu_GetItem(ConCat("::Data::Color::",#pName)), ITEM_DATA_RESET) - Reset( "Brightness" ); - Reset( "Contrast" ); - Reset( "Gamma" ); - Reset( "HWGamma" ); - Reset( "Extended::Active" ); - Reset( "Extended::Low::Red" ); - Reset( "Extended::Low::Green" ); - Reset( "Extended::Low::Blue" ); - Reset( "Extended::Mid::Red" ); - Reset( "Extended::Mid::Green" ); - Reset( "Extended::Mid::Blue" ); - Reset( "Extended::High::Red" ); - Reset( "Extended::High::Green" ); - Reset( "Extended::High::Blue" ); -#undef ConCat -#undef Reset + Raise_DataEvent( Menu_GetItem( "::Data::Color" ), ITEM_DATA_RESET ); }; diff --git a/scmenu/source/custom/creategame.qm b/scmenu/source/custom/creategame.qm index 2556841c5..66f8e1cbb 100644 --- a/scmenu/source/custom/creategame.qm +++ b/scmenu/source/custom/creategame.qm @@ -3,56 +3,145 @@ // uses target and _target // requires neighbors: Picture, Name, Description -void() Nex_Automation_UpdateMap_Update = +void() Nex_MapSelector_UpdateMap = { + local entity lInfo; local entity lItem; - local entity lTarget; + local entity lSelector; + local float lIndex; - if( self._target.name != "Data::CreateGame::Map" ) - self._target = Menu_GetItem( "Data::CreateGame::Map" ); + lSelector = Menu_GetItem( "::Data::Server::Map::Selector" ); + Raise_DataEvent( lSelector, ITEM_DATALINK_GET ); + lIndex = lSelector._realValue; + lInfo = Nex_MapDB_GetByIndex( lIndex ); - lTarget = self._target; + // If there is a new selected map, the info panel is updated accordingly + if( lIndex != self.minValue ) { + self.minValue = lIndex; - lItem = Menu_GetItem( "Picture" ); - String_EntitySet( lItem, picture, lTarget._link.picture ); + lItem = Menu_GetItem( "Picture" ); + String_EntitySet( lItem, picture, lInfo.picture ); - lItem = Menu_GetItem( "Name" ); - String_EntitySet( lItem, text, lTarget._link.normal ); + lItem = Menu_GetItem( "Name" ); + String_EntitySet( lItem, text, lInfo.normal ); - lItem = Menu_GetItem( "Description" ); - String_EntitySet( lItem, text, lTarget._link.text ); -}; + lItem = Menu_GetItem( "Description" ); + String_EntitySet( lItem, text, lInfo.text ); + } -void() Nex_Automation_UpdateMap_Destroy = -{ - String_EntityFree( self, target ); + lItem = Menu_GetItem( "::Data::Server::Map::Cycle" ); + DataLink_Nex_MapList_SetFirst( lItem, lInfo.normal, lInfo.link ); }; -void() Nex_Automation_UpdateMap = +void() Nex_MapSelector_Synchronize = { - String_EntityZone( self, target ); - - self._update = Nex_Automation_UpdateMap_Update; - self._destroy = Nex_Automation_UpdateMap_Destroy; + local entity lCycle; + local entity lSelector; + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + lSelector = Menu_GetItem( "::Data::Server::Map::Selector" ); + + if( lCycle.stepValue == 0.0 ) { + Raise_DataEvent( lCycle, ITEM_DATA_RESET ); + } else { + local string lPath; + local entity lMapInfo; + + lPath = Util_GetAltStringItem( lCycle.valueList, 0 ); + lMapInfo = Nex_MapDB_GetByPath( lPath ); + String_Free( lPath ); + + if( lMapInfo == null_entity ) { + Raise_DataEvent( lCycle, ITEM_DATA_RESET ); + } else { + lSelector._realValue = Nex_MapDB_GetIndex( lMapInfo ); + Raise_DataEvent( lSelector, ITEM_DATALINK_SET ); + } + } }; // more concrete functions -void() Nex_Action_Map_Next = +void() Nex_Action_MapSelector_Next = { local entity lItem; - lItem = Menu_GetItem( "Data::CreateGame::Map" ); + lItem = Menu_GetItem( "::Data::Server::Map::Selector" ); + Raise_DataEvent( lItem, ITEM_DATALINK_GET ); lItem._realValue = lItem._realValue + 1; - Raise_DataEvent( lItem, ITEM_DATA_SEND ); + Raise_DataEvent( lItem, ITEM_DATALINK_SET ); }; -void() Nex_Action_Map_Prev = +void() Nex_Action_MapSelector_Prev = { local entity lItem; - lItem = Menu_GetItem( "Data::CreateGame::Map" ); + lItem = Menu_GetItem( "::Data::Server::Map::Selector" ); + Raise_DataEvent( lItem, ITEM_DATALINK_GET ); lItem._realValue = lItem._realValue - 1; - Raise_DataEvent( lItem, ITEM_DATA_SEND ); + Raise_DataEvent( lItem, ITEM_DATALINK_SET ); +}; + +#define MAPLIST "maplist.cfg" + +void() Nex_WriteCycleList = +{ + local float lHandle; + local float lCount; + local float lIndex; + local entity lCycle; + + lHandle = fopen( MAPLIST, FILE_WRITE ); + if( lHandle < 0 ) { + print( "menu: Failed to write ", MAPLIST, "!\n" ); + return; + } + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + lCount = Util_GetAltStringCount( lCycle.valueList ); + for( lIndex = 0 ; lIndex < lCount ; lIndex++ ) { + fputs( lHandle, String_Normal( Util_GetAltStringItem( lCycle.valueList, lIndex ) ) ); + fputs( lHandle, "\n" ); + } + + fclose( lHandle ); +}; + +void() Nex_ReadCycleList = +{ + local float lHandle; + local string lLine; + local entity lMapInfo; + local entity lCycle; + + lHandle = fopen( MAPLIST, FILE_READ ); + if( lHandle < 0 ) { + return; + } + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + + lLine = String_Create(); + while( 1 ) { + lLine = String_Set( lLine, fgets( lHandle ) ); + + if( lLine == "" ) + break; + + lMapInfo = Nex_MapDB_GetByPath( lLine ); + if( lMapInfo == null_entity ) { + print( MAPLIST, ": Map '", lLine, "' not found in database - ignored\n" ); + continue; + } + + lCycle.descList = Util_AltStringPushBack( lCycle.descList, lMapInfo.normal ); + lCycle.valueList = Util_AltStringPushBack( lCycle.valueList, lMapInfo.link ); + } + String_Free( lLine ); + + fclose( lHandle ); + + DataLink_Nex_MapList_UpdateRange( lCycle ); + Nex_MapSelector_Synchronize(); }; // TODO: Make MaxPlayers real Data items (no container with correct set behavior) @@ -61,9 +150,9 @@ void() Nex_Action_Map_Start = local entity lItem; local float lNumBots, lSkill; // we need to set the following var - lItem = Menu_GetItem( "::Data::CreateGame::NumBots" ); + lItem = Menu_GetItem( "::Data::Server::NumBots" ); lNumBots = stof( lItem.value ); - lItem = Menu_GetItem( "::Data::CreateGame::BotSkill" ); + lItem = Menu_GetItem( "::Data::Server::BotSkill" ); lSkill = stof( lItem.value ); cvar_set( "saved1", "1" ); @@ -71,22 +160,89 @@ void() Nex_Action_Map_Start = cvar_set( "scratch2", ftos( lSkill * (pow(4, min(lNumBots, 8)) - 1) / 3) ); cvar_set( "scratch3", ftos( lSkill * (pow(4, min(lNumBots - 8, 8)) - 1) / 3) ); // Set maxplayers - lItem = Menu_GetItem( "::Data::CreateGame::MaxPlayers" ); + lItem = Menu_GetItem( "::Data::Server::MaxPlayers" ); cmd( "maxplayers \"" ); cmd( lItem.value ); cmd( "\"\n" ); - lItem = Menu_GetItem( "::Data::CreateGame::Map" ); + lItem = Menu_GetItem( "::Data::Server::Map::Cycle" ); cmd( "map \"" ); - cmd( lItem._link.link ); + cmd( String_Normal( Util_GetAltStringItem( lItem.valueList, 0 ) ) ); cmd( "\"\n"); + Nex_WriteCycleList(); + // force the menu to hide m_hide(); }; -// init the map list -void() Nex_Action_MapList_Init = +// cycle list edit features +void() Nex_Action_Cycle_Add = { - Item_DataLink_Nex_MapList_InitWithMapList( self ); + local entity lList; + local entity lCycle; + local string lPath; + local string lName; + + lList = Menu_GetItem( "::Data::Server::Map::List" ); + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + + lName = DataLink_Nex_MapList_GetCurrentName( lList ); + lPath = DataLink_Nex_MapList_GetCurrentPath( lList ); + + DataLink_Nex_MapList_InsertEntryAfter( lCycle, lName, lPath ); + + String_Free( lName ); + String_Free( lPath ); + + lCycle._realValue = lCycle._realValue + 1; + Raise_DataEvent( lCycle, ITEM_DATALINK_SET ); + + Nex_MapSelector_Synchronize(); +}; + +void() Nex_Action_Cycle_Remove = +{ + local entity lCycle; + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + DataLink_Nex_MapList_DeleteEntry( lCycle ); + + Nex_MapSelector_Synchronize(); +}; + +void() Nex_Action_Cycle_MoveUp = +{ + local entity lCycle; + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + DataLink_Nex_MapList_MoveEntryUp( lCycle ); + + lCycle._realValue = lCycle._realValue - 1; + Raise_DataEvent( lCycle, ITEM_DATALINK_SET ); + + Nex_MapSelector_Synchronize(); +}; + +void() Nex_Action_Cycle_MoveDown = +{ + local entity lCycle; + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + DataLink_Nex_MapList_MoveEntryDown( lCycle ); + + lCycle._realValue = lCycle._realValue + 1; + Raise_DataEvent( lCycle, ITEM_DATALINK_SET ); + + Nex_MapSelector_Synchronize(); +}; + +void() Nex_Action_Cycle_Clear = +{ + local entity lCycle; + + lCycle = Menu_GetItem( "::Data::Server::Map::Cycle" ); + DataLink_Nex_MapList_Clear( lCycle ); + + Nex_MapSelector_Synchronize(); }; diff --git a/scmenu/source/custom/creategame/creategame.qh b/scmenu/source/custom/creategame/creategame.qh index a2245ac2f..2becc3803 100644 --- a/scmenu/source/custom/creategame/creategame.qh +++ b/scmenu/source/custom/creategame/creategame.qh @@ -1,9 +1,6 @@ // Property of Alientrap/AK // custom/player/avatar.qh -string Nex_MapList_FullPath; -string Nex_MapList_Name; - // Item_Nex_Map_Info // its a valid item nevertheless .string normal; // contains the map name @@ -14,13 +11,19 @@ string Nex_MapList_Name; void() Item_Nex_Map_Info_Destroy; void() Item_Nex_Map_Info_Spawn; -// see control/data/data.qh -// Item_Data_Nex_Map Item_DataLink_Value (implements more or less) -// _realValue should be a integer in the range 1..n where n is the number of found maps -.entity _link; +// Map ""database"" Singleton Item_Nex_MapDB + +// pRoot should be an item with no other children +void() Item_Nex_MapDB_EnumFiles; +void() Item_Nex_MapDB_Destroy; +void() Item_Nex_MapDB_Spawn; + +entity( string pPath ) Nex_MapDB_GetByPath; +entity( float pIndex ) Nex_MapDB_GetByIndex; +float( entity pItem ) Nex_MapDB_GetIndex; -void( float pEvent ) Item_Data_Nex_Map_DataEvent; -void() Item_Data_Nex_Map_Spawn; +string() Nex_MapDB_GetPathAltString; +string() Nex_MapDB_GetNameAltString; // see control/data/data.qh // Item_Data_Nex_Name [Item_Data] @@ -30,11 +33,26 @@ void() Item_Data_Nex_Name_Spawn; // Item_DataLink_Nex_MapList [Item_DataLink_Switch] // contains the full .bsp path in value and the text/map name in desc // this is just a placeholder data item - it only keeps a set +.event init; // if you want to initialize it void( float pEvent ) Item_DataLink_Nex_MapList_DataEvent; void() Item_DataLink_Nex_MapList_Spawn; -void( entity pItem ) Item_DataLink_Nex_MapList_InitWithMapList; -void( entity pItem ) Item_DataLink_Nex_MapList_UpdateRange; +void() Item_DataLink_Nex_MapList_InitWithMapList; +void( entity pItem ) DataLink_Nex_MapList_UpdateRange; + +// MapList edit commands +// these functions work with the entry selected by _realValue +void( entity pItem, string pName, string pPath ) DataLink_Nex_MapList_InsertEntryAfter; +void( entity pItem ) DataLink_Nex_MapList_DeleteEntry; +void( entity pItem ) DataLink_Nex_MapList_MoveEntryUp; +void( entity pItem ) DataLink_Nex_MapList_MoveEntryDown; +// creates the first entry if necessary +void( entity pItem, string pName, string pPath ) DataLink_Nex_MapList_SetFirst; +void( entity pItem ) DataLink_Nex_MapList_Clear; + +// both functions return str zoned strings +string( entity pItem ) DataLink_Nex_MapList_GetCurrentName; +string( entity pItem ) DataLink_Nex_MapList_GetCurrentPath; // see control/data/data.qh // Item_DataLink_Nex_ModSwitch Item_DataLink_TextSwitch diff --git a/scmenu/source/custom/creategame/maps.qc b/scmenu/source/custom/creategame/maps.qc index c7cba8a0b..e30420010 100644 --- a/scmenu/source/custom/creategame/maps.qc +++ b/scmenu/source/custom/creategame/maps.qc @@ -7,6 +7,11 @@ Item_Nex_Map_Info =================== */ +/* +=================== +Item_Nex_Map_Info_Destroy +=================== +*/ void() Item_Nex_Map_Info_Destroy = { String_EntityFree( self, link ); @@ -15,6 +20,11 @@ void() Item_Nex_Map_Info_Destroy = String_EntityFree( self, normal ); }; +/* +=================== +Item_Nex_Map_Info_Spawn +=================== +*/ void() Item_Nex_Map_Info_Spawn = { String_EntityZone( self, link ); @@ -29,27 +39,28 @@ void() Item_Nex_Map_Info_Spawn = /* =================== -Item_Data_Nex_Avatar +Item_Nex_MapDB =================== */ +string _Nex_MapList_FullPath; +string _Nex_MapList_Name; +entity _Nex_MapList_Root; - -// Nex_Action_Map_BuildAvatarList +/* +=================== +Item_Nex_MapDB_EnumFiles +=================== +*/ // map definition format // name // rest: description text -void() _IDNM_BuildList = +void() Item_Nex_MapDB_EnumFiles = { local float lSearchHandle; local float lSearchSize; local float lSearchCounter; local entity lMap; - // since we access two globals, we cant support calling BuildList multiple times, since this would leak str memory - //Menu_EmptyWindow( self ); - Nex_MapList_FullPath = String_Create(); - Nex_MapList_Name = String_Create(); - lSearchHandle = search_begin( "maps/*.bsp", true, true ); if( lSearchHandle < 0 ) return; @@ -72,7 +83,10 @@ void() _IDNM_BuildList = lTitle = String_Zone( lName ); lDescription = String_Zone( strcat( "--NO INFORMATION AVAILABLE--\n", lFilename ) ); } else { + // uncomment this line and comment the other if you have the old map info files + //lTitle = String_Zone( lName ); lTitle = String_Zone( fgets( lHandle ) ); + lDescription = String_Create(); do { local string lLine; @@ -84,7 +98,7 @@ void() _IDNM_BuildList = fclose( lHandle ); } - // add this avatar_info + // save this in a new Map_Info lMap = Menu_CreateItem( "Item_Nex_Map_Info", ftos( lSearchCounter ), self.name ); lMap.link = lName; @@ -92,8 +106,8 @@ void() _IDNM_BuildList = lMap.normal = lTitle; lMap.text = lDescription; - Nex_MapList_FullPath = Util_AltStringPushBack( Nex_MapList_FullPath, lName ); - Nex_MapList_Name = Util_AltStringPushBack( Nex_MapList_Name, lTitle ); + _Nex_MapList_FullPath = Util_AltStringPushBack( _Nex_MapList_FullPath, lName ); + _Nex_MapList_Name = Util_AltStringPushBack( _Nex_MapList_Name, lTitle ); Menu_LinkItem( lMap ); @@ -112,93 +126,116 @@ void() _IDNM_BuildList = self.maxValue = fabs( lMap.orderPos ); }; -void() _IDNM_UpdateLink = +/* +=================== +Item_Nex_MapDB_Destroy +=================== +*/ +void() Item_Nex_MapDB_Destroy = { - local float lCurrent; - local float lTarget; - local entity lMatch; - - lCurrent = fabs( self._link.orderPos ); - lTarget = self._realValue; - if( lCurrent < lTarget ) - for( lMatch = self._link; lMatch._next && fabs( lMatch.orderPos ) != lTarget; lMatch = lMatch._next ); - else - for( lMatch = self._link; lMatch._prev && fabs( lMatch.orderPos ) != lTarget; lMatch = lMatch._prev ); - // lMatch always is valid if there are any children - self._link = lMatch; - - self._realValue = fabs( self._link.orderPos ); - String_EntitySet( self, value, ftos( self._realValue ) ); -}; + String_Free( _Nex_MapList_FullPath ); + String_Free( _Nex_MapList_Name ); -void() _IDNM_Sync = -{ - String_EntitySet( self, value, ftos( self._realValue ) ); - String_EntitySet( self, _syncValue, ftos( self._realValue ) ); + _Nex_MapList_Root = null_entity; }; -void() _IDNM_Send = +/* +=================== +Item_Nex_MapDB_Spawn +=================== +*/ +void() Item_Nex_MapDB_Spawn = { - _IDNM_UpdateLink(); - String_EntitySet( self, _syncValue, self.value ); + if( _Nex_MapList_Root ) + error( "There is already another Item_Nex_MapDB object!" ); + + _Nex_MapList_FullPath = String_Create(); + _Nex_MapList_Name = String_Create(); + _Nex_MapList_Root = self; + + Item_Nex_MapDB_EnumFiles(); + + self._destroy = Item_Nex_MapDB_Destroy; }; -void() _IDNM_Test_Start = +/* +=================== +Nex_MapDB_GetByName +=================== +*/ +entity( string pPath ) Nex_MapDB_GetByPath = { - _IDNM_UpdateLink(); + local entity lNode; + + if( !_Nex_MapList_Root ) + error( "No Item_Nex_MapDB found!" ); + + for( lNode = _Nex_MapList_Root._child ; lNode ; lNode = lNode._next ) { + if( lNode.link == pPath ) { + return lNode; + } + } + + return null_entity; }; -void() _IDNM_Test_End = +/* +=================== +Nex_MapDB_GetByIndex +=================== +*/ +entity( float pIndex ) Nex_MapDB_GetByIndex = { - String_EntitySet( self, value, self._syncValue ); - _IDNM_UpdateLink(); + local entity lNode; + + if( !_Nex_MapList_Root ) + error( "No Item_Nex_MapDB found!" ); + + pIndex = fabs( pIndex ); + for( lNode = _Nex_MapList_Root._child ; lNode ; lNode = lNode._next ) { + if( fabs( lNode.orderPos ) == pIndex ) { + return lNode; + } + } + + return null_entity; }; -void() _IDNM_Reset = +/* +=================== +Nex_MapDB_GetPathAltString +=================== +*/ +string() Nex_MapDB_GetPathAltString = { - String_EntitySet( self, value, self.defValue ); - _IDNM_Send(); + return _Nex_MapList_FullPath; }; -void( float pEvent ) Item_Data_Nex_Map_DataEvent = +/* +=================== +Nex_MapDB_GetNameAltString +=================== +*/ +string() Nex_MapDB_GetNameAltString = { - switch( pEvent ) { - case ITEM_DATA_SYNC: - _IDNM_Sync(); - break; - case ITEM_DATA_SEND: - _IDNM_Send(); - break; - case ITEM_DATA_RESET: - _IDNM_Reset(); - break; - case ITEM_DATA_TEST_START: - _IDNM_Test_Start(); - break; - case ITEM_DATA_TEST_END: - _IDNM_Test_End(); - break; - case ITEM_DATALINK_SET: - _IDNM_UpdateLink(); - break; - } + return _Nex_MapList_Name; }; -void() Item_Data_Nex_Map_Spawn = +/* +=================== +Nex_MapDB_GetIndex +=================== +*/ +float( entity pItem ) Nex_MapDB_GetIndex = { - Item_Data_Init(); - - self.flag = self.flag | FLAG_HIDDEN; - - self._dataEvent = Item_Data_Nex_Map_DataEvent; - - _IDNM_BuildList(); - - self._link = self._child; - self._realValue = stof( self.defValue ); - _IDNM_UpdateLink(); + return fabs( pItem.orderPos ); }; +/* +=================== +Item_DataLink_Nex_MapList_DataEvent +=================== +*/ void( float pEvent ) Item_DataLink_Nex_MapList_DataEvent = { switch( pEvent ) { @@ -207,22 +244,30 @@ void( float pEvent ) Item_DataLink_Nex_MapList_DataEvent = case ITEM_DATA_SEND: break; case ITEM_DATA_RESET: - self._realValue = 0.0; + self._realValue = 1.0; break; case ITEM_DATA_TEST_START: break; case ITEM_DATA_TEST_END: break; case ITEM_DATALINK_SET: + case ITEM_DATALINK_GET: self._realValue = floor( self._realValue ); - if( self._realValue < 1.0 ) + if( self._realValue < 1.0 ) { self._realValue = 1.0; - if( self._realValue > self.maxValue ) + } else if( self._realValue > self.maxValue ) { self._realValue = self.maxValue; + } + break; } }; +/* +=================== +Item_DataLink_Nex_MapList_Destroy +=================== +*/ void() Item_DataLink_Nex_MapList_Destroy = { String_EntityFree( self, valueList ); @@ -230,10 +275,15 @@ void() Item_DataLink_Nex_MapList_Destroy = Item_DataLink_Switch_Destroy(); }; +/* +=================== +Item_DataLink_Nex_MapList_Spawn +=================== +*/ void() Item_DataLink_Nex_MapList_Spawn = { Item_DataLink_Switch_Init(); - String_EntityCreate( self, valueList ); + String_EntityZone( self, valueList ); self.minValue = 1.0; self.maxValue = 1.0; @@ -241,24 +291,199 @@ void() Item_DataLink_Nex_MapList_Spawn = self._dataEvent = Item_DataLink_Nex_MapList_DataEvent; self._destroy = Item_DataLink_Nex_MapList_Destroy; + + CtCall_Init(); }; -void( entity pItem ) Item_DataLink_Nex_MapList_InitWithMapList = +/* +=================== +Item_DataLink_Nex_MapList_InitWithMapList +=================== +*/ +void() Item_DataLink_Nex_MapList_InitWithMapList = { - String_EntitySet( pItem, valueList, Nex_MapList_FullPath ); - String_EntitySet( pItem, descList, Nex_MapList_Name ); + String_EntitySet( self, valueList, Nex_MapDB_GetPathAltString() ); + String_EntitySet( self, descList, Nex_MapDB_GetNameAltString() ); - Item_DataLink_Nex_MapList_UpdateRange( pItem ); + DataLink_Nex_MapList_UpdateRange( self ); }; -void( entity pItem ) Item_DataLink_Nex_MapList_UpdateRange = +/* +=================== +DataLink_Nex_MapList_UpdateRange +=================== +*/ +void( entity pItem ) DataLink_Nex_MapList_UpdateRange = { pItem.minValue = 1.0; pItem.maxValue = Util_GetAltStringCount( pItem.descList ); - if( pItem.maxValue > 1.0 ) + if( pItem.maxValue >= 1 ) { pItem.stepValue = 1.0; - else + } else { + pItem.maxValue = 1.0; pItem.stepValue = 0.0; + } +}; + +/* +=================== +DataLink_Nex_MapList_InsertEntryAfter +=================== +*/ +void( entity pItem, string pName, string pPath ) DataLink_Nex_MapList_InsertEntryAfter = +{ + local float lIndex; + + Raise_DataEvent( pItem, ITEM_DATALINK_GET ); + // - 1, because minValue == 1 + lIndex = pItem._realValue - 1; + pItem.descList = Util_InsAltStringItem( pItem.descList, lIndex, pName ); + pItem.valueList = Util_InsAltStringItem( pItem.valueList, lIndex, pPath ); + + DataLink_Nex_MapList_UpdateRange( pItem ); +}; + +/* +=================== +DataLink_Nex_MapList_DeleteEntry +=================== +*/ +void( entity pItem ) DataLink_Nex_MapList_DeleteEntry = +{ + local float lIndex; + + if( pItem.stepValue == 0.0 ) + return; + + Raise_DataEvent( pItem, ITEM_DATALINK_GET ); + lIndex = pItem._realValue - 1; + pItem.descList = Util_DelAltStringItem( pItem.descList, lIndex ); + pItem.valueList = Util_DelAltStringItem( pItem.valueList, lIndex ); + + DataLink_Nex_MapList_UpdateRange( pItem ); +}; + +/* +=================== +DataLink_Nex_MapList_MoveEntryUp +=================== +*/ +void( entity pItem ) DataLink_Nex_MapList_MoveEntryUp = +{ + local string lName; + local string lPath; + local float lIndexNew; + local float lIndexOld; + + Raise_DataEvent( pItem, ITEM_DATALINK_GET ); + if( pItem._realValue == 1 ) + return; + + // map 1..n to 0..n-1 + lIndexOld = pItem._realValue - 1; + + // we want to insert it up by one, ie. insert it after up by two + lIndexNew = lIndexOld - 2; + + lName = Util_GetAltStringItem( pItem.descList, lIndexOld ); + lPath = Util_GetAltStringItem( pItem.valueList, lIndexOld ); + + pItem.descList = Util_InsAltStringItem( pItem.descList, lIndexNew, String_Normal( lName ) ); + pItem.valueList = Util_InsAltStringItem( pItem.valueList, lIndexNew, String_Normal( lPath ) ); + + // adjust lIndexOld for the entry that has been inserted before it + lIndexOld = lIndexOld + 1; + + pItem.descList = Util_DelAltStringItem( pItem.descList, lIndexOld ); + pItem.valueList = Util_DelAltStringItem( pItem.valueList, lIndexOld ); + + DataLink_Nex_MapList_UpdateRange( pItem ); +}; + +/* +=================== +DataLink_Nex_MapList_MoveEntryDown +=================== +*/ +void( entity pItem ) DataLink_Nex_MapList_MoveEntryDown = +{ + local string lName; + local string lPath; + local float lIndexNew; + local float lIndexOld; + + Raise_DataEvent( pItem, ITEM_DATALINK_GET ); + if( pItem._realValue == pItem.maxValue ) + return; + + // map 1..n to 0..n-1 + lIndexOld = pItem._realValue - 1; + + // we want to insert it down by one + lIndexNew = lIndexOld + 1; + + lName = Util_GetAltStringItem( pItem.descList, lIndexOld ); + lPath = Util_GetAltStringItem( pItem.valueList, lIndexOld ); + + pItem.descList = Util_InsAltStringItem( pItem.descList, lIndexNew, String_Normal( lName ) ); + pItem.valueList = Util_InsAltStringItem( pItem.valueList, lIndexNew, String_Normal( lPath ) ); + + pItem.descList = Util_DelAltStringItem( pItem.descList, lIndexOld ); + pItem.valueList = Util_DelAltStringItem( pItem.valueList, lIndexOld ); + + DataLink_Nex_MapList_UpdateRange( pItem ); +}; + +/* +=================== +DataLink_Nex_MapList_SetFirst +=================== +*/ +void( entity pItem, string pName, string pPath ) DataLink_Nex_MapList_SetFirst = +{ + if( pItem.stepValue == 0.0 ) { + pItem.descList = Util_AltStringPush( pItem.descList, pName ); + pItem.valueList = Util_AltStringPush( pItem.valueList, pPath ); + } else { + pItem.descList = Util_SetAltStringItem( pItem.descList, 0, pName ); + pItem.valueList = Util_SetAltStringItem( pItem.valueList, 0, pPath ); + } + DataLink_Nex_MapList_UpdateRange( pItem ); +}; + +/* +=================== +DataLink_Nex_MapList_Clear +=================== +*/ +void( entity pItem ) DataLink_Nex_MapList_Clear = +{ + String_EntitySet( pItem, descList, "" ); + String_EntitySet( pItem, valueList, "" ); + + DataLink_Nex_MapList_UpdateRange( pItem ); +}; + +/* +=================== +DataLink_Nex_MapList_GetCurrentName +=================== +*/ +string( entity pItem ) DataLink_Nex_MapList_GetCurrentName = +{ + Raise_DataEvent( pItem, ITEM_DATALINK_GET ); + return Util_GetAltStringItem( pItem.descList, pItem._realValue - 1 ); +}; + +/* +=================== +DataLink_Nex_MapList_GetCurrentPath +=================== +*/ +string( entity pItem ) DataLink_Nex_MapList_GetCurrentPath = +{ + Raise_DataEvent( pItem, ITEM_DATALINK_GET ); + return Util_GetAltStringItem( pItem.valueList, pItem._realValue - 1 ); }; diff --git a/scmenu/source/menu.qc b/scmenu/source/menu.qc index 362ba544e..9dbc6b262 100644 --- a/scmenu/source/menu.qc +++ b/scmenu/source/menu.qc @@ -24,7 +24,7 @@ void() m_init = // required menu functions void( float pKey, float pAscii ) m_keydown = { - if(!Menu_Active) + if( !Menu_Active ) return; // actually the menu is the only system that needs to react on key events @@ -71,11 +71,11 @@ void() m_display = // update isserver and clientstate gamestatus = 0; - if(isserver()) + if( isserver() ) gamestatus = gamestatus | GAME_ISSERVER; - if(clientstate() == CS_CONNECTED) + if( clientstate() == CS_CONNECTED ) gamestatus = gamestatus | GAME_CONNECTED; - if(cvar("developer")) + if( cvar("developer") ) gamestatus = gamestatus | GAME_DEVELOPER; // let also the snd and gfx know (perhaps for sfx) diff --git a/scmenu/source/menu.qh b/scmenu/source/menu.qh index 02af4da27..1536d4ff1 100644 --- a/scmenu/source/menu.qh +++ b/scmenu/source/menu.qh @@ -24,4 +24,5 @@ bool Menu_Active; // is set when the menu is active // updated every time toggle is called float gamestatus; -#define USEFUNCTIONS +//#define USEFUNCTIONS +//#define UTILALTSTRING diff --git a/scmenu/source/todo b/scmenu/source/todo index 8d0cd4beb..278d4a9ae 100644 --- a/scmenu/source/todo +++ b/scmenu/source/todo @@ -1,5 +1,6 @@ // Todo list +-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?? diff --git a/scmenu/source/util/altstring.qc b/scmenu/source/util/altstring.qc index f48a57713..a68d913a0 100644 --- a/scmenu/source/util/altstring.qc +++ b/scmenu/source/util/altstring.qc @@ -65,7 +65,8 @@ string( string pStr, float pCount ) Util_GetAltStringItem = lLetter = substring( pStr, lPosition, 1 ); } - lOut = strcat( lOut, lLetter ); // no need for strzone since there are 16 buffers and we use 2 in the for + // 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 @@ -125,8 +126,8 @@ string( string pAlt, float pIndex, string pSet ) Util_SetAltStringItem = } lOut = String_Substring( pAlt, 0, lStart ); - pSet = Util_AltStringPrepare( String_Normal( pSet ) ); - lOut = strcat( lOut, String_Normal( pSet ), substring( pAlt, lPosition, lLength - lPosition ) ); + pSet = String_Normal( Util_AltStringPrepare( String_Normal( pSet ) ) ); + lOut = strcat( lOut, pSet, substring( pAlt, lPosition, lLength - lPosition ) ); return String_Set( pAlt, lOut ); }; @@ -189,10 +190,43 @@ string( string pAlt, float pIndex ) Util_DelAltStringItem = 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 /* =================== diff --git a/scmenu/source/util/altstring.qh b/scmenu/source/util/altstring.qh index d53767620..ee2beaf02 100644 --- a/scmenu/source/util/altstring.qh +++ b/scmenu/source/util/altstring.qh @@ -7,7 +7,7 @@ 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 beginninge use -1) +// 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; -- 2.39.2