No subject
Thu Mar 12 03:42:49 EDT 2009
cl_curl_maxspeed added to player options
Modified: branches/nexuiz-2.0/data/default.cfg
===================================================================
--- branches/nexuiz-2.0/data/default.cfg 2006-11-25 13:24:27 UTC (rev 1933)
+++ branches/nexuiz-2.0/data/default.cfg 2006-11-25 13:25:51 UTC (rev 1934)
@@ -710,6 +710,7 @@
// singleplayer campaign
set g_campaign 0
+seta g_campaign_name ""
seta g_campaign_index 0
set g_campaign_skill 0
Modified: branches/nexuiz-2.0/data/maps/campaign.txt
===================================================================
--- branches/nexuiz-2.0/data/maps/campaign.txt 2006-11-25 13:24:27 UTC (rev 1933)
+++ branches/nexuiz-2.0/data/maps/campaign.txt 2006-11-25 13:25:51 UTC (rev 1934)
@@ -1,3 +1,4 @@
+"//campaign:Nexuiz Campaign"
"//game","mapname","bots","skill","frag","mutator-sets","description","long description"
"dm","downer","2","1","15",,"Downer","Welcome to your first taste of campaign deathmatch!\n\nYou will face off against two unskilled bots in the decaying industrial arena known as Downer with a fraglimit of 15, this should be good practice for later, so make the best of it."
"dm","basement","3","1","10",,"Basement","Frenzied deathmatch in Basement against three bots, fraglimit is 10."
Modified: branches/nexuiz-2.0/data/menu/campaign/campaign.menu
===================================================================
--- branches/nexuiz-2.0/data/menu/campaign/campaign.menu 2006-11-25 13:24:27 UTC (rev 1933)
+++ branches/nexuiz-2.0/data/menu/campaign/campaign.menu 2006-11-25 13:25:51 UTC (rev 1934)
@@ -9,27 +9,27 @@
flag [FlagEmbedded]
- Derive Picture PrevPicture
+ Derive Picture PrevPictureCampaign
{
size '30 18'
picture "gfx/create_map_nav"
pos '30 25'
}
- Derive TextButton Prev
+ Derive TextButton PrevCampaign
{
normal "<<"
pos '33 29'
- action Nex_Action_Campaign_Prev
+ action Nex_Action_Campaign_Prev_Campaign
}
- Derive Picture NamePicture
+ Derive Picture NamePictureCampaign
{
picture "gfx/create_map_nav_background"
size '409 18'
pos '60 24'
}
- Derive MultiLabel ShortDescription
+ Derive MultiLabel ShortDescriptionCampaign
{
alignment [AlignCenter]
color "1 1 1"
@@ -37,33 +37,75 @@
pos '64 29'
}
- Derive Picture NextPicture
+ Derive Picture NextPictureCampaign
{
size '30 18'
picture "gfx/create_map_nav"
pos '471 25'
}
- Derive TextButton Next
+ Derive TextButton NextCampaign
{
normal ">>"
pos '474 29'
- action Nex_Action_Campaign_Next
+ action Nex_Action_Campaign_Next_Campaign
}
+
+ Derive Picture PrevPictureEntry
+ {
+ size '30 18'
+ picture "gfx/create_map_nav"
+ pos '30 45'
+ }
+ Derive TextButton PrevEntry
+ {
+ normal "<<"
+ pos '33 49'
+ action Nex_Action_Campaign_Prev_Entry
+ }
+
+ Derive Picture NamePictureEntry
+ {
+ picture "gfx/create_map_nav_background"
+ size '409 18'
+ pos '60 44'
+ }
+ Derive MultiLabel ShortDescriptionEntry
+ {
+ alignment [AlignCenter]
+ color "1 1 1"
+ size '409 14'
+ pos '64 49'
+ }
+ Derive Picture NextPictureEntry
+ {
+ size '30 18'
+ picture "gfx/create_map_nav"
+ pos '471 45'
+ }
+ Derive TextButton NextEntry
+ {
+ normal ">>"
+ pos '474 49'
+
+ action Nex_Action_Campaign_Next_Entry
+ }
+
+
Derive Picture Table1
{
picture "gfx/create_map_border"
- pos '70 35'
- size '385 275'
+ pos '70 55'
+ size '385 255'
}
- Derive Picture Picture
+ Derive Picture PictureEntry
{
picture "gfx/m_white"
- size '323 226'
- pos '101 60'
+ size '323 206'
+ pos '101 80'
}
Derive Picture Table2
{
@@ -72,7 +114,7 @@
size '500 200'
}
- Derive MultiLabel LongDescription
+ Derive MultiLabel LongDescriptionEntry
{
pos '44 315'
size '480 200'
Modified: branches/nexuiz-2.0/data/menu/data/player.menu
===================================================================
--- branches/nexuiz-2.0/data/menu/data/player.menu 2006-11-25 13:24:27 UTC (rev 1933)
+++ branches/nexuiz-2.0/data/menu/data/player.menu 2006-11-25 13:25:51 UTC (rev 1934)
@@ -157,4 +157,17 @@
}
}
}
+ Item Data_Cvar MapDLSpeed
+ {
+ cvarName "cl_curl_maxspeed"
+ defValue "300"
+
+ Item DataLink_Value Value
+ {
+ minValue 10.0
+ maxValue 1000.0
+ stepValue 10.0
+ link "##up"
+ }
+ }
}
Modified: branches/nexuiz-2.0/data/menu/options/player.menu
===================================================================
--- branches/nexuiz-2.0/data/menu/options/player.menu 2006-11-25 13:24:27 UTC (rev 1933)
+++ branches/nexuiz-2.0/data/menu/options/player.menu 2006-11-25 13:25:51 UTC (rev 1934)
@@ -187,6 +187,11 @@
text "Show player names"
target "::Data::Player::PlayerShowNames::Switch"
}
+ Derive Nex_Option_Slider MapDLSpeed
+ {
+ text "Download Speed"
+ target "::Data::Player::MapDLSpeed::Value"
+ }
Derive Nex_Void Seperator1
{}
Derive PictureButton Apply
Modified: branches/nexuiz-2.0/data/qcsrc/menu/custom/campaign.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/custom/campaign.qc 2006-11-25 13:24:27 UTC (rev 1933)
+++ branches/nexuiz-2.0/data/qcsrc/menu/custom/campaign.qc 2006-11-25 13:25:51 UTC (rev 1934)
@@ -52,11 +52,11 @@
CampaignSetup(n);
}
-float campaign_index;
+float campaign_entry_index;
void() Nex_Action_Campaign_Start =
{
- Campaign_JumpLevel(campaign_index);
+ Campaign_JumpLevel(campaign_entry_index);
// force the menu to hide
m_hide();
@@ -64,48 +64,104 @@
void() Nex_Action_Campaign_Update =
{
- local entity lItem;
- local string longdesc;
- local string shortdesc;
- lItem = Menu_GetItem( "ShortDescription" );
- shortdesc = campaign_shortdesc[campaign_index];
- shortdesc = strcat("Level ", ftos(campaign_index + 1), ": ", shortdesc);
- String_EntitySet( lItem, text, shortdesc);
+ local entity item;
+ local string desc;
+ local float handle;
+ local string line;
- lItem = Menu_GetItem( "LongDescription" );
- longdesc = wordwrap(campaign_longdesc[campaign_index], lItem.wrap - 1);
- String_EntitySet( lItem, text, longdesc );
+ handle = fopen(strcat("maps/campaign", campaign_name, ".txt"), FILE_READ);
+ if(handle >= 0) {
+ while (line = fgets(handle)) {
+ if(substring(line, 0, 12) == "\"//campaign:") {
+ desc = substring(line, 12, (strlen(line) - (12 + 1)));
+ break;
+ } else {
+ continue;
+ }
+ }
+ }
+ fclose(handle);
- lItem = Menu_GetItem( "Picture" );
- String_EntitySet( lItem, picture, strcat("maps/",campaign_mapname[campaign_index], ".jpg") );
+ item = Menu_GetItem("ShortDescriptionCampaign");
+ desc = strcat("Campaign: ", desc);
+ String_EntitySet(item, text, desc);
+
+ item = Menu_GetItem("ShortDescriptionEntry");
+ desc = campaign_shortdesc[campaign_entry_index];
+ desc = strcat("Level ", ftos(campaign_entry_index + 1), ": ", desc);
+ String_EntitySet(item, text, desc);
+
+ item = Menu_GetItem("LongDescriptionEntry");
+ desc = wordwrap(campaign_longdesc[campaign_entry_index], item.wrap - 1);
+ String_EntitySet(item, text, desc);
+
+ item = Menu_GetItem("PictureEntry");
+ String_EntitySet(item, picture, strcat("maps/",campaign_mapname[campaign_entry_index], ".jpg"));
};
-void() Nex_Action_Campaign_Init =
+void(float index) Nex_Action_Campaign_Find_Entry =
{
- campaign_index = cvar(campaign_index_var);
+ campaign_entry_index+=index;
+ if (campaign_entry_index < 0) campaign_entry_index = min((campaign_entries - 1), cvar(campaign_index_var));
+ if (campaign_entry_index > min((campaign_entries - 1), cvar(campaign_index_var))) campaign_entry_index = 0;
+}
+void() Nex_Action_Campaign_Prev_Entry =
+{
+ Nex_Action_Campaign_Find_Entry(-1);
Nex_Action_Campaign_Update();
};
-void() Nex_Action_Campaign_Prev =
+void() Nex_Action_Campaign_Next_Entry =
{
- if (campaign_index <= 0) {
- campaign_index = min(campaign_entries, cvar(campaign_index_var));
- } else {
- campaign_index -= 1;
- }
+ Nex_Action_Campaign_Find_Entry(1);
+ Nex_Action_Campaign_Update();
+};
+void() Nex_Action_Campaign_Init =
+{
+ Campaign_Init();
+
+ campaign_entry_index = cvar(campaign_index_var);
+ Nex_Action_Campaign_Find_Entry(0); // set campaign_index_var back into range if too high or low
+
Nex_Action_Campaign_Update();
};
-void() Nex_Action_Campaign_Next =
+void(float index) Nex_Action_Campaign_Find_Campaign =
{
- if (campaign_index >= min(campaign_entries, cvar(campaign_index_var))) {
- campaign_index = 0;
- } else {
- campaign_index += 1;
+ local float handle;
+ local float count;
+ float i;
+ local string filename;
+ handle = search_begin("maps/campaign*.txt", true, true);
+ if(handle >= 0) {
+ count = search_getsize(handle);
+ for (i = 0; i < count; i++) {
+ filename = search_getfilename(handle, i);
+ if (filename == strcat("maps/campaign", campaign_name, ".txt")) {
+ index+=i;
+ if (index < 0) index = (count - 1);
+ if (index > (count - 1)) index = 0;
+ filename = search_getfilename(handle, index);
+ break;
+ }
+ }
+ count = strlen(filename);
+ cvar_set("g_campaign_name", substring(filename, 13, (count - (13 + 4))));
}
+ search_end(handle);
+ Nex_Action_Campaign_Init();
+}
+void() Nex_Action_Campaign_Prev_Campaign =
+{
+ Nex_Action_Campaign_Find_Campaign(-1);
Nex_Action_Campaign_Update();
};
+void() Nex_Action_Campaign_Next_Campaign =
+{
+ Nex_Action_Campaign_Find_Campaign(1);
+ Nex_Action_Campaign_Update();
+};
More information about the nexuiz-commits
mailing list