Initial Commit
This commit is contained in:
110
2DGAMELIB/_2DGAMELIB/But1.cs
Normal file
110
2DGAMELIB/_2DGAMELIB/But1.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
public class But1 : But
|
||||
{
|
||||
public List<Color> BaseColors = new List<Color>();
|
||||
|
||||
public List<Color> OverColors = new List<Color>();
|
||||
|
||||
public List<Color> PushColors = new List<Color>();
|
||||
|
||||
public List<Color> TextColors = new List<Color>();
|
||||
|
||||
public But1(Par Par, Action<But> Action)
|
||||
: base(Par, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
|
||||
public But1(ParT ParT, Action<But> Action)
|
||||
: base(ParT, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
|
||||
public But1(Pars Pars, Action<But> Action)
|
||||
: base(Pars, Action)
|
||||
{
|
||||
Setting();
|
||||
}
|
||||
|
||||
private void Setting()
|
||||
{
|
||||
foreach (Par item in pars.EnumAllPar())
|
||||
{
|
||||
BaseColors.Add(item.BrushColor);
|
||||
OverColors.Add(BaseColors.Last().FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
}));
|
||||
PushColors.Add(OverColors.Last().FuncHSV(delegate(Hsv hsv)
|
||||
{
|
||||
hsv.Hue += 30;
|
||||
hsv.Sat -= 30;
|
||||
hsv.Val += 100;
|
||||
return hsv;
|
||||
}));
|
||||
TextColors.Add(item.IsParT() ? item.ToParT().TextColor : Color.Empty);
|
||||
}
|
||||
Over = delegate
|
||||
{
|
||||
int num4 = 0;
|
||||
foreach (Par item2 in pars.EnumAllPar())
|
||||
{
|
||||
item2.BrushColor = OverColors[num4];
|
||||
if (item2.IsParT())
|
||||
{
|
||||
item2.ToParT().TextColor = TextColors[num4].Reverse();
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
};
|
||||
Push = delegate
|
||||
{
|
||||
int num3 = 0;
|
||||
foreach (Par item3 in pars.EnumAllPar())
|
||||
{
|
||||
item3.BrushColor = PushColors[num3];
|
||||
if (item3.IsParT())
|
||||
{
|
||||
item3.ToParT().TextColor = TextColors[num3].Reverse();
|
||||
}
|
||||
num3++;
|
||||
}
|
||||
};
|
||||
Release = delegate
|
||||
{
|
||||
int num2 = 0;
|
||||
foreach (Par item4 in pars.EnumAllPar())
|
||||
{
|
||||
item4.BrushColor = OverColors[num2];
|
||||
if (item4.IsParT())
|
||||
{
|
||||
item4.ToParT().TextColor = TextColors[num2].Reverse();
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
};
|
||||
Out = delegate
|
||||
{
|
||||
int num = 0;
|
||||
foreach (Par item5 in pars.EnumAllPar())
|
||||
{
|
||||
item5.BrushColor = BaseColors[num];
|
||||
if (item5.IsParT())
|
||||
{
|
||||
item5.ToParT().TextColor = TextColors[num];
|
||||
}
|
||||
num++;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user