public void ShowMsgBoxLua(int style, UIMsgBoxLuaDelegate handler, string content, string title = "", string ok = "", string cancel = "") { if (string.IsNullOrEmpty(content)) { JW.Common.Log.LogE("ShowMsgBox Error Content"); return; } if (_msgBox != null) { UIFormHelper.DisposeFormClass <UIMsgBox>(ref _msgBox); _msgBox = null; } _msgBox = UIFormHelper.CreateResidentFormClass <UIMsgBox>(); if (_msgBox != null) { if (string.IsNullOrEmpty(title)) { title = _msgBoxDefaultTitle; } if (string.IsNullOrEmpty(ok)) { ok = _msgBoxDefaultOk; } if (string.IsNullOrEmpty(cancel)) { cancel = _msgBoxDefaultCancel; } _msgBoxLuaHandler = handler; _msgBox.InitShow((UIMsgBoxStyle)style, OnMsgBoxResultLua, title, content, ok, cancel); } }
public void CloseMsgBox() { if (_msgBox != null) { UIFormHelper.DisposeFormClass <UIMsgBox>(ref _msgBox); _msgBox = null; } _msgBoxHandler = null; _msgBoxLuaHandler = null; }
private void OnMsgBoxResultLua(UIMsgBoxResult result) { if (_msgBox != null) { UIFormHelper.DisposeFormClass <UIMsgBox>(ref _msgBox); _msgBox = null; } // if (_msgBoxLuaHandler != null) { _msgBoxLuaHandler((int)result); } _msgBoxLuaHandler = null; }
public override void Uninitialize() { if (_msgBox != null) { UIFormHelper.DisposeFormClass <UIMsgBox>(ref _msgBox); _msgBox = null; } if (null != _waiting) { UIFormHelper.DisposeFormClass <UIWaiting>(ref _waiting); _waiting = null; } _msgBoxDefaultCancel = null; _msgBoxDefaultOk = null; _msgBoxDefaultTitle = null; _msgBoxHandler = null; _msgBoxLuaHandler = null; }