API:BarbershopSubmitFeatures
From RoR Wiki
UI Lua API · Appearance functions
Version: WAR 1.4.8
Sends the barbershop preview appearance to the server to make it the character's new appearance.
BarbershopSubmitFeatures()
Arguments
None.
Returns
Nothing.
Details
- The call only has an effect while the barbershop is open. Otherwise nothing is sent.
- The client sends the 15 appearance values of the preview to the server. The client does not check whether anything changed or whether the player can pay; the stock UI does that first with BarbershopHaveFeaturesChanged and its own token count.
- The server's answer arrives as
SystemData.Events.INTERACT_BARBERSHOP_RESULT. The stock handler compares it withGameData.BarberShopMessagevalues such asSUCCESS,NOT_ENOUGH_TOKENS,BAD_VARIATIONandANOTHER_FORM.
Errors
None.
Example
From ea_barbershopwindow/source/barbershopwindow.lua, which asks for confirmation when tokens are needed:
local confirmText = GetStringFormat( StringTables.Default.TEXT_BARBERSHOP_TOKEN_CONFIRMATION, { towstring(numTokensRequired) } )
local yesText = GetString( StringTables.Default.LABEL_YES )
local noText = GetString( StringTables.Default.LABEL_NO )
DialogManager.MakeTwoButtonDialog( confirmText, yesText, BarbershopSubmitFeatures, noText, nil )
