Skip to content

Commit

Permalink
Merge pull request #182 from LoadedCamel/dev
Browse files Browse the repository at this point in the history
3.7.4.8 Fixes
  • Loading branch information
Metalios authored May 17, 2024
2 parents 7f41316 + bb213f1 commit e4ce6be
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 105 deletions.
1 change: 0 additions & 1 deletion MidsReborn/Controls/ctlCombatTimeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ public Dictionary<EffectTypeShort, List<Color>> BuildColorDictionary()
new() {EffectType = Enums.eEffectType.MaxFlySpeed},
new() {EffectType = Enums.eEffectType.MaxJumpSpeed},
new() {EffectType = Enums.eEffectType.MaxRunSpeed},
new() {EffectType = Enums.eEffectType.JumpHeight},
new() {EffectType = Enums.eEffectType.Fly},
new() {EffectType = Enums.eEffectType.Absorb},
new() {EffectType = Enums.eEffectType.Enhancement, ETModifies = Enums.eEffectType.Heal},
Expand Down
8 changes: 3 additions & 5 deletions MidsReborn/Core/Base/Master_Classes/MidsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public static class MidsContext
private const int AppMajorVersion = 3;
private const int AppMinorVersion = 7;
private const int AppBuildVersion = 4;
private const int AppRevisionVersion = 3;

private const int AppRevisionVersion = 8;
public const string AssemblyVersion = "3.7.4";
public const string AssemblyFileVersion = "3.7.4.3";
public const string AssemblyFileVersion = "3.7.4.8";

public static Version AppFileVersion { get; set; } = new(AppMajorVersion, AppMinorVersion, AppBuildVersion, AppRevisionVersion);

public const string AppVersionStatus = "";
Expand All @@ -23,8 +23,6 @@ public static class MidsContext

internal static bool EnhCheckMode = false;

//public static readonly Version AppVersion = new Version(AppMajorVersion, AppMinorVersion, AppBuildVersion, AppRevisionVersion);

internal static Archetype? Archetype;
internal static Character? Character;
internal static Build? Build;
Expand Down
19 changes: 19 additions & 0 deletions MidsReborn/Core/BuildFile/EnhancementDataConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
{
enhancementData.Uid = DatabaseAPI.GetEnhancementUid(enhancementValue.ToObject<string>());
}
if (jsonObject.TryGetValue("Grade", out var gradeValue))
{
enhancementData.Grade = gradeValue.ToObject<string>() ?? throw new InvalidOperationException();
}

if (jsonObject.TryGetValue("IoLevel", out var ioLevelValue))
{
enhancementData.IoLevel = ioLevelValue.ToObject<int>();
}

if (jsonObject.TryGetValue("RelativeLevel", out var relativeLevelValue))
{
enhancementData.RelativeLevel = relativeLevelValue.ToObject<string>() ?? throw new InvalidOperationException();
}

if (jsonObject.TryGetValue("Obtained", out var obtainedValue))
{
enhancementData.Obtained = obtainedValue.ToObject<bool>();
}

return enhancementData;
}
Expand Down
2 changes: 1 addition & 1 deletion MidsReborn/Core/Utils/WinApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ public static void SetWindowBackdropType(IntPtr handle, BackdropTypes backdropTy
_ = DwmSetWindowAttribute(handle, WindowAttribute.Backdrop, new[] { value }, Marshal.SizeOf<int>());
}
}
}
}
14 changes: 8 additions & 6 deletions MidsReborn/Forms/Controls/DataView.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
Expand Down Expand Up @@ -189,6 +190,7 @@ private static PairedListEx.Item BuildEDItem(int index, float[] value, Enums.eSc
var num2 = Enhancement.ApplyED(schedule[index], value[index]) * 100f;
var num3 = num2 + afterED[index] * 100f;
var num4 = (float)Math.Round(num1 - (double)num2, 3);

var str1 = num1.ToString("##0" + NumberFormatInfo.CurrentInfo.NumberDecimalSeparator + "00") + "%";
var str2 = num4.ToString("##0" + NumberFormatInfo.CurrentInfo.NumberDecimalSeparator + "00") + "%";
var str3 = num3.ToString("##0" + NumberFormatInfo.CurrentInfo.NumberDecimalSeparator + "00") + "%";
Expand Down Expand Up @@ -1388,12 +1390,12 @@ public void DisplayTotals()
}

var iTip3 = $"Time to go from 0-100% health: {Utilities.FixDP(displayStats.HealthRegenTimeToFull)}s.\r\nHealth regenerated per second: {Utilities.FixDP(displayStats.HealthRegenHealthPerSec)}%\r\nHitPoints regenerated per second at level 50: {Utilities.FixDP(displayStats.HealthRegenHPPerSec)} HP";
total_Misc.AddItem(new PairedListEx.Item("Recovery:", $"{displayStats.EnduranceRecoveryPercentage(false):0.#}% ({displayStats.EnduranceRecoveryNumeric:0.#}/s)", false, false, false, iTip2));
total_Misc.AddItem(new PairedListEx.Item("Regen:", $"{displayStats.HealthRegenPercent(false):0.#}%", false, false, false, iTip3));
total_Misc.AddItem(new PairedListEx.Item("EndDrain:", $"{displayStats.EnduranceUsage:0.#}/s", false, false, false, iTip1));
total_Misc.AddItem(new PairedListEx.Item("+ToHit:", $"{displayStats.BuffToHit:0.#}%", false, false, false, "This effect is increasing the accuracy of all your powers."));
total_Misc.AddItem(new PairedListEx.Item("+EndRdx:", $"{displayStats.BuffEndRdx:0.#}%", false, false, false, "The end cost of all your powers is being reduced by this effect.\r\nThis is applied like an end-reduction enhancement."));
total_Misc.AddItem(new PairedListEx.Item("+Recharge:", $"{displayStats.BuffHaste(false) - 100.0:0.#}%", false, false, false, "The recharge time of your powers is being altered by this effect.\r\nThe higher the value, the faster the recharge."));
total_Misc.AddItem(new PairedListEx.Item("Recovery:", $"{displayStats.EnduranceRecoveryPercentage(false):0.##}% ({displayStats.EnduranceRecoveryNumeric:0.#}/s)", false, false, false, iTip2));
total_Misc.AddItem(new PairedListEx.Item("Regen:", $"{displayStats.HealthRegenPercent(false):0.##}%", false, false, false, iTip3));
total_Misc.AddItem(new PairedListEx.Item("EndDrain:", $"{displayStats.EnduranceUsage:0.##}/s", false, false, false, iTip1));
total_Misc.AddItem(new PairedListEx.Item("+ToHit:", $"{displayStats.BuffToHit:0.##}%", false, false, false, "This effect is increasing the accuracy of all your powers."));
total_Misc.AddItem(new PairedListEx.Item("+EndRdx:", $"{displayStats.BuffEndRdx:0.##}%", false, false, false, "The end cost of all your powers is being reduced by this effect.\r\nThis is applied like an end-reduction enhancement."));
total_Misc.AddItem(new PairedListEx.Item("+Recharge:", $"{displayStats.BuffHaste(false):0.#}%", false, false, false, "The recharge time of your powers is being altered by this effect.\r\nThe higher the value, the faster the recharge."));
total_Misc.Rows = 3;
total_Misc.Redraw();
}
Expand Down
32 changes: 16 additions & 16 deletions MidsReborn/Forms/Controls/MidsMenuStrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ internal class MidsMenuColorTable : ProfessionalColorTable
public override Color MenuStripGradientEnd => Color.FromArgb(44, 47, 51);

// Background color of a menu item that is highlighted
public override Color MenuItemSelected => Color.FromArgb(60, 160, 255);
public override Color MenuItemSelectedGradientBegin => Color.FromArgb(60, 160, 255);
public override Color MenuItemSelectedGradientEnd => Color.FromArgb(60, 160, 255);
public override Color MenuItemSelected => Color.FromArgb(3, 111, 160);
public override Color MenuItemSelectedGradientBegin => Color.FromArgb(3, 111, 160);
public override Color MenuItemSelectedGradientEnd => Color.FromArgb(3, 111, 160);

// Border color of a menu item that is highlighted
public override Color MenuItemBorder => Color.FromArgb(60, 160, 255);
public override Color MenuItemBorder => Color.FromArgb(3, 111, 160);

// Background color for menu items that are on a drop-down when they are highlighted
public override Color MenuItemPressedGradientBegin => Color.FromArgb(60, 160, 255);
public override Color MenuItemPressedGradientEnd => Color.FromArgb(60, 160, 255);
public override Color MenuItemPressedGradientBegin => Color.FromArgb(3, 111, 160);
public override Color MenuItemPressedGradientEnd => Color.FromArgb(3, 111, 160);

// Background color of the drop-down menu
public override Color ToolStripDropDownBackground => Color.FromArgb(44, 47, 51);
Expand All @@ -56,18 +56,18 @@ internal class MidsMenuColorTable : ProfessionalColorTable
public override Color SeparatorLight => Color.WhiteSmoke;

// Button-selected gradient (for ToolStrip)
public override Color ButtonSelectedGradientBegin => Color.FromArgb(60, 160, 255);
public override Color ButtonSelectedGradientEnd => Color.FromArgb(60, 160, 255);
public override Color ButtonSelectedBorder => Color.FromArgb(60, 160, 255);
public override Color ButtonSelectedGradientBegin => Color.FromArgb(3, 111, 160);
public override Color ButtonSelectedGradientEnd => Color.FromArgb(3, 111, 160);
public override Color ButtonSelectedBorder => Color.FromArgb(3, 111, 160);

// Button-pressed gradient (for ToolStrip)
public override Color ButtonPressedGradientBegin => Color.FromArgb(60, 160, 255);
public override Color ButtonPressedGradientEnd => Color.FromArgb(60, 160, 255);
public override Color ButtonPressedGradientBegin => Color.FromArgb(3, 111, 160);
public override Color ButtonPressedGradientEnd => Color.FromArgb(3, 111, 160);

// Button-checked gradient (for ToolStrip when an item is checked or toggled)
public override Color CheckBackground => Color.FromArgb(44, 47, 51);
public override Color CheckSelectedBackground => Color.FromArgb(60, 160, 255);
public override Color CheckPressedBackground => Color.FromArgb(60, 160, 255);
public override Color CheckSelectedBackground => Color.FromArgb(3, 111, 160);
public override Color CheckPressedBackground => Color.FromArgb(3, 111, 160);

// Overflow button colors (if applicable)
public override Color OverflowButtonGradientBegin => Color.FromArgb(44, 47, 51);
Expand Down Expand Up @@ -100,11 +100,11 @@ protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
{
if (menuItem.DropDown.Visible) // Dropdown is open
{
e.TextColor = Color.Black; // Keep text black when dropdown is open
e.TextColor = Color.FromArgb(239, 239, 239); // Keep text black when dropdown is open
}
else if (menuItem.Selected) // Hovered but dropdown not necessarily open
{
e.TextColor = Color.Black; // Text color black when item is selected/hovered
e.TextColor = Color.FromArgb(239, 239, 239); // Text color black when item is selected/hovered
}
else
{
Expand All @@ -114,7 +114,7 @@ protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
else
{
// Non-menu item texts, could be used for other types of items
e.TextColor = e.Item.Selected ? Color.Black : Color.WhiteSmoke;
e.TextColor = e.Item.Selected ? Color.FromArgb(239, 239, 239) : Color.WhiteSmoke;
}

base.OnRenderItemText(e);
Expand Down
23 changes: 9 additions & 14 deletions MidsReborn/Forms/OptionsMenuItems/DbEditor/frmEnhData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,21 +297,19 @@ private void btnRemove_Click(object sender, EventArgs e)
{
if (lstSelected.SelectedIndex <= -1)
return;
var sEffectArray = new Enums.sEffect[myEnh.Effect.Length - 1 + 1];
var sEffectArray = new Enums.sEffect[myEnh.Effect.Length];
var selectedIndex = lstSelected.SelectedIndex;
var index1 = 0;
var num1 = myEnh.Effect.Length - 1;
for (var index2 = 0; index2 <= num1; ++index2)
for (var index2 = 0; index2 < myEnh.Effect.Length; index2++)
{
if (index2 == selectedIndex)
continue;
sEffectArray[index1].Assign(myEnh.Effect[index2]);
++index1;
}

myEnh.Effect = new Enums.sEffect[myEnh.Effect.Length - 2 + 1];
var num2 = myEnh.Effect.Length - 1;
for (var index2 = 0; index2 <= num2; ++index2)
myEnh.Effect = new Enums.sEffect[myEnh.Effect.Length - 1];
for (var index2 = 0; index2 < myEnh.Effect.Length; index2++)
myEnh.Effect[index2].Assign(sEffectArray[index2]);
FillEffectList();
ListSelectedEffects();
Expand Down Expand Up @@ -694,12 +692,10 @@ private void EditClick()
num1 = MezPicker(subId);
if (num1 == subId)
return;
var num2 = myEnh.Effect.Length - 1;
for (var index1 = 0; index1 <= num2; ++index1)
for (var index1 = 0; index1 < myEnh.Effect.Length; index1++)
{
var effect = myEnh.Effect;
var index2 = index1;
if ((effect[index2].Mode == Enums.eEffMode.Enhancement) & (effect[index2].Enhance.SubID == num1))
if (effect[index1].Mode == Enums.eEffMode.Enhancement & effect[index1].Enhance.SubID == num1)
{
flag = false;
}
Expand All @@ -724,7 +720,7 @@ private void EditClick()
effect[index].Mode = Enums.eEffMode.FX;
effect[index].Enhance.ID = -1;
effect[index].Enhance.SubID = -1;
effect[index].Multiplier = 1f;
effect[index].Multiplier = 1;
effect[index].Schedule = Enums.eSchedule.A;
effect[index].FX = (IEffect)frmPowerEffect.MyFx.Clone();
}
Expand Down Expand Up @@ -885,13 +881,12 @@ private void ListSelectedEffects()
var names2 = Enum.GetNames(eMez.GetType());
lstSelected.BeginUpdate();
lstSelected.Items.Clear();
var num = myEnh.Effect.Length - 1;
for (var index = 0; index <= num; ++index)
for (var index = 0; index < myEnh.Effect.Length; index++)
if (myEnh.Effect[index].Mode == Enums.eEffMode.Enhancement)
{
var str = names1[myEnh.Effect[index].Enhance.ID];
if (myEnh.Effect[index].Enhance.SubID > -1)
str = str + ":" + names2[myEnh.Effect[index].Enhance.SubID];
str += $":{names2[myEnh.Effect[index].Enhance.SubID]}";
lstSelected.Items.Add(str);
}
else
Expand Down
Loading

0 comments on commit e4ce6be

Please sign in to comment.