Files
dsrc/sku.0/sys.server/compiled/game/script/item/ring/aurebesh_decoder.script
T

130 lines
3.4 KiB
Plaintext

/**
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
* All Rights Reserved
*
* Title: aurebesh_decoder.script
* DesCRiption: Allows player to translate from Aurebesh to English or English to Aurebesh
* @author $AutHor: Jesse Benjamin$
* @version $Revision:$
*/
/***** INCLUDES ********************************************************/
include library.sui;
include library.utils;
/***** INCLUDES ********************************************************/
/***** CONSTANTS *******************************************************/
const string_id SID_AUREBESH_TO_ENGLISH = new string_id("collection", "aurebesh_to_english");
const string_id SID_ENGLISH_TO_AUREBESH = new string_id("collection", "english_to_aurebesh");
const string SID_A_TO_E_PROMPT = "@collection:a_to_e_prompt";
const string SID_E_TO_A_PROMPT = "@collection:e_to_a_prompt";
const string SID_A_TO_E_TITLE = "@collection:a_to_e_title";
const string SID_E_TO_A_TITLE = "@collection:e_to_a_title";
const string SID_TRANSLATED_TEXT = "@collection:translated_text";
/***** TRIGGERS ********************************************************/
trigger OnAttach()
{
return SCRIPT_CONTINUE;
}
trigger OnInitialize()
{
return SCRIPT_CONTINUE;
}
trigger OnDestroy()
{
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
{
if ( utils.isNestedWithin(self, player) )
{
mi.addRootMenu (menu_info_types.SERVER_MENU2, SID_ENGLISH_TO_AUREBESH);
mi.addRootMenu (menu_info_types.SERVER_MENU3, SID_AUREBESH_TO_ENGLISH);
}
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuSelect(obj_id player, int item)
{
//aurebesh to english
if ( item == menu_info_types.SERVER_MENU3 )
{
int pid = sui.inputbox(self, player, SID_A_TO_E_PROMPT, SID_A_TO_E_TITLE, "aurebeshToEnglish", 25, false, "");
setSUIProperty(pid, "txtInput", "Style", "/Styles.textbox.default.Style_aurabesh_12");
flushSUIPage(pid);
}
//english to aurebesh
if ( item == menu_info_types.SERVER_MENU2 )
{
int pid = sui.inputbox(self, player, SID_E_TO_A_PROMPT, SID_E_TO_A_TITLE, "englishToAurebesh", 25, false, "");
}
return SCRIPT_CONTINUE;
}
//message Handlers
messageHandler englishToAurebesh()
{
if(params == null || params.isEmpty())
return SCRIPT_CONTINUE;
//get button pressed
int bp = sui.getIntButtonPressed(params);
//if they pressed cancel then we bail out and do nothing
if ( bp == sui.BP_CANCEL )
{
return SCRIPT_CONTINUE;
}
string inputText= sui.getInputBoxText(params);
obj_id player = sui.getPlayerId(params);
int pid = sui.msgbox( self, player, inputText, sui.OK_ONLY, SID_TRANSLATED_TEXT, "noHandler" );
setSUIProperty(pid, "Prompt.lblPrompt", "Font", "aurabesh_18");
setSUIProperty(pid, "Prompt.lblPrompt", "Editable", "true");
flushSUIPage(pid);
return SCRIPT_CONTINUE;
}
messageHandler aurebeshToEnglish()
{
if(params == null || params.isEmpty())
return SCRIPT_CONTINUE;
//get button pressed
int bp = sui.getIntButtonPressed(params);
//if they pressed cancel then we bail out and do nothing
if ( bp == sui.BP_CANCEL )
{
return SCRIPT_CONTINUE;
}
string inputText= sui.getInputBoxText(params);
obj_id player = sui.getPlayerId(params);
int pid = sui.msgbox( self, player, inputText, sui.OK_ONLY, SID_TRANSLATED_TEXT, "noHandler" );
setSUIProperty(pid, "Prompt.lblPrompt", "Font", "bold_15");
setSUIProperty(pid, "Prompt.lblPrompt", "Editable", "true");
flushSUIPage(pid);
return SCRIPT_CONTINUE;
}