private void Awake()
        {
            MessageBoxFactory = new UIMessageBoxFactory();

            // Load the message box config for not in challenge mode
            TextAsset configAsset = Resources.Load <TextAsset>(NOT_IN_CHALLENGE_MODE_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            NotInChallengeModeMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // Load the message box config for completing a challenge
            configAsset = Resources.Load <TextAsset>(CHALLENGE_COMPLETE_CONFIG_RESOURCE);
            Assert.IsNotNull(configAsset);
            ChallengeCompleteConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // Load the message box config for incomplete solution for activate all outputs mode
            configAsset = Resources.Load <TextAsset>(ACTIVATE_ALL_OUTPUTS_INCOMPLETE_CONFIG_RESOURCE);
            Assert.IsNotNull(configAsset);
            ActivateAllOutputs_IncompleteMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // Load the message box config for incomplete solution for match test cases mode
            configAsset = Resources.Load <TextAsset>(MATCH_TEST_CASES_INCOMPLETE_CONFIG_RESOURCE);
            Assert.IsNotNull(configAsset);
            MatchTestCases_IncompleteMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);
        }
Exemplo n.º 2
0
        // Use this for initialization
        private void Awake()
        {
            Assert.IsNotNull(Foreground);
            Assert.AreEqual(gameObject.transform.localScale.x, gameObject.transform.localScale.y);
            Components      = new List <SPLogicComponent>();
            Edges           = new List <SPEdge>();
            _CurrentTool    = SPTool.Pointer;
            _PreviousTool   = SPTool.Pointer;
            CurrentEdge     = null;
            Circuit         = new Circuit();
            Running         = false;
            Frozen          = false;
            IsDraggable     = true;
            CurrentMode     = GameMode.Sandbox;
            NumberedInputs  = new Dictionary <uint, SPNumberedInputToggler>();
            NumberedOutputs = new Dictionary <uint, SPNumberedOutput>();

            // Load the message box config for open circuit
            TextAsset configAsset = Resources.Load <TextAsset>(CHALLENGE_COMPLETE_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            ChallengeCompleteMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // "Hide" challenge verify button
            FindObjectOfType <UIOverlayControlVerifyChallengeButton>().GetComponent <RectTransform>().sizeDelta = new Vector2
            {
                x = 0,
                y = 0
            };
        }
Exemplo n.º 3
0
        /// <summary>
        /// 提示框
        /// </summary>
        /// <param name="infos">提示信息</param>
        /// <param name="type">类型INFO,ERROR,QUESTION,WARNING</param>
        public static void MessageShow(string infos, string type)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Message = infos;
            config.Buttons = MessageBox.Button.OK;
            if (type == "INFO")
            {
                config.Title = "提示";
                config.Icon = MessageBox.Icon.INFO;

            }
            else if (type == "ERROR")
            {
                config.Title = "错误";
                config.Icon = MessageBox.Icon.ERROR;
            }
            else if (type == "QUESTION")
            {
                config.Title = "询问";
                config.Icon = MessageBox.Icon.QUESTION;
            }
            else if (type == "WARNING")
            {
                config.Title = "警告";
                config.Icon = MessageBox.Icon.WARNING;
            }
            X.MessageBox.Show(config);
        }
Exemplo n.º 4
0
    /// <summary>
    /// 提示框
    /// </summary>
    /// <param name="infos">提示信息</param>
    /// <param name="type">类型INFO,ERROR,QUESTION,WARNING</param>
    public static void MessageShow(string infos, string type)
    {
        MessageBoxConfig config = new MessageBoxConfig();

        config.Message = infos;
        config.Buttons = MessageBox.Button.OK;
        if (type == "INFO")
        {
            config.Title = "提示";
            config.Icon  = MessageBox.Icon.INFO;
        }
        else if (type == "ERROR")
        {
            config.Title = "错误";
            config.Icon  = MessageBox.Icon.ERROR;
        }
        else if (type == "QUESTION")
        {
            config.Title = "询问";
            config.Icon  = MessageBox.Icon.QUESTION;
        }
        else if (type == "WARNING")
        {
            config.Title = "警告";
            config.Icon  = MessageBox.Icon.WARNING;
        }
        X.MessageBox.Show(config);
    }
Exemplo n.º 5
0
        protected override void Awake()
        {
            base.Awake();
            OutConnectors.AddRange(Enumerable.Repeat <SPConnector>(null, 1));

            // Set up renderer
            SpriteRenderer     = gameObject.GetComponent <SpriteRenderer>();
            CurrentSpriteIndex = 0;

            // Set up connectors
            OutConnector = Instantiate(SPOutConnectorPrefab, gameObject.transform, false);
            Assert.IsNotNull(OutConnector);
            OutConnector.gameObject.name         = "OutConnector";
            OutConnector.transform.localPosition = new Vector3(1, 0, -1);
            OutConnector.Register(this, SPConnectorType.SPOutConnector, 0);

            MessageBoxFactory = new UIMessageBoxFactory();

            // Load the message box config for save ciruit
            TextAsset configAsset = Resources.Load <TextAsset>(CLOCK_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            ClockMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            LogicComponent = new Clock(DEFAULT_CLOCK_RATE);
            Canvas.Circuit.AddComponent(LogicComponent);

            Assert.AreEqual(CLOCK_SPRITES_COUNT, UnselectedClockSprites.Count);
            Assert.AreEqual(CLOCK_SPRITES_COUNT, SelectedClockSprites.Count);
        }
        private void Awake()
        {
            MessageBoxFactory = new UIMessageBoxFactory();

            // Load the message box config for setting the internal clock
            TextAsset configAsset = Resources.Load <TextAsset>(INTERNAL_CLOCK_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            InternalClockMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);
        }
        private void Awake()
        {
            MessageBoxFactory = new UIMessageBoxFactory();

            // Load the message box config for setting the internal clock
            TextAsset configAsset = Resources.Load <TextAsset>(SET_MULTISTEP_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            SetMultistepMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);
        }
        private void Awake()
        {
            MessageBoxFactory = new UIMessageBoxFactory();

            // Load the message box config for unsaved changes
            var configAsset = Resources.Load <TextAsset>(UNSAVED_CHANGES_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            UnsavedChangesMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);
        }
Exemplo n.º 9
0
        private void Awake()
        {
            MessageBoxFactory = new UIMessageBoxFactory();

            // Load the message box config for import circuit
            TextAsset configAsset = Resources.Load <TextAsset>(IMPORT_CIRCUIT_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            ImportCircuitMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // Load the message box config for import error
            configAsset = Resources.Load <TextAsset>(IMPORT_ERROR_MESSAGE_BOX_CONFIG_RESOURCE);
            Assert.IsNotNull(configAsset);
            ImportErrorMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);
        }
Exemplo n.º 10
0
        private static void ShowMsg(MsgType type, string msg, string okJsFunction = "")
        {
            MessageBoxConfig messageBoxConfig = new MessageBoxConfig();

            MessageBox.Icon icon = MessageBox.Icon.NONE;
            switch (type)
            {
            case MsgType.Prompt:
                messageBoxConfig.Title = "提示";
                icon = MessageBox.Icon.INFO;
                break;

            case MsgType.Warning:
                messageBoxConfig.Title = "警告";
                icon = MessageBox.Icon.WARNING;
                break;

            case MsgType.Error:
                messageBoxConfig.Title = "错误";
                icon = MessageBox.Icon.ERROR;
                break;

            default:
                break;
            }
            messageBoxConfig.Multiline = false;
            messageBoxConfig.Buttons   = MessageBox.Button.OK;
            messageBoxConfig.Icon      = icon;
            messageBoxConfig.Message   = msg;
            messageBoxConfig.Closable  = true;

            MessageBoxButtonsConfig buttonConfig = new MessageBoxButtonsConfig();

            buttonConfig.Ok      = new MessageBoxButtonConfig();
            buttonConfig.Ok.Text = "确定";
            if (!string.IsNullOrEmpty(okJsFunction))
            {
                string okHandler = okJsFunction;         //"<script type='text/javascript'>{0}</script>";
                buttonConfig.Ok.Handler  = okJsFunction; //string.Format(okHandler, okJsFunction);
                messageBoxConfig.Handler = okJsFunction;
            }
            messageBoxConfig.MessageBoxButtonsConfig = buttonConfig;

            X.Msg.Show(messageBoxConfig);
        }
Exemplo n.º 11
0
        private void ShowContinueMsg()
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title    = "Inscripcion existente";
            config.Message  = "Ya existe una inscripción con este numero de documento. ¿Desea continuar con la inscripción?";
            config.Closable = false;
            config.Icon     = MessageBox.Icon.QUESTION;
            config.Buttons  = MessageBox.Button.YESNO;
            config.MessageBoxButtonsConfig = new MessageBoxButtonsConfig {
                Yes = new MessageBoxButtonConfig {
                    Handler = "App.direct.ClickedYES()", Text = "Si por favor"
                },
                No = new MessageBoxButtonConfig {
                    Handler = "App.direct.ClickedNO()", Text = "No gracias"
                }
            };
            X.Msg.Show(config);
        }
Exemplo n.º 12
0
        protected void deleteRowConfirmation(object sender, DirectEventArgs e)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title    = "ALERTE";
            config.Message  = "Êtes-vous sûr de vouloir supprimer?";
            config.Closable = false;
            config.Icon     = MessageBox.Icon.WARNING;
            config.Buttons  = MessageBox.Button.YESNO;
            config.MessageBoxButtonsConfig = new MessageBoxButtonsConfig
            {
                Yes = new MessageBoxButtonConfig {
                    Handler = "App.direct.deleteRow", Text = "YES"
                },
                No = new MessageBoxButtonConfig {
                    Handler = "Ext.net.DirectMethods.ClickedNO()", Text = "NO"
                }
            };
            X.Msg.Show(config);
        }
Exemplo n.º 13
0
        private void Awake()
        {
            MessageBoxFactory     = new UIMessageBoxFactory();
            SelectedFilenameStash = new Stack <string>();

            // Load the message box config for open circuit
            TextAsset configAsset = Resources.Load <TextAsset>(PLAY_CHALLENGE_MESSAGE_BOX_CONFIG_RESOURCE);

            Assert.IsNotNull(configAsset);
            PlayChallengeMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // Load the message box config for open error
            configAsset = Resources.Load <TextAsset>(OPEN_ERROR_MESSAGE_BOX_CONFIG_RESOURCE);
            Assert.IsNotNull(configAsset);
            OpenErrorMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);

            // Load the message box config for unsaved changes
            configAsset = Resources.Load <TextAsset>(UNSAVED_CHANGES_MESSAGE_BOX_CONFIG_RESOURCE);
            Assert.IsNotNull(configAsset);
            UnsavedChangesMessageBoxConfig = JsonUtility.FromJson <MessageBoxConfig>(configAsset.text);
        }