-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDummyCommandModule.py
More file actions
50 lines (40 loc) · 1.83 KB
/
DummyCommandModule.py
File metadata and controls
50 lines (40 loc) · 1.83 KB
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
# -*- coding: utf-8 -*-
import CBE
class DummyCommand(CBE.CBEModule):
def __init__(self, id):
self.id = id
self.UI_File = "UI/DummyCommand_UI.json"
self.dummyCMD = None
return
def RegisterCommands(self):
self.cbe.CBEDebugLog("RegisterCommands", "DummyCommand")
cfg = self.cbe.Config
self.dummyCMD = CBE.CBECommand(cfg["Dummy_CMDName" + str(self.id)], cfg["Dummy_CMDCooldown" + str(self.id)], False, cfg["Dummy_CMDIsGlobal" + str(self.id)], cfg["Dummy_CMDUsage" + str(self.id)], cfg["Dummy_CMDDescription" + str(self.id)], self.ProcessDummy)
self.cbe.AddCommand(self.dummyCMD)
return
def RegisterUI(self):
self.cbe.CBEDebugLog("RegisterUI", "DummyCommand")
json = self.cbe.LoadUIFromFile(self.UI_File)
for k in json.keys():
json[k]["group"] = json[k]["group"] + " " + str(self.id)
json[k + str(self.id)] = json[k]
del json[k]
self.cbe.AddUI(json)
def RegisterHelp(self):
self.cbe.CBEDebugLog("RegisterHelp", "DummyCommand")
return
def GetDefaultConfig(self):
self.cbe.CBEDebugLog("GetDefaultConfig", "DummyCommand")
tempDict = {}
tempDict["Dummy_CMDName" + str(self.id)] = "Insert command name here"
tempDict["Dummy_CMDCooldown" + str(self.id)] = 10
tempDict["Dummy_CMDIsGlobal" + str(self.id)] = False
tempDict["Dummy_CMDUsage" + str(self.id)] = "Insert command usage here"
tempDict["Dummy_CMDDescription" + str(self.id)] = "Insert command description here"
return tempDict
def ReloadSettings(self, jsonData):
self.cbe.CBEDebugLog("ReloadSettings", "DummyCommand")
self.cbe.RemoveCommand(self.dummyCMD.cmd)
self.RegisterCommands()
def ProcessDummy(self, data):
return