raze-gles/source/duke3d/src/menus.cpp
Christoph Oelckers 1b9a2f5932 - disabled the message entering code.
This needs to be replaced with the game independent ZDoom version and hooked up properly, but it of low priority because it's a multiplayer only feature.
2019-12-24 13:21:36 +01:00

225 lines
8 KiB
C++

//-------------------------------------------------------------------------
/*
Copyright (C) 2016 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else!
#include "cheats.h"
#include "compat.h"
#include "demo.h"
#include "duke3d.h"
#include "menus.h"
#include "osdcmds.h"
#include "savegame.h"
#include "superfasthash.h"
#include "gamecvars.h"
#include "gamecontrol.h"
#include "c_bind.h"
#include "../../glbackend/glbackend.h"
bool ShowOptionMenu();
namespace ImGui
{
void ShowDemoWindow(bool*);
}
BEGIN_DUKE_NS
#if 0
void Menu_Init(void)
{
int32_t i, j, k;
if (FURY)
// prepare shareware
if (VOLUMEONE)
{
// blue out episodes beyond the first
for (i = 1; i < g_volumeCnt; ++i)
{
if (MEL_EPISODE[i])
{
ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
ME_EPISODE[i].flags |= MEF_LookDisabled;
}
}
M_EPISODE.numEntries = g_volumeCnt; // remove User Map (and spacer)
MEOS_NETOPTIONS_EPISODE.numOptions = 1;
MenuEntry_DisableOnCondition(&ME_NETOPTIONS_EPISODE, 1);
}
}
static void Menu_PreDraw(MenuID_t cm, MenuEntry_t *entry, const vec2_t origin)
{
int32_t i, j, l = 0;
switch (cm)
{
case MENU_CREDITS4: // JBF 20031220
{
#define MENU_YOFFSET 40
#define MENU_INCREMENT(x) (oy += ((x) << 16)) // maybe this should have been MENU_EXCREMENT instead
int32_t oy = origin.y;
mgametextcenter(origin.x, MENU_INCREMENT(MENU_YOFFSET), "Developers");
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(11), "Richard \"TerminX\" Gobeille", 8);
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(7), "Evan \"Hendricks266\" Ramos", 8);
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(7), "Alex \"pogokeen\" Dawson", 8);
mgametextcenter(origin.x, MENU_INCREMENT(11), "Retired developers");
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(11), "Pierre-Loup \"Plagman\" Griffais", 8);
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(7), "Philipp \"Helixhorned\" Kutin", 8);
mgametextcenter(origin.x, MENU_INCREMENT(11), "Special thanks to");
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(11), "Jonathon \"JonoF\" Fowler", 8);
mgametextcenter(origin.x, MENU_INCREMENT(11), "Uses BUILD Engine technology by");
creditsminitext(origin.x + (160 << 16), MENU_INCREMENT(11), "Ken \"Awesoken\" Silverman", 8);
#undef MENU_INCREMENT
#undef MENU_YOFFSET
}
break;
case MENU_CREDITS5:
l = 7;
mgametextcenter(origin.x, origin.y + ((38-l)<<16), "License and Other Contributors");
{
static const char *header[] =
{
"This program is distributed under the terms of the",
"GNU General Public License version 2 as published by the",
"Free Software Foundation. See gpl-2.0.txt for details.",
"BUILD engine technology available under license. See buildlic.txt.",
nullptr,
"The EDuke32 team thanks the following people for their contributions:",
nullptr,
};
static const char *body[] =
{
"Alexey Skrybykin", // Nuke.YKT - Polymost fixes
"Bioman", // GTK work, APT repository and package upkeep
"Brandon Bergren", // "Bdragon" - tiles.cfg
"Charlie Honig", // "CONAN" - showview command
"Dan Gaskill", // "DeeperThought" - testing
"David Koenig", // "Bargle" - Merged a couple of things from duke3d_w32
"Ed Coolidge", // Mapster32 improvements
"Emile Belanger", // original Android work
"Fox", // various patches
"Hunter_rus", // tons of stuff
"James Bentler", // Mapster32 improvements
"Jasper Foreman", // netcode contributions
"Javier Martinez", // "Malone3D" - EDuke 2.1.1 components
"Jeff Hart", // website graphics
"Jonathan Strander", // "Mblackwell" - testing and feature speccing
"Jordon Moss", // "Striker" - various patches, OldMP work
"Jose del Castillo", // "Renegado" - EDuke 2.1.1 components
"Lachlan McDonald", // official EDuke32 icon
"LSDNinja", // OS X help and testing
"Marcus Herbert", // "rhoenie" - OS X compatibility work
"Matthew Palmer", // "Usurper" - testing and eduke32.com domain
"Matt Saettler", // original DOS EDuke/WW2GI enhancements
"NY00123", // Linux / SDL usability patches
"Ozkan Sezer", // SDL/GTK version checking improvements
"Peter Green", // "Plugwash" - dynamic remapping, custom gametypes
"Peter Veenstra", // "Qbix" - port to 64-bit
"Robin Green", // CON array support
"Ryan Gordon", // "icculus" - icculus.org Duke3D port sound code
"Stephen Anthony", // early 64-bit porting work
"tueidj", // Wii port
};
EDUKE32_STATIC_ASSERT(ARRAY_SIZE(body) % 3 == 0);
static const char *footer[] =
{
nullptr,
"Visit eduke32.com for news and updates",
};
static constexpr int header_numlines = ARRAY_SIZE(header);
static constexpr int body_numlines = ARRAY_SIZE(body);
static constexpr int footer_numlines = ARRAY_SIZE(footer);
static constexpr int CCOLUMNS = 3;
static constexpr int CCOLXBUF = 20;
int c;
i = 0;
for (c = 0; c < header_numlines; c++)
if (header[c])
creditsminitext(origin.x + (160<<16), origin.y + ((17+10+10+8+4+(c*7)-l)<<16), header[c], 8);
i += c;
for (c = 0; c < body_numlines; c++)
if (body[c])
creditsminitext(origin.x + ((CCOLXBUF+((320-CCOLXBUF*2)/(CCOLUMNS*2)) +((320-CCOLXBUF*2)/CCOLUMNS)*(c/(body_numlines/CCOLUMNS)))<<16), origin.y + ((17+10+10+8+4+((c%(body_numlines/CCOLUMNS))*7)+(i*7)-l)<<16), body[c], 8);
i += c/CCOLUMNS;
for (c = 0; c < footer_numlines; c++)
if (footer[c])
creditsminitext(origin.x + (160<<16), origin.y + ((17+10+10+8+4+(c*7)+(i*7)-l)<<16), footer[c], 8);
}
break;
default:
break;
}
}
/*
Functions where a "newValue" or similar is passed are run *before* the linked variable is actually changed.
That way you can compare the new and old values and potentially block the change.
*/
static void Menu_EntryLinkActivate(MenuEntry_t *entry)
{
else if (entry == &ME_NETHOST_LAUNCH)
{
// master does whatever it wants
if (g_netServer)
{
Net_FillNewGame(&pendingnewgame, 1);
Net_StartNewGame();
Net_SendNewGame(1, NULL);
}
else if (voting == -1)
{
Net_SendMapVoteInitiate();
Menu_Change(MENU_NETWAITVOTES);
}
}
}
#endif
END_DUKE_NS