Files
Bubberstation/code/datums/components/COMPONENT_TEMPLATE.md
tonty b3085c973a Fixes some instances of PostTransfer not using new_parent argument (#88398)
## About The Pull Request

Since #87866 PostTransfer now has it's parent set to nil, and instead
has a `datum/new_parent` argument supplied to it.
Why does the ***post*** transfer proc not have it's parent set yet? Not
sure, but some procs (and the documentation) haven't been adjusted yet
and this PR fixes that

also:
fixes #88156 
fixes #88325 

## Why It's Good For The Game

Fix man good...

## Changelog

🆑
fix: /datum/component/PostTransfer() procs that didn't have their
new_parent arguments have now been fixed
fix: This means that turning into a Domain gondola shouldn't RR people
anymore
/🆑
2024-12-08 15:49:49 +01:00

1.8 KiB

Template file for your new component

See _component.dm for detailed explanations

/datum/component/mycomponent
	//can_transfer = TRUE                   // Must have PostTransfer
	//dupe_mode = COMPONENT_DUPE_ALLOWED    // code/__DEFINES/dcs/flags.dm
	var/myvar

/datum/component/mycomponent/Initialize(myargone, myargtwo)
	if(myargone)
		myvar = myargone
	if(myargtwo)
		send_to_playing_players(myargtwo)

/datum/component/mycomponent/RegisterWithParent()
	RegisterSignal(parent, COMSIG_NOT_REAL, PROC_REF(signalproc))                                    // RegisterSignal can take a signal name by itself,
	RegisterSignal(parent, list(COMSIG_NOT_REAL_EITHER, COMSIG_ALMOST_REAL), PROC_REF(otherproc))    // or a list of them to assign to the same proc

/datum/component/mycomponent/UnregisterFromParent()
	UnregisterSignal(parent, COMSIG_NOT_REAL)          // UnregisterSignal has similar behavior
	UnregisterSignal(parent, list(                     // But you can just include all registered signals in one call
		COMSIG_NOT_REAL,
		COMSIG_NOT_REAL_EITHER,
		COMSIG_ALMOST_REAL,
	))

/datum/component/mycomponent/proc/signalproc(datum/source)
	SIGNAL_HANDLER
	send_to_playing_players("[source] signaled [src]!")

/*
/datum/component/mycomponent/InheritComponent(datum/component/mycomponent/old, i_am_original, list/arguments)
	myvar = old.myvar

	if(i_am_original)
		send_to_playing_players("No parent should have to bury their child")
*/

/*
/datum/component/mycomponent/PreTransfer(datum/new_parent)
	send_to_playing_players("Goodbye [new_parent], I'm getting adopted")

/datum/component/mycomponent/PostTransfer(datum/new_parent)
	send_to_playing_players("Hello my new parent, [parent]! It's nice to meet you!")
*/

/*
/datum/component/mycomponent/CheckDupeComponent(datum/mycomponent/new, myargone, myargtwo)
	if(myargone == myvar)
		return TRUE
*/