2021-04-02 20:53:19 +05:30
|
|
|
# Released under the MIT License. See LICENSE for details.
|
2021-04-03 20:54:32 +05:30
|
|
|
import ba,_ba,json,os
|
|
|
|
|
from stats import mystats
|
|
|
|
|
statsFile = mystats.statsfile
|
2021-04-02 20:53:19 +05:30
|
|
|
|
|
|
|
|
def get_setting():
|
2021-04-03 20:54:32 +05:30
|
|
|
s = {}
|
|
|
|
|
f=open("setting.json","r")
|
|
|
|
|
d = json.loads(f.read())
|
|
|
|
|
f.close()
|
|
|
|
|
return d
|
2021-04-02 20:53:19 +05:30
|
|
|
|
2021-04-03 20:54:32 +05:30
|
|
|
def commit(updated_settings: dict):
|
|
|
|
|
if updated_settings == {}: return
|
2021-04-02 20:53:19 +05:30
|
|
|
f=open("setting.json",'w')
|
2021-04-03 20:54:32 +05:30
|
|
|
json.dump(updated_settings,f,indent=4)
|
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
|
def sendError(msg: str, ID: int = None):
|
|
|
|
|
if ID is not None:
|
|
|
|
|
ba.screenmessage(msg, color=(1,0,0), clients=[ID], transient=True)
|
|
|
|
|
else:
|
|
|
|
|
ba.screenmessage(msg, color=(1,0,0), transient=True)
|
|
|
|
|
|