Skip to content

celebration_react_util

Source: base/tealdef/game_mechanics/celebrations/celebration_react_util.d.tl

Notes

Celebration types, the GUI event that shows a celebration and the recipe that displays them.

CelebrationType

enum global base/tealdef/game_mechanics/celebrations/celebration_react_util.d.tl:3

global enum CelebrationType

Notes

Kind of celebration callout. The celebrations game script tracks these firsts and level-ups.

Value Description
"ProductDeliveredToTown" First delivery of products to a town.In game Congratulations, you have just started the delivery of products requested by {townName}!
"CargoDeliveredToIndustry" First delivery of cargo to an industry.In game Congratulations, you have just started delivering cargo requested by {industryName}!
"PassengerTransportedInTown" First passenger boarding a line in a town.In game Congratulations, the first passenger just boarded a transit vehicle in {townName}!
"TownLevelUp" A town reached a new level.In game Congratulations, thanks to the excellent care, {townName} was able to grow steadily and reached a new level: {townType}.
"CompanyLevelUp" The player's company reached a new rank.In game Congratulations, your hard work and endurance are paying off. You got promoted to {role} and great rewards have been unlocked.

CelebrationAddedEventParams

record global base/tealdef/game_mechanics/celebrations/celebration_react_util.d.tl:11

global record CelebrationAddedEventParams

Notes

Param of the GUI React event celebration-add, fired by the celebrations game script (guiUpdate). CelebrationsContainer queues and shows it.

Example

-- base game, celebrations/celebrations.script.tl
api.gui.fireReactEvent("celebration-add", { type = "TownLevelUp", entity = entityAndRev, value = v.counter, reputationEffect = v.reputationEffect })

Fields

Name Type Description
type CelebrationType Kind of celebration.
entity EntityUtil.EntityAndRevision The town or industry. Not set for CompanyLevelUp.
value integer For TownLevelUp the new town level, for CompanyLevelUp the new company rank, otherwise the count of deliveries or boardings so far.
reputationEffect boolean The event also raised a town's reputation; the text then says so.
reputationEffectEntity EntityUtil.EntityAndRevision Town whose reputation was raised, if it is not entity (for CargoDeliveredToIndustry, the town closest to the industry).

CelebrationsContainerParams

record global base/tealdef/game_mechanics/celebrations/celebration_react_util.d.tl:19

global record CelebrationsContainerParams

Notes

Params of CelebrationsContainer.

Fields

Name Type Description
gameCtx GameContext Game GUI context; its callout container shows the celebrations.

CelebrationReactUtil

record global base/tealdef/game_mechanics/celebrations/celebration_react_util.d.tl:23

global record CelebrationReactUtil

Load: local celebration_react_util = ug_require "::/game_mechanics/celebrations/celebration_react_util.tl" as CelebrationReactUtil

Notes

GUI recipe for celebration callouts.

Fields

Name Type Description
CelebrationsContainer Recipe<CelebrationsContainerParams> Collects celebration-add events and shows them one at a time as callouts at the top of the screen, with the CelebrationSFX.Earned sound.In game Time to Celebrate! · Reputation improved in {townName}. used 1× in the base game