Example #1
0
        public void Update(StripButtonState buildStatus, short type)
        {
            SuspendFlowLayout();
            buttons[type].State = buildStatus;

            InvokeShow(type);

            UpdateFlowLayoutPanelSize();
            ResumeFlowLayout();
        }
Example #2
0
        public void SetStateWithoutInvoke(StripButtonState state)
        {
            StripButtonState oldstate = state;

            this.state = state;
            if (this.state != oldstate)
            {
                OnStateChangeWithoutInvoke(state);
            }
            else
            if (state == StripButtonState.Percantage)
            {
                Refresh();
            }
        }
Example #3
0
        /*public bool DrawPercentage {
         *      get { return drawPercentage; }
         *      set {
         *              drawPercentage = value;
         * InvokeRefresh();
         *      }
         * }*/


        private void OnStateChange(StripButtonState state)
        {
            switch (state)
            {
            case StripButtonState.Inactive:
                InvokeState(new ApplyStateCallback(ApplyInactive));
                break;

            case StripButtonState.Ready:
                InvokeState(new ApplyStateCallback(ApplyReady));
                break;

            case StripButtonState.Active:
                InvokeState(new ApplyStateCallback(ApplyActive));
                break;

            case StripButtonState.Percantage:
                InvokeState(new ApplyStateCallback(ApplyPercent));
                break;
            }
        }
Example #4
0
        private void OnStateChangeWithoutInvoke(StripButtonState state)
        {
            switch (state)
            {
            case StripButtonState.Inactive:
                ApplyInactive();
                break;

            case StripButtonState.Active:
                ApplyActive();
                break;

            case StripButtonState.Ready:
                ApplyReady();
                break;

            case StripButtonState.Percantage:
                ApplyPercent();
                break;
            }
            Refresh();
        }
Example #5
0
        public int RightBuildingClick(int id, bool isUnit)
        {
            InfoLog.WriteInfo("Enter RightBuildingClick" + id, EPrefix.BMan);
            int current = -1;

            InfoLog.WriteInfo("Lock cObjLock in RightBuildingClick", EPrefix.BMan);
            lock (this.cObjLock)
                current = _currentObjectID;
            InfoLog.WriteInfo("Unlock cObjLock in RightBuildingClick", EPrefix.BMan);
            if (current != -1)
            {
                StripButtonState state = _stripData[current][(short)id].State;
                InfoLog.WriteInfo("State: " + state + " " + Enum.GetName(typeof(StripButtonState), state), EPrefix.BMan);
                switch (state)
                {
                case StripButtonState.Active:
                    RightBuildActiveClick(id, isUnit);
                    InfoLog.WriteInfo("Exit RightBuildingClick", EPrefix.BMan);
                    return(current);
                }
            }
            InfoLog.WriteInfo("Exit RightBuildingClick", EPrefix.BMan);
            return(-1);
        }
Example #6
0
 public BuildStatusStrip(int objectid, short typeid, short turnsToBuild, BuildType type) : base(objectid, typeid, turnsToBuild, type)
 {
     _state = StripButtonState.Active;
 }
Example #7
0
 public void SetState(int key, StripButtonState state)
 {
     buttons[key].State = state;
 }