void app_ApplicationLanguageChanged(object sender, Languages current)
        {
            if (statesView != null)
            {
                statesView.Filter = null;
            }

            States.Clear();

            M2SceneNode node = ModelSceneService.Instance.MainM2SceneNode;

            if (node != null)
            {
                for (int i = 0; i < (int)E_M2_STATES.EMS_COUNT; ++i)
                {
                    if (node.IsStateValid((E_M2_STATES)i))
                    {
                        M2State s = new M2State();
                        s.State = (E_M2_STATES)i;
                        s.Name  = s.GetStateName(current);
                        States.Add(s);
                    }
                }
            }

            statesView = CollectionViewSource.GetDefaultView(States);

            FilterState();
        }
        void _stateSelect_State_Selected(object sender, M2State state)
        {
            M2SceneNode node = ModelSceneService.Instance.MainM2SceneNode;

            if (node != null && node.M2Fsm != null)
            {
                node.M2Fsm.ChangeState(state.State);
            }
        }
        private void ChangeState()
        {
            M2State state = _listView.SelectedItem as M2State;

            if (state != null)
            {
                if (State_Selected != null)
                {
                    State_Selected.Invoke(this, state);
                }
            }
        }
Beispiel #4
0
        private void ChangeState()
        {
            if (Client.Instance.GetPlayer().GetRideNpcId() != 0)
            {
                return;
            }

            M2State state = _listView.SelectedItem as M2State;

            if (state != null)
            {
                if (State_Selected != null)
                {
                    State_Selected.Invoke(this, state);
                }
            }
        }
        public void FillData(M2SceneNode node)
        {
            App app = Application.Current as App;

            States.Clear();
            for (int i = 0; i < (int)E_M2_STATES.EMS_COUNT; ++i)
            {
                if (node.IsStateValid((E_M2_STATES)i))
                {
                    M2State s = new M2State();
                    s.State = (E_M2_STATES)i;
                    s.Name  = s.GetStateName(app.Language);
                    States.Add(s);
                }
            }

            statesView = CollectionViewSource.GetDefaultView(States);
        }
        private bool IsMatch(object state)
        {
            M2State i = state as M2State;

            return(-1 != i.Name.IndexOf(filter.Text, StringComparison.CurrentCultureIgnoreCase));
        }