Disable palette flash on item pickup

Moderator: GZDoom Developers

Post Reply
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Disable palette flash on item pickup

Post by amv2k9 »

Pretty much what it says in the title; a way to disable the flash that occurs when you pick up an item.

From the "How do I" thread:
Blue Shadow wrote:
Vaecrius wrote:
Flynn Taggart wrote:How do I change the color of the flash when you pick up items and the flash when you get hurt. For example, Item pickups will make your hud flash blue instead of yellow or being shot makes your hud flash pink.
For pain there's player.damagescreencolor but I haven't the slightest clue about changing pickup flash.
It can be changed "globally" by using [wiki=GameInfo_definition]pickupcolor[/wiki] mapinfo property.
amv2k9 wrote:What if you want no flash at all? I 've been making pickup flashes with A_SetFade and I'd rather not have the two overlapping.
Blue Shadow wrote:I could be wrong, but I don't think there is a way to disable the [wiki=Palette_flash]palette flash[/wiki] for item pickup, currently.
User avatar
TheFortuneTeller
Posts: 36
Joined: Sun Oct 28, 2012 4:20 pm
Location: United States

Re: Disable palette flash on item pickup

Post by TheFortuneTeller »

Diff patch that adds a new DECORATE flag "NOSCREENFLASH" that disables the flash.

Code: Select all

Index: src/g_shared/a_pickups.cpp
===================================================================
--- src/g_shared/a_pickups.cpp	(revision 4140)
+++ src/g_shared/a_pickups.cpp	(working copy)
@@ -964,7 +964,10 @@
 		if (toucher->player != NULL)
 		{
 			PlayPickupSound (toucher->player->mo);
-			toucher->player->bonuscount = BONUSADD;
+			if (!(ItemFlags & IF_NOSCREENFLASH))
+			{
+				toucher->player->bonuscount = BONUSADD;
+			}
 		}
 		else
 		{
Index: src/g_shared/a_pickups.h
===================================================================
--- src/g_shared/a_pickups.h	(revision 4140)
+++ src/g_shared/a_pickups.h	(working copy)
@@ -133,6 +133,7 @@
 	IF_PERSISTENTPOWER	= 1<<18,	// Powerup is kept when travelling between levels
 	IF_RESTRICTABSOLUTELY = 1<<19,	// RestrictedTo and ForbiddenTo do not allow pickup in any form by other classes
 	IF_NEVERRESPAWN		= 1<<20,	// Never, ever respawns
+	IF_NOSCREENFLASH	= 1<<21,	// No pickup flash on the player's screen
 };
 
 
Index: src/thingdef/thingdef_data.cpp
===================================================================
--- src/thingdef/thingdef_data.cpp	(revision 4140)
+++ src/thingdef/thingdef_data.cpp	(working copy)
@@ -299,6 +299,7 @@
 	DEFINE_FLAG(IF, PERSISTENTPOWER, AInventory, ItemFlags),
 	DEFINE_FLAG(IF, RESTRICTABSOLUTELY, AInventory, ItemFlags),
 	DEFINE_FLAG(IF, NEVERRESPAWN, AInventory, ItemFlags),
+	DEFINE_FLAG(IF, NOSCREENFLASH, AInventory, ItemFlags),
 
 	DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
 	DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),
Attachments
diff.txt
(1.53 KiB) Downloaded 63 times
User avatar
randi
Site Admin
Posts: 7750
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Disable palette flash on item pickup

Post by randi »

Added in r4145.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: Disable palette flash on item pickup

Post by amv2k9 »

Thanks, TheFortuneTeller & randi!
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”