private GamebaseUtilAlertType GetButtonTypeWithURL(string url)
        {
            GamebaseUtilAlertType alertType = GamebaseUtilAlertType.ALERT_OKCANCEL;

            if (true == string.IsNullOrEmpty(url))
            {
                alertType = GamebaseUtilAlertType.ALERT_OK;
            }

            return(alertType);
        }
        private void ShowSystemPopup(GamebaseUtilAlertType alertType, string title, string message, string buttonLeft = "", string buttonRight = "", string extra = "", GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> callback = null)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add(KEY_TITLE, title);
            parameters.Add(KEY_MESSAGE, message);
            parameters.Add(KEY_BUTTON_LEFT, buttonLeft);
            parameters.Add(KEY_BUTTON_RIGHT, buttonRight);
            parameters.Add(KEY_EXTRA, extra);

            GamebaseUtilImplementation.Instance.ShowAlert(parameters, alertType, callback);
        }
Esempio n. 3
0
        public override void ShowAlert(Dictionary <string, string> parameters, GamebaseUtilAlertType alertType, int handle)
        {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
            string title       = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_TITLE);
            string message     = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_MESSAGE);
            string buttonLeft  = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_BUTTON_LEFT);
            string buttonRight = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_BUTTON_RIGHT);

            int select = BUTTON_OK;

            if (GamebaseUtilAlertType.ALERT_OK == alertType)
            {
                StandaloneGamebaseMessageBox.OK = buttonRight;

                select = StandaloneGamebaseMessageBox.ShowMessageBox(
                    title,
                    message,
                    StandaloneGamebaseMessageBox.MB_OK);
            }
            else
            {
                StandaloneGamebaseMessageBox.OK     = buttonLeft;
                StandaloneGamebaseMessageBox.Cancel = buttonRight;

                select = StandaloneGamebaseMessageBox.ShowMessageBox(
                    title,
                    message,
                    StandaloneGamebaseMessageBox.MB_OKCANCEL);
            }

            GamebaseUtilAlertButtonID buttonID;
            if (BUTTON_OK == select)
            {
                buttonID = GamebaseUtilAlertButtonID.BUTTON_ONE;
            }
            else
            {
                buttonID = GamebaseUtilAlertButtonID.BUTTON_TWO;
            }

            if (-1 != handle)
            {
                GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> callback = GamebaseCallbackHandler.GetCallback <GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> >(handle);
                if (null != callback)
                {
                    callback(buttonID);
                }
            }
#else
            base.ShowAlert(parameters, alertType, handle);
#endif
        }
Esempio n. 4
0
        public override void ShowAlert(Dictionary <string, string> parameters, GamebaseUtilAlertType alertType, int handle)
        {
            string title   = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_TITLE);
            string message = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_MESSAGE);
            string extra   = GetDictionaryValue(parameters, GamebaseSystemPopup.KEY_EXTRA);

            int select = BUTTON_OK;

            if (GamebaseUtilAlertType.ALERT_OK == alertType)
            {
                StringBuilder sb = new StringBuilder(message);

                Alert(title, sb.ToString());
            }
            else
            {
                StringBuilder sb = new StringBuilder(message);
                if (false == string.IsNullOrEmpty(extra))
                {
                    sb.Append("\n\n").Append(extra);
                }

                select = Confirm(title, sb.ToString());
            }

            GamebaseUtilAlertButtonID buttonID;

            if (BUTTON_OK == select)
            {
                buttonID = GamebaseUtilAlertButtonID.BUTTON_ONE;
            }
            else
            {
                buttonID = GamebaseUtilAlertButtonID.BUTTON_TWO;
            }

            if (-1 != handle)
            {
                GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> callback = GamebaseCallbackHandler.GetCallback <GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> >(handle);
                if (null != callback)
                {
                    callback(buttonID);
                }
            }
        }
        private GamebaseUtilAlertType GetButtonTypeWithPageTypeCode(string pageTypeCode)
        {
            GamebaseUtilAlertType alertType = GamebaseUtilAlertType.ALERT_OKCANCEL;

            switch (pageTypeCode)
            {
            case "DEFAULT":
                alertType = GamebaseUtilAlertType.ALERT_OK;
                break;

            case "DEFAULT_HTML":
                alertType = GamebaseUtilAlertType.ALERT_OK;
                break;

            case "URL":
                break;

            case "URL_PARAM":
                break;
            }

            return(alertType);
        }
 public virtual void ShowAlert(Dictionary <string, string> parameters, GamebaseUtilAlertType alertType, int handle)
 {
     GamebaseErrorNotifier.FireNotSupportedAPI(this, "ShowNotice");
 }
        public void ShowAlert(Dictionary <string, string> parameters, GamebaseUtilAlertType alertType, GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> buttonCallback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(buttonCallback);

            util.ShowAlert(parameters, alertType, handle);
        }