Skip to content

Commit d02480d

Browse files
authored
Merge branch 'TechPenguineer:Windows' into Windows
2 parents 9e7cb8c + 4c858b9 commit d02480d

File tree

2 files changed

+68
-13
lines changed

2 files changed

+68
-13
lines changed

src/HyperMC/Data/Settings.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
using System;
3+
using System.IO;
4+
using System.Text.Json;
5+
using System.Text.Json.Serialization;
6+
7+
namespace HyperMcSettings
8+
{
9+
public class manager
10+
{
11+
12+
string path = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\.hypermc\\settings";
13+
14+
public void createSettingsFolder(string SettingType)
15+
{
16+
string setting_file_path = $"{path}\\{SettingType}";
17+
if(!Directory.Exists(setting_file_path))
18+
{
19+
Directory.CreateDirectory(setting_file_path);
20+
}
21+
}
22+
public void addSetting(string settingFolder, string settingName, string settingValue, bool overwriteIfExists)
23+
{
24+
void checkIfExists()
25+
{
26+
if (!Directory.Exists($"{path}\\{settingFolder}"))
27+
{
28+
createSettingsFolder(settingFolder);
29+
}
30+
}
31+
void writeSettingFile()
32+
{
33+
if(File.Exists($"{path}\\{settingFolder}\\{settingName}") && overwriteIfExists)
34+
{
35+
File.Create($"{path}\\{settingFolder}\\{settingName}.json");
36+
}
37+
}
38+
39+
void writeSetting()
40+
{
41+
42+
}
43+
44+
45+
checkIfExists();
46+
writeSettingFile();
47+
48+
49+
50+
51+
}
52+
}
53+
}

src/HyperMC/HyperMcView.Designer.cs

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)