1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 22:05:12 +00:00

feat: auto-generate MCE/config.json

This commit is contained in:
RedDeadDepresso 2023-12-25 17:51:56 +00:00 committed by YoursFunny
parent a915ce396b
commit fc1edefa79
Signed by: YoursFunny
GPG Key ID: 207EDC3CD5B40F9C
3 changed files with 19 additions and 14 deletions

View File

@ -1,12 +0,0 @@
{
"ResetDaily": false,
"LastRun": "2023-12-24 21:41:55",
"ResetTime": "11:21:30",
"RechargeAP": true,
"PreferredTemplate": "template1",
"Queue": [],
"Event": false,
"Templates": {
"template1": []
}
}

View File

@ -1,12 +1,29 @@
import customtkinter
import json
import sys
from MCE.custom_widgets.ctk_notification import CTkNotification
import os
class Config:
def __init__(self, linker, config_file):
self.default_config = {
"ResetDaily": False,
"LastRun": "2023-12-24 21:41:55",
"ResetTime": "11:21:30",
"RechargeAP": False,
"PreferredTemplate": "template1",
"Queue": [],
"Event": False,
"Templates": {
"template1": []
}
}
self.linker = linker
self.config_file = config_file
if not os.path.exists(self.config_file):
with open(self.config_file, "w") as f:
json.dump(self.default_config, f, indent=2)
self.config_data = self.read()
self.linker.widgets = self.set_values_to_none(self.config_data)
self.locked = False

View File

@ -52,7 +52,7 @@
},
"Mission": {
"name": "Mission/Commissions/Event",
"help": "Open MCE Manager for additional settings"
"help": "Open MCE Manager for additional settings. Must be opened if it's your first time!"
},
"Circle": {
"name": "Club",