forked from HeyM1ke/ValorantStreamOverlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SettingsParser.cs
96 lines (84 loc) · 2.93 KB
/
SettingsParser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ValorantStreamOverlay
{
class SettingsParser
{
public async Task<string> ReadRegion(int regionName)
{
string region = "na";
switch (regionName)
{
case 0:
region = "na";
break;
case 1:
region = "eu";
break;
case 2:
region = "kr";
break;
case 3:
region = "ap";
break;
}
return region;
}
public async Task ReadSkin(int skinNumber)
{
//Depending on the skin number it will set the background image.
//Implement var that accesses the resources to remove switch statement.
switch (skinNumber)
{
case 0:
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.backgroundv2;
break;
case 1:
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.bluebackground;
break;
case 2:
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.lightbluebackground;
break;
case 3:
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.greenbackground;
break;
case 4:
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.purplebackground;
break;
case 5:
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.graybackground;
break;
case 6:
if (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), "references", "custom.png")))
{
LogicHandler.ValorantOver.backgroundPic.Image = Image.FromFile(Path.Combine(Directory.GetCurrentDirectory(), "references", "custom.png"));
}
else
{
LogicHandler.ValorantOver.backgroundPic.Image = Properties.Resources.custom;
}
break;
}
}
public async Task<int> ReadDelay(int delayNumber)
{
if (delayNumber != null)
{
switch (delayNumber)
{
case 0:
return 30;
case 1:
return 60;
}
}
return 30;
}
}
}