File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
NWN.Anvil/src/main/API/Objects Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1685,6 +1685,36 @@ public void UnpossessCreature()
16851685 Player . PossessCreature ( NwObject . Invalid , ( byte ) NWN . Native . API . AssociateType . None ) ;
16861686 }
16871687
1688+ /// <summary>
1689+ /// Refreshes the player's character sheet.
1690+ /// </summary>
1691+ public async Task UpdateCharacterSheet ( )
1692+ {
1693+ await NwTask . Delay ( TimeSpan . FromSeconds ( 0.5f ) ) ;
1694+ if ( ! IsValid )
1695+ {
1696+ return ;
1697+ }
1698+
1699+ CNWSPlayerCharSheetGUI ? charSheet = Player . m_pCharSheetGUI ;
1700+ if ( charSheet == null )
1701+ {
1702+ return ;
1703+ }
1704+
1705+ uint updatesRequired = charSheet . ComputeCharacterSheetUpdateRequired ( Player ) ;
1706+ if ( updatesRequired == 0 )
1707+ {
1708+ return ;
1709+ }
1710+
1711+ CNWSMessage ? message = LowLevel . ServerExoApp . GetNWSMessage ( ) ;
1712+ if ( message != null )
1713+ {
1714+ message . WriteGameObjUpdate_CharacterSheet ( Player , updatesRequired ) ;
1715+ }
1716+ }
1717+
16881718 /// <summary>
16891719 /// Vibrates the player's device or controller. Does nothing if vibration is not supported.
16901720 /// </summary>
You can’t perform that action at this time.
0 commit comments