Beispiel #1
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            string directoryName = Path.GetDirectoryName(ImageFile);
            string imageName     = Path.GetFileNameWithoutExtension(ImageFile);

            Directory.CreateDirectory(directoryName + "/" + imageName);

            int    width    = SourceImage.Width;
            int    height   = SourceImage.Height;
            int    size     = Math.Max(width, height);
            double numTiles = size / 256.0;

            for (int level = MinLevel; level <= MaxLevel; level++)
            {
                int logTileSize = (OrgLevel > level) ? 256 << (OrgLevel - level) : 256 >> (level - OrgLevel);
                int numTilesX   = (width % logTileSize == 0) ? width / logTileSize : width / logTileSize + 1;
                int numTilesY   = (height % logTileSize == 0) ? height / logTileSize : height / logTileSize + 1;

                for (int tx = 0; tx < numTilesX; tx++)
                {
                    for (int ty = 0; ty < numTilesY; ty++)
                    {
                        using (var tileImg = new Bitmap(256, 256))
                            using (var graphcis = Graphics.FromImage(tileImg))
                            {
                                graphcis.FillRectangle(new SolidBrush(BackgroundColor), 0, 0, 256, 256);
                                graphcis.DrawImage(SourceImage, new Rectangle(0, 0, 256, 256),
                                                   new Rectangle(tx * logTileSize, ty * logTileSize, logTileSize, logTileSize),
                                                   GraphicsUnit.Pixel);

                                tileImg.Save(string.Format("{0}/{1}/{2}-{3}-{4}.jpg", directoryName, imageName, level, tx, ty),
                                             System.Drawing.Imaging.ImageFormat.Jpeg);

                                bw.ReportProgress(0, new SendFeedbackEventArgs {
                                    Level = level, X = tx, Y = ty, Image = tileImg.Clone() as Bitmap
                                });
                            }
                    }
                }
            }

            string template;

            using (var reader = new StreamReader(Application.StartupPath + "\\Template.html"))
            {
                template = reader.ReadToEnd();
                reader.Close();
            }

            template = template.Replace("//image//", imageName);

            template = template.Replace("//width//", width.ToString());
            template = template.Replace("//height//", height.ToString());

            template = template.Replace("//maxLevel//", MaxLevel.ToString());
            template = template.Replace("//minLevel//", MinLevel.ToString());
            template = template.Replace("//orgLevel//", OrgLevel.ToString());

            template = template.Replace("//bgColor//", ColorTranslator.ToHtml(BackgroundColor));

            string htmlFile = directoryName + "/" + imageName + ".html";

            using (var writer = new StreamWriter(htmlFile))
            {
                writer.Write(template);
                writer.Close();
            }

            e.Result = htmlFile;
        }
Beispiel #2
0
        public void SaveToIni(IniData iniData)
        {
            var tpData = iniData["TemplePlus"];

            if (tpData == null)
            {
                iniData.Sections.Add(new SectionData("TemplePlus"));
                tpData = iniData["TemplePlus"];
            }

            tpData["toeeDir"]    = InstallationPath;
            tpData["autoUpdate"] = DisableAutomaticUpdates ? "false" : "true";
            switch (HpOnLevelUp)
            {
            case HpOnLevelUpType.Max:
                tpData["hpOnLevelup"] = "max";
                break;

            case HpOnLevelUpType.Average:
                tpData["hpOnLevelup"] = "average";
                break;

            default:
                tpData["hpOnLevelup"] = "normal";
                break;
            }
            tpData["maxHpForNpcHitdice"] = MaxHpForNpcHitdice ? "true" : "false";
            switch (FogOfWar)
            {
            case FogOfWarType.Unfogged:
                tpData["fogOfWar"] = "unfogged";
                break;

            case FogOfWarType.Always:
                tpData["fogOfWar"] = "always";
                break;

            default:
                tpData["fogOfWar"] = "normal";
                break;
            }
            tpData["laxRules"] = LaxRules ? "true" : "false";

            tpData["disableAlignmentRestrictions"]   = DisableAlignmentRestrictions ? "true" : "false";
            tpData["disableCraftingSpellReqs"]       = DisableCraftingSpellReqs ? "true" : "false";
            tpData["disableMulticlassXpPenalty"]     = DisableMulticlassXpPenalty ? "true" : "false";
            tpData["showTargetingCirclesInFogOfWar"] = ShowTargetingCirclesInFogOfWar ? "true" : "false";


            tpData["pointBuyPoints"]       = PointBuyPoints.ToString();
            tpData["renderWidth"]          = RenderWidth.ToString();
            tpData["renderHeight"]         = RenderHeight.ToString();
            tpData["windowed"]             = WindowedMode ? "true" : "false";
            tpData["windowWidth"]          = RenderWidth.ToString();
            tpData["windowHeight"]         = RenderHeight.ToString();
            tpData["antialiasing"]         = AntiAliasing? "true" : "false";
            tpData["softShadows"]          = SoftShadows ? "true" : "false";
            tpData["windowedLockCursor"]   = WindowedLockCursor ? "true" : "false";
            tpData["dungeonMaster"]        = DungeonMaster ? "true" : "false";
            tpData["maxLevel"]             = MaxLevel.ToString();
            tpData["allowXpOverflow"]      = AllowXpOverflow ? "true" : "false";
            tpData["slowerLevelling"]      = SlowerLevelling ? "true" : "false";
            tpData["newClasses"]           = NewClasses? "true" : "false";
            tpData["nonCoreMaterials"]     = NonCore ? "true" : "false";
            tpData["tolerantNpcs"]         = TolerantTownsfolk? "true" : "false";
            tpData["showExactHPforNPCs"]   = TransparentNpcStats? "true" : "false";
            tpData["showNpcStats"]         = TransparentNpcStats ? "true" : "false";
            tpData["fastSneakAnim"]        = FastSneaking ? "true" : "false";
            tpData["disableDoorRelocking"] = DisableDoorRelocking? "true" : "false";
            tpData["alertAiThroughDoors"]  = AlertAiThroughDoors ? "true" : "false";
        }
Beispiel #3
0
 public override string GetTipString()
 {
     return(LabelCap + ": " + CurLevelPercentage.ToStringPercent() + " (" + CurLevel.ToString("0.##") + " / " + MaxLevel.ToString("0.##") + ")\n" + def.description);
 }
Beispiel #4
0
 public override string ToString()
 {
     return($"{CardType.PadLeft(8)} {(Level.ToString()+'/'+ MaxLevel.ToString()).PadRight(5)} {(IsMax?Max:NotMax).PadLeft(7)} : {Cards.ToString().PadLeft(5)} = {Name}");
 }
Beispiel #5
0
        public void ConvertsPropertiesToSettings()
        {
            // Main - General
            ModeSetting                 = Mode.ToString();
            LockFirstSlotSetting        = LockFirstSlot.ToString();
            LockSecondSlotSetting       = LockSecondSlot.ToString();
            LockThirdSlotSetting        = LockThirdSlot.ToString();
            MinLevelSetting             = MinLevel.ToString();
            MinPetHealthSetting         = MinPetHealth.ToString();
            MaxLevelSetting             = MaxLevel.ToString();
            UseWildPetsSetting          = UseWildPets.ToString();
            OnlyBluePetsSetting         = OnlyBluePets.ToString();
            UseFavouritePetsOnlySetting = UseFavouritePetsOnly.ToString();
            UseFavouriteRingersSetting  = UseFavouriteRingers.ToString();
            if (UseFavouritePetsOnly)
            {
                UseFavouriteRingersSetting = UseFavouritePetsOnly.ToString();
            }
            MinRingerPetHealthSetting  = MinRingerPetHealth.ToString();
            CaptureRaresSetting        = CaptureRares.ToString();
            IgnoreElitesSetting        = IgnoreElites.ToString();
            CaptureNotOwnRaritySetting = CaptureNotOwnRarity.ToString();
            MovementByPlayerSetting    = MovementByPlayer.ToString();
            RecordPetsSetting          = RecordPets.ToString();
            DoNotEngageSetting         = DoNotEngage.ToString();

            Pet2_Differ_Relative_Setting  = Pet2_Differ_Relative.ToString();
            Pet3_Differ_Relative_Setting  = Pet3_Differ_Relative.ToString();
            Zone_Diff_Relative_Setting    = Zone_Diff_Relative.ToString();
            Swap1_Health_Relative_Setting = Swap1_Health_Relative.ToString();
            Swap2_Health_Relative_Setting = Swap2_Health_Relative.ToString();
            Swap3_Health_Relative_Setting = Swap3_Health_Relative.ToString();

            Pet2_Differ_Ringer_Setting  = Pet2_Differ_Ringer.ToString();
            Pet3_Differ_Ringer_Setting  = Pet3_Differ_Ringer.ToString();
            Zone_Diff_Ringer_Setting    = Zone_Diff_Ringer.ToString();
            Swap1_Health_Ringer_Setting = Swap1_Health_Ringer.ToString();
            Swap2_Health_Ringer_Setting = Swap2_Health_Ringer.ToString();
            Swap3_Health_Ringer_Setting = Swap3_Health_Ringer.ToString();

            Pet2_Differ_Ringerx2_Setting  = Pet2_Differ_Ringerx2.ToString();
            Pet3_Differ_Ringerx2_Setting  = Pet3_Differ_Ringerx2.ToString();
            Zone_Diff_Ringerx2_Setting    = Zone_Diff_Ringerx2.ToString();
            Swap1_Health_Ringerx2_Setting = Swap1_Health_Ringerx2.ToString();
            Swap2_Health_Ringerx2_Setting = Swap2_Health_Ringerx2.ToString();
            Swap3_Health_Ringerx2_Setting = Swap3_Health_Ringerx2.ToString();

            Pet2_Differ_Capture_Setting  = Pet2_Differ_Capture.ToString();
            Pet3_Differ_Capture_Setting  = Pet3_Differ_Capture.ToString();
            Zone_Diff_Capture_Setting    = Zone_Diff_Capture.ToString();
            Swap1_Health_Capture_Setting = Swap1_Health_Capture.ToString();
            Swap2_Health_Capture_Setting = Swap2_Health_Capture.ToString();
            Swap3_Health_Capture_Setting = Swap3_Health_Capture.ToString();

            Pet2_Differ_Custom_Setting  = Pet2_Differ_Custom.ToString();
            Pet3_Differ_Custom_Setting  = Pet3_Differ_Custom.ToString();
            Zone_Diff_Custom_Setting    = Zone_Diff_Custom.ToString();
            Swap1_Health_Custom_Setting = Swap1_Health_Custom.ToString();
            Swap2_Health_Custom_Setting = Swap2_Health_Custom.ToString();
            Swap3_Health_Custom_Setting = Swap3_Health_Custom.ToString();

            AutoZoneChangeSetting = AutoZoneChange.ToString();

            SetSwapByCurrentMode();  // TODO: why it is here, lol?
        }
Beispiel #6
0
    void init()
    {
        var rate            = (float)CollectExp / (float)NextExp;
        var isReachMaxLevel = false;

        if (Level == MaxLevel)
        {
            isReachMaxLevel = true;
            rate            = 1;
        }

        if (textLevel != null)
        {
            textLevel.text = useFormatForInfo ? RPGLanguageManager.FormatInfo(GameText.TITLE_LEVEL, Level) : Level.ToString("N0");
            if (showMaxLevelInTextLevel)
            {
                textLevel.text += "/" + MaxLevel.ToString("N0");
            }
        }

        if (textCollectExp != null)
        {
            textCollectExp.text = useFormatForInfo ? RPGLanguageManager.FormatInfo(GameText.TITLE_COLLECT_EXP, CollectExp) : CollectExp.ToString("N0");
            if (isReachMaxLevel)
            {
                textCollectExp.text = "0";
            }
        }

        if (textNextExp != null)
        {
            textNextExp.text = useFormatForInfo ? RPGLanguageManager.FormatInfo(GameText.TITLE_NEXT_EXP, NextExp) : NextExp.ToString("N0");
            if (isReachMaxLevel)
            {
                textNextExp.text = "0";
            }
        }

        if (textCollectPerNextExp != null)
        {
            textCollectPerNextExp.text = CollectExp.ToString("N0") + "/" + NextExp.ToString("N0");
            if (isReachMaxLevel)
            {
                textCollectPerNextExp.text = RPGLanguageManager.GetText(GameText.TITLE_EXP_MAX);
            }
        }

        if (textRequireExp != null)
        {
            textRequireExp.text = useFormatForInfo ? RPGLanguageManager.FormatInfo(GameText.TITLE_REQUIRE_EXP, this.RequireExp()) : this.RequireExp().ToString("N0");
            if (isReachMaxLevel)
            {
                textRequireExp.text = "0";
            }
        }

        if (textExpPercent != null)
        {
            textExpPercent.text = (rate * 100).ToString("N2") + "%";
        }

        if (imageExpGage != null)
        {
            imageExpGage.fillAmount = rate;
        }
    }
Beispiel #7
0
        public void SaveToIni(IniData iniData)
        {
            var tpData = iniData["TemplePlus"];

            if (tpData == null)
            {
                iniData.Sections.Add(new SectionData("TemplePlus"));
                tpData = iniData["TemplePlus"];
            }

            tpData["toeeDir"]       = InstallationPath;
            tpData["defaultModule"] = ModuleName;
            tpData["autoUpdate"]    = DisableAutomaticUpdates ? "false" : "true";
            switch (HpOnLevelUp)
            {
            case HpOnLevelUpType.Max:
                tpData["hpOnLevelup"] = "max";
                break;

            case HpOnLevelUpType.Average:
                tpData["hpOnLevelup"] = "average";
                break;

            default:
                tpData["hpOnLevelup"] = "normal";
                break;
            }

            switch (HpForNPCHd)
            {
            case HpForNPCHdType.Min:
                tpData["HpForNPCHd"] = "min";
                break;

            case HpForNPCHdType.Max:
                tpData["HpForNPCHd"] = "max";
                break;

            case HpForNPCHdType.Average:
                tpData["HpForNPCHd"] = "average";
                break;

            case HpForNPCHdType.ThreeFourth:
                tpData["HpForNPCHd"] = "threefourth";
                break;

            default:
                tpData["HpForNPCHd"] = "normal";
                break;
            }

            //Set the old setting to false
            tpData["maxHpForNpcHitdice"] = "false";
            switch (FogOfWar)
            {
            case FogOfWarType.Unfogged:
                tpData["fogOfWar"] = "unfogged";
                break;

            case FogOfWarType.Always:
                tpData["fogOfWar"] = "always";
                break;

            default:
                tpData["fogOfWar"] = "normal";
                break;
            }
            tpData["laxRules"] = LaxRules ? "true" : "false";
            tpData["stricterRulesEnforcement"] = StricterRulesEnforcement ? "true" : "false";

            tpData["disableAlignmentRestrictions"]   = DisableAlignmentRestrictions ? "true" : "false";
            tpData["disableCraftingSpellReqs"]       = DisableCraftingSpellReqs ? "true" : "false";
            tpData["disableMulticlassXpPenalty"]     = DisableMulticlassXpPenalty ? "true" : "false";
            tpData["showTargetingCirclesInFogOfWar"] = ShowTargetingCirclesInFogOfWar ? "true" : "false";
            tpData["wildShapeUsableItems"]           = WildshapeUsableItems ? "true" : "false";


            tpData["pointBuyPoints"]     = PointBuyPoints.ToString();
            tpData["renderWidth"]        = RenderWidth.ToString();
            tpData["renderHeight"]       = RenderHeight.ToString();
            tpData["windowed"]           = WindowedMode ? "true" : "false";
            tpData["windowWidth"]        = RenderWidth.ToString();
            tpData["windowHeight"]       = RenderHeight.ToString();
            tpData["antialiasing"]       = AntiAliasing? "true" : "false";
            tpData["softShadows"]        = SoftShadows ? "true" : "false";
            tpData["windowedLockCursor"] = WindowedLockCursor ? "true" : "false";
            tpData["dungeonMaster"]      = DungeonMaster ? "true" : "false";
            tpData["maxLevel"]           = MaxLevel.ToString();
            tpData["maxPCsFlexible"]     = "false";
            switch (NumberOfPcs)
            {
            case NumberOfPcsType.Flexible:
                tpData["maxPCsFlexible"] = "true";
                break;

            case NumberOfPcsType.PCs_3_NPCs_5:
                tpData["maxPCs"] = 3.ToString();
                break;

            case NumberOfPcsType.PCs_4_NPCs_4:
                tpData["maxPCs"] = 4.ToString();
                break;

            case NumberOfPcsType.PCs_5_NPCs_3:
                tpData["maxPCs"] = 5.ToString();
                break;

            case NumberOfPcsType.PCs_6_NPCs_2:
                tpData["maxPCs"] = 6.ToString();
                break;

            case NumberOfPcsType.PCs_7_NPCs_1:
                tpData["maxPCs"] = 7.ToString();
                break;

            case NumberOfPcsType.PCs_8_NPCs_0:
                tpData["maxPCs"] = 8.ToString();
                break;

            default:
                tpData["maxPCs"] = 5.ToString();
                break;
            }
            tpData["allowXpOverflow"]      = AllowXpOverflow ? "true" : "false";
            tpData["metamagicStacking"]    = MetamagicStacking ? "true" : "false";
            tpData["slowerLevelling"]      = SlowerLevelling ? "true" : "false";
            tpData["newClasses"]           = NewClasses? "true" : "false";
            tpData["newRaces"]             = NewRaces? "true" : "false";
            tpData["monstrousRaces"]       = MonstrousRaces? "true" : "false";
            tpData["forgottenRealmsRaces"] = ForgottenRealmsRaces ? "true" : "false";
            tpData["nonCoreMaterials"]     = NonCore ? "true" : "false";
            tpData["tolerantNpcs"]         = TolerantTownsfolk? "true" : "false";
            tpData["showExactHPforNPCs"]   = TransparentNpcStats? "true" : "false";
            tpData["showNpcStats"]         = TransparentNpcStats ? "true" : "false";
            tpData["fastSneakAnim"]        = FastSneaking ? "true" : "false";
            if (WalkDistanceFt < 0)
            {
                WalkDistanceFt = 0;
            }
            tpData["walkDistanceFt"]            = WalkDistanceFt.ToString();
            tpData["disableDoorRelocking"]      = DisableDoorRelocking? "true" : "false";
            tpData["alertAiThroughDoors"]       = AlertAiThroughDoors ? "true" : "false";
            tpData["preferUse5FootStep"]        = PreferUse5FootStep ? "true" : "false";
            tpData["extendedSpellDescriptions"] = ExtendedSpellDescriptions ? "true" : "false";
        }
Beispiel #8
0
 public override string GetTipString()
 {
     return(string.Concat(LabelCap, ": ", CurLevelPercentage.ToStringPercent(), " (", CurLevel.ToString("0.##"), " / ", MaxLevel.ToString("0.##"), ")\n", def.description));
 }
 /// <summary>
 /// Returns a string that represents the current object.
 /// </summary>
 public override string ToString()
 {
     return(string.Format("AggregatorConfig [{0},{1},{2},{3},[{4}]]", MaxLevel?.ToString() ?? "null", AggregationAlgorithm?.ToString() ?? "null",
                          AggregationPeriod?.ToString() ?? "null", MaxRequests?.ToString() ?? "null", GetParentUrisString()));
 }