Exemplo n.º 1
0
        private void Macro_button_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button != null)
            {
                Macro macro = m_sysConfig.Profile.UserMacros.Find(button.ToolTip.ToString());
                if (macro != null)
                {
                    HistoryStep step = new HistoryStep();
                    step.number      = -1;
                    step.category    = "Macro";
                    step.description = button.ToolTip.ToString();
                    step.Buffer      = macro.Buffer;
                    step.Filter      = macro.Filter;
                    step.Histogram   = macro.Histogram;
                    step.PseudoColor = macro.PseudoColor;

                    m_History.AddStep(step);

                    IsMacroButtonClicked = true;

                    m_History.ApplyStep();
                }
            }
        }
Exemplo n.º 2
0
        private void ApplyHistory(HistoryStep step)
        {
            m_IsColorEnabled = (string.Compare(step.Histogram.effecttype, "Color", true) == 0) ? true : false;

            UpdateDisplay();

            rangeSlider.SetSelectedRange(step.Histogram.start, step.Histogram.end);
        }
Exemplo n.º 3
0
 public Macro (string name, HistoryStep history)
 {
     Name = name;
     Buffer = history.Buffer;
     PseudoColor = history.PseudoColor;
     Histogram = history.Histogram;
     Filter = history.Filter;
 }
Exemplo n.º 4
0
 public Macro(string name, HistoryStep history)
 {
     Name        = name;
     Buffer      = history.Buffer;
     PseudoColor = history.PseudoColor;
     Histogram   = history.Histogram;
     Filter      = history.Filter;
 }
Exemplo n.º 5
0
        internal void AddDitherIndicator()
        {
            lock (lockObj) {
                var dither = HistoryStep.GenerateDitherStep();
                overallGuideSteps.AddLast(dither);

                GuideSteps.Add(dither);
            }
        }
Exemplo n.º 6
0
 public void Clear()
 {
     lock (lockObj) {
         overallGuideSteps.Clear();
         GuideSteps.Clear();
         RMS.Clear();
         MaxDurationY = 1;
         HistoryStep.ResetIdProvider();
     }
 }
Exemplo n.º 7
0
    public HistoryStep BuildHistoryStep(int counter, ChessData source, ChessData target, ChessDataPath path, int result)
    {
        HistoryStep re = new HistoryStep();

        re.Counter = counter;
        re.Source  = source;
        re.Target  = target;
        re.Path    = path;
        re.Result  = result;
        return(re);
    }
Exemplo n.º 8
0
 public HistoryStep(HistoryStep other, Dictionary <Hero, Hero> heroMap)
 {
     type   = other.type;
     block  = new SimBlock(other.block);
     health = other.health;
     if (other.damages != null)
     {
         damages = new Damage[other.damages.Length];
         for (int i = 0; i < damages.Length; i++)
         {
             damages [i] = new Damage(other.damages [i], heroMap);
         }
     }
 }
Exemplo n.º 9
0
    public override bool DoChangeDamageOnAttack(ref Damage[] dmgs)
    {
        HistoryStep lastHistory = GetLastStep(HistoryStep.RecordType.StartBattle);

        if (lastHistory.block.Equals(parent.TemSimpleBlock))
        {
            for (int i = 0; i < dmgs.Length; ++i)
            {
                dmgs[i].damage *= attackMutiple;
            }
            return(true);
        }
        return(false);
    }
Exemplo n.º 10
0
        private void HistoryList_Closed(object sender, EventArgs e)
        {
            int index = History_ListView.SelectedIndex;

            if ((m_History.Step.Count - 1) != index)
            {
                HistoryStep step = m_History.GetStep(index);
                step.number      = -1;
                step.category    = "Reapply";
                step.description = "Step " + index.ToString();
                m_History.AddStep(step);
            }

            History_Image.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/HistoryOff.png", UriKind.Relative));
        }
Exemplo n.º 11
0
        public bool AddTransition(PageName page, string currentPosition, HistoryStep historyStep)
        {
            History history     = new History(page, currentPosition, historyStep);
            History currHistory = GetCurrentTransition();

            if (currHistory != null && currHistory.HistoryEquals(history))
            {
                return(false);
            }
            HistoryList.Add(history);
            if (EventRedirectPage != null)
            {
                EventRedirectPage(history, null);
            }
            return(true);
        }
Exemplo n.º 12
0
        public void GotoPage(HistoryStep step)
        {
            if (User.Singleton == null)
            {
                loginTemplate.GoToMain();
                Content = loginTemplate;
                return;
            }

            if (userInfoLayout == null)
            {
                InitializationUserInfoAsync();
                Content = userInfoLayout;
                return;
            }
            Content = userInfoLayout;

            switch (step)
            {
            case HistoryStep.MyOrders:
                OnePage.topView.lblPagePosition.Text = "Мои заказы";
                userInfoLayout.GotoOrdersList(true);
                break;

            case HistoryStep.StatusOrders:
                OnePage.topView.lblPagePosition.Text = "Статус заказа";
                userInfoLayout.GotoStatusList(true);
                break;

            case HistoryStep.InfoOrder:
                OnePage.topView.lblPagePosition.Text = "Информация о заказе";
                userInfoLayout.GoToOrderResultView(true);
                break;

            case HistoryStep.OrdersList:
                OnePage.topView.lblPagePosition.Text = "Состав заказа";
                userInfoLayout.GoToOrdersList();
                break;

            default:
                if (User.Singleton != null)
                {
                    userInfoLayout.SetMain();
                }
                break;
            }
        }
Exemplo n.º 13
0
    public HistoryStep GetLastStep(HistoryStep.RecordType type)
    {
        HistoryStep lastHistory = null;

        int hi = parent.GetHeroInfo().history.Count - 1;

        while (hi >= 0)
        {
            lastHistory = parent.GetHeroInfo().history[hi];
            if (lastHistory.type == type)
            {
                break;
            }
            hi--;
        }

        return(lastHistory);
    }
Exemplo n.º 14
0
        public void GotoTableSize(bool isHistory, HistoryStep step = HistoryStep.Default)
        {
            if (!isHistory)
            {
                OnePage.redirectApp.AddTransition(PageName.Catalog, "Размерные таблицы", HistoryStep.TableSizes);
            }

            if (tableSizeView == null)
            {
                tableSizeView = new TableSizeView();
                mainLayout.Children.Add(tableSizeView);
            }
            else
            {
                tableSizeView.GotoMain();
            }
            productTemplate.IsVisible = false;
            scrollView.IsVisible      = false;
            tableSizeView.IsVisible   = true;
        }
Exemplo n.º 15
0
    public void Record(Damage[] dmgs, HistoryStep.RecordType type)
    {
        HistoryStep step = new HistoryStep();

        step.type   = type;
        step.block  = new SimBlock(parent.TemSimpleBlock);
        step.health = m_health;
        if (dmgs == null)
        {
            step.damages = new Damage[0];
        }
        else
        {
            step.damages = new Damage[dmgs.Length];
            for (int i = 0; i < dmgs.Length; ++i)
            {
                step.damages[i] = dmgs[i];
            }
        }
        history.Add(step);
    }
Exemplo n.º 16
0
        public void AddGuideStep(IGuideStep step)
        {
            lock (lockObj) {
                var historyStep = HistoryStep.FromGuideStep(step, Scale == GuiderScaleEnum.PIXELS ? 1 : PixelScale);
                overallGuideSteps.AddLast(historyStep);

                if (GuideSteps.Count == HistorySize)
                {
                    var elementIdx = overallGuideSteps.Count - HistorySize;
                    if (elementIdx >= 0)
                    {
                        var stepToRemove = overallGuideSteps.ElementAt(elementIdx);
                        RMS.RemoveDataPoint(stepToRemove.RADistanceRaw, stepToRemove.DECDistanceRaw);
                    }
                }

                RMS.AddDataPoint(step.RADistanceRaw, step.DECDistanceRaw);

                GuideSteps.Add(historyStep);
                CalculateMaximumDurationY();
            }
        }
Exemplo n.º 17
0
        private void ApplyHistory(HistoryStep step)
        {
            foreach (BufferInstance buffer in m_Buffers)
            {
                if (string.Compare(buffer.Instance.Name, step.Buffer.name, true) == 0)
                {
                    buffer.Instance.ApplyFilter(true);
                }
                else
                {
                    buffer.Instance.ApplyFilter(false);
                }
            }

            foreach (ComboBoxItem cbi in PseudoColor_ComboBox.Items)
            {
                if (string.Compare(cbi.Name, step.PseudoColor.name, true) == 0)
                {
                    PseudoColor_ComboBox.SelectedItem = cbi;
                    break;
                }
            }

            foreach (HistoryFilter element in step.Filter)
            {
                FilterInstance filter = m_Filters.Find(element.name);

                if (filter != null)
                {
                    filter.Instance.ApplyFilter(element.parameter, element.optparameter1);
                }
            }

            if (step.DualEnergy != null)
            {
                ApplyDualEnergy(step.DualEnergy.name, false);
            }
        }
Exemplo n.º 18
0
 public History(PageName page, string currentPosition, HistoryStep historyStep)
 {
     Page            = page;
     CurrentPosition = currentPosition;
     Step            = historyStep;
 }
Exemplo n.º 19
0
    public override void OnDraw(int index, object data)
    {
        stepData = (HistoryStep)data;
        string     belongMe = App.Package.Player.playerInfo.ZoneId + "/" + App.Package.Player.playerInfo.UserId;
        bool       me       = true;
        PlayerInfo enemy    = null;

        for (int i = 0; i < App.Package.ChessGame.EnemyPlayerList.Count; i++)
        {
            PlayerInfo player = App.Package.ChessGame.EnemyPlayerList[i];
            string     belong = player.ZoneId + "/" + player.UserId;
            if (belong == stepData.Source.Belong)
            {
                enemy = player;
                me    = false;
                break;
            }
            if (belong == stepData.Target.Belong)
            {
                enemy = player;
                break;
            }
        }
        string item = "第" + (stepData.Counter + 1) + "回合:";

        if (me)
        {
            item += "我方 [11B0FF]" + ChessAgainst.ChessHeroNameDefine[stepData.Source.ChessType] + "[-] ";
            if (stepData.Target.ChessRemoteId == 0)
            {
                item += "走子";
            }
            else
            {
                if (stepData.Result == (int)ChessMoveResult.WIN)
                {
                    item += "[FFC300]胜利";
                }
                else
                {
                    item += "[999999]阵亡";
                }
            }
        }
        else
        {
            if (stepData.Target.ChessRemoteId == 0)
            {
                item += "敌方走子";
            }
            else
            {
                if (stepData.Result == (int)ChessMoveResult.WIN || stepData.Result == (int)ChessMoveResult.TIE)
                {
                    item += "敌方走子,我方 [11B0FF]" + ChessAgainst.ChessHeroNameDefine[stepData.Target.ChessType] + "[-] [999999]阵亡";
                }
                else
                {
                    item += "敌方走子,我方 [11B0FF]" + ChessAgainst.ChessHeroNameDefine[stepData.Target.ChessType] + "[-] [FFC300]胜利";
                }
            }
        }
        itemLable.text = item;
    }
Exemplo n.º 20
0
        private void Macro_button_Click (object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button != null)
            {
                Macro macro = m_sysConfig.Profile.UserMacros.Find(button.ToolTip.ToString());
                if (macro != null)
                {
                    HistoryStep step = new HistoryStep();
                    step.number = -1;
                    step.category = "Macro";
                    step.description = button.ToolTip.ToString();
                    step.Buffer = macro.Buffer;
                    step.Filter = macro.Filter;
                    step.Histogram = macro.Histogram;
                    step.PseudoColor = macro.PseudoColor;

                    m_History.AddStep(step);

                    IsMacroButtonClicked = true;

                    m_History.ApplyStep();                   
                }
            }
        }
Exemplo n.º 21
0
 public bool AddTransition(PageName page, string currentPosition, bool isRedirectToBack = false, bool isNarrowTitle = false, HistoryStep historyStep = HistoryStep.Default)
 {
     return(this.AddTransition(page, currentPosition, isRedirectToBack, isNarrowTitle, null));
 }
Exemplo n.º 22
0
        private void ApplyHistory (HistoryStep step)
        {
            m_IsColorEnabled = (string.Compare(step.Histogram.effecttype, "Color", true) == 0) ? true : false;

            UpdateDisplay();

            rangeSlider.SetSelectedRange(step.Histogram.start, step.Histogram.end);
        }
Exemplo n.º 23
0
        private void ApplyHistory (HistoryStep step)
        {
            foreach (BufferInstance buffer in m_Buffers)
            {
                if (string.Compare(buffer.Instance.Name, step.Buffer.name, true) == 0)
                {
                    buffer.Instance.ApplyFilter(true);
                }
                else
                {
                    buffer.Instance.ApplyFilter(false);
                }
            }

            foreach (ComboBoxItem cbi in PseudoColor_ComboBox.Items)
            {
                if (string.Compare(cbi.Name, step.PseudoColor.name, true) == 0)
                {
                    PseudoColor_ComboBox.SelectedItem = cbi;
                    break;
                }
            }

            foreach (HistoryFilter element in step.Filter)
            {
                FilterInstance filter = m_Filters.Find(element.name);

                if (filter != null)
                {
                    filter.Instance.ApplyFilter(element.parameter, element.optparameter1);
                }
            }

            if (step.DualEnergy != null)
            {
                ApplyDualEnergy(step.DualEnergy.name, false);
            }
        }