- Added customizable pickup flash.

- Added option to show shorter messages for save game and screenshot confirmation.
  Also added this to the 'Messages' menu.


SVN r749 (trunk)
This commit is contained in:
Christoph Oelckers 2008-02-16 10:23:12 +00:00
parent 0acbbb3a8e
commit e99b239ae6
19 changed files with 132 additions and 32 deletions

View file

@ -1,4 +1,9 @@
February 12, 2008
February 16, 2008 (Changes by Graf Zahl)
- Added customizable pickup flash.
- Added option to show shorter messages for save game and screenshot confirmation.
Also added this to the 'Messages' menu.
February 15, 2008
- Version bump to 2.2.0.
- Disabled console alpha when the console is fullscreen.
- Re-enabled maybedrawnow for the software renderer. This should be replaced

View file

@ -102,6 +102,7 @@ FIntCVar gameskill ("skill", 2, CVAR_SERVERINFO|CVAR_LATCH);
CVAR (Int, deathmatch, 0, CVAR_SERVERINFO|CVAR_LATCH);
CVAR (Bool, chasedemo, false, 0);
CVAR (Bool, storesavepic, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, longsavemessages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
gameaction_t gameaction;
gamestate_t gamestate = GS_STARTUP;
@ -2065,7 +2066,11 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
}
fclose(stdfile);
}
if (success) Printf ("%s (%s)\n", GStrings("GGSAVED"), filename.GetChars());
if (success)
{
if (longsavemessages) Printf ("%s (%s)\n", GStrings("GGSAVED"), filename.GetChars());
else Printf ("%s\n", GStrings("GGSAVED"));
}
else Printf(PRINT_HIGH, "Save failed\n");
BackupSaveName = filename;

View file

@ -24,7 +24,7 @@ IMPLEMENT_ACTOR (AArtiTomeOfPower, Heretic, 86, 134)
PROP_Flags (MF_SPECIAL|MF_COUNTITEM)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_FlagsSet (IF_PICKUPFLASH)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_Icon ("ARTIPWBK")
PROP_PowerupGiver_Powerup ("PowerWeaponLevel2")
PROP_Inventory_PickupMessage("$TXT_ARTITOMEOFPOWER")
@ -106,7 +106,8 @@ IMPLEMENT_ACTOR (AArtiTimeBomb, Heretic, 34, 72)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTIFBMB")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTIFIREBOMB")

View file

@ -37,7 +37,8 @@ IMPLEMENT_ACTOR (AArtiBlastRadius, Hexen, 10110, 74)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTIBLST")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTIBLASTRADIUS")

View file

@ -33,7 +33,8 @@ IMPLEMENT_ACTOR (AArtiBoostArmor, Hexen, 8041, 22)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTIBRAC")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTIBOOSTARMOR")

View file

@ -159,7 +159,8 @@ IMPLEMENT_ACTOR (AArtiPoisonBag, Hexen, 8000, 72)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTIPSBG")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTIPOISONBAG")

View file

@ -48,7 +48,8 @@ IMPLEMENT_ACTOR (AArtiHealingRadius, Hexen, 10120, 0)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTIHRAD")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTIHEALINGRADIUS")

View file

@ -30,7 +30,8 @@ IMPLEMENT_ACTOR (AArtiDarkServant, Hexen, 86, 16)
PROP_SpawnState (S_ARTI_SUMMON)
PROP_Inventory_RespawnTics (30+4200)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTISUMN")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTISUMMON")

View file

@ -44,7 +44,8 @@ IMPLEMENT_ACTOR (AArtiTeleportOther, Hexen, 10040, 17)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (S_ARTI_TELOTHER1)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTITELO")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTITELEPORTOTHER")

View file

@ -31,7 +31,8 @@ IMPLEMENT_ACTOR (AArtiTeleport, Raven, 36, 18)
PROP_Flags2 (MF2_FLOATBOB)
PROP_SpawnState (0)
PROP_Inventory_DefMaxAmount
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
PROP_Inventory_PickupFlash (1)
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
PROP_Inventory_Icon ("ARTIATLP")
PROP_Inventory_PickupSound ("misc/p_pkup")
PROP_Inventory_PickupMessage("$TXT_ARTITELEPORT")

View file

@ -587,18 +587,18 @@ bool AInventory::GoAway ()
// Dropped items never stick around
if (flags & MF_DROPPED)
{
if (ItemFlags & IF_PICKUPFLASH)
if (PickupFlash != NULL)
{
Spawn<APickupFlash> (x, y, z, ALLOW_REPLACE);
Spawn(PickupFlash, x, y, z, ALLOW_REPLACE);
}
return false;
}
if (!ShouldStay ())
{
if (ItemFlags & IF_PICKUPFLASH)
if (PickupFlash != NULL)
{
Spawn<APickupFlash> (x, y, z, ALLOW_REPLACE);
Spawn(PickupFlash, x, y, z, ALLOW_REPLACE);
}
Hide ();
if (ShouldRespawn ())
@ -857,7 +857,7 @@ void AInventory::Hide ()
{
SetState (&States[S_HIDESPECIAL]);
tics = 1400;
if (ItemFlags & IF_PICKUPFLASH) tics += 30;
if (PickupFlash != NULL) tics += 30;
}
else
{

View file

@ -90,7 +90,7 @@ enum
IF_INVBAR = 1<<6, // Item appears in the inventory bar
IF_HUBPOWER = 1<<7, // Powerup is kept when moving in a hub
IF_INTERHUBSTRIP = 1<<8, // Item is removed when travelling between hubs
IF_PICKUPFLASH = 1<<9, // Item "flashes" when picked up
//IF_PICKUPFLASH = 1<<9, // superseded by 'PickupFlash' property.
IF_ALWAYSPICKUP = 1<<10, // For IF_AUTOACTIVATE, MaxAmount=0 items: Always "pick up", even if it doesn't do anything
IF_FANCYPICKUPSOUND = 1<<11, // Play pickup sound in "surround" mode
IF_BIGPOWERUP = 1<<12, // Affected by RESPAWN_SUPER dmflag
@ -136,6 +136,7 @@ public:
int DropTime; // Countdown after dropping
DWORD ItemFlags;
const PClass *PickupFlash; // actor to spawn as pickup flash
WORD PickupSound;

View file

@ -317,6 +317,7 @@ enum
ADEF_Inventory_RespawnTics,
ADEF_Inventory_FlagsSet,
ADEF_Inventory_FlagsClear,
ADEF_Inventory_PickupFlash,
ADEF_PuzzleItem_Number, // Identifies the puzzle item for UsePuzzleItem

View file

@ -255,6 +255,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
case ADEF_Inventory_FlagsSet: item->ItemFlags |= dataint; break;
case ADEF_Inventory_FlagsClear: item->ItemFlags &= ~dataint; break;
case ADEF_Inventory_PickupFlash:item->PickupFlash = dataint? fuglyname("PickupFlash") : NULL;
case ADEF_Inventory_Amount: item->Amount = dataint; break;
case ADEF_Inventory_RespawnTics:item->RespawnTics = dataint; break;
case ADEF_Inventory_MaxAmount: item->MaxAmount = dataint; break;

View file

@ -297,6 +297,7 @@ public:
#define PROP_Inventory_RespawnTics(x) ADD_WORD_PROP(ADEF_Inventory_RespawnTics,x)
#define PROP_Inventory_FlagsSet(x) ADD_LONG_PROP(ADEF_Inventory_FlagsSet,x)
#define PROP_Inventory_FlagsClear(x) ADD_LONG_PROP(ADEF_Inventory_FlagsClear,x)
#define PROP_Inventory_PickupFlash(x) ADD_BYTE_PROP(ADEF_Inventory_PickupFlash, x)
#define PROP_PuzzleItem_Number(x) ADD_BYTE_PROP(ADEF_PuzzleItem_Number,x)

View file

@ -81,6 +81,7 @@ FGameConfigFile *GameConfig;
CVAR(Bool, screenshot_quiet, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CVAR(String, screenshot_type, "png", CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CVAR(String, screenshot_dir, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
EXTERN_CVAR(Bool, longsavemessages);
extern void FreeKeySections();
@ -721,7 +722,9 @@ void M_ScreenShot (const char *filename)
if (!screenshot_quiet)
{
Printf ("Captured %s\n", autoname.GetChars());
int slash = -1;
if (!longsavemessages) slash = autoname.LastIndexOfAny(":/\\");
Printf ("Captured %s\n", autoname.GetChars()+slash+1);
}
}
else

View file

@ -92,6 +92,8 @@ CVAR (Float, mouse_sensitivity, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
// Show messages has default, 0 = off, 1 = on
CVAR (Bool, show_messages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, show_obituaries, true, CVAR_ARCHIVE)
EXTERN_CVAR (Bool, longsavemessages)
EXTERN_CVAR (Bool, screenshot_quiet)
extern int skullAnimCounter;
@ -134,6 +136,11 @@ value_t OnOff[2] = {
{ 1.0, "On" }
};
value_t OffOn[2] = {
{ 0.0, "On" },
{ 1.0, "Off" }
};
menu_t *CurrentMenu;
int CurrentItem;
static const char *OldMessage;
@ -794,7 +801,10 @@ static menuitem_t MessagesItems[] = {
{ cdiscrete, "Critical Messages", {&msg2color}, {21.0}, {0.0}, {0.0}, {TextColors} },
{ cdiscrete, "Chat Messages", {&msg3color}, {21.0}, {0.0}, {0.0}, {TextColors} },
{ cdiscrete, "Team Messages", {&msg4color}, {21.0}, {0.0}, {0.0}, {TextColors} },
{ cdiscrete, "Centered Messages", {&msgmidcolor}, {21.0}, {0.0}, {0.0}, {TextColors} }
{ cdiscrete, "Centered Messages", {&msgmidcolor}, {21.0}, {0.0}, {0.0}, {TextColors} },
{ redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} },
{ discrete, "Screenshot messages", {&screenshot_quiet}, {2.0}, {0.0}, {0.0}, {OffOn} },
{ discrete, "Detailed save messages",{&longsavemessages}, {2.0}, {0.0}, {0.0}, {OnOff} },
};
menu_t MessagesMenu =

View file

@ -492,10 +492,12 @@ void ParseActor(FScanner &sc)
// fields in the weapons
//
//==========================================================================
void FinishThingdef()
{
unsigned int i;
bool isRuntimeActor=false;
int errorcount=0;
for (i = 0;i < PClass::m_Types.Size(); i++)
{
@ -517,6 +519,26 @@ void FinishThingdef()
GetDefaultByType(ti)->flags &=~MF_COUNTKILL;
}
if (ti->IsDescendantOf(RUNTIME_CLASS(AInventory)))
{
AInventory * defaults=(AInventory *)ti->Defaults;
fuglyname v;
v = defaults->PickupFlash;
if (v != NAME_None && v.IsValidName())
{
defaults->PickupFlash = PClass::FindClass(v);
if (isRuntimeActor)
{
if (!defaults->PickupFlash)
{
Printf("Unknown pickup flash '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
}
}
}
// the typeinfo properties of weapons have to be fixed here after all actors have been declared
if (ti->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
@ -531,11 +553,13 @@ void FinishThingdef()
{
if (!defaults->AmmoType1)
{
I_Error("Unknown ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Unknown ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
else if (defaults->AmmoType1->ParentClass != RUNTIME_CLASS(AAmmo))
{
I_Error("Invalid ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Invalid ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
}
}
@ -548,11 +572,13 @@ void FinishThingdef()
{
if (!defaults->AmmoType2)
{
I_Error("Unknown ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Unknown ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
else if (defaults->AmmoType2->ParentClass != RUNTIME_CLASS(AAmmo))
{
I_Error("Invalid ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Invalid ammo type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
}
}
@ -565,11 +591,13 @@ void FinishThingdef()
{
if (!defaults->SisterWeaponType)
{
I_Error("Unknown sister weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Unknown sister weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
else if (!defaults->SisterWeaponType->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
I_Error("Invalid sister weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Invalid sister weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
}
}
@ -586,10 +614,26 @@ void FinishThingdef()
if (ready || select || deselect || fire)
{
// Do some consistency checks. If these states are undefined the weapon cannot work!
if (!ready) I_Error("Weapon %s doesn't define a ready state.\n", ti->TypeName.GetChars());
if (!select) I_Error("Weapon %s doesn't define a select state.\n", ti->TypeName.GetChars());
if (!deselect) I_Error("Weapon %s doesn't define a deselect state.\n", ti->TypeName.GetChars());
if (!fire) I_Error("Weapon %s doesn't define a fire state.\n", ti->TypeName.GetChars());
if (!ready)
{
Printf("Weapon %s doesn't define a ready state.\n", ti->TypeName.GetChars());
errorcount++;
}
if (!select)
{
Printf("Weapon %s doesn't define a select state.\n", ti->TypeName.GetChars());
errorcount++;
}
if (!deselect)
{
Printf("Weapon %s doesn't define a deselect state.\n", ti->TypeName.GetChars());
errorcount++;
}
if (!fire)
{
Printf("Weapon %s doesn't define a fire state.\n", ti->TypeName.GetChars());
errorcount++;
}
}
}
@ -606,15 +650,21 @@ void FinishThingdef()
defaults->WeaponClass = PClass::FindClass(v);
if (!defaults->WeaponClass)
{
I_Error("Unknown weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Unknown weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
else if (!defaults->WeaponClass->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
I_Error("Invalid weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
Printf("Invalid weapon type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars());
errorcount++;
}
}
}
}
if (errorcount > 0)
{
I_Error("%d errors during actor postprocessing", errorcount);
}
// Since these are defined in DECORATE now the table has to be initialized here.
for(int i=0;i<31;i++)

View file

@ -247,12 +247,14 @@ static flagdef InventoryFlags[] =
DEFINE_FLAG(IF, INVBAR, AInventory, ItemFlags),
DEFINE_FLAG(IF, HUBPOWER, AInventory, ItemFlags),
DEFINE_FLAG(IF, INTERHUBSTRIP, AInventory, ItemFlags),
DEFINE_FLAG(IF, PICKUPFLASH, AInventory, ItemFlags),
DEFINE_FLAG(IF, ALWAYSPICKUP, AInventory, ItemFlags),
DEFINE_FLAG(IF, FANCYPICKUPSOUND, AInventory, ItemFlags),
DEFINE_FLAG(IF, BIGPOWERUP, AInventory, ItemFlags),
DEFINE_FLAG(IF, KEEPDEPLETED, AInventory, ItemFlags),
DEFINE_FLAG(IF, IGNORESKILL, AInventory, ItemFlags),
DEFINE_DEPRECATED_FLAG(PICKUPFLASH, AInventory, 5),
};
static flagdef WeaponFlags[] =
@ -398,6 +400,9 @@ static void HandleDeprecatedFlags(AActor *defaults, bool set, int index)
case 4: // LONGMELEERANGE
defaults->meleethreshold = set? 196*FRACUNIT : 0;
break;
case 5: // INVENTORY.PICKUPFLASH
static_cast<AInventory*>(defaults)->PickupFlash = set? fuglyname("PickupFlash") : NULL;
break;
default:
break; // silence GCC
}
@ -1816,6 +1821,15 @@ static void InventoryDefMaxAmount (FScanner &sc, AInventory *defaults, Baggage &
}
//==========================================================================
//
//==========================================================================
static void InventoryPickupflash (FScanner &sc, AInventory *defaults, Baggage &bag)
{
sc.MustGetString();
defaults->PickupFlash = fuglyname(sc.String);
}
//==========================================================================
//
//==========================================================================
@ -2500,6 +2514,7 @@ static const ActorProps props[] =
{ "inventory.givequest", (apf)InventoryGiveQuest, RUNTIME_CLASS(AInventory) },
{ "inventory.icon", (apf)InventoryIcon, RUNTIME_CLASS(AInventory) },
{ "inventory.maxamount", (apf)InventoryMaxAmount, RUNTIME_CLASS(AInventory) },
{ "inventory.pickupflash", (apf)InventoryPickupflash, RUNTIME_CLASS(AInventory) },
{ "inventory.pickupmessage", (apf)InventoryPickupmsg, RUNTIME_CLASS(AInventory) },
{ "inventory.pickupsound", (apf)InventoryPickupsound, RUNTIME_CLASS(AInventory) },
{ "inventory.respawntics", (apf)InventoryRespawntics, RUNTIME_CLASS(AInventory) },