3 private MultilineEditBoxWidget m_MedxInitScript;
5 private ButtonWidget m_BtnRun;
6 private ButtonWidget m_BtnSave;
7 private ButtonWidget m_BtnCancel;
9 private int m_SceneObjectIndex;
12 private PluginSceneManager m_ModuleSceneManager;
17 void UIPopupScriptInitScript(
Widget wgt)
19 m_ModuleSceneManager = PluginSceneManager.Cast(
GetPlugin(PluginSceneManager) );
21 m_MedxInitScript = MultilineEditBoxWidget.Cast( wgt.FindAnyWidget(
"pnl_ppp_is_init_script_value") );
23 m_BtnRun = ButtonWidget.Cast( wgt.FindAnyWidget(
"btn_ppp_is_run") );
24 m_BtnSave = ButtonWidget.Cast( wgt.FindAnyWidget(
"btn_ppp_is_save") );
25 m_BtnCancel = ButtonWidget.Cast( wgt.FindAnyWidget(
"btn_ppp_is_cancel") );
31 override void OnOpen(
Param param)
33 m_MedxInitScript.SetText(
"" );
38 int index = param_scene_object.param1;
39 SceneObject scene_object = param_scene_object.param2;
41 if ( index > -1 && scene_object != NULL )
43 m_SceneObjectIndex = index;
44 m_SceneObject = scene_object;
45 m_MedxInitScript.SetText( m_SceneObject.GetInitScript() );
55 super.OnClick(w,
x,
y, button);
59 if ( m_SceneObject != NULL )
62 m_MedxInitScript.GetText( text_run );
63 m_ModuleSceneManager.ExecuteEnforceScript( m_SceneObjectIndex, m_SceneObject, text_run );
66 else if ( w == m_BtnSave )
68 if ( m_SceneObject != NULL )
71 m_MedxInitScript.GetText( text_script );
72 m_SceneObject.SetInitScript( text_script );
79 else if ( w == m_BtnCancel )