This script is used to create a status bar style widget that fades in, shows the message, waits a bit then fades out. Basic usage: UIStatus.Show(text)
Inheritance: MonoBehaviour
Esempio n. 1
0
 private void CloseMainGraphView(GameObject go)//Do the same job then SwitchToMainSensorView but do not call Datafiller, so we don't refresh the data of the sensor. avoid unecessary computation.
 {
     UIStatus = UIStatus.SensorView;
     UIMainSensorView.SetActive(true);
     UIMainGraphView.SetActive(false);
     UIMainSelectorView.SetActive(false);
 }
        /// <summary>
        /// Get the right message to use in <see cref="CreateWithMatchmakerUI(MatchRequest, Action, Action{string})"/>.
        /// </summary>
        private string GetMessageFromUIStatus(UIStatus status)
        {
            switch (status)
            {
            case UIStatus.Valid:
                return("Valid.");

            case UIStatus.InternalError:
                return("Error: InternalError. An internal error occurred.");

            case UIStatus.NotAuthorized:
                return("Error: NotAuthorized. The player is not authorized to perform the operation.");

            case UIStatus.VersionUpdateRequired:
                return("Error: VersionUpdateRequired. The installed version of Google Play services is out of date.");

            case UIStatus.Timeout:
                return("Error: Timeout. Timed out while awaiting the result.");

            case UIStatus.UserClosedUI:
                return("Error: UserClosedUI. UI closed by user.");

            case UIStatus.UiBusy:
                return("Error: UiBusy. UI was busy.");

            case UIStatus.LeftRoom:
                return("Error: LeftRoom. The player left the multiplayer room.");

            default:
                return(string.Empty);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 从隐藏状态重新显示UI
 /// </summary>
 public void ResumeUI()
 {
     m_status = UIStatus.Showing;
     gameObject.CustomSetActive(true);
     Raycaster.enabled = true;
     Resume();
 }
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     // Create your application here
     Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);
     uiStatus = UIStatus.CurrentHistory;
 }
Esempio n. 5
0
    //作成可能なキャラ数
    void Start()
    {
        //ゲームのセーブロード
        SaveDataBase.loadData();

        int createChara = 0;

        //初回か?
        if (SaveDataBase.GetSamurai_All() == 0)
        {
            //初期化
            SaveDataBase.InitSaveData();
            createChara = (int)SaveDataBase.GetSamuraiNum();
            //初回タイマー保存
            SaveDataBase.SetClose_Timer();
        }
        else
        {
            //アプリ終了前に徘徊している侍
            createChara = SaveDataBase.GetSamuraiNum();
        }


        CharacterManager.getInstance().characterAdd(createChara);
        //ステータス表示の更新
        UIStatus.getInstance().upDataText();
    }
Esempio n. 6
0
 private void OnInputComplete(string input)
 {
     if (!string.IsNullOrEmpty(input))
     {
         if (this.m_receiver.IsOnline())
         {
             BnetWhisperMgr.Get().SendWhisper(this.m_receiver, input);
             ChatMgr.Get().AddRecentWhisperPlayerToTop(this.m_receiver);
         }
         else if (ChatMgr.Get().IsChatLogFrameShown())
         {
             if (!BnetWhisperMgr.Get().SendWhisper(this.m_receiver, input))
             {
                 this.m_chatLogFrame.m_chatLog.OnWhisperFailed();
             }
             ChatMgr.Get().AddRecentWhisperPlayerToTop(this.m_receiver);
         }
         else
         {
             object[] args    = new object[] { this.m_receiver.GetBestName() };
             string   message = GameStrings.Format("GLOBAL_CHAT_RECEIVER_OFFLINE", args);
             UIStatus.Get().AddError(message);
         }
     }
     if (ChatMgr.Get().IsChatLogFrameShown())
     {
         this.ShowInput(false);
     }
     else
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// 隐藏UI
 /// </summary>
 public void HideUI()
 {
     m_status          = UIStatus.Hide;
     Raycaster.enabled = false;
     gameObject.CustomSetActive(false);
     Hide();
 }
Esempio n. 8
0
        private void LoadAsset()
        {
            if (status != UIStatus.Disabled)
            {
                return;
            }
            status       = UIStatus.Loading;
            atlasCount   = 0;
            textureCount = 0;

            if (atlases.Count == 0 && textures.Count == 0)
            {
                LoadAssetOver();
                return;
            }
            for (int i = 0, count = atlases.Count; i < count; i++)
            {
                RequestAtlas(atlases[i], RequestAtlasOver, atlasUnloadType, atlasUnloadInterval);
            }

            for (int i = 0, count = textures.Count; i < count; i++)
            {
                RequestTexture(textures[i], RequestTextureOver);
            }
        }
Esempio n. 9
0
 void OnDestroy()
 {
     if (mInst == this)
     {
         mInst = null;
     }
 }
Esempio n. 10
0
        private void Webtoon_DownloadFinished(bool success)
        {
            if (success)
            {
                GC.Collect(0, GCCollectionMode.Forced);                   // 쓰레드가 강제 종료된 후 메모리를 정리하기 위해 GC 강제 실행

                if (downFinishShutDownCheckBox.Checked)
                {
                    UIStatusVar = UIStatus.Idle;
                    //System.Diagnostics.Process.Start( "shutdown", "/s /f /t 60" ); // 시스템 종료

                    Win32.InitiateSystemShutdown("\\\\127.0.0.1", // 컴퓨터 이름
                                                 null,            // 종료 전 사용자에게 알릴 메시지
                                                 60,              // 종료까지 대기 시간
                                                 false,           // 프로그램 강제 종료 여부(false > 강제 종료)
                                                 false            // 시스템 종료 후 다시 시작 여부(true > 다시 시작)
                                                 );

                    new ShutdownNotify( ).ShowDialog( );

                    return;
                }

                System.Diagnostics.Process.Start("explorer.exe", Webtoon.BaseDirectory);

                UIStatusVar = UIStatus.Idle;

                NotifyBox.Show(this, "다운로드 완료", "다운로드를 모두 마무리했습니다.", NotifyBoxType.OK, NotifyBoxIcon.Information);
            }
            else
            {
                UIStatusVar = UIStatus.Idle;
            }
        }
Esempio n. 11
0
 private void ShowUIDelegateHandle(UIStatus status)
 {
     Debug.Log("ShowUIDelegateHandle - " + status.ToString());
     if (status == UIStatus.NotAuthorized)
     {
         PreventGoogleAutoSignIn();
     }
 }
 public static UIStatus Get()
 {
     if (s_instance == null)
     {
         s_instance = AssetLoader.Get().LoadUIScreen("UIStatus", true, false).GetComponent <UIStatus>();
     }
     return(s_instance);
 }
Esempio n. 13
0
 /// <summary>
 /// 回收UI
 /// </summary>
 public void DeSpawnUI()
 {
     m_status          = UIStatus.Despawn;
     m_CloseSelfEvent  = null;
     Raycaster.enabled = false;
     DeSpawn();
     PoolManager.instance.DeSpawn <GameObject>(AssetType.Prefab, this.gameObject);
 }
 private void UpdateUI(UIStatus uiStatus)
 {
     if (uiStatus == UIStatus.Complete)
     {
         FileIsCurrentButton.IsEnabled         = false;
         ProvideUpdatedVersionButton.IsEnabled = false;
     }
 }
Esempio n. 15
0
 private void UpdateUI(UIStatus uiStatus)
 {
     if (uiStatus == UIStatus.Complete)
     {
         OverwriteButton.IsEnabled = false;
         RenameButton.IsEnabled    = false;
     }
 }
 private void UpdateUI(UIStatus uiStatus)
 {
     if (uiStatus == UIStatus.Complete)
     {
         FileIsCurrentButton.IsEnabled = false;
         ProvideUpdatedVersionButton.IsEnabled = false;
     }
 }
 private void UpdateUI(UIStatus uiStatus)
 {
     if (uiStatus == UIStatus.Complete)
     {
         OverwriteButton.IsEnabled = false;
         RenameButton.IsEnabled = false;
     }
 }
Esempio n. 18
0
 private IEnumerator InnerShow()
 {
     m_status = UIStatus.Showing;
     gameObject.CustomSetActive(true);
     Raycaster.enabled = true;
     Show();
     yield break;
 }
Esempio n. 19
0
        private void ChangeUIStatus(UIStatus uiStatus)
        {
            if (uiStatus == _currentUIStatus)
            {
                return;
            }

            switch (uiStatus)
            {
            case UIStatus.StandBy:
                btnSelectDir.Enabled = true;
                btnSettings.Enabled  = true;
                dgvFileList.Columns["CheckBoxColumn"].ReadOnly = false;
                btnSelectAll.Enabled  = true;
                btnSelectNone.Enabled = true;
                btnStartBatch.Enabled = true;
                btnStartBatch.Text    = Properties.Resources.UiStartDownload;
                this.Cursor           = Cursors.Default;
                foreach (Control ctrl in this.Controls)
                {
                    ctrl.Cursor = Cursors.Default;
                }
                break;

            case UIStatus.Downloading:
                btnSelectDir.Enabled = false;
                btnSettings.Enabled  = false;
                dgvFileList.Columns["CheckBoxColumn"].ReadOnly = true;
                btnSelectAll.Enabled  = false;
                btnSelectNone.Enabled = false;
                //btnStartBatch.Enabled = false;
                btnStartBatch.Text = Properties.Resources.UiCancelDownload;
                this.Cursor        = Cursors.WaitCursor;
                foreach (Control ctrl in this.Controls)
                {
                    ctrl.Cursor = Cursors.WaitCursor;
                }
                break;

            case UIStatus.Canceling:
                btnSelectDir.Enabled = false;
                btnSettings.Enabled  = false;
                dgvFileList.Columns["CheckBoxColumn"].ReadOnly = true;
                btnSelectAll.Enabled  = false;
                btnSelectNone.Enabled = false;
                btnStartBatch.Enabled = false;
                btnStartBatch.Text    = Properties.Resources.UiCanceling;
                this.Cursor           = Cursors.WaitCursor;
                foreach (Control ctrl in this.Controls)
                {
                    ctrl.Cursor = Cursors.WaitCursor;
                }
                break;
            }

            _currentUIStatus = uiStatus;
        }
Esempio n. 20
0
 public void setUIALL(UIStatus status, string text, string name, bool btn, string btn_text)
 {
     setUiStatusColor(status);
     setUiStatusText(text);
     setUiStatusSprite(name);
     setUiStatusBtnInteractable(btn);
     setUiStatusButtonText(btn_text);
     this.name = name;
 }
 private void Awake()
 {
     s_instance = this;
     this.m_Text.gameObject.SetActive(false);
     if (OverlayUI.Get() == null)
     {
         throw new UnityException("Trying to create UIStatus before OverlayUI!");
     }
     OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT);
 }
Esempio n. 22
0
    //Navigation Functions
    #region
    private void SwitchToMainSelectorView(GameObject go)//go useless in the main selector
    {
        UIStatus = UIStatus.MainSelectorView;
        UIMainSensorView.SetActive(false);
        UIMainGraphView.SetActive(false);
        UIMainSelectorView.SetActive(true);

        //NO data filler because we don't want to overcompute at each flow. The scan must be done in the main frame. If you want to change it, uncomment the datafiller
        //await DataFiller();
    }
Esempio n. 23
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;
    }
Esempio n. 24
0
        private void Prepare()
        {
            status = UIStatus.Enabled;

            UIManager.ProcessUILayer(layer, this);

            OnEnable();

            ShowUICallback();
        }
Esempio n. 25
0
 private void GameWin()
 {
     closeUILoss = true;
     UIStatus.SetActive(false);
     UIEnd.SetActive(true);
     textWorL.text   = "WINNER";
     textResult.text = "YOUR POINT IS: " + point;
     StartCoroutine(Wait(7, 0));
     start = false;
 }
Esempio n. 26
0
 //Question mode selection
 public void ButtonQuestion()
 {
     start = true;
     UI.SetActive(true);
     UIStatus.SetActive(true);
     UIAdd.SetActive(true);
     UIChoose.SetActive(false);
     timeMore = Time.time;
     StartCoroutine(wait(2, 1f));
     noteText.text = "Your task is to answer questions to move to objects!";
 }
Esempio n. 27
0
 //Auto mode selection
 public void ButtonAuto()
 {
     StopAllCoroutines();
     UIChoose.SetActive(false);
     UI.SetActive(false);
     autoMove = true;
     start    = false;
     UIAdd.SetActive(true);
     UIConver.SetActive(false);
     UIStatus.SetActive(false);
     indexAuto = 0;
 }
Esempio n. 28
0
 /// <summary>
 /// 回收UI
 /// </summary>
 public void DeSpawnUI()
 {
     if (m_iterator != null)
     {
         StopCoroutine(m_iterator);
     }
     m_status          = UIStatus.Despawn;
     closeSelfAction   = null;
     Raycaster.enabled = false;
     DeSpawn();
     PoolManager.instance.DeSpawn <GameObject>(AssetType.Prefab, this.gameObject);
 }
Esempio n. 29
0
        /// <summary>
        /// 设置单据UI控件状态
        /// </summary>
        /// <param name="control"></param>
        /// <param name="status"></param>
        public static void SetStatus(Control control, UIStatus status)
        {
            foreach (Control ctrl in control.Controls)
            {
                if (ctrl is Bar)
                {
                    SetBarStatus(ctrl as Bar, status);
                }
                else if (ctrl is GridControl)
                {
                    #region GridView状态
                    var view = (ctrl as GridControl).MainView;

                    if (status == UIStatus.Browse)
                    {
                        (ctrl as GridControl).DataSource = null;
                    }
                    if (status == UIStatus.Add || status == UIStatus.Edit)
                    {
                        (view as GridView).OptionsBehavior.Editable         = true;
                        (view as GridView).OptionsBehavior.ReadOnly         = false;
                        (view as GridView).OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
                    }
                    else
                    {
                        (view as GridView).OptionsBehavior.Editable         = false;
                        (view as GridView).OptionsBehavior.ReadOnly         = true;
                        (view as GridView).OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect;
                    }
                    #endregion
                }
                else if (ctrl is DataGridView)
                {
                    var grid = ctrl as DataGridView;
                    grid.ReadOnly = (status == UIStatus.Browse || status == UIStatus.Audit);
                }
                else if (ctrl is Panel)
                {
                    SetStatus(ctrl as Panel, status);
                }
                else if (ctrl is SplitContainer)
                {
                    var sp = ctrl as SplitContainer;
                    SetStatus(sp.Panel1, status);
                    SetStatus(sp.Panel2, status);
                }
                else
                {
                    SetCtrlStatus(ctrl, status);
                }
            }
        }
Esempio n. 30
0
        private static void OnShowOverlayCompleted(UIStatus callback)
        {
#if CO_DEBUG
            Debug.Log("Leaderboards overlay closed.");
#endif
            if (callback == UIStatus.NotAuthorized)
            {
#if CO_DEBUG
                Debug.Log("User logged out from overlay, using guest user from now on.");
#endif
                GooglePlayGamesCloudProvider.Instance.ActivateGuestUserMode();
            }
        }
        private static void OnShowOverlayCompleted(UIStatus callback)
        {
#if CLOUDONCE_DEBUG
            UnityEngine.Debug.Log("Achievements overlay closed.");
#endif
            if (callback == UIStatus.NotAuthorized)
            {
#if CLOUDONCE_DEBUG
                UnityEngine.Debug.Log("User logged out from overlay, using guest user from now on.");
#endif
                GooglePlayGamesCloudProvider.Instance.ActivateGuestUserMode();
            }
        }
 private void OnInputComplete(string inputCommand)
 {
     this.m_inputActive = false;
     inputCommand       = inputCommand.TrimStart(new char[0]);
     if (!string.IsNullOrEmpty(inputCommand))
     {
         string str = this.ProcessCheat(inputCommand);
         if (!string.IsNullOrEmpty(str))
         {
             UIStatus.Get().AddError(str);
         }
     }
 }
Esempio n. 33
0
        private IEnumerator InnerShow(params object[] param)
        {
            m_status = UIStatus.Showing;
            gameObject.CustomSetActive(true);
            Raycaster.enabled = true;
            if (param != null && param.Length > 0)
            {
                Show(param);
            }
            else
            {
                Show();
            }

            yield break;
        }
Esempio n. 34
0
    // Sets the progress status of this element, updating its UI icon.
    public void setStatus(UIStatus status)
    {
        switch (status) {

        case UIStatus.Loading:
            statusImage.sprite = loadingIcon;
            break;

        case UIStatus.OK:
            statusImage.sprite = tickIcon;
            break;

        case UIStatus.Error:
            statusImage.sprite = errorIcon;
            break;
        }
    }
Esempio n. 35
0
        private void ShowTroubleCode()
        {
            if (codes == null || codes.Count == 0)
                return;

            uiStatus = UIStatus.Result;
            string[] arrays = new string[codes.Count];
            int i = 0;
            foreach (var item in codes)
            {
                arrays[i++] = StaticString.beforeBlank + item.Code + ": " + item.Content;
            }

            RunOnUiThread(() =>
            {
                ListView.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, arrays);
            }
            );
            ListView.ItemClick -= OnItemClickMikuni;
            ListView.ItemClick -= OnItemClickSynerject;
            ListView.ItemClick -= OnItemClickVisteon;
            ListView.ItemClick += OnTroubleCodeItemClick;
        }
Esempio n. 36
0
	void Awake () { mInst = this; mTrans = transform; mBackColor = background.color; }
Esempio n. 37
0
	void OnDestroy () { if (mInst == this) mInst = null; }
Esempio n. 38
0
 public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
 {
     if (keyCode == Keycode.Back)
     {
         if (uiStatus == UIStatus.CurrentHistory)
         {
             this.Finish();
             return true;
         }
         else if (uiStatus == UIStatus.Result)
         {
             uiStatus = UIStatus.CurrentHistory;
             if (model == Database.GetText("QM250J-2L", "QingQi"))
             {
                 this.Finish();
                 return true;
             }
             else
             {
                 ListView.ItemClick -= OnTroubleCodeItemClick;
                 ListView.ItemClick -= OnItemClickMikuni;
                 ListView.ItemClick -= OnItemClickSynerject;
                 ListView.ItemClick -= OnItemClickVisteon;
                 if ((model == Database.GetText("QM125T-8H", "QingQi")) ||
                     (model == Database.GetText("QM250GY", "QingQi")) ||
                     (model == Database.GetText("QM250T", "QingQi")))
                 {
                     OnSynerjectProtocol();
                 }
                 else
                 {
                     OnMikuniProtocol();
                 }
                 return true;
             }
         }
     }
     return base.OnKeyDown(keyCode, e);
 }
Esempio n. 39
0
        private void ChangeUIStatus(UIStatus uiStatus)
        {
            if(uiStatus == _currentUIStatus)
                return;

            switch(uiStatus)
            {
                case UIStatus.StandBy:
                    btnSelectDir.Enabled = true;
                    btnSettings.Enabled = true;
                    dgvFileList.Columns["CheckBoxColumn"].ReadOnly = false;
                    btnSelectAll.Enabled = true;
                    btnSelectNone.Enabled = true;
                    btnStartBatch.Enabled = true;
                    btnStartBatch.Text = Resources.UiStartDownload;
                    Cursor = Cursors.Default;
                    foreach(Control ctrl in Controls)
                        ctrl.Cursor = Cursors.Default;
                    break;
                case UIStatus.Downloading:
                    btnSelectDir.Enabled = false;
                    btnSettings.Enabled = false;
                    dgvFileList.Columns["CheckBoxColumn"].ReadOnly = true;
                    btnSelectAll.Enabled = false;
                    btnSelectNone.Enabled = false;
                    //btnStartBatch.Enabled = false;
                    btnStartBatch.Text = Resources.UiCancelDownload;
                    Cursor = Cursors.WaitCursor;
                    foreach(Control ctrl in Controls)
                        ctrl.Cursor = Cursors.WaitCursor;
                    break;
                case UIStatus.Canceling:
                    btnSelectDir.Enabled = false;
                    btnSettings.Enabled = false;
                    dgvFileList.Columns["CheckBoxColumn"].ReadOnly = true;
                    btnSelectAll.Enabled = false;
                    btnSelectNone.Enabled = false;
                    btnStartBatch.Enabled = false;
                    btnStartBatch.Text = Resources.UiCanceling;
                    Cursor = Cursors.WaitCursor;
                    foreach(Control ctrl in Controls)
                        ctrl.Cursor = Cursors.WaitCursor;
                    break;
            }

            _currentUIStatus = uiStatus;
        }
Esempio n. 40
0
	// Use this for initialization
	void Awake () 
	{
		main = this;
	}