uipopupscriptscenenew.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. class UIPopupScriptSceneNew extends UIPopupScript
  2. {
  3. private ButtonWidget m_BtnOk;
  4. private ButtonWidget m_BtnCancel;
  5. //================================================
  6. // UIPopupScriptSceneNew
  7. //================================================
  8. void UIPopupScriptSceneNew(Widget wgt)
  9. {
  10. m_BtnOk = ButtonWidget.Cast( wgt.FindAnyWidget("btn_ppp_sn_ok") );
  11. m_BtnCancel = ButtonWidget.Cast( wgt.FindAnyWidget("btn_ppp_sn_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_sn_new_name") );
  22. PluginSceneManager editor = PluginSceneManager.Cast( GetPlugin(PluginSceneManager) );
  23. Log("OnClick -> SceneLoad");
  24. editor.SceneLoad(wgt_text.GetText());
  25. editor.SceneSave();
  26. PopupBack();
  27. return true;
  28. }
  29. else if ( w == m_BtnCancel )
  30. {
  31. PopupBack();
  32. return true;
  33. }
  34. return false;
  35. }
  36. }