public InventoryTransferState(UIStateManager stateManager)
 {
     this.stateManager = stateManager;
     this.container    = stateManager.container;
     this.input        = stateManager.input;
     this.player       = stateManager.player;
 }
示例#2
0
        private void CreateToolBar(UIStateManager manager)
        {
            if (manager == null || this.ReportViewControl == null || this.ReportViewControl.Report == null)
            {
                int count = this.ReportFormInput.Actions.Count;
                for (int i = 0; i < count; i++)
                {
                    NetAction action = this.ReportFormInput.Actions[i] as NetAction;
                    //action.Style = (int)Proxy.UFPortalProxy.ToolButtonSyle.DropDown;
                    //if(action.Id!="Help")
                    //    action.IsVisible = false;
                    action.IsEnabled = false;
                }
                if (count > 0)
                {
                    this.ReportFormInput.FireActionsChange(ButtonChangeType.Modify);
                }
                return;
            }
            this.ReportFormInput.Actions.Clear();

            IActionDelegate actionDelegate = new ReportActionDelegate(this.ReportViewControl);

            foreach (StateButton sb in manager.CurrentState.Buttons)
            {
                NetAction action = new NetAction(sb.Key, actionDelegate);
                action.Text        = sb.Caption;
                action.IsEnabled   = sb.IsEnable;
                action.ToolTipText = sb.ToolTip;
                action.Image       = sb.Image;
                action.Tag         = null;
                action.Catalog     = sb.Category;
                action.RowSpan     = sb.RowSpan;
                action.ActionType  = (sb.Category == "编辑" ? NetAction.NetActionType.Edit : NetAction.NetActionType.Normal);
                action.Style       = sb.ButtonStyle;
                action.SetGroup    = sb.SetGroup;
                action.IsChecked   = sb.IsChecked;
                action.IsVisible   = sb.Visible;
                sb.Tag             = action;
                sb.VisibleChanged -= new VisibleChangedHandler(StateButtonVisibleChanged);
                sb.VisibleChanged += new VisibleChangedHandler(StateButtonVisibleChanged);

                AddSubButtons(sb, actionDelegate, action);
                this.ReportFormInput.Actions.Add(sb.Key, action);
                if (!UserToolbarStateManager.ReportActionsState.ContainsKey(this.ReportViewControl.ClientReportContext.GetReportId()))
                {
                    UserToolbarStateManager.ReportActionsState.Add(this.ReportViewControl.ClientReportContext.GetReportId(), this.ReportFormInput.Actions);
                }
                else
                {
                    UserToolbarStateManager.ReportActionsState[this.ReportViewControl.ClientReportContext.GetReportId()] = this.ReportFormInput.Actions;
                }
            }
            this.ReportFormInput.FormInputExtend.IsSmallButton = manager.CurrentState.Buttons.IsSmallButton;
            this.ReportFormInput.FireActionsChange(ButtonChangeType.Add);
            this.ReportFormInput.Text = this.GetObjectName();
            (this.ReportEditorPart as NetEditor).Refresh(this.ReportFormInput);

            this.ReportViewControl.Focus();
        }
 public GameOptionsState(UIStateManager stateManager)
 {
     this.stateManager = stateManager;
     this.container    = stateManager.container;
     this.input        = stateManager.input;
     this.player       = stateManager.player;
 }
示例#4
0
 public MarketState(UIStateManager stateManager)
 {
     this.stateManager = stateManager;
     this.container    = stateManager.container;
     this.input        = stateManager.input;
     this.player       = stateManager.player;
 }
示例#5
0
 public NPCInteractionState(UIStateManager stateManager)
 {
     this.stateManager = stateManager;
     this.container    = stateManager.container;
     this.player       = stateManager.player;
     this.input        = stateManager.input;
     sub = new Subscriber();
 }
示例#6
0
    private void Player_OnDeath(object sender, System.EventArgs e)
    {
        content.SetActive(true);

        UIStateManager.RegisterUI();

        quitButton.onClick.AddListener(CryQuit);
    }
示例#7
0
    public void OpenUI(IContainer a, IContainer b)
    {
        if (UIStateManager.State == UIState.Free && state == UITransferState.Free)
        {
            UIStateManager.RegisterUI();
            listerA.Clear();
            listerA.Populate(a);
            listerB.Clear();
            listerB.Populate(b);
            content.SetActive(true);
            Time.timeScale = 0.0f;

            State = UITransferState.Busy;
        }
    }
示例#8
0
 private void OnStateChangeCallback(object sender, UIMenuStateChangeArgs args)
 {
     if (args.newState == UIMenuState.Hidden && State == UIMenuState.Shown)
     {
         UIStateManager.UnregisterUI();
         content.SetActive(false);
         Time.timeScale = 1.0f;
     }
     else if (args.newState == UIMenuState.Shown && State == UIMenuState.Hidden)
     {
         UIStateManager.RegisterUI();
         content.SetActive(true);
         Time.timeScale = 0.0f;
     }
 }
示例#9
0
    //################################ Initialization ################################
    // Singleton check.
    void Awake()
    {
        if (controller == null)
        {
            controller = this;
        }
        else if (controller != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        FindReferences();
        ReadyAnimtaions();
        ShowPanel();
        Application.targetFrameRate = targetFrameRate;
    }
示例#10
0
    private void Start()
    {
        GameManager.OnMazeGenerationFinished += GameManager_OnMazeGenerationFinished;
        GameManager.OnMazePopulationFinished += GameManager_OnMazePopulationFinished;
        GameManager.OnPlayerCreation         += GameManager_OnPlayerCreation;

        animator                 = GetComponent <Animator>();
        loaderActualizer         = ActualizeLoadingSentence();
        textChanger              = ChangeTextOnTime();
        progressActualizerThread = new System.Threading.Thread(ActualizeProgress);

        StartCoroutine(loaderActualizer);
        StartCoroutine(textChanger);
        progressActualizerThread.Start();

        UIStateManager.RegisterUI();
    }
示例#11
0
    void Start()
    {
        Settings.Load();

        boundController      = _boundController;
        collectableGenerator = _collectableGenerator;
        playerController     = _playerController;
        audioController      = _audioController;
        damageIndicator      = _damageIndicator;
        uiStateManager       = _uiStateManager;

        pointsPerCrystal     = _pointsPerCrystal;
        boundBonusPercentage = _boundBonusPercentage;

        highscore = PlayerPrefs.GetInt("highscore", 0);

        StartGame();
    }
示例#12
0
    public void CloseUI()
    {
        if (state == UITransferState.Busy)
        {
            if (listerB.Target is Container)
            {
                AudioManager.PlaySfx(closeClip, Camera.main.transform);
            }

            UIStateManager.UnregisterUI();
            listerA.Clear();
            listerB.Clear();
            content.SetActive(false);
            Time.timeScale = 1.0f;

            State = UITransferState.Free;
        }
    }
示例#13
0
    private void OnLevelWasLoaded(int level)
    {
        if (generateMaze)
        {
            mazeInstance = gameObject.GetComponentWithTag <Maze>("Maze");
            gridInstance = mazeInstance.GetComponent <Grid>();

            if (mazeInstance != null)
            {
                mazeInstance.Seed = seed + (int)stage;
                Task mazeGeneration = new Task(mazeInstance.Generate(), false);
                mazeGeneration.Finished += MazeGenerationFinished;
                mazeGeneration.Start();
            }
            else
            {
                throw new InvalidOperationException("Maze instance undefined.");
            }

            generateMaze = false;
        }

        UIStateManager.ClearState();
    }
示例#14
0
	void Awake()
	{
		g_instance = this;		
	}
示例#15
0
 public IdleState(UIStateManager stateManager)
 {
     this.stateManager = stateManager;
     this.container    = stateManager.container;
     this.input        = stateManager.input;
 }
    void Awake()
    {
        if (LockFps)
        {
            Application.targetFrameRate = FpsClampValue;
        }

        if (Manager)
        {
            DestroyImmediate(gameObject);
        }
        else
        {
            DontDestroyOnLoad(gameObject);
            Manager = this;
        }
    }
示例#17
0
 public void DisableCallback()
 {
     UIStateManager.UnregisterUI();
     gameObject.SetActive(false);
 }