Skip to content

Commit

Permalink
Merge pull request #172 from LoadedCamel/dev
Browse files Browse the repository at this point in the history
3.6.6.3
  • Loading branch information
Metalios authored Sep 6, 2023
2 parents ebf2ced + 4720bff commit ce37943
Show file tree
Hide file tree
Showing 35 changed files with 964 additions and 1,733 deletions.
54 changes: 36 additions & 18 deletions MidsReborn/Controls/I9Picker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -614,27 +614,32 @@ private void DisplaySetEnhancements()
{
var enh = DatabaseAPI.Database.EnhancementSets[Ui.Sets[Ui.View.SetTypeId][Ui.View.SetId]].Enhancements[i];
var enhData = DatabaseAPI.Database.Enhancements[enh];
_enhUniqueStatus.Add(!enhData.Unique
? null
: new EnhUniqueStatus
{
InMain = _mySlotted.Any(slotted => enh == slotted) || MidsContext.Character.CurrentBuild
_enhUniqueStatus.Add(new EnhUniqueStatus
{
InMain = enhData.Unique
? _mySlotted.Any(slotted => enh == slotted) || MidsContext.Character.CurrentBuild
.Powers
.Where(e => e is {Power.Slottable: true})
.Any(f => f.Slots.Any(g => g.Enhancement.Enh == enh))
: _mySlotted.Any(slotted => enh == slotted) || MidsContext.Character.CurrentBuild
.Powers
.Where(e => e is {Power.Slottable: true} && e?.Power?.StaticIndex == DatabaseAPI.Database.Power[_nPowerIdx]?.StaticIndex)
.Any(f => f.Slots.Any(g => g.Enhancement.Enh == enh)),
InAlternate = _mySlotted.Any(slotted => enh == slotted) || MidsContext.Character.CurrentBuild
InAlternate = enhData.Unique
? _mySlotted.Any(slotted => enh == slotted) || MidsContext.Character.CurrentBuild
.Powers
.Where(e => e is {Power.Slottable: true})
.Any(f => f.Slots.Any(g => g.FlippedEnhancement.Enh == enh))
: _mySlotted.Any(slotted => enh == slotted) || MidsContext.Character.CurrentBuild
.Powers
.Where(e => e is { Power.Slottable: true })
.Where(e => e is { Power.Slottable: true } && e?.Power?.StaticIndex == DatabaseAPI.Database.Power[_nPowerIdx]?.StaticIndex)
.Any(f => f.Slots.Any(g => g.FlippedEnhancement.Enh == enh))
});
var grey = _mySlotted.All(slotted => enh != slotted) && enhData.Unique &&
(_enhUniqueStatus[i] == null
? false
: _enhUniqueStatus[i].Value.InMain);
});

var graphics = _myBx.Graphics;
I9Gfx.DrawEnhancementAt(ref graphics, GetRectBounds(IndexToXy(i)),
DatabaseAPI.Database.EnhancementSets[Ui.Sets[Ui.View.SetTypeId][Ui.View.SetId]].Enhancements[i],
(Origin.Grade) 5, GreyItem(grey));
(Origin.Grade) 5, GreyItem(_enhUniqueStatus[i]?.InMain == true));
}
}
}
Expand Down Expand Up @@ -678,9 +683,11 @@ private bool IsPlaced(int index)
return false;
}

return _mySlotted.Any(t =>
DatabaseAPI.Database.EnhancementSets[Ui.Sets[Ui.View.SetTypeId][Ui.View.SetId]]
.Enhancements[index] == t);
//var enh = DatabaseAPI.Database.EnhancementSets[Ui.Sets[Ui.View.SetTypeId][Ui.View.SetId]].Enhancements[index];
//var enhData = DatabaseAPI.Database.Enhancements[enh];
//var sourcePower = DatabaseAPI.Database.Enhancements[_mySlot.Enh].GetPower();

return _mySlotted.Any(t => DatabaseAPI.Database.EnhancementSets[Ui.Sets[Ui.View.SetTypeId][Ui.View.SetId]].Enhancements[index] == t);
}

private void DisplaySetImages()
Expand Down Expand Up @@ -1243,7 +1250,10 @@ private bool DoEnhancementPicked(int index)
case Enums.eType.SetO:
if (IsPlaced(index))
{
return true;
if (_mySlot.RelativeLevel == Ui.View.RelLevel)
{
return false;
}
}

i9Slot.Enh = DatabaseAPI.Database.EnhancementSets[Ui.Sets[Ui.View.SetTypeId][Ui.View.SetId]].Enhancements[index];
Expand All @@ -1255,7 +1265,15 @@ private bool DoEnhancementPicked(int index)

if (uniqueSlotted)
{
return false;
if (_mySlot.Enh == i9Slot.Enh & _mySlot.RelativeLevel == Ui.View.RelLevel)
{
return false;
}

if (_mySlot.Enh != i9Slot.Enh)
{
return false;
}
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions MidsReborn/Controls/LabelEx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System.Drawing;
using System.Windows.Forms;

namespace Mids_Reborn.Controls
{
public sealed partial class LabelEx : Label
{
public LabelEx()
{
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
BackColor = Color.Transparent;
InitializeComponent();
}

protected override CreateParams CreateParams
{
get
{
var cp = base.CreateParams;
cp.ExStyle |= 0x20; // EX_TRANSPARENT
return cp;
}
}

protected override void OnPaintBackground(PaintEventArgs e)
{
// Paint background with underlying graphics from other controls
base.OnPaintBackground(e);
var g = e.Graphics;

if (Parent == null) return;

// Take each control in turn
var index = Parent.Controls.GetChildIndex(this);
for (var i = Parent.Controls.Count - 1; i > index; i--)
{
var c = Parent.Controls[i];

// Check it's visible and overlaps this control
if (!c.Bounds.IntersectsWith(Bounds) || !c.Visible) continue;

// Load appearance of underlying control and redraw it on this background
var bmp = new Bitmap(c.Width, c.Height, g);
c.DrawToBitmap(bmp, c.ClientRectangle);
g.TranslateTransform(c.Left - Left, c.Top - Top);
g.DrawImageUnscaled(bmp, Point.Empty);
g.TranslateTransform(Left - c.Left, Top - c.Top);
bmp.Dispose();
}
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion MidsReborn/Core/Base/Data_Classes/Power.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ public int GetDurationEffectID()
e.Value.PvMode == Enums.ePvX.PvE & !MidsContext.Config.Inc.DisablePvE |
e.Value.PvMode == Enums.ePvX.PvP & MidsContext.Config.Inc.DisablePvE) &
e.Value.EffectClass != Enums.eEffectClass.Ignored & e.Value.Duration > 0 &
e.Value.EffectType == Enums.eEffectType.Mez & e.Value.ValidateConditional() &
e.Value.ValidateConditional() &
e.Value.Probability > float.Epsilon &
e.Value.SpecialCase != Enums.eSpecialCase.Defiance)
.OrderByDescending(e => e.Value, new EffectDurationComparer())
Expand Down
24 changes: 24 additions & 0 deletions MidsReborn/Core/Base/Extensions/GraphicsPathExt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Drawing;
using System.Drawing.Drawing2D;

namespace Mids_Reborn.Core.Base.Extensions
{
public static class GraphicsPathExt
{
public static void AddRoundRectangle(this GraphicsPath path, Rectangle rectangle, int radius)
{
var diameter = radius * 2;
var size = new Size(diameter, diameter);
var arc = new Rectangle(rectangle.Location, size);

path.AddArc(arc, 180, 90); // Top-left corner
arc.X = rectangle.Right - diameter;
path.AddArc(arc, 270, 90); // Top-right corner
arc.Y = rectangle.Bottom - diameter;
path.AddArc(arc, 0, 90); // Bottom-right corner
arc.X = rectangle.Left;
path.AddArc(arc, 90, 90); // Bottom-left corner
path.CloseFigure();
}
}
}
7 changes: 0 additions & 7 deletions MidsReborn/Core/Base/IO_Classes/IMessager.cs

This file was deleted.

6 changes: 6 additions & 0 deletions MidsReborn/Core/Base/IO_Classes/IMessenger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Mids_Reborn.Core.Base.IO_Classes;

public interface IMessenger
{
void SetMessage(string text);
}
6 changes: 3 additions & 3 deletions MidsReborn/Core/Base/Master_Classes/MidsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ public static class MidsContext
public const string AppName = "Mids' Reborn";
private const int AppMajorVersion = 3;
private const int AppMinorVersion = 6;
private const int AppBuildVersion = 5;
private const int AppBuildVersion = 6;
private const int AppRevisionVersion = 3;

public const string AssemblyVersion = "3.6.5";
public const string AssemblyFileVersion = "3.6.5.3";
public const string AssemblyVersion = "3.6.6";
public const string AssemblyFileVersion = "3.6.6.3";
public static Version AppFileVersion { get; set; } = new(AppMajorVersion, AppMinorVersion, AppBuildVersion, AppRevisionVersion);

public const string AppVersionStatus = "";
Expand Down
Loading

0 comments on commit ce37943

Please sign in to comment.