Skip to content

Commit

Permalink
Update SkinList.json
Browse files Browse the repository at this point in the history
+ added WIP functionality to git
  • Loading branch information
Prevter committed Feb 10, 2023
1 parent f08676c commit 572074d
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 12 deletions.
111 changes: 111 additions & 0 deletions FloatTool/Assets/SkinList.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,115 @@
[
{
"Name": "Revolution Case",
"Link": "https://csgostash.com/case/376/Revolution-Case",
"CanBeStattrak": true,
"LowestRarity": "Mil-Spec",
"HighestRarity": "Covert",
"Skins": [
{
"Name": "AK-47 | Head Shot",
"Rarity": "Covert",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "M4A4 | Temukau",
"Rarity": "Covert",
"MinWear": 0.0,
"MaxWear": 0.8
},
{
"Name": "AWP | Doodle Lore",
"Rarity": "Classified",
"MinWear": 0.0,
"MaxWear": 0.8
},
{
"Name": "P2000 | Wicked Sick",
"Rarity": "Classified",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "UMP-45 | Wild Child",
"Rarity": "Classified",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "M4A1-S | Emphorosaur-S",
"Rarity": "Restricted",
"MinWear": 0.0,
"MaxWear": 0.8
},
{
"Name": "Glock-18 | Umbral Rabbit",
"Rarity": "Restricted",
"MinWear": 0.0,
"MaxWear": 0.75
},
{
"Name": "R8 Revolver | Banana Cannon",
"Rarity": "Restricted",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "P90 | Neoqueen",
"Rarity": "Restricted",
"MinWear": 0.0,
"MaxWear": 0.6
},
{
"Name": "MAC-10 | Sakkaku",
"Rarity": "Restricted",
"MinWear": 0.21,
"MaxWear": 0.79
},
{
"Name": "MP5-SD | Liquidation",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "P250 | Re.built",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 0.9
},
{
"Name": "SCAR-20 | Fragments",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 0.78
},
{
"Name": "MP9 | Featherweight",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "Tec-9 | Rebel",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "MAG-7 | Insomnia",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 1.0
},
{
"Name": "SG 553 | Cyberforce",
"Rarity": "Mil-Spec",
"MinWear": 0.0,
"MaxWear": 0.9
}
]
},
{
"Name": "Recoil Case",
"Link": "https://csgostash.com/case/355/Recoil-Case",
Expand Down
4 changes: 3 additions & 1 deletion FloatTool/Common/Skin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@ public sealed class InputSkin
public double WearValue;
public float Price;
public Currency SkinCurrency;
public string ListingID;

public double GetWearValue => WearValue;

public InputSkin(double wear, float price, Currency currency)
public InputSkin(double wear, float price, Currency currency, string listingId = "")
{
WearValue = wear;
Price = price;
SkinCurrency = currency;
ListingID = listingId;
}

internal int CompareTo(InputSkin b)
Expand Down
34 changes: 34 additions & 0 deletions FloatTool/Common/Steam/SteamApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;

namespace FloatTool.Steam
{
/*public static class SteamApi
{
public readonly static HttpClient httpClient = new();
public struct RequestDefinition
{
public string ApiInterface;
public string ApiMethod;
public string ApiVersion;
public dynamic Data;
public string? AccessToken;
}
public static async Task<dynamic> SendRequest(RequestDefinition request)
{
string url = $"https://api.steampowered.com/{request.ApiInterface}/{request.ApiMethod}/v{request.ApiVersion}/";
var content = new FormUrlEncodedContent(request.Data);
var result = await httpClient.PostAsync(url, content);
return null;
}
}*/
}
19 changes: 8 additions & 11 deletions FloatTool/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ private async void Window_KeyUp(object sender, KeyEventArgs e)
switch (e.Key)
{
case Key.F1:
Process.Start(new ProcessStartInfo { FileName = "https://git.prevter.ml/floattool/table", UseShellExecute = true });
Process.Start(new ProcessStartInfo { FileName = "https://prevter.ml/floattool/table", UseShellExecute = true });
break;
case Key.F2:
Process.Start(new ProcessStartInfo { FileName = "https://git.prevter.ml/floattool/tools", UseShellExecute = true });
Process.Start(new ProcessStartInfo { FileName = "https://prevter.ml/floattool/tools", UseShellExecute = true });
break;
case Key.F3:
string skin = $"{ViewModel.WeaponName} | {ViewModel.SkinName}";
Expand All @@ -135,10 +135,6 @@ private async void Window_KeyUp(object sender, KeyEventArgs e)
ViewModel.FoundCombinations.Sort((a, b) => a.Price.CompareTo(b.Price));
break;
case Key.F12:
// TODO: Create a dev tools window
// var client = new SteamClient();
// var qrcode = await client.LoginWithQR();
// MessageBox.Show(qrcode);
break;
}
}
Expand Down Expand Up @@ -337,7 +333,7 @@ private void StartSearchButton_Click(object sender, RoutedEventArgs e)

SetStatus("m_GettingFloats");

Dictionary<Task<double>, float> floatTasks = new();
Dictionary<Task<double>, (string, float)> floatTasks = new();
foreach (var skin in r["listinginfo"])
{
string lid = r["listinginfo"][skin.Name]["listingid"].ToString();
Expand All @@ -348,8 +344,8 @@ private void StartSearchButton_Click(object sender, RoutedEventArgs e)
{
floatTasks.Add(
Utils.GetWearFromInspectURL(link),
(float.Parse(r["listinginfo"][skin.Name]["converted_price"].ToString()) +
float.Parse(r["listinginfo"][skin.Name]["converted_fee"].ToString())) / 100
(lid, (float.Parse(r["listinginfo"][skin.Name]["converted_price"].ToString()) +
float.Parse(r["listinginfo"][skin.Name]["converted_fee"].ToString())) / 100)
);
}
catch (Exception ex)
Expand All @@ -364,8 +360,9 @@ private void StartSearchButton_Click(object sender, RoutedEventArgs e)
{
inputSkinBag.Add(new InputSkin(
task.Result,
floatTasks[task],
Settings.Currency
floatTasks[task].Item2,
AppHelpers.Settings.Currency,
floatTasks[task].Item1
));

ViewModel.ProgressPercentage = (float)inputSkinBag.Count * 100 / floatTasks.Count;
Expand Down

0 comments on commit 572074d

Please sign in to comment.