mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- added 'startuptype' to iwadinfo, allowing to change the game startup screen with custom iwads
This commit is contained in:
parent
30c6cf82ca
commit
4fb355d8da
2 changed files with 34 additions and 18 deletions
|
@ -182,6 +182,21 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
|
|||
sc.MustGetString();
|
||||
iwad->Required = sc.String;
|
||||
}
|
||||
else if (sc.Compare("StartupType"))
|
||||
{
|
||||
sc.MustGetStringName("=");
|
||||
sc.MustGetString();
|
||||
FString sttype = sc.String;
|
||||
if (!sttype.CompareNoCase("DOOM"))
|
||||
iwad->StartupType = FStartupInfo::DoomStartup;
|
||||
else if (!sttype.CompareNoCase("HERETIC"))
|
||||
iwad->StartupType = FStartupInfo::HereticStartup;
|
||||
else if (!sttype.CompareNoCase("HEXEN"))
|
||||
iwad->StartupType = FStartupInfo::HexenStartup;
|
||||
else if (!sttype.CompareNoCase("STRIFE"))
|
||||
iwad->StartupType = FStartupInfo::StrifeStartup;
|
||||
else iwad->StartupType = FStartupInfo::DefaultStartup;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.ScriptError("Unknown keyword '%s'", sc.String);
|
||||
|
@ -739,6 +754,7 @@ const FIWADInfo *FIWadManager::FindIWAD(TArray<FString> &wadfiles, const char *i
|
|||
DoomStartupInfo.BkColor = iwad_info->BkColor;
|
||||
DoomStartupInfo.FgColor = iwad_info->FgColor;
|
||||
}
|
||||
if (DoomStartupInfo.Type == 0) DoomStartupInfo.Type = iwad_info->StartupType;
|
||||
I_SetIWADInfo();
|
||||
return iwad_info;
|
||||
}
|
||||
|
|
36
src/d_main.h
36
src/d_main.h
|
@ -74,6 +74,23 @@ struct WadStuff
|
|||
FString Name;
|
||||
};
|
||||
|
||||
struct FStartupInfo
|
||||
{
|
||||
FString Name;
|
||||
uint32_t FgColor; // Foreground color for title banner
|
||||
uint32_t BkColor; // Background color for title banner
|
||||
FString Song;
|
||||
int Type;
|
||||
enum
|
||||
{
|
||||
DefaultStartup,
|
||||
DoomStartup,
|
||||
HereticStartup,
|
||||
HexenStartup,
|
||||
StrifeStartup,
|
||||
};
|
||||
};
|
||||
|
||||
struct FIWADInfo
|
||||
{
|
||||
FString Name; // Title banner text for this IWAD
|
||||
|
@ -85,6 +102,7 @@ struct FIWADInfo
|
|||
uint32_t FgColor = 0; // Foreground color for title banner
|
||||
uint32_t BkColor = 0xc0c0c0; // Background color for title banner
|
||||
EGameType gametype = GAME_Doom; // which game are we playing?
|
||||
int StartupType = FStartupInfo::DefaultStartup; // alternate startup type
|
||||
FString MapInfo; // Base mapinfo to load
|
||||
TArray<FString> Load; // Wads to be loaded with this one.
|
||||
TArray<FString> Lumps; // Lump names for identification
|
||||
|
@ -104,24 +122,6 @@ struct FFoundWadInfo
|
|||
}
|
||||
};
|
||||
|
||||
struct FStartupInfo
|
||||
{
|
||||
FString Name;
|
||||
uint32_t FgColor; // Foreground color for title banner
|
||||
uint32_t BkColor; // Background color for title banner
|
||||
FString Song;
|
||||
int Type;
|
||||
enum
|
||||
{
|
||||
DefaultStartup,
|
||||
DoomStartup,
|
||||
HereticStartup,
|
||||
HexenStartup,
|
||||
StrifeStartup,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
extern FStartupInfo DoomStartupInfo;
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue