CreateDescWindow¶
This is a public method that initialises descwindow. It is called both by the Shop interaction and the Item object during CheckItem. It receives a bool that is false during CheckItem and true during the shop interaction.
- instance.
discoveryhubis set to 0.0 which hides the discovery HUD element - If this is an item entity (which should always be the case), entity.
animstateis set to entity.itemstate deswindowis set to the DialogueAnim of a new white 9Box usingSprites/GUI/9Box/box0of position (-3.5.0, -3.9.0, 10.0) with size (11.0, 3.0) with sortingOrder of -3 and with growing- If it was called from CheckItem, instance.
showmoneyis set to 0.0 which hides the berry count HUD element followed by thedescwindowlocal position being set to (0.0, the existing y local position - 0.5, the existing z local position) - If the
shopkeeperexists and itsdialgues[1].yis 1 (the shop accepts Crystal Berries instead of regular berries):- A new SpriteRenderer UI object named
CBerryBaris created childed to thedescwindowof color cyan with position (10.65, -0.45, 0.0) with size (0.55, 0.6, 1.0) withguisprites[4](the HUD element background) and a sortingOrder of 0 - SetText is called using
|sort,10||color,4||single||dropshadow,0.75,-0.75|followed by flagvar 14 padded by 30as the input string in non dialogue mode with the following:- fonttype of 2 (gets overriden to
D3Streetismas 2 is UNUSED) - No linebreak
- No tridimensional
- Position offset of (-0.65, -0.5, 0.0)
- No camera offset
- size of 1.75 uniform
- Parent is the SpriteRenderer created earlier
- No caller
- fonttype of 2 (gets overriden to
- A new UI object called
BerryIconis created using the sprite of the Crystal Berry icon childed to thedescwindowwith a position of (9.45, -0.45, 0.0) with a size of Vector3.one and a sortingOrder of 1
- A new SpriteRenderer UI object named
- If entity.
animidis 2 (it's a medal), flagvar 10 is set to the price of the medal (entity.animstateused as the id, berries or Crystal Berries depending onshopkeeper.dialogues[1].ybeing 1 or not), but it's overriden to 35 berries (or 4 Crystal Berries unless flagvar 66 (amount of medals bought at shades) is less than 2 where it's 3 Crystal Berries) if theshopkeeperexists and flag 681 is true (MYSTERY? is active) - Otherwise, flagvar 10 is set to the buying price of the item *
mmulti(the price multiplier loaded from the shop keeper entity data) all ceiled - From there, a SetText string is constructed with the following appended together in order:
|single||singlebreak,followed byitemdescbreakfollowed by|- If entity.
animidis 2 (it's a medal) and the call came from the Shop interaction, the name of the medal is appended (overriden tomenutext[59]or?????if MYSTERY? is active) followed byfollowed by a-(or a—if the languageid isGerman) followed byfollowed bymenutext[49](Worth |currency,var,10|) ifshopkeeper.dialogues[1].yisn't 1 (the shop accepts regular berries) and if it's 1, it's followed byflagvar10 followed by a space followed bymenutext[169](Crystal Berries, it'smenutext[112]ifflagvar10 is 1 for the singular form) followed by|line| - If entity.
animidis 2 (it's a medal), the description of the medal is appened (entity.animstateis used as the medal id), but it's overriden tomenutext[59](?????) if theshopkeeperexists and MYSTERY? is active - If entity.
animidisn't 2 (it's not a medal) and the call came from the Shop interaction, the name of the item is appended (entity.animstateis used as the item id) followed byfollowed byfollowed by a-(or a—if the languageid isGerman) followed byfollowed bymenutext[49](Worth |currency,var,10|) followed by|line| - If entity.
animidisn't 2 (it's not a medal), the description of the item is appended (entity.animstateis used as the item id)
- A SetText call occurs in non dialogue mode with the string generated above with these properties:
- fonttype of
BubblegumSans - No linebreak
- No tridimensional
- Position offset of (-5.2, 0.65, 0.0)
- No camera offset
- size of 0.675 uniform
- Parent is the
descwindow - No caller
- fonttype of