mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-18 21:21:36 +00:00
- Added actor replacement for DECORATE. This works at a higher level than
using duplicate DoomEdNums and will affect all attempts to spawn the replaced actor. However, because this happens for all spawns and not just at map load, the replacing actor must be compatible with the replaced actor, which means that an actor can only serve as a replacement for one of its baseclasses. For example, if you want to use a modified imp, you can use this DECORATE: actor MyImp : DoomImp replaces DoompImp { // Put changed properties here } - New: The IWAD dialog now remembers the last IWAD you picked and automatically highlights it the next time you run the game. This also applies if you check "Don't ask me this again": The IWAD selected will be the one that gets automatically loaded, not the one located first. (Using the -iwad parameter will not change the default IWAD.) In addition, you can now bring the dialog up even if you disable it by holding down SHIFT during startup. - Changed ExtractFilePath() and ExtractFileBase() to return FStrings instead of writing to a provided output buffer. ExtractFileBase() can also optionally keep the file's extension in the result. - Removed the -heapsize parameter entirely. The informational message should no longer be needed. - Removed -maxdemo parameter. There's no point to having it around since the demo buffer grows automatically. SVN r238 (trunk)
This commit is contained in:
parent
43c1ec4a74
commit
6695e255ce
20 changed files with 449 additions and 307 deletions
|
@ -1,3 +1,30 @@
|
|||
July 7, 2006
|
||||
- Added actor replacement for DECORATE. This works at a higher level than
|
||||
using duplicate DoomEdNums and will affect all attempts to spawn the
|
||||
replaced actor. However, because this happens for all spawns and not just
|
||||
at map load, the replacing actor must be compatible with the replaced
|
||||
actor, which means that an actor can only serve as a replacement for one
|
||||
of its baseclasses. For example, if you want to use a modified imp, you can
|
||||
use this DECORATE:
|
||||
actor MyImp : DoomImp replaces DoompImp
|
||||
{
|
||||
// Put changed properties here
|
||||
}
|
||||
- New: The IWAD dialog now remembers the last IWAD you picked and
|
||||
automatically highlights it the next time you run the game. This also
|
||||
applies if you check "Don't ask me this again": The IWAD selected will be
|
||||
the one that gets automatically loaded, not the one located first. (Using
|
||||
the -iwad parameter will not change the default IWAD.) In addition, you
|
||||
can now bring the dialog up even if you disable it by holding down SHIFT
|
||||
during startup.
|
||||
- Changed ExtractFilePath() and ExtractFileBase() to return FStrings instead
|
||||
of writing to a provided output buffer. ExtractFileBase() can also
|
||||
optionally keep the file's extension in the result.
|
||||
- Removed the -heapsize parameter entirely. The informational message should
|
||||
no longer be needed.
|
||||
- Removed -maxdemo parameter. There's no point to having it around since
|
||||
the demo buffer grows automatically.
|
||||
|
||||
July 3, 2006 (Changes by Graf Zahl)
|
||||
- Fixed: Changed initialization of Weapon.Kickback so that it is only done
|
||||
for direct descendants of AWeapon and not for every weapon being defined.
|
||||
|
|
|
@ -474,12 +474,13 @@ CCMD (error_fatal)
|
|||
|
||||
CCMD (dir)
|
||||
{
|
||||
char dir[256], curdir[256];
|
||||
char *match;
|
||||
FString dir;
|
||||
char curdir[256];
|
||||
const char *match;
|
||||
findstate_t c_file;
|
||||
void *file;
|
||||
|
||||
if (!getcwd (curdir, 256))
|
||||
if (!getcwd (curdir, countof(curdir)))
|
||||
{
|
||||
Printf ("Current path too long\n");
|
||||
return;
|
||||
|
@ -487,21 +488,21 @@ CCMD (dir)
|
|||
|
||||
if (argv.argc() == 1 || chdir (argv[1]))
|
||||
{
|
||||
match = argv.argc() == 1 ? (char *)"./*" : argv[1];
|
||||
match = argv.argc() == 1 ? "./*" : argv[1];
|
||||
|
||||
ExtractFilePath (match, dir);
|
||||
if (dir[0])
|
||||
dir = ExtractFilePath (match);
|
||||
if (dir[0] != '\0')
|
||||
{
|
||||
match += strlen (dir);
|
||||
match += dir.Len();
|
||||
}
|
||||
else
|
||||
{
|
||||
dir[0] = '.';
|
||||
dir[1] = '/';
|
||||
dir[2] = '\0';
|
||||
dir = "./";
|
||||
}
|
||||
if (!match[0])
|
||||
if (match[0] == '\0')
|
||||
{
|
||||
match = "*";
|
||||
}
|
||||
|
||||
if (chdir (dir))
|
||||
{
|
||||
|
@ -512,9 +513,11 @@ CCMD (dir)
|
|||
else
|
||||
{
|
||||
match = "*";
|
||||
strcpy (dir, argv[1]);
|
||||
if (dir[strlen(dir) - 1] != '/')
|
||||
strcat (dir, "/");
|
||||
dir = argv[1];
|
||||
if (dir[dir.Len()-1] != '/')
|
||||
{
|
||||
dir += '/';
|
||||
}
|
||||
}
|
||||
|
||||
if ( (file = I_FindFirst (match, &c_file)) == ((void *)(-1)))
|
||||
|
|
|
@ -166,7 +166,7 @@ Extract file parts
|
|||
*/
|
||||
// FIXME: should include the slash, otherwise
|
||||
// backing to an empty path will be wrong when appending a slash
|
||||
void ExtractFilePath (const char *path, char *dest)
|
||||
FString ExtractFilePath (const char *path)
|
||||
{
|
||||
const char *src;
|
||||
|
||||
|
@ -178,13 +178,12 @@ void ExtractFilePath (const char *path, char *dest)
|
|||
while (src != path && !IsSeperator(*(src-1)))
|
||||
src--;
|
||||
|
||||
memcpy (dest, path, src-path);
|
||||
dest[src-path] = 0;
|
||||
return FString(path, src - path);
|
||||
}
|
||||
|
||||
void ExtractFileBase (const char *path, char *dest)
|
||||
FString ExtractFileBase (const char *path, bool include_extension)
|
||||
{
|
||||
const char *src;
|
||||
const char *src, *dot;
|
||||
|
||||
src = path + strlen(path) - 1;
|
||||
|
||||
|
@ -203,12 +202,21 @@ void ExtractFileBase (const char *path, char *dest)
|
|||
}
|
||||
#endif
|
||||
|
||||
while (*src && *src != '.')
|
||||
if (!include_extension)
|
||||
{
|
||||
*dest++ = *src++;
|
||||
dot = src;
|
||||
while (*dot && *dot != '.')
|
||||
{
|
||||
dot++;
|
||||
}
|
||||
return FString(src, dot - src);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FString(src);
|
||||
}
|
||||
}
|
||||
*dest = 0;
|
||||
return FString();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ void FixPathSeperator (char *path);
|
|||
void DefaultExtension (char *path, const char *extension);
|
||||
void DefaultExtension (FString &path, const char *extension);
|
||||
|
||||
void ExtractFilePath (const char *path, char *dest);
|
||||
void ExtractFileBase (const char *path, char *dest);
|
||||
FString ExtractFilePath (const char *path);
|
||||
FString ExtractFileBase (const char *path, bool keep_extension=false);
|
||||
|
||||
int ParseHex (char *str);
|
||||
int ParseNum (char *str);
|
||||
|
|
|
@ -2105,11 +2105,8 @@ void DoDehPatch (const char *patchfile, BOOL autoloading)
|
|||
if (!PatchFile)
|
||||
{
|
||||
// Couldn't find it on disk, try reading it from a lump
|
||||
strcpy (file, patchfile);
|
||||
FixPathSeperator (file);
|
||||
ExtractFileBase (file, file);
|
||||
file[8] = 0;
|
||||
lump = Wads.CheckNumForName (file);
|
||||
FString filebase(ExtractFileBase (patchfile));
|
||||
lump = Wads.CheckNumForName (filebase);
|
||||
if (lump >= 0)
|
||||
{
|
||||
filelen = Wads.LumpLength (lump);
|
||||
|
|
|
@ -151,6 +151,7 @@ extern cycle_t WallCycles, PlaneCycles, MaskedCycles, WallScanCycles;
|
|||
CVAR (Int, fraglimit, 0, CVAR_SERVERINFO);
|
||||
CVAR (Float, timelimit, 0.f, CVAR_SERVERINFO);
|
||||
CVAR (Bool, queryiwad, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||
CVAR (String, defaultiwad, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||
CVAR (Int, wipetype, 1, CVAR_ARCHIVE);
|
||||
|
||||
bool DrawFSHUD; // [RH] Draw fullscreen HUD?
|
||||
|
@ -1595,15 +1596,36 @@ static EIWADType IdentifyVersion (const char *zdoom_wad)
|
|||
"Did you install ZDoom properly? You can do either of the following:\n"
|
||||
"\n"
|
||||
"1. Place one or more of these wads in the same directory as ZDoom.\n"
|
||||
"2. Edit your zdoom.ini and add the directories of your iwads\n"
|
||||
"2. Edit your zdoom-username.ini and add the directories of your iwads\n"
|
||||
"to the list beneath [IWADSearch.Directories]");
|
||||
}
|
||||
|
||||
pickwad = 0;
|
||||
|
||||
if (!iwadparmfound && numwads > 1 && queryiwad)
|
||||
if (!iwadparmfound && numwads > 1)
|
||||
{
|
||||
pickwad = I_PickIWad (wads, (int)numwads);
|
||||
int defiwad = 0;
|
||||
|
||||
// Locate the user's prefered IWAD, if it was found.
|
||||
if (defaultiwad[0] != '\0')
|
||||
{
|
||||
for (i = 0; i < numwads; ++i)
|
||||
{
|
||||
FString basename = ExtractFileBase (wads[i].Path);
|
||||
if (stricmp (basename, defaultiwad) == 0)
|
||||
{
|
||||
defiwad = (int)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pickwad = I_PickIWad (wads, (int)numwads, queryiwad, defiwad);
|
||||
if (pickwad >= 0)
|
||||
{
|
||||
// The newly selected IWAD becomes the new default
|
||||
FString basename = ExtractFileBase (wads[pickwad].Path);
|
||||
defaultiwad = basename;
|
||||
}
|
||||
}
|
||||
|
||||
if (pickwad < 0)
|
||||
|
@ -2204,13 +2226,6 @@ void D_DoomMain (void)
|
|||
// about to begin the game.
|
||||
FBaseCVar::EnableNoSet ();
|
||||
|
||||
// [RH] Print an informative message if -heapsize is used
|
||||
if (Args.CheckParm ("-heapsize"))
|
||||
{
|
||||
Printf (TEXTCOLOR_ORANGE "Starting with -heapsize is unnecessary.\n"
|
||||
TEXTCOLOR_ORANGE "The zone heap is not used anymore.\n");
|
||||
}
|
||||
|
||||
// [RH] Run any saved commands from the command line or autoexec.cfg now.
|
||||
gamestate = GS_FULLCONSOLE;
|
||||
Net_NewMakeTic ();
|
||||
|
|
|
@ -208,6 +208,7 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size)
|
|||
info->DoomEdNum = -1;
|
||||
info->OwnedStates = NULL;
|
||||
info->NumOwnedStates = 0;
|
||||
info->Replacement = NULL;
|
||||
m_RuntimeActors.Push (type);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -2150,9 +2150,6 @@ void G_RecordDemo (char* name)
|
|||
FixPathSeperator (demoname);
|
||||
DefaultExtension (demoname, ".lmp");
|
||||
v = Args.CheckValue ("-maxdemo");
|
||||
if (v)
|
||||
maxdemosize = atoi(v)*1024;
|
||||
if (maxdemosize < 0x20000)
|
||||
maxdemosize = 0x20000;
|
||||
demobuffer = (byte *)M_Malloc (maxdemosize);
|
||||
|
||||
|
|
|
@ -143,11 +143,17 @@ AInventory *AAmmo::CreateCopy (AActor *other)
|
|||
if (GetClass()->ParentClass != RUNTIME_CLASS(AAmmo))
|
||||
{
|
||||
const PClass *type = GetParentAmmo();
|
||||
assert (type->ActorInfo != NULL);
|
||||
FActorInfo *replacesave = type->ActorInfo->Replacement;
|
||||
if (!GoAway ())
|
||||
{
|
||||
Destroy ();
|
||||
}
|
||||
// If the base ammo class has a replacement defined, the replacement
|
||||
// must not be used in the inventory.
|
||||
type->ActorInfo->Replacement = NULL;
|
||||
copy = static_cast<AInventory *>(Spawn (type, 0, 0, 0));
|
||||
type->ActorInfo->Replacement = replacesave;
|
||||
copy->Amount = amount;
|
||||
copy->BecomeItem ();
|
||||
}
|
||||
|
|
15
src/info.cpp
15
src/info.cpp
|
@ -306,6 +306,21 @@ void FActorInfo::StaticSpeedSet ()
|
|||
}
|
||||
}
|
||||
|
||||
FActorInfo *FActorInfo::GetReplacement ()
|
||||
{
|
||||
if (Replacement == NULL)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
// The Replacement field is temporarily NULLed to prevent
|
||||
// potential infinite recursion.
|
||||
FActorInfo *savedrep = Replacement;
|
||||
Replacement = NULL;
|
||||
FActorInfo *rep = savedrep->GetReplacement ();
|
||||
Replacement = savedrep;
|
||||
return rep;
|
||||
}
|
||||
|
||||
FDoomEdMap DoomEdMap;
|
||||
|
||||
FDoomEdMap::FDoomEdEntry *FDoomEdMap::DoomEdHash[DOOMED_HASHSIZE];
|
||||
|
|
|
@ -374,9 +374,11 @@ struct FActorInfo
|
|||
void BuildDefaults ();
|
||||
void ApplyDefaults (BYTE *defaults);
|
||||
void RegisterIDs ();
|
||||
FActorInfo *GetReplacement ();
|
||||
|
||||
PClass *Class;
|
||||
FState *OwnedStates;
|
||||
FActorInfo *Replacement;
|
||||
int NumOwnedStates;
|
||||
BYTE GameFilter;
|
||||
BYTE SpawnID;
|
||||
|
|
|
@ -173,12 +173,12 @@ public:
|
|||
|
||||
#define BEGIN_DEFAULTS(actor,game,ednum,spawnid) \
|
||||
BEGIN_DEFAULTS_PRE(actor) \
|
||||
RUNTIME_CLASS(actor), &actor::States[0], countof(actor::States), \
|
||||
RUNTIME_CLASS(actor), &actor::States[0], NULL, countof(actor::States), \
|
||||
BEGIN_DEFAULTS_POST(actor,game,ednum,spawnid)
|
||||
|
||||
#define BEGIN_STATELESS_DEFAULTS(actor,game,ednum,spawnid) \
|
||||
BEGIN_DEFAULTS_PRE(actor) \
|
||||
RUNTIME_CLASS(actor), NULL, 0, \
|
||||
RUNTIME_CLASS(actor), NULL, NULL, 0, \
|
||||
BEGIN_DEFAULTS_POST(actor,game,ednum,spawnid)
|
||||
|
||||
// IMPLEMENT_ACTOR combines IMPLEMENT_CLASS and BEGIN_DEFAULTS
|
||||
|
|
|
@ -785,6 +785,7 @@ AInventory *AActor::FindInventory (const PClass *type) const
|
|||
{
|
||||
AInventory *item;
|
||||
|
||||
assert (type->ActorInfo != NULL);
|
||||
for (item = Inventory; item != NULL; item = item->Inventory)
|
||||
{
|
||||
if (item->GetClass() == type)
|
||||
|
@ -792,6 +793,21 @@ AInventory *AActor::FindInventory (const PClass *type) const
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (item == NULL && type->ActorInfo->Replacement != NULL)
|
||||
{ // Try again with a replacement type
|
||||
PClass *newtype = type->ActorInfo->GetReplacement()->Class;
|
||||
|
||||
if (newtype != type)
|
||||
{
|
||||
for (item = Inventory; item != NULL; item = item->Inventory)
|
||||
{
|
||||
if (item->GetClass() == newtype)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -3018,6 +3034,9 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
I_Error ("%s is not an actor\n", type->TypeName.GetChars());
|
||||
}
|
||||
|
||||
// Handle decorate replacements.
|
||||
type = type->ActorInfo->GetReplacement()->Class;
|
||||
|
||||
AActor *actor;
|
||||
|
||||
actor = static_cast<AActor *>(const_cast<PClass *>(type)->CreateNew ());
|
||||
|
|
|
@ -110,7 +110,6 @@ void SC_OpenFile (const char *name)
|
|||
ScriptSize = M_ReadFile (name, &filebuf);
|
||||
ScriptBuffer = (char *)filebuf;
|
||||
ScriptName = name; // This is used for error messages so the full file name is preferable
|
||||
//ExtractFileBase (name, ScriptName);
|
||||
FreeScript = true;
|
||||
SC_PrepareScript ();
|
||||
}
|
||||
|
|
|
@ -350,9 +350,7 @@ void I_PrintStr (const char *cp, bool scroll)
|
|||
fflush (stdout);
|
||||
}
|
||||
|
||||
EXTERN_CVAR (Bool, queryiwad)
|
||||
|
||||
int I_PickIWad (WadStuff *wads, int numwads)
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool queryiwad, int defaultiwad)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ void I_PrintStr (const char *str, bool scroll);
|
|||
void I_SetTitleString (const char *title);
|
||||
|
||||
// Pick from multiple IWADs to use
|
||||
int I_PickIWad (WadStuff *wads, int numwads);
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool queryiwad, int defaultiwad);
|
||||
|
||||
// [RH] Returns millisecond-accurate time
|
||||
unsigned int I_MSTime (void);
|
||||
|
|
|
@ -1213,6 +1213,7 @@ static FActorInfo * CreateNewActor(FActorInfo ** parentc, Baggage *bag)
|
|||
{
|
||||
FName typeName;
|
||||
|
||||
// Get actor name
|
||||
SC_MustGetString();
|
||||
|
||||
char * colon = strchr(sc_String, ':');
|
||||
|
@ -1286,6 +1287,35 @@ static FActorInfo * CreateNewActor(FActorInfo ** parentc, Baggage *bag)
|
|||
|
||||
info->DoomEdNum = -1;
|
||||
|
||||
// Check for "replaces"
|
||||
SC_MustGetString ();
|
||||
if (SC_Compare ("replaces"))
|
||||
{
|
||||
const PClass *replacee;
|
||||
|
||||
// Get actor name
|
||||
SC_MustGetString ();
|
||||
replacee = PClass::FindClass (sc_String);
|
||||
|
||||
if (replacee == NULL)
|
||||
{
|
||||
SC_ScriptError ("Replaced type '%s' not found", sc_String);
|
||||
}
|
||||
else if (replacee->ActorInfo == NULL)
|
||||
{
|
||||
SC_ScriptError ("Replaced type '%s' is not an actor", sc_String);
|
||||
}
|
||||
else if (!ti->IsDescendantOf (replacee))
|
||||
{
|
||||
SC_ScriptError ("'%s' must be derived from '%s' to replace it", typeName.GetChars(), sc_String);
|
||||
}
|
||||
replacee->ActorInfo->Replacement = ti->ActorInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
SC_UnGet();
|
||||
}
|
||||
|
||||
// Now, after the actor names have been parsed, it is time to switch to C-mode
|
||||
// for the rest of the actor definition.
|
||||
SC_SetCMode (true);
|
||||
|
|
|
@ -655,13 +655,11 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
|
|||
}
|
||||
else
|
||||
{ // This is just a single lump file
|
||||
char name[PATH_MAX];
|
||||
|
||||
fileinfo2free = NULL;
|
||||
fileinfo = &singleinfo;
|
||||
singleinfo.FilePos = 0;
|
||||
singleinfo.Size = LittleLong(wadinfo->GetLength());
|
||||
ExtractFileBase (filename, name);
|
||||
FString name(ExtractFileBase (filename));
|
||||
uppercopy(singleinfo.Name, name);
|
||||
NumLumps++;
|
||||
}
|
||||
|
|
|
@ -569,7 +569,11 @@ void I_PrintStr (const char *cp, bool lineBreak)
|
|||
char buf[256];
|
||||
int bpos = 0;
|
||||
|
||||
SendMessage (edit, EM_SETSEL, (WPARAM)-1, 0);
|
||||
int selstart, selend;
|
||||
SendMessage (edit, EM_GETSEL, (WPARAM)&selstart, (LPARAM)&selend);
|
||||
|
||||
// SendMessage (edit, EM_SETSEL, (WPARAM)-1, 0);
|
||||
SendMessage (edit, EM_SETSEL, INT_MAX, INT_MAX);
|
||||
|
||||
if (lineBreak && !newLine)
|
||||
{
|
||||
|
@ -608,23 +612,35 @@ void I_PrintStr (const char *cp, bool lineBreak)
|
|||
SendMessage (edit, EM_REPLACESEL, FALSE, (LPARAM)buf);
|
||||
newLine = buf[bpos-1] == '\n';
|
||||
}
|
||||
SendMessage (edit, EM_SETSEL, selstart, selend);
|
||||
}
|
||||
|
||||
EXTERN_CVAR (Bool, queryiwad);
|
||||
static WadStuff *WadList;
|
||||
static int NumWads;
|
||||
static int DefaultWad;
|
||||
|
||||
static void SetQueryIWad (HWND dialog)
|
||||
{
|
||||
HWND checkbox = GetDlgItem (dialog, IDC_DONTASKIWAD);
|
||||
int state = SendMessage (checkbox, BM_GETCHECK, 0, 0);
|
||||
bool query = (state != BST_CHECKED);
|
||||
|
||||
queryiwad = (state != BST_CHECKED);
|
||||
if (!query && queryiwad)
|
||||
{
|
||||
MessageBox (dialog,
|
||||
"You have chosen not to show this dialog box in the future.\n"
|
||||
"If you wish to see it again, hold down SHIFT while starting " GAMENAME ".",
|
||||
"Don't ask me this again",
|
||||
MB_OK | MB_ICONINFORMATION);
|
||||
}
|
||||
|
||||
queryiwad = query;
|
||||
}
|
||||
|
||||
BOOL CALLBACK IWADBoxCallback (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND list;
|
||||
HWND ctrl;
|
||||
int i;
|
||||
|
||||
switch (message)
|
||||
|
@ -640,7 +656,7 @@ BOOL CALLBACK IWADBoxCallback (HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
|
|||
SetWindowText (hDlg, newlabel.GetChars());
|
||||
}
|
||||
// Populate the list with all the IWADs found
|
||||
list = GetDlgItem (hDlg, IDC_IWADLIST);
|
||||
ctrl = GetDlgItem (hDlg, IDC_IWADLIST);
|
||||
for (i = 0; i < NumWads; i++)
|
||||
{
|
||||
FString work;
|
||||
|
@ -650,11 +666,17 @@ BOOL CALLBACK IWADBoxCallback (HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
|
|||
else
|
||||
filepart++;
|
||||
work.Format ("%s (%s)", IWADTypeNames[WadList[i].Type], filepart);
|
||||
SendMessage (list, LB_ADDSTRING, 0, (LPARAM)work.GetChars());
|
||||
SendMessage (list, LB_SETITEMDATA, i, (LPARAM)i);
|
||||
SendMessage (ctrl, LB_ADDSTRING, 0, (LPARAM)work.GetChars());
|
||||
SendMessage (ctrl, LB_SETITEMDATA, i, (LPARAM)i);
|
||||
}
|
||||
SendMessage (list, LB_SETCURSEL, 0, 0);
|
||||
SetFocus (list);
|
||||
SendMessage (ctrl, LB_SETCURSEL, DefaultWad, 0);
|
||||
SetFocus (ctrl);
|
||||
// Set the state of the "Don't ask me again" checkbox
|
||||
ctrl = GetDlgItem (hDlg, IDC_DONTASKIWAD);
|
||||
SendMessage (ctrl, BM_SETCHECK, queryiwad ? BST_UNCHECKED : BST_CHECKED, 0);
|
||||
// Make sure the dialog is in front. If SHIFT was pressed to force it visible,
|
||||
// then the other window will normally be on top.
|
||||
SetForegroundWindow (hDlg);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
@ -666,22 +688,27 @@ BOOL CALLBACK IWADBoxCallback (HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
|
|||
(LOWORD(wParam) == IDC_IWADLIST && HIWORD(wParam) == LBN_DBLCLK))
|
||||
{
|
||||
SetQueryIWad (hDlg);
|
||||
list = GetDlgItem (hDlg, IDC_IWADLIST);
|
||||
EndDialog (hDlg, SendMessage (list, LB_GETCURSEL, 0, 0));
|
||||
ctrl = GetDlgItem (hDlg, IDC_IWADLIST);
|
||||
EndDialog (hDlg, SendMessage (ctrl, LB_GETCURSEL, 0, 0));
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int I_PickIWad (WadStuff *wads, int numwads)
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
||||
{
|
||||
if (showwin || GetAsyncKeyState(VK_SHIFT))
|
||||
{
|
||||
WadList = wads;
|
||||
NumWads = numwads;
|
||||
DefaultWad = defaultiwad;
|
||||
|
||||
return DialogBox (g_hInst, MAKEINTRESOURCE(IDD_IWADDIALOG),
|
||||
(HWND)Window, (DLGPROC)IWADBoxCallback);
|
||||
}
|
||||
return defaultiwad;
|
||||
}
|
||||
|
||||
void *I_FindFirst (const char *filespec, findstate_t *fileinfo)
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ void I_PrintStr (const char *cp, bool lineBreak);
|
|||
void I_SetTitleString (const char *title);
|
||||
|
||||
// Pick from multiple IWADs to use
|
||||
int I_PickIWad (WadStuff *wads, int numwads);
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool queryiwad, int defaultiwad);
|
||||
|
||||
// [RH] Returns millisecond-accurate time
|
||||
unsigned int I_MSTime (void);
|
||||
|
|
Loading…
Reference in a new issue