mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
Merge remote-tracking branch 'origin/master' into vulkan2
This commit is contained in:
commit
3c594c6c93
17 changed files with 125 additions and 85 deletions
|
@ -1855,7 +1855,7 @@ CCMD (toggle)
|
||||||
val = var->GetGenericRep (CVAR_Bool);
|
val = var->GetGenericRep (CVAR_Bool);
|
||||||
val.Bool = !val.Bool;
|
val.Bool = !val.Bool;
|
||||||
var->SetGenericRep (val, CVAR_Bool);
|
var->SetGenericRep (val, CVAR_Bool);
|
||||||
Printf ("\"%s\" is \"%s\"\n", var->GetName(),
|
Printf ("\"%s\" = \"%s\"\n", var->GetName(),
|
||||||
val.Bool ? "true" : "false");
|
val.Bool ? "true" : "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -863,7 +863,7 @@ void D_Display ()
|
||||||
{
|
{
|
||||||
FTexture *tex;
|
FTexture *tex;
|
||||||
int x;
|
int x;
|
||||||
FString pstring = "By ";
|
FString pstring = GStrings("TXT_BY");
|
||||||
|
|
||||||
tex = TexMan.GetTextureByName(gameinfo.PauseSign, true);
|
tex = TexMan.GetTextureByName(gameinfo.PauseSign, true);
|
||||||
x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
|
x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
|
||||||
|
@ -871,7 +871,7 @@ void D_Display ()
|
||||||
screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
|
screen->DrawTexture (tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
|
||||||
if (paused && multiplayer)
|
if (paused && multiplayer)
|
||||||
{
|
{
|
||||||
pstring += players[paused - 1].userinfo.GetName();
|
pstring << ' ' << players[paused - 1].userinfo.GetName();
|
||||||
screen->DrawText(SmallFont, CR_RED,
|
screen->DrawText(SmallFont, CR_RED,
|
||||||
(screen->GetWidth() - SmallFont->StringWidth(pstring)*CleanXfac) / 2,
|
(screen->GetWidth() - SmallFont->StringWidth(pstring)*CleanXfac) / 2,
|
||||||
(tex->GetDisplayHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE);
|
(tex->GetDisplayHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE);
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
#include "i_time.h"
|
#include "i_time.h"
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
|
#include "gstrings.h"
|
||||||
|
|
||||||
EXTERN_CVAR (Int, disableautosave)
|
EXTERN_CVAR (Int, disableautosave)
|
||||||
EXTERN_CVAR (Int, autosavecount)
|
EXTERN_CVAR (Int, autosavecount)
|
||||||
|
@ -2187,6 +2188,13 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
|
||||||
case DEM_GIVECHEAT:
|
case DEM_GIVECHEAT:
|
||||||
s = ReadString (stream);
|
s = ReadString (stream);
|
||||||
cht_Give (&players[player], s, ReadLong (stream));
|
cht_Give (&players[player], s, ReadLong (stream));
|
||||||
|
if (player != consoleplayer)
|
||||||
|
{
|
||||||
|
FString message = GStrings("TXT_X_CHEATS");
|
||||||
|
message.Substitute("%s", players[player].userinfo.GetName());
|
||||||
|
Printf("%s: give %s\n", message.GetChars(), s);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEM_TAKECHEAT:
|
case DEM_TAKECHEAT:
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include "cmdlib.h"
|
#include "cmdlib.h"
|
||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
|
#include "gstrings.h"
|
||||||
|
|
||||||
static FRandom pr_pickteam ("PickRandomTeam");
|
static FRandom pr_pickteam ("PickRandomTeam");
|
||||||
|
|
||||||
|
@ -314,7 +315,7 @@ static void UpdateTeam (int pnum, int team, bool update)
|
||||||
|
|
||||||
if ((dmflags2 & DF2_NO_TEAM_SWITCH) && (alwaysapplydmflags || deathmatch) && TeamLibrary.IsValidTeam (info->GetTeam()))
|
if ((dmflags2 & DF2_NO_TEAM_SWITCH) && (alwaysapplydmflags || deathmatch) && TeamLibrary.IsValidTeam (info->GetTeam()))
|
||||||
{
|
{
|
||||||
Printf ("Team changing has been disabled!\n");
|
Printf ("%s\n", GStrings("TXT_NO_TEAM_CHANGE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,10 +330,18 @@ static void UpdateTeam (int pnum, int team, bool update)
|
||||||
|
|
||||||
if (update && oldteam != team)
|
if (update && oldteam != team)
|
||||||
{
|
{
|
||||||
|
FString message;
|
||||||
if (TeamLibrary.IsValidTeam (team))
|
if (TeamLibrary.IsValidTeam (team))
|
||||||
Printf ("%s joined the %s team\n", info->GetName(), Teams[team].GetName ());
|
{
|
||||||
|
message = GStrings("TXT_JOINED_TEAM");
|
||||||
|
message.Substitute("%t", Teams[team].GetName());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Printf ("%s is now a loner\n", info->GetName());
|
{
|
||||||
|
message = GStrings("TXT_LONER");
|
||||||
|
}
|
||||||
|
message.Substitute("%s", info->GetName());
|
||||||
|
Printf("%s\n", message.GetChars());
|
||||||
}
|
}
|
||||||
// Let the player take on the team's color
|
// Let the player take on the team's color
|
||||||
R_BuildPlayerTranslation (pnum);
|
R_BuildPlayerTranslation (pnum);
|
||||||
|
|
|
@ -1673,16 +1673,9 @@ void G_DoPlayerPop(int playernum)
|
||||||
{
|
{
|
||||||
playeringame[playernum] = false;
|
playeringame[playernum] = false;
|
||||||
|
|
||||||
if (deathmatch)
|
FString message = GStrings(deathmatch? "TXT_LEFTWITHFRAGS" : "TXT_LEFTTHEGAME");
|
||||||
{
|
message.Substitute("%s", players[playernum].userinfo.GetName());
|
||||||
Printf("%s left the game with %d frags\n",
|
message.Substitute("%d", FStringf("%d", players[playernum].fragcount));
|
||||||
players[playernum].userinfo.GetName(),
|
|
||||||
players[playernum].fragcount);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Printf("%s left the game\n", players[playernum].userinfo.GetName());
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RH] Revert each player to their own view if spying through the player who left
|
// [RH] Revert each player to their own view if spying through the player who left
|
||||||
for (int ii = 0; ii < MAXPLAYERS; ++ii)
|
for (int ii = 0; ii < MAXPLAYERS; ++ii)
|
||||||
|
@ -1754,7 +1747,7 @@ static bool CheckSingleWad (const char *name, bool &printRequires, bool printwar
|
||||||
{
|
{
|
||||||
if (!printRequires)
|
if (!printRequires)
|
||||||
{
|
{
|
||||||
Printf ("This savegame needs these wads:\n%s", name);
|
Printf ("%s:\n%s", GStrings("TXT_SAVEGAMENEEDS"), name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1790,6 +1783,12 @@ bool G_CheckSaveGameWads (FSerializer &arc, bool printwarn)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void LoadGameError(const char *label, const char *append = "")
|
||||||
|
{
|
||||||
|
FString message = GStrings(label);
|
||||||
|
message.Substitute("%s", savename);
|
||||||
|
Printf ("%s %s\n", message.GetChars(), append);
|
||||||
|
}
|
||||||
|
|
||||||
void G_DoLoadGame ()
|
void G_DoLoadGame ()
|
||||||
{
|
{
|
||||||
|
@ -1805,13 +1804,13 @@ void G_DoLoadGame ()
|
||||||
std::unique_ptr<FResourceFile> resfile(FResourceFile::OpenResourceFile(savename.GetChars(), true, true));
|
std::unique_ptr<FResourceFile> resfile(FResourceFile::OpenResourceFile(savename.GetChars(), true, true));
|
||||||
if (resfile == nullptr)
|
if (resfile == nullptr)
|
||||||
{
|
{
|
||||||
Printf ("Could not read savegame '%s'\n", savename.GetChars());
|
LoadGameError("TXT_COULDNOTREAD");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FResourceLump *info = resfile->FindLump("info.json");
|
FResourceLump *info = resfile->FindLump("info.json");
|
||||||
if (info == nullptr)
|
if (info == nullptr)
|
||||||
{
|
{
|
||||||
Printf("'%s' is not a valid savegame: Missing 'info.json'.\n", savename.GetChars());
|
LoadGameError("TXT_NOINFOJSON");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1821,7 +1820,7 @@ void G_DoLoadGame ()
|
||||||
FSerializer arc(nullptr);
|
FSerializer arc(nullptr);
|
||||||
if (!arc.OpenReader((const char *)data, info->LumpSize))
|
if (!arc.OpenReader((const char *)data, info->LumpSize))
|
||||||
{
|
{
|
||||||
Printf("Failed to access savegame info\n");
|
LoadGameError("TXT_FAILEDTOREADSG");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1839,27 +1838,30 @@ void G_DoLoadGame ()
|
||||||
// have this information.
|
// have this information.
|
||||||
if (engine.IsEmpty())
|
if (engine.IsEmpty())
|
||||||
{
|
{
|
||||||
Printf("Savegame is from an incompatible version\n");
|
LoadGameError("TXT_INCOMPATIBLESG");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Printf("Savegame is from another ZDoom-based engine: %s\n", engine.GetChars());
|
LoadGameError("TXT_IOTHERENGINESG", engine.GetChars());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SaveVersion < MINSAVEVER || SaveVersion > SAVEVER)
|
if (SaveVersion < MINSAVEVER || SaveVersion > SAVEVER)
|
||||||
{
|
{
|
||||||
Printf("Savegame is from an incompatible version");
|
FString message;
|
||||||
if (SaveVersion < MINSAVEVER)
|
if (SaveVersion < MINSAVEVER)
|
||||||
{
|
{
|
||||||
Printf(": %d (%d is the oldest supported)", SaveVersion, MINSAVEVER);
|
message = GStrings("TXT_TOOOLDSG");
|
||||||
|
message.Substitute("%e", FStringf("%d", MINSAVEVER));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Printf(": %d (%d is the highest supported)", SaveVersion, SAVEVER);
|
message = GStrings("TXT_TOONEWSG");
|
||||||
|
message.Substitute("%e", FStringf("%d", SAVEVER));
|
||||||
}
|
}
|
||||||
Printf("\n");
|
message.Substitute("%d", FStringf("%d", SaveVersion));
|
||||||
|
LoadGameError(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1870,7 +1872,7 @@ void G_DoLoadGame ()
|
||||||
|
|
||||||
if (map.IsEmpty())
|
if (map.IsEmpty())
|
||||||
{
|
{
|
||||||
Printf("Savegame is missing the current map\n");
|
LoadGameError("TXT_NOMAPSG");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1886,14 +1888,14 @@ void G_DoLoadGame ()
|
||||||
info = resfile->FindLump("globals.json");
|
info = resfile->FindLump("globals.json");
|
||||||
if (info == nullptr)
|
if (info == nullptr)
|
||||||
{
|
{
|
||||||
Printf("'%s' is not a valid savegame: Missing 'globals.json'.\n", savename.GetChars());
|
LoadGameError("TXT_NOGLOBALSJSON");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = info->CacheLump();
|
data = info->CacheLump();
|
||||||
if (!arc.OpenReader((const char *)data, info->LumpSize))
|
if (!arc.OpenReader((const char *)data, info->LumpSize))
|
||||||
{
|
{
|
||||||
Printf("Failed to access savegame info\n");
|
LoadGameError("TXT_SGINFOERR");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1959,20 +1961,19 @@ void G_SaveGame (const char *filename, const char *description)
|
||||||
{
|
{
|
||||||
if (sendsave || gameaction == ga_savegame)
|
if (sendsave || gameaction == ga_savegame)
|
||||||
{
|
{
|
||||||
Printf ("A game save is still pending.\n");
|
Printf ("%s\n", GStrings("TXT_SAVEPENDING"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (!usergame)
|
else if (!usergame)
|
||||||
{
|
{
|
||||||
Printf ("not in a saveable game\n");
|
Printf ("%s\n", GStrings("TXT_NOTSAVEABLE"));
|
||||||
}
|
}
|
||||||
else if (gamestate != GS_LEVEL)
|
else if (gamestate != GS_LEVEL)
|
||||||
{
|
{
|
||||||
Printf ("not in a level\n");
|
Printf ("%s\n", GStrings("TXT_NOTINLEVEL"));
|
||||||
}
|
}
|
||||||
else if (players[consoleplayer].health <= 0 && !multiplayer)
|
else if (players[consoleplayer].health <= 0 && !multiplayer)
|
||||||
{
|
{
|
||||||
Printf ("player is dead in a single-player game\n");
|
Printf ("%s\n", GStrings("TXT_SPPLAYERDEAD"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2291,7 +2292,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
|
||||||
if (longsavemessages) Printf ("%s (%s)\n", GStrings("GGSAVED"), filename.GetChars());
|
if (longsavemessages) Printf ("%s (%s)\n", GStrings("GGSAVED"), filename.GetChars());
|
||||||
else Printf ("%s\n", GStrings("GGSAVED"));
|
else Printf ("%s\n", GStrings("GGSAVED"));
|
||||||
}
|
}
|
||||||
else Printf(PRINT_HIGH, "Save failed\n");
|
else Printf(PRINT_HIGH, "%s\n", GStrings("TXT_SAVEFAILED"));
|
||||||
|
|
||||||
|
|
||||||
BackupSaveName = filename;
|
BackupSaveName = filename;
|
||||||
|
|
|
@ -193,6 +193,11 @@ void DPusher::Tick ()
|
||||||
|
|
||||||
if (m_Type == p_push)
|
if (m_Type == p_push)
|
||||||
{
|
{
|
||||||
|
if (m_Source == nullptr)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Seek out all pushable things within the force radius of this
|
// Seek out all pushable things within the force radius of this
|
||||||
// point pusher. Crosses sectors, so use blockmap.
|
// point pusher. Crosses sectors, so use blockmap.
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ void cht_DoMDK(player_t *player, const char *mod)
|
||||||
{
|
{
|
||||||
if (player->mo == NULL)
|
if (player->mo == NULL)
|
||||||
{
|
{
|
||||||
Printf("What do you want to kill outside of a game?\n");
|
Printf("%s\n", GStrings("TXT_WHAT_KILL"));
|
||||||
}
|
}
|
||||||
else if (!deathmatch)
|
else if (!deathmatch)
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,6 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
AActor *item;
|
AActor *item;
|
||||||
FString smsg;
|
FString smsg;
|
||||||
const char *msg = "";
|
const char *msg = "";
|
||||||
char msgbuild[32];
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// No cheating when not having a pawn attached.
|
// No cheating when not having a pawn attached.
|
||||||
|
@ -204,25 +203,25 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
case CHT_NOTARGET:
|
case CHT_NOTARGET:
|
||||||
player->cheats ^= CF_NOTARGET;
|
player->cheats ^= CF_NOTARGET;
|
||||||
if (player->cheats & CF_NOTARGET)
|
if (player->cheats & CF_NOTARGET)
|
||||||
msg = "notarget ON";
|
msg = GStrings("TXT_NOTARGET_ON");
|
||||||
else
|
else
|
||||||
msg = "notarget OFF";
|
msg = GStrings("TXT_NOTARGET_OFF");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_ANUBIS:
|
case CHT_ANUBIS:
|
||||||
player->cheats ^= CF_FRIGHTENING;
|
player->cheats ^= CF_FRIGHTENING;
|
||||||
if (player->cheats & CF_FRIGHTENING)
|
if (player->cheats & CF_FRIGHTENING)
|
||||||
msg = "\"Quake with fear!\"";
|
msg = GStrings("TXT_ANUBIS_ON");
|
||||||
else
|
else
|
||||||
msg = "No more ogre armor";
|
msg = GStrings("TXT_ANUBIS_OFF");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_CHASECAM:
|
case CHT_CHASECAM:
|
||||||
player->cheats ^= CF_CHASECAM;
|
player->cheats ^= CF_CHASECAM;
|
||||||
if (player->cheats & CF_CHASECAM)
|
if (player->cheats & CF_CHASECAM)
|
||||||
msg = "chasecam ON";
|
msg = GStrings("TXT_CHASECAM_ON");
|
||||||
else
|
else
|
||||||
msg = "chasecam OFF";
|
msg = GStrings("TXT_CHASECAM_OFF");
|
||||||
R_ResetViewInterpolation ();
|
R_ResetViewInterpolation ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -326,10 +325,18 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
{
|
{
|
||||||
int killcount = primaryLevel->Massacre (cheat == CHT_MASSACRE2);
|
int killcount = primaryLevel->Massacre (cheat == CHT_MASSACRE2);
|
||||||
// killough 3/22/98: make more intelligent about plural
|
// killough 3/22/98: make more intelligent about plural
|
||||||
// Ty 03/27/98 - string(s) *not* externalized
|
if (killcount == 1)
|
||||||
mysnprintf (msgbuild, countof(msgbuild), "%d %s%s Killed", killcount,
|
{
|
||||||
cheat==CHT_MASSACRE2 ? "Baddie" : "Monster", killcount==1 ? "" : "s");
|
msg = GStrings(cheat == CHT_MASSACRE? "TXT_MONSTER_KILLED" : "TXT_BADDIE_KILLED");
|
||||||
msg = msgbuild;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Note: Do not use the language string directly as a format template!
|
||||||
|
smsg = GStrings(cheat == CHT_MASSACRE? "TXT_MONSTERS_KILLED" : "TXT_BADDIES_KILLED");
|
||||||
|
FStringf countstr("%d", killcount);
|
||||||
|
smsg.Substitute("%d", countstr);
|
||||||
|
msg = smsg.GetChars();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -352,64 +359,64 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
{
|
{
|
||||||
if (player->mo->IsKindOf("PlayerChunk"))
|
if (player->mo->IsKindOf("PlayerChunk"))
|
||||||
{
|
{
|
||||||
Printf("Unable to resurrect. Player is no longer connected to its body.\n");
|
Printf("%s\n", GStrings("TXT_NO_RESURRECT"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player->Resurrect();
|
player->Resurrect();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEA:
|
case CHT_GIMMIEA:
|
||||||
cht_Give (player, "ArtiInvulnerability");
|
cht_Give (player, "ArtiInvulnerability");
|
||||||
msg = "Valador's Ring of Invunerability";
|
msg = GStrings("TAG_ARTIINVULNERABILITY");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEB:
|
case CHT_GIMMIEB:
|
||||||
cht_Give (player, "ArtiInvisibility");
|
cht_Give (player, "ArtiInvisibility");
|
||||||
msg = "Shadowsphere";
|
msg = GStrings("TAG_ARTIINVISIBILITY");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEC:
|
case CHT_GIMMIEC:
|
||||||
cht_Give (player, "ArtiHealth");
|
cht_Give (player, "ArtiHealth");
|
||||||
msg = "Quartz Flask";
|
msg = GStrings("TAG_ARTIHEALTH");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIED:
|
case CHT_GIMMIED:
|
||||||
cht_Give (player, "ArtiSuperHealth");
|
cht_Give (player, "ArtiSuperHealth");
|
||||||
msg = "Mystic Urn";
|
msg = GStrings("TAG_ARTISUPERHEALTH");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEE:
|
case CHT_GIMMIEE:
|
||||||
cht_Give (player, "ArtiTomeOfPower");
|
cht_Give (player, "ArtiTomeOfPower");
|
||||||
msg = "Tyketto's Tome of Power";
|
msg = GStrings("TAG_ARTITOMEOFPOWER");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEF:
|
case CHT_GIMMIEF:
|
||||||
cht_Give (player, "ArtiTorch");
|
cht_Give (player, "ArtiTorch");
|
||||||
msg = "Torch";
|
msg = GStrings("TAG_ARTITORCH");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEG:
|
case CHT_GIMMIEG:
|
||||||
cht_Give (player, "ArtiTimeBomb");
|
cht_Give (player, "ArtiTimeBomb");
|
||||||
msg = "Delmintalintar's Time Bomb of the Ancients";
|
msg = GStrings("TAG_ARTIFIREBOMB");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEH:
|
case CHT_GIMMIEH:
|
||||||
cht_Give (player, "ArtiEgg");
|
cht_Give (player, "ArtiEgg");
|
||||||
msg = "Torpol's Morph Ovum";
|
msg = GStrings("TAG_ARTIEGG");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEI:
|
case CHT_GIMMIEI:
|
||||||
cht_Give (player, "ArtiFly");
|
cht_Give (player, "ArtiFly");
|
||||||
msg = "Inhilicon's Wings of Wrath";
|
msg = GStrings("TAG_ARTIFLY");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEJ:
|
case CHT_GIMMIEJ:
|
||||||
cht_Give (player, "ArtiTeleport");
|
cht_Give (player, "ArtiTeleport");
|
||||||
msg = "Darchala's Chaos Device";
|
msg = GStrings("TAG_ARTITELEPORT");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_GIMMIEZ:
|
case CHT_GIMMIEZ:
|
||||||
|
@ -417,7 +424,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
{
|
{
|
||||||
cht_Give (player, "artifacts");
|
cht_Give (player, "artifacts");
|
||||||
}
|
}
|
||||||
msg = "All artifacts!";
|
msg = GStrings("TAG_ALL_ARTIFACTS");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_TAKEWEAPS:
|
case CHT_TAKEWEAPS:
|
||||||
|
@ -444,9 +451,10 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_MDK:
|
case CHT_MDK:
|
||||||
if (player->mo == NULL)
|
if (player->mo == nullptr)
|
||||||
{
|
{
|
||||||
Printf ("What do you want to kill outside of a game?\n");
|
Printf ("%s\n", GStrings("TXT_WHAT_KILL"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (!deathmatch)
|
else if (!deathmatch)
|
||||||
{
|
{
|
||||||
|
@ -512,7 +520,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
|
|
||||||
case CHT_CLEARFROZENPROPS:
|
case CHT_CLEARFROZENPROPS:
|
||||||
player->cheats &= ~(CF_FROZEN|CF_TOTALLYFROZEN);
|
player->cheats &= ~(CF_FROZEN|CF_TOTALLYFROZEN);
|
||||||
msg = "Frozen player properties turned off";
|
msg = GStrings("TXT_NOT_FROZEN");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_FREEZE:
|
case CHT_FREEZE:
|
||||||
|
@ -528,13 +536,17 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*msg) // [SO] Don't print blank lines!
|
if (!msg || !*msg) // [SO] Don't print blank lines!
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player == &players[consoleplayer])
|
if (player == &players[consoleplayer])
|
||||||
Printf ("%s\n", msg);
|
Printf ("%s\n", msg);
|
||||||
else if (cheat != CHT_CHASECAM)
|
else if (cheat != CHT_CHASECAM)
|
||||||
Printf ("%s cheats: %s\n", player->userinfo.GetName(), msg);
|
{
|
||||||
|
FString message = GStrings("TXT_X_CHEATS");
|
||||||
|
message.Substitute("%s", player->userinfo.GetName());
|
||||||
|
Printf("%s: %s\n", message.GetChars(), msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FString cht_Morph(player_t *player, PClassActor *morphclass, bool quickundo)
|
FString cht_Morph(player_t *player, PClassActor *morphclass, bool quickundo)
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
#include "gi.h"
|
#include "gi.h"
|
||||||
|
|
||||||
#include "gameconfigfile.h"
|
#include "gameconfigfile.h"
|
||||||
|
#include "gstrings.h"
|
||||||
|
|
||||||
FGameConfigFile *GameConfig;
|
FGameConfigFile *GameConfig;
|
||||||
|
|
||||||
|
@ -511,7 +512,7 @@ void WritePNGfile (FileWriter *file, const uint8_t *buffer, const PalEntry *pale
|
||||||
!M_AppendPNGText (file, "Software", software) ||
|
!M_AppendPNGText (file, "Software", software) ||
|
||||||
!M_FinishPNG (file))
|
!M_FinishPNG (file))
|
||||||
{
|
{
|
||||||
Printf ("Could not create screenshot.\n");
|
Printf ("%s\n", GStrings("TXT_SCREENSHOTERR"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
#include "scripting/types.h"
|
#include "scripting/types.h"
|
||||||
|
|
||||||
int DMenu::InMenu;
|
int DMenu::InMenu;
|
||||||
|
static ScaleOverrider *CurrentScaleOverrider;
|
||||||
//
|
//
|
||||||
// Todo: Move these elsewhere
|
// Todo: Move these elsewhere
|
||||||
//
|
//
|
||||||
|
@ -348,7 +349,7 @@ bool DMenu::TranslateKeyboardEvents()
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
void M_StartControlPanel (bool makeSound)
|
void M_StartControlPanel (bool makeSound, bool scaleoverride)
|
||||||
{
|
{
|
||||||
// intro might call this repeatedly
|
// intro might call this repeatedly
|
||||||
if (CurrentMenu != nullptr)
|
if (CurrentMenu != nullptr)
|
||||||
|
@ -372,6 +373,8 @@ void M_StartControlPanel (bool makeSound)
|
||||||
}
|
}
|
||||||
BackbuttonTime = 0;
|
BackbuttonTime = 0;
|
||||||
BackbuttonAlpha = 0;
|
BackbuttonAlpha = 0;
|
||||||
|
if (scaleoverride && !CurrentScaleOverrider) CurrentScaleOverrider = new ScaleOverrider;
|
||||||
|
else if (!scaleoverride && CurrentScaleOverrider) delete CurrentScaleOverrider;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -912,6 +915,8 @@ void M_ClearMenus()
|
||||||
CurrentMenu = parent;
|
CurrentMenu = parent;
|
||||||
}
|
}
|
||||||
menuactive = MENU_Off;
|
menuactive = MENU_Off;
|
||||||
|
if (CurrentScaleOverrider) delete CurrentScaleOverrider;
|
||||||
|
CurrentScaleOverrider = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
|
@ -347,7 +347,7 @@ void M_PreviousMenu ();
|
||||||
void M_ParseMenuDefs();
|
void M_ParseMenuDefs();
|
||||||
void M_StartupEpisodeMenu(FGameStartup *gs);
|
void M_StartupEpisodeMenu(FGameStartup *gs);
|
||||||
void M_StartupSkillMenu(FGameStartup *gs);
|
void M_StartupSkillMenu(FGameStartup *gs);
|
||||||
void M_StartControlPanel (bool makeSound);
|
void M_StartControlPanel (bool makeSound, bool scaleoverride = true);
|
||||||
void M_SetMenu(FName menu, int param = -1);
|
void M_SetMenu(FName menu, int param = -1);
|
||||||
void M_StartMessage(const char *message, int messagemode, FName action = NAME_None);
|
void M_StartMessage(const char *message, int messagemode, FName action = NAME_None);
|
||||||
DMenu *StartPickerMenu(DMenu *parent, const char *name, FColorCVar *cvar);
|
DMenu *StartPickerMenu(DMenu *parent, const char *name, FColorCVar *cvar);
|
||||||
|
|
|
@ -381,6 +381,7 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
||||||
I_SetMusicVolume (dlg_musicvolume);
|
I_SetMusicVolume (dlg_musicvolume);
|
||||||
S_Sound (npc, CHAN_VOICE|CHAN_NOPAUSE, CurNode->SpeakerVoice, 1, ATTN_NORM);
|
S_Sound (npc, CHAN_VOICE|CHAN_NOPAUSE, CurNode->SpeakerVoice, 1, ATTN_NORM);
|
||||||
}
|
}
|
||||||
|
M_StartControlPanel(false, true);
|
||||||
|
|
||||||
// Create the menu. This may be a user-defined class so check if it is good to use.
|
// Create the menu. This may be a user-defined class so check if it is good to use.
|
||||||
FName cls = CurNode->MenuClassName;
|
FName cls = CurNode->MenuClassName;
|
||||||
|
@ -405,7 +406,6 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
||||||
}
|
}
|
||||||
|
|
||||||
// And open the menu
|
// And open the menu
|
||||||
M_StartControlPanel (false);
|
|
||||||
M_ActivateMenu((DMenu*)cmenu);
|
M_ActivateMenu((DMenu*)cmenu);
|
||||||
menuactive = MENU_OnNoPause;
|
menuactive = MENU_OnNoPause;
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,9 +156,9 @@ void DFrameBuffer::DrawRateStuff ()
|
||||||
int textScale = active_con_scale();
|
int textScale = active_con_scale();
|
||||||
|
|
||||||
chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2llu ms (%3llu fps)", (unsigned long long)howlong, (unsigned long long)LastCount);
|
chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2llu ms (%3llu fps)", (unsigned long long)howlong, (unsigned long long)LastCount);
|
||||||
rate_x = Width / textScale - ConFont->StringWidth(&fpsbuff[0]);
|
rate_x = Width / textScale - NewConsoleFont->StringWidth(&fpsbuff[0]);
|
||||||
Clear (rate_x * textScale, 0, Width, ConFont->GetHeight() * textScale, GPalette.BlackIndex, 0);
|
Clear (rate_x * textScale, 0, Width, NewConsoleFont->GetHeight() * textScale, GPalette.BlackIndex, 0);
|
||||||
DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0],
|
DrawText (NewConsoleFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0],
|
||||||
DTA_VirtualWidth, screen->GetWidth() / textScale,
|
DTA_VirtualWidth, screen->GetWidth() / textScale,
|
||||||
DTA_VirtualHeight, screen->GetHeight() / textScale,
|
DTA_VirtualHeight, screen->GetHeight() / textScale,
|
||||||
DTA_KeepRatio, true, TAG_DONE);
|
DTA_KeepRatio, true, TAG_DONE);
|
||||||
|
|
|
@ -436,7 +436,7 @@ class PoisonCloud : Actor
|
||||||
Mass 0x7fffffff;
|
Mass 0x7fffffff;
|
||||||
+NOBLOCKMAP +NOGRAVITY +DROPOFF
|
+NOBLOCKMAP +NOGRAVITY +DROPOFF
|
||||||
+NODAMAGETHRUST
|
+NODAMAGETHRUST
|
||||||
+DONTSPLASH +FOILINVUL +CANBLAST +BLOODLESSIMPACT +BLOCKEDBYSOLIDACTORS +FORCEZERORADIUSDMG
|
+DONTSPLASH +FOILINVUL +CANBLAST +BLOODLESSIMPACT +BLOCKEDBYSOLIDACTORS +FORCEZERORADIUSDMG +OLDRADIUSDMG
|
||||||
RenderStyle "Translucent";
|
RenderStyle "Translucent";
|
||||||
Alpha 0.6;
|
Alpha 0.6;
|
||||||
DeathSound "PoisonShroomDeath";
|
DeathSound "PoisonShroomDeath";
|
||||||
|
|
|
@ -49,9 +49,6 @@ extend class PlayerPawn
|
||||||
Class<Inventory> type;
|
Class<Inventory> type;
|
||||||
let player = self.player;
|
let player = self.player;
|
||||||
|
|
||||||
if (PlayerNumber() != consoleplayer)
|
|
||||||
A_Log(String.Format ("%s is a cheater: give %s\n", player.GetUserName(), name));
|
|
||||||
|
|
||||||
if (player.mo == NULL || player.health <= 0)
|
if (player.mo == NULL || player.health <= 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -82,6 +82,7 @@ class ConversationMenu : Menu
|
||||||
PlayerInfo mPlayer;
|
PlayerInfo mPlayer;
|
||||||
int mSelection;
|
int mSelection;
|
||||||
int ConversationPauseTic;
|
int ConversationPauseTic;
|
||||||
|
int LineHeight;
|
||||||
|
|
||||||
int SpeechWidth;
|
int SpeechWidth;
|
||||||
int ReplyWidth;
|
int ReplyWidth;
|
||||||
|
@ -107,6 +108,7 @@ class ConversationMenu : Menu
|
||||||
|
|
||||||
ReplyWidth = 320-50-10;
|
ReplyWidth = 320-50-10;
|
||||||
SpeechWidth = screen.GetWidth()/CleanXfac - 24*2;
|
SpeechWidth = screen.GetWidth()/CleanXfac - 24*2;
|
||||||
|
LineHeight = SmallFont.GetHeight();
|
||||||
|
|
||||||
FormatSpeakerMessage();
|
FormatSpeakerMessage();
|
||||||
return FormatReplies(activereply);
|
return FormatReplies(activereply);
|
||||||
|
@ -174,8 +176,8 @@ class ConversationMenu : Menu
|
||||||
mResponseLines.Push(goodbyestr);
|
mResponseLines.Push(goodbyestr);
|
||||||
|
|
||||||
// Determine where the top of the reply list should be positioned.
|
// Determine where the top of the reply list should be positioned.
|
||||||
mYpos = MIN (140, 192 - mResponseLines.Size() * OptionMenuSettings.mLinespacing);
|
mYpos = MIN (140, 192 - mResponseLines.Size() * LineHeight);
|
||||||
i = 44 + mResponseLines.Size() * OptionMenuSettings.mLinespacing;
|
i = 44 + mResponseLines.Size() * LineHeight;
|
||||||
if (mYpos - 100 < i - screen.GetHeight() / CleanYfac / 2)
|
if (mYpos - 100 < i - screen.GetHeight() / CleanYfac / 2)
|
||||||
{
|
{
|
||||||
mYpos = i - screen.GetHeight() / CleanYfac / 2 + 100;
|
mYpos = i - screen.GetHeight() / CleanYfac / 2 + 100;
|
||||||
|
@ -305,7 +307,7 @@ class ConversationMenu : Menu
|
||||||
override bool MouseEvent(int type, int x, int y)
|
override bool MouseEvent(int type, int x, int y)
|
||||||
{
|
{
|
||||||
int sel = -1;
|
int sel = -1;
|
||||||
int fh = OptionMenuSettings.mLinespacing;
|
int fh = LineHeight;
|
||||||
|
|
||||||
// convert x/y from screen to virtual coordinates, according to CleanX/Yfac use in DrawTexture
|
// convert x/y from screen to virtual coordinates, according to CleanX/Yfac use in DrawTexture
|
||||||
x = ((x - (screen.GetWidth() / 2)) / CleanXfac) + 160;
|
x = ((x - (screen.GetWidth() / 2)) / CleanXfac) + 160;
|
||||||
|
@ -382,7 +384,7 @@ class ConversationMenu : Menu
|
||||||
virtual void DrawSpeakerText(bool dimbg)
|
virtual void DrawSpeakerText(bool dimbg)
|
||||||
{
|
{
|
||||||
String speakerName;
|
String speakerName;
|
||||||
int linesize = OptionMenuSettings.mLinespacing * CleanYfac;
|
int linesize = LineHeight * CleanYfac;
|
||||||
int cnt = mDialogueLines.Count();
|
int cnt = mDialogueLines.Count();
|
||||||
|
|
||||||
// Who is talking to you?
|
// Who is talking to you?
|
||||||
|
@ -434,10 +436,10 @@ class ConversationMenu : Menu
|
||||||
{
|
{
|
||||||
// Dim the screen behind the PC's choices.
|
// Dim the screen behind the PC's choices.
|
||||||
screen.Dim(0, 0.45, (24 - 160) * CleanXfac + screen.GetWidth() / 2, (mYpos - 2 - 100) * CleanYfac + screen.GetHeight() / 2,
|
screen.Dim(0, 0.45, (24 - 160) * CleanXfac + screen.GetWidth() / 2, (mYpos - 2 - 100) * CleanYfac + screen.GetHeight() / 2,
|
||||||
272 * CleanXfac, MIN(mResponseLines.Size() * OptionMenuSettings.mLinespacing + 4, 200 - mYpos) * CleanYfac);
|
272 * CleanXfac, MIN(mResponseLines.Size() * LineHeight + 4, 200 - mYpos) * CleanYfac);
|
||||||
|
|
||||||
int y = mYpos;
|
int y = mYpos;
|
||||||
int fontheight = OptionMenuSettings.mLinespacing;
|
int fontheight = LineHeight;
|
||||||
|
|
||||||
int response = 0;
|
int response = 0;
|
||||||
for (int i = 0; i < mResponseLines.Size(); i++)
|
for (int i = 0; i < mResponseLines.Size(); i++)
|
||||||
|
|
|
@ -285,7 +285,7 @@ class Menu : Object native ui version("2.4")
|
||||||
|
|
||||||
static void DrawConText (int color, int x, int y, String str)
|
static void DrawConText (int color, int x, int y, String str)
|
||||||
{
|
{
|
||||||
screen.DrawText (ConFont, color, x, y, str, DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac);
|
screen.DrawText (ConFont, color, x, y, str, DTA_CellX, 16 * CleanXfac_1, DTA_CellY, 16 * CleanYfac_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int OptionColor(int color)
|
static int OptionColor(int color)
|
||||||
|
|
|
@ -744,13 +744,13 @@ class OptionMenuSliderBase : OptionMenuItem
|
||||||
if (!mSliderShort)
|
if (!mSliderShort)
|
||||||
{
|
{
|
||||||
Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12");
|
Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12");
|
||||||
Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 78) / range)) * CleanXfac_1), cy, "\x13");
|
Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 78) / range)) * 2 * CleanXfac_1), cy, "\x13");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// On 320x200 we need a shorter slider
|
// On 320x200 we need a shorter slider
|
||||||
Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x12");
|
Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x12");
|
||||||
Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 38) / range)) * CleanXfac_1), cy, "\x13");
|
Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 38) / range)) * 2 * CleanXfac_1), cy, "\x13");
|
||||||
right -= 5*8*CleanXfac;
|
right -= 5*8*CleanXfac;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue