mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-20 18:52:36 +00:00
MENU: Loading screen
This commit is contained in:
parent
4b4761d3e2
commit
cdee3852d8
7 changed files with 115 additions and 220 deletions
|
@ -21,6 +21,7 @@ menu_audi.qc // Audio Menu
|
|||
menu_ctrl.qc // Control Menu
|
||||
menu_gpad.qc // Gamepad Menu
|
||||
menu_cred.qc // Credits Menu
|
||||
menu_load.qc // Loading Screen
|
||||
|
||||
main.qc
|
||||
#endlist
|
|
@ -450,191 +450,6 @@ void() DropRecoilKick =
|
|||
gun_kick[2] *= len;
|
||||
}
|
||||
|
||||
string() LoadScreen_GiveTip =
|
||||
{
|
||||
float index = rint((random() * (80 - 1))) + 1;
|
||||
|
||||
switch(index)
|
||||
{
|
||||
case 1:
|
||||
return "Released in 1996, Quake is over 25 years old!";
|
||||
case 2:
|
||||
return "Use the Kar98k to be the hero we need!";
|
||||
case 3:
|
||||
return "Lots of modern engines are based on Quake!";
|
||||
case 4:
|
||||
return "NZ:P began development on September 27 2009!";
|
||||
case 5:
|
||||
return "NZ:P was first released on December 25, 2010!";
|
||||
case 6:
|
||||
return "NZ:P Beta 1.1 has over 300,000 downloads!";
|
||||
case 7:
|
||||
return "NZ:P has been downloaded over 500,000 times!";
|
||||
case 8:
|
||||
return "A lot of people have worked on NZ:P!";
|
||||
case 9:
|
||||
return "Blubswillrule, or \"blubs\", is from the US.";
|
||||
case 10:
|
||||
return "Jukki is from Finland.";
|
||||
case 11:
|
||||
return "Ju[s]tice, or \"tom\" is from Lithuania.";
|
||||
case 12:
|
||||
return "This game has given us bad sleeping habits!";
|
||||
case 13:
|
||||
return "We had a lot of fun making this game!";
|
||||
case 14:
|
||||
return "Pro Tip: you can make your own custom map!";
|
||||
case 15:
|
||||
return "Try Retro Mode, it's in the Graphics Settings!";
|
||||
case 16:
|
||||
return "Tired of our maps? Go make your own!";
|
||||
case 17:
|
||||
return "Slay zombies & be grateful.";
|
||||
case 18:
|
||||
return "Custom maps, CUSTOM MAPS!";
|
||||
case 19:
|
||||
return "Go outside & build a snowman!";
|
||||
case 20:
|
||||
return "Please surround yourself with zombies!";
|
||||
case 21:
|
||||
return "Don't play for too long.. zombies may eat you.";
|
||||
case 22:
|
||||
return "That was epic... EPIC FOR THE WIIIN!"; //why
|
||||
case 23:
|
||||
return "FTEQW is an awesome Quake Engine!";
|
||||
case 24:
|
||||
return "You dead yet?";
|
||||
case 25:
|
||||
return "Now 21% cooler!";
|
||||
case 26:
|
||||
return "your lg is nothink on the lan!"; //what
|
||||
case 27:
|
||||
return "I'm not your chaotic on dm6!";
|
||||
case 28:
|
||||
return "Shoot or knife zombies to kill them, up to you!";
|
||||
case 29:
|
||||
return "How many people forgot to Compile today?";
|
||||
case 30:
|
||||
return "ggnore";
|
||||
case 31:
|
||||
return "NZ:P is also on PC, Switch, Vita, and PSP!";
|
||||
case 32:
|
||||
return "Submerge your device in water for godmode!";
|
||||
case 33:
|
||||
return "10/10/10 was a good day.";
|
||||
case 34:
|
||||
return "Also check out \"FreeCS\" by eukara!";
|
||||
case 35:
|
||||
return "CypressImplex, or \"Ivy\", is from the USA.";
|
||||
case 36:
|
||||
return "Zombies don't like bullets.";
|
||||
case 37:
|
||||
return "Thanks for being an awesome fan!";
|
||||
case 38:
|
||||
return "Removed Herobrine";
|
||||
case 39:
|
||||
return "Pack-a-Punch the Kar98k to get to round 100000.";
|
||||
case 40:
|
||||
return "I feel like I'm being gaslit.";
|
||||
case 41:
|
||||
return "Heads up! You will die if you are killed!";
|
||||
case 42:
|
||||
return "Zombies legally can't kill you if you say no!";
|
||||
case 43:
|
||||
return "Please help me find the meaning of . Thanks.";
|
||||
case 44:
|
||||
return "Discord is ONLY for Thomas the Tank Engine RP!";
|
||||
case 45:
|
||||
return "\"Get rid of the 21% tip, it's an MLP reference.\"";
|
||||
case 46:
|
||||
return "You're playing on FTE!";
|
||||
case 47:
|
||||
return "Don't leak the beta!";
|
||||
case 48:
|
||||
return "Jugger-Nog increases your health!";
|
||||
case 49:
|
||||
return "greg was here";
|
||||
case 50:
|
||||
return "Where the hell is the Mystery Box?!";
|
||||
case 51:
|
||||
return "Zombies like getting shot.. I think.";
|
||||
case 52:
|
||||
return "pro tip: aiming helps";
|
||||
case 53:
|
||||
return "\"my mom gave me plunger money\"";
|
||||
case 54:
|
||||
return "dolphin dive on top of your friend for god mode";
|
||||
case 55:
|
||||
return "no free rides. ass, grass, or cash!";
|
||||
case 56:
|
||||
return "https://nzp.gay/";
|
||||
case 57:
|
||||
return "im an mlg gamer girl so its pretty guaranteed";
|
||||
case 58:
|
||||
return "this is a w because you cant have enough fnaf";
|
||||
case 59:
|
||||
return "i hope santa drops bombs on the uk";
|
||||
case 60:
|
||||
return "Hoyl shit, bro! You fucking ported fortnite!";
|
||||
case 61:
|
||||
return "icarly feet futtishist.";
|
||||
case 62:
|
||||
return "Well, it's impossible to play, I'm disgusted.";
|
||||
case 63:
|
||||
return "I like my women to not be cartoons";
|
||||
case 64:
|
||||
return "Plot twist: NZP was always broken";
|
||||
case 65:
|
||||
return "testing some think.";
|
||||
case 66:
|
||||
return "fnaf is older than gay marriage in the us";
|
||||
case 67:
|
||||
return "i want that twink Obliterated";
|
||||
case 68:
|
||||
return "i think he started the femboy transition process";
|
||||
case 69:
|
||||
return "nice";
|
||||
case 70:
|
||||
return "He's FUCKING annoying";
|
||||
case 71:
|
||||
return "yeah pog female bikers";
|
||||
case 72:
|
||||
return "Its either a stroke of genius or just a stroke";
|
||||
case 73:
|
||||
return "Play some Custom Maps!";
|
||||
case 74:
|
||||
return "Real OGs play on Win9X Machines!";
|
||||
case 75:
|
||||
return "Adding this tip improved framerate by 39%!";
|
||||
case 76:
|
||||
return "The NZ in NZP stands for New Zealand!";
|
||||
case 77:
|
||||
return "The P in NZP stands for Professional!";
|
||||
case 78:
|
||||
return "Remember to stay hydrated!";
|
||||
case 79:
|
||||
return "cofe";
|
||||
}
|
||||
return "wut wut";
|
||||
};
|
||||
|
||||
noref void(float width, float height, float notmenu) CSQC_UpdateViewLoading =
|
||||
{
|
||||
if (loadscreen_mapname != "") {
|
||||
drawpic([0, 0], strcat("gfx/lscreen/", loadscreen_mapname), [width, height], [1, 1, 1], 1);
|
||||
}
|
||||
|
||||
drawfill ([0, 0], [width, 32, 1], [0, 0, 0], 0.68, 0);
|
||||
drawfill ([0, height - 32], [width, 32, 1], [0, 0, 0], 0.68, 0);
|
||||
|
||||
drawstring([width/2 - (stringwidth(loadscreen_tip, 0, [12, 12])/2), height - 16, 0], loadscreen_tip, [12, 12], [1, 1, 1], 1, 0);
|
||||
drawstring([6, 6], loadscreen_maptitle, [24, 24], TEXT_ORANGE, 1, 0);
|
||||
|
||||
drawfill ([width/2 - 160, height - 42], [320, 18, 1], [0.27, 0.27, 0.27], 1, 0);
|
||||
drawfill ([width/2 - 164, height - 46], [328, 26, 1], [0, 0, 0], 0.77, 0);
|
||||
drawstring([width/2 - (stringwidth("Loading...", 0, [14, 14])/2), height - 40, 0], "Loading...", [14, 14], [1, 1, 1], 1, 0);
|
||||
};
|
||||
|
||||
//
|
||||
// Key_IsControllerGlyph(bind)
|
||||
// Returns TRUE if the string provided belongs to
|
||||
|
@ -843,11 +658,6 @@ noref void(float width, float height, float menushown) CSQC_UpdateView =
|
|||
//does what you think it does
|
||||
renderscene();
|
||||
|
||||
if (in_loadscreen)
|
||||
{
|
||||
in_loadscreen = false;
|
||||
localcmd(strcat("map ", loadscreen_mapname, "\n"));
|
||||
}
|
||||
if(in_menu)
|
||||
{
|
||||
// sorta-nasty hack: flashes should still draw if we're
|
||||
|
|
|
@ -2082,36 +2082,8 @@ void() Draw_Extra_ASettings =
|
|||
Draw_String([6, g_height - 42, 0], aset_desc, [12, 12], [1, 1, 1], 1, 0);
|
||||
}
|
||||
|
||||
string() LoadScreen_GiveTip;
|
||||
void() Draw_Menu =
|
||||
{
|
||||
// CSQC likes to take us back and forth between UpdateView and UpdateViewLoading,
|
||||
// meaning normally you'd see the menu pop in and out of scene. We add a delay
|
||||
// before the loading sequence and make sure to draw the first load screen "frame",
|
||||
// so when this back and forth shenanigan happens, the client will not notice
|
||||
// this stupid hack.
|
||||
if (loadscreen_timetrigger) {
|
||||
if (!loadscreen_tip)
|
||||
loadscreen_tip = LoadScreen_GiveTip();
|
||||
|
||||
drawpic([0, 0], strcat("gfx/lscreen/", loadscreen_mapname), [g_width, g_height], [1, 1, 1], 1);
|
||||
|
||||
drawfill ([0, 0], [g_width, 32, 1], [0, 0, 0], 0.68, 0);
|
||||
drawfill ([0, g_height - 32], [g_width, 32, 1], [0, 0, 0], 0.68, 0);
|
||||
|
||||
Draw_String([g_width/2 - (stringwidth(loadscreen_tip, 0, [12, 12])/2), g_height - 16, 0], loadscreen_tip, [12, 12], [1, 1, 1], 1, 0);
|
||||
Draw_String([6, 6], loadscreen_maptitle, [24, 24], TEXT_ORANGE, 1, 0);
|
||||
|
||||
drawfill ([g_width/2 - 160, g_height - 42], [320, 18, 1], [0.27, 0.27, 0.27], 1, 0);
|
||||
drawfill ([g_width/2 - 164, g_height - 46], [328, 26, 1], [0, 0, 0], 0.77, 0);
|
||||
Draw_String([g_width/2 - (stringwidth("Loading...", 0, [14, 14])/2), g_height - 40, 0], "Loading...", [14, 14], [1, 1, 1], 1, 0);
|
||||
|
||||
if (loadscreen_timetrigger < cltime) {
|
||||
in_loadscreen = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
string menu_track_path;
|
||||
if (platform_is_web)
|
||||
menu_track_path = "tracks/tensioned_by_the_damned.wav";
|
||||
|
|
|
@ -59,6 +59,8 @@ enum {
|
|||
};
|
||||
float menu_map_mode;
|
||||
|
||||
#define USER_MAPS_MAX 512
|
||||
|
||||
// Map content data structure
|
||||
var struct
|
||||
{
|
||||
|
@ -69,7 +71,7 @@ var struct
|
|||
string map_name_pretty;
|
||||
string map_desc[8];
|
||||
string map_author;
|
||||
} user_maps[500];
|
||||
} user_maps[USER_MAPS_MAX];
|
||||
float user_maps_count;
|
||||
float user_maps_page;
|
||||
|
||||
|
|
|
@ -49,6 +49,26 @@ string() Menu_PickBackground =
|
|||
return image;
|
||||
};
|
||||
|
||||
//
|
||||
// UserMapNameLookup(bsp_name)
|
||||
// Returns the Prettified name for the given
|
||||
// .BSP
|
||||
//
|
||||
string UserMapNameLookup(string bsp_name) =
|
||||
{
|
||||
for(int i = 0; i < USER_MAPS_MAX; i++) {
|
||||
if (user_maps[i].map_name != bsp_name)
|
||||
continue;
|
||||
|
||||
if (user_maps[i].map_name_pretty)
|
||||
return user_maps[i].map_name_pretty;
|
||||
|
||||
return user_maps[i].map_name;
|
||||
}
|
||||
|
||||
return "NULL";
|
||||
};
|
||||
|
||||
//
|
||||
// Menu_MapFinder()
|
||||
// Performs a .BSP search in the maps/
|
||||
|
|
84
source/menu/menu_load.qc
Normal file
84
source/menu/menu_load.qc
Normal file
|
@ -0,0 +1,84 @@
|
|||
string UserMapNameLookup(string bsp_name);
|
||||
|
||||
string loading_tips[] =
|
||||
{
|
||||
"Now with Font Kerning.",
|
||||
"Quick Revive will ressurect you in Solo.",
|
||||
"Use Quick Revive to revive faster in Co-Op!",
|
||||
"Jugger-Nog increases your health.",
|
||||
"Speed Cola increases Reload speed.",
|
||||
"Speed Cola allows faster Barricade building",
|
||||
"Double Tap will improve Rate of Fire.",
|
||||
"Stamin-Up increases your Move Speed.",
|
||||
"Stamin-Up allows you to Sprint longer.",
|
||||
"PhD Flopper grants explosive immunity.",
|
||||
"Dive-to-prone with PhD to cause PAIN!",
|
||||
"Deadshot Daiquiri improves your accuracy.",
|
||||
"Deadshot Daiquiri removes sniper scope sway.",
|
||||
"Deadshot Daiquiri increases weapon accuracy.",
|
||||
"Carry three weapons with Mule Kick!",
|
||||
"Removed Herobrine.",
|
||||
"Pack-A-Punch the Kar98k to get to round 500!",
|
||||
"NZ:P is on too many platforms to keep count of.",
|
||||
"Dive on top of your friends to win!",
|
||||
"Open Source!",
|
||||
"Max Ammo doesn't refill your mag, so RELOAD!",
|
||||
"KA-BOOM!",
|
||||
"NZ:P has been in development since 2009.",
|
||||
"Hold a crawler and hunt for secrets.",
|
||||
"'Where's the armor station?'",
|
||||
"https://docs.nzp.gay/",
|
||||
"Also try FreeCS by eukara!",
|
||||
"FTE is a pretty awesome Quake sourceport",
|
||||
"\"your lg is nothink on the lan\" - Cooller",
|
||||
"\"¦]\" - Cooller",
|
||||
"\"i'm not your chaotic on dm6\" - Cooller",
|
||||
"\"alltimes lucky\" - Cooller",
|
||||
"\"not my trouble\" - Cooller",
|
||||
"\"it's not internet\" - Cooller",
|
||||
"\"relax\" - Cooller",
|
||||
"Also try LibreQuake."
|
||||
};
|
||||
|
||||
float loading_tip_endtime;
|
||||
string current_tip;
|
||||
string GetLoadingTip() =
|
||||
{
|
||||
if (time > loading_tip_endtime) {
|
||||
current_tip = loading_tips[random() * loading_tips.length];
|
||||
loading_tip_endtime = time + 5;
|
||||
}
|
||||
|
||||
return current_tip;
|
||||
};
|
||||
|
||||
void(vector screensize, float opaque) m_drawloading =
|
||||
{
|
||||
// Black Background
|
||||
drawfill([0, 0], screensize, [0, 0, 0], 1);
|
||||
|
||||
string current_map_loading = cvar_string("mapname");
|
||||
|
||||
// If it's blank, just keep the screen black until FTE sends it to us.
|
||||
if (current_map_loading == "")
|
||||
return;
|
||||
|
||||
// Pick a loading tip.
|
||||
string loading_tip = GetLoadingTip();
|
||||
string map_name_pretty = UserMapNameLookup(current_map_loading);
|
||||
|
||||
//float(vector position, string pic, vector size, vector rgb, float alpha, optional float flag) drawpic = #456;
|
||||
|
||||
// Loading screen
|
||||
drawpic([0, 0], sprintf("gfx/lscreen/%s", current_map_loading), screensize, [1, 1, 1], 1);
|
||||
|
||||
// Cinematic Lines
|
||||
drawfill([0, 0], [screensize_x, 36], [0, 0, 0], 175/255);
|
||||
drawfill([0, screensize_y - 36], [screensize_x, 36], [0, 0, 0], 175/255);
|
||||
|
||||
// Map Title
|
||||
Draw_String([10, 5], map_name_pretty, MENU_TEXT_LARGE, [1, 1, 0], 1, 0);
|
||||
|
||||
// Loading Tip
|
||||
Draw_String([screensize_x/2 - getTextWidth(loading_tip, MENU_TEXT_SMALL_x)/2, screensize_y - 25], loading_tip, MENU_TEXT_SMALL, [1, 1, 1], 1, 0);
|
||||
};
|
|
@ -31,6 +31,12 @@ void() Menu_Maps_PrevPage =
|
|||
user_maps_page--;
|
||||
}
|
||||
|
||||
void(string bsp_name) Menu_Maps_LoadMap =
|
||||
{
|
||||
localcmd(sprintf("map %s\n", bsp_name));
|
||||
current_menu = MENU_MAIN;
|
||||
};
|
||||
|
||||
void() Menu_Maps =
|
||||
{
|
||||
if (!menu_maps_init)
|
||||
|
@ -56,7 +62,7 @@ void() Menu_Maps =
|
|||
// Stock Maps
|
||||
if (menu_map_mode == MAP_SOLOSTOCK || menu_map_mode == MAP_COOPSTOCK) {
|
||||
for(i = 0; i < stock_maps.length; i++) {
|
||||
Menu_MapButton(i + 1, sprintf("map_%s", stock_maps[i].bsp_name), stock_maps[i].bsp_name, -1) ? localcmd(sprintf("map %s\n", stock_maps[i].bsp_name)) : 0;
|
||||
Menu_MapButton(i + 1, sprintf("map_%s", stock_maps[i].bsp_name), stock_maps[i].bsp_name, -1) ? Menu_Maps_LoadMap(stock_maps[i].bsp_name) : 0;
|
||||
}
|
||||
Menu_DrawDivider(i + 1.25);
|
||||
Menu_Button(i + 1.5, "map_nzpusermaps", "USER MAPS", "View User-Created Maps.") ? current_menu = MENU_SOLOUSER : 0;
|
||||
|
|
Loading…
Reference in a new issue