Ejemplo n.º 1
0
        public ATaskTempl Clone()
        {
            MemoryStream output       = new MemoryStream();
            BinaryWriter bw           = new BinaryWriter(output);
            BinaryReader binaryStream = new BinaryReader(output);

            this.Write(9999, bw);
            ATaskTempl task = new ATaskTempl(9999, binaryStream, 0, null);

            bw.Close();
            binaryStream.Close();
            output.Close();
            return(task);
        }
Ejemplo n.º 2
0
        public static void UpdateNode(TreeNode Node, ATaskTempl Task, int UpdateType, int GMIconIndex = 12)
        {
            string Name               = Task.Name;
            Color  Color              = Color.White;
            int    ImageIndex         = 0;
            int    SelectedImageIndex = 1;

            switch ((GlobalData.ENUM_TASK_TYPE)Task.m_ulType)
            {
            case GlobalData.ENUM_TASK_TYPE.enumTTCommonOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTRepeatedOld:
                ImageIndex         = 8;
                SelectedImageIndex = 9;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTKeyOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTBossOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTInstanceOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTScrollOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTBusinessOld:
                ImageIndex         = 4;
                SelectedImageIndex = 5;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTFeelingOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTTacticsOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTRegionOld:
                ImageIndex         = 6;
                SelectedImageIndex = 7;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTSevenKillListOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTFactionOld:
                ImageIndex         = 6;
                SelectedImageIndex = 7;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTHintOld:
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTDaily:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(38, 178, 255);
                    }
                    else
                    {
                        Color = Color.FromArgb(100, 185, 250);
                    }
                }
                ImageIndex         = 8;
                SelectedImageIndex = 9;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTLevel2:
                if (GlobalData.version >= 120)
                {
                    Color = Color.FromArgb(238, 156, 15);
                }
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTMajor:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(20, 255, 255);
                    }
                    else
                    {
                        Color = Color.FromArgb(255, 150, 255);
                    }
                }
                if (GlobalData.version >= 156)
                {
                    ImageIndex         = 16;
                    SelectedImageIndex = 17;
                }
                else
                {
                    ImageIndex         = 10;
                    SelectedImageIndex = 11;
                }
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTBranch:
                if (GlobalData.version >= 120)
                {
                    Color = Color.FromArgb(255, 255, 255);
                }
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTEvent:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(150, 224, 255);
                    }
                    else
                    {
                        Color = Color.FromArgb(255, 255, 0);
                    }
                }
                ImageIndex         = 8;
                SelectedImageIndex = 9;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTQiShaList:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 161)
                    {
                        Color = Color.FromArgb(150, 224, 255);
                    }
                    else if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(255, 255, 255);
                    }
                    else
                    {
                        Color = Color.FromArgb(180, 180, 255);
                    }
                }
                ImageIndex         = 6;
                SelectedImageIndex = 7;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTFaction:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(255, 255, 255);
                    }
                    else
                    {
                        Color = Color.FromArgb(0, 200, 200);
                    }
                }
                ImageIndex         = 4;
                SelectedImageIndex = 5;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTFunction:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(20, 196, 100);
                    }
                    else
                    {
                        Color = Color.FromArgb(120, 255, 120);
                    }
                }
                ImageIndex         = 4;
                SelectedImageIndex = 5;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTLegend:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 126)
                    {
                        if (GlobalData.version >= 156)
                        {
                            Color = Color.FromArgb(255, 255, 255);
                        }
                        else
                        {
                            Color = Color.FromArgb(255, 0, 0);
                        }
                    }
                    else
                    {
                        Color = Color.FromArgb(255, 120, 120);
                    }
                }
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTQuestion:
                if (GlobalData.version >= 120)
                {
                    Color = Color.FromArgb(146, 255, 216);
                }
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTHome:
                if (GlobalData.version >= 120)
                {
                    if (GlobalData.version >= 156)
                    {
                        Color = Color.FromArgb(84, 197, 255);
                    }
                    else
                    {
                        Color = Color.FromArgb(255, 120, 120);
                    }
                }
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTGrowth:
                Color              = Color.FromArgb(20, 196, 100);
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTStory:
                Color              = Color.FromArgb(255, 173, 255);
                ImageIndex         = 12;
                SelectedImageIndex = 13;
                break;

            case GlobalData.ENUM_TASK_TYPE.enumTTInstance:
                Color              = Color.FromArgb(255, 255, 255);
                ImageIndex         = 0;
                SelectedImageIndex = 1;
                break;
            }
            if (Task.m_bKeyTask)
            {
                Color = Color.FromArgb(238, 156, 15);
                if (GlobalData.version >= 156)
                {
                    ImageIndex         = 14;
                    SelectedImageIndex = 15;
                }
                else
                {
                    ImageIndex         = 2;
                    SelectedImageIndex = 3;
                }
            }
            if (Task.m_bGM)
            {
                ImageIndex         = GMIconIndex;
                SelectedImageIndex = GMIconIndex;
            }
            if (Name.StartsWith("^"))
            {
                try
                {
                    if (GlobalData.version <= 119 || ((Task.m_ulType == (int)GlobalData.ENUM_TASK_TYPE.enumTTQiShaList || Task.m_ulType == (int)GlobalData.ENUM_TASK_TYPE.enumTTHome) && !Task.m_bKeyTask))
                    {
                        if (Int32.TryParse(Name.Substring(1, 6), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out int color_int))
                        {
                            Color = Color.FromArgb(color_int);
                        }
                        else
                        {
                            Color = Color.White;
                        }
                    }
                }
                catch
                {
                    Color = Color.White;
                }
            }
            if (UpdateType != 1)
            {
                Node.Text = Task.m_ID.ToString() + " - " + ColorClean(Name);
            }
            Node.ForeColor          = Color;
            Node.ImageIndex         = ImageIndex;
            Node.SelectedImageIndex = SelectedImageIndex;
        }