uipopupscriptpresetnew.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. class UIPopupScriptPresetNew extends UIPopupScript
  2. {
  3. private ButtonWidget m_BtnOk;
  4. private ButtonWidget m_BtnCancel;
  5. //================================================
  6. // UIPopupScriptSceneNew
  7. //================================================
  8. void UIPopupScriptPresetNew( Widget wgt )
  9. {
  10. m_BtnOk = ButtonWidget.Cast( wgt.FindAnyWidget("btn_ppp_pn_ok") );
  11. m_BtnCancel = ButtonWidget.Cast( wgt.FindAnyWidget("btn_ppp_pn_cancel") );
  12. }
  13. //================================================
  14. // OnClick
  15. //================================================
  16. override bool OnClick( Widget w, int x, int y, int button )
  17. {
  18. super.OnClick( w, x, y, button );
  19. if ( w == m_BtnOk )
  20. {
  21. EditBoxWidget wgt_text = EditBoxWidget.Cast( m_WgtRoot.FindAnyWidget("fld_ppp_pn_new_name") );
  22. PluginConfigDebugProfile m_ConfigDebugProfile = PluginConfigDebugProfile.Cast( GetPlugin(PluginConfigDebugProfile) );
  23. m_ConfigDebugProfile.PresetAdd( wgt_text.GetText() );
  24. SceneEditorMenu menu = SceneEditorMenu.Cast( GetGame().GetUIManager().GetMenu() );
  25. menu.RefreshLists();
  26. PopupBack();
  27. return true;
  28. }
  29. else if ( w == m_BtnCancel )
  30. {
  31. PopupBack();
  32. return true;
  33. }
  34. return false;
  35. }
  36. }