Add Colour Star Support
This commit is contained in:
1 parent
545fd41b03
commit
1ef8436e50
1 file changed
+10
-2
+10
-2
@@ -132,10 +132,18 @@ class Database:
|
||||
self.Views += 1
|
||||
return True
|
||||
return False
|
||||
def AddStar(self, CreatorID, filename, amount=1):#todo: add support for other colored stars
|
||||
def AddStar(self, CreatorID, filename, amount=1, color='yellow'):
|
||||
print color
|
||||
starindices = {
|
||||
'yellow': 2,
|
||||
'green': 3,
|
||||
'red': 4,
|
||||
'blue': 5,
|
||||
'purple': 6
|
||||
}
|
||||
for i, flipnote in enumerate(self.GetCreator(CreatorID, True) or []):
|
||||
if flipnote[0] == filename:
|
||||
self.Creator[CreatorID][i][2] = int(flipnote[2]) + amount
|
||||
self.Creator[CreatorID][i][starindices[color]] = int(flipnote[starindices[color]]) + amount
|
||||
self.Stars += 1
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in new issue
Block a user
