Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xcibe95x committed Jul 15, 2019
1 parent 96019bf commit d9a27a0
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 120 deletions.
224 changes: 127 additions & 97 deletions Form1.Designer.cs

Large diffs are not rendered by default.

180 changes: 157 additions & 23 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static Cursor LoadCustomCursor(string path)
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern IntPtr LoadCursorFromFile(string path);
}

public TFTCrafter()
{
InitializeComponent();
Expand All @@ -78,7 +78,8 @@ private void CalculateWR()
if (TotalGames != 0)
{
WinRate.Text = FinalWinRate.ToString("0.0") + "%";
} else
}
else
{
WinRate.Text = "0%";
}
Expand Down Expand Up @@ -126,7 +127,7 @@ private void Form1_Load(object sender, EventArgs e)




// GET JSON DATA
itemsJSON = client.DownloadString("https://solomid-resources.s3.amazonaws.com/blitz/tft/data/items.json");
tiersJSON = client.DownloadString("https://solomid-resources.s3.amazonaws.com/blitz/tft/data/tierlist.json");
Expand Down Expand Up @@ -164,7 +165,7 @@ private void Form1_Load(object sender, EventArgs e)

// LOAD CHAMPIONS LIST
championsListLoop();


}

Expand Down Expand Up @@ -854,14 +855,16 @@ private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e)
Properties.Settings.Default.TopMost = false;
TopMost = false;
Properties.Settings.Default.Save();
} else {
}
else
{
Properties.Settings.Default.TopMost = true;
TopMost = true;
Properties.Settings.Default.Save();
}
}



private void flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
{
Expand Down Expand Up @@ -892,7 +895,7 @@ private void GetTierList(int TierIndex, string TierType)



string champName = (string)jObject.SelectToken(TierType + "."+ TierIndex + "[" + champIndex.ToString() + "]");
string champName = (string)jObject.SelectToken(TierType + "." + TierIndex + "[" + champIndex.ToString() + "]");

var picture = new PictureBox
{
Expand Down Expand Up @@ -1094,12 +1097,12 @@ private void ProbTab_Click(object sender, EventArgs e)

// DEPRECATED

// private void Pointer_MouseClick(object sender, MouseEventArgs e)
// {
// Cursor = NativeMethods.LoadCustomCursor(Path.GetTempPath() + "Pointer.cur");
// System.Threading.Thread.Sleep(60);
// Cursor = NativeMethods.LoadCustomCursor(Path.GetTempPath() + "Normal.cur");
// }
// private void Pointer_MouseClick(object sender, MouseEventArgs e)
// {
// Cursor = NativeMethods.LoadCustomCursor(Path.GetTempPath() + "Pointer.cur");
// System.Threading.Thread.Sleep(60);
// Cursor = NativeMethods.LoadCustomCursor(Path.GetTempPath() + "Normal.cur");
// }

private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
Expand All @@ -1119,11 +1122,11 @@ private void PointerLogicLeave(object sender, EventArgs e)



// CHAMPIONS LIST CODE
// CHAMPIONS LIST CODE

private void championsListLoop()
{

JObject jObject = JObject.Parse(champsJSON);

// CHAMP LIST (FOREACH)
Expand All @@ -1137,7 +1140,7 @@ private void championsListLoop()

// VARIABLES
var key = item.Name.ToString();
int cost = (int)jObject.SelectToken(key + ".cost");
int cost = (int)jObject.SelectToken(key + ".cost");
string ability = (string)jObject.SelectToken(key + ".ability.description");
Color tiercost = Color.OrangeRed;

Expand All @@ -1150,8 +1153,9 @@ private void championsListLoop()
tiercost = Color.DimGray;
}

if (cost == 2) {
tiercost = Color.ForestGreen;
if (cost == 2)
{
tiercost = Color.ForestGreen;
}

if (cost == 3)
Expand Down Expand Up @@ -1184,12 +1188,13 @@ private void championsListLoop()
var basepanel = new FlowLayoutPanel
{
Name = key,
Text = cost.ToString(),
Size = new Size(312, 48),

};
ChampsList.Controls.Add(basepanel);
SearchPanel = basepanel;


// CHAMP BORDER
var ChampBox = new Panel
{
Expand Down Expand Up @@ -1218,13 +1223,15 @@ private void championsListLoop()
// CHAMP COST
var ChampCost = new MetroLabel
{

Name = cost.ToString(),
Text = cost.ToString(),
Anchor = AnchorStyles.None,
Dock = DockStyle.None,
UseCustomBackColor = true,
UseCustomForeColor = true,
ForeColor = tiercost,

Size = new Size(12, 18),
FontWeight = MetroFramework.MetroLabelWeight.Bold,
};
Expand Down Expand Up @@ -1309,7 +1316,7 @@ private void championsListLoop()
tiup.SetToolTip(picturebox, classes);
classesIndex++;
}



// SPACER
Expand Down Expand Up @@ -1368,13 +1375,17 @@ private void championsListLoop()

// TOOLTIPS
tiup.SetToolTip(ChampBox, ability);
tiup.SetToolTip(ChampPicture, " "+ ability + " ");
tiup.SetToolTip(ChampPicture, " " + ability + " ");


}

}





private void textBox1_TextChanged(object sender, EventArgs e)
{
foreach (Control SearchPanel in ChampsList.Controls)
Expand Down Expand Up @@ -1407,11 +1418,134 @@ private void metroTabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
ChampsSearchBox.Visible = false;
label9.Visible = false;
} else
}
else
{
ChampsSearchBox.Visible = true;
label9.Visible = true;
}
}

private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
ChampsList.Controls.Clear();
ChampsSearchBox.Clear();
championsListLoop();

}

private void ascendingToolStripMenuItem_Click(object sender, EventArgs e)
{
ChampsList.Controls.Clear();
ChampsSearchBox.Clear();
championsListLoop();

for (int i = 0; i < 5; i++)
{
foreach (Control SearchPanel in ChampsList.Controls)
{


if (!SearchPanel.Text.ToLower().Contains("1".ToLower()))
{

Console.WriteLine("Executed");
ChampsList.Controls.Remove(SearchPanel);
}

}
}
}

private void descendingToolStripMenuItem_Click(object sender, EventArgs e)
{

ChampsList.Controls.Clear();
ChampsSearchBox.Clear();
championsListLoop();
for (int i = 0; i < 5; i++)
{
foreach (Control SearchPanel in ChampsList.Controls)
{


if (!SearchPanel.Text.ToLower().Contains("2".ToLower()))
{

Console.WriteLine("Executed");
ChampsList.Controls.Remove(SearchPanel);
}

}
}
}

private void cost3ToolStripMenuItem_Click(object sender, EventArgs e)
{
ChampsList.Controls.Clear();
ChampsSearchBox.Clear();
championsListLoop();

for (int i = 0; i < 5; i++)
{
foreach (Control SearchPanel in ChampsList.Controls)
{


if (!SearchPanel.Text.ToLower().Contains("3".ToLower()))
{

Console.WriteLine("Executed");
ChampsList.Controls.Remove(SearchPanel);
}

}
}
}

private void cost4ToolStripMenuItem_Click(object sender, EventArgs e)
{
ChampsList.Controls.Clear();
ChampsSearchBox.Clear();
championsListLoop();
for (int i = 0; i < 5; i++)
{
foreach (Control SearchPanel in ChampsList.Controls)
{


if (!SearchPanel.Text.ToLower().Contains("4".ToLower()))
{

Console.WriteLine("Executed");
ChampsList.Controls.Remove(SearchPanel);
}

}
}
}

private void cost5ToolStripMenuItem_Click(object sender, EventArgs e)
{
ChampsList.Controls.Clear();
ChampsSearchBox.Clear();
championsListLoop();

for (int i = 0; i < 5; i++)
{
foreach (Control SearchPanel in ChampsList.Controls)
{


if (!SearchPanel.Text.ToLower().Contains("5".ToLower()))
{

Console.WriteLine("Executed");
ChampsList.Controls.Remove(SearchPanel);
}

}
}
}
}
}
Binary file modified bin/Release/TFT Overlay.exe
Binary file not shown.
Binary file modified bin/Release/TFT Overlay.pdb
Binary file not shown.
Binary file modified obj/Release/TFT Overlay.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified obj/Release/TFT Overlay.exe
Binary file not shown.
Binary file modified obj/Release/TFT Overlay.pdb
Binary file not shown.

0 comments on commit d9a27a0

Please sign in to comment.