.BANCHO. Add some tillerino-like commands to fokabot
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Some functions that don't fit in any other file"""
|
||||
from constants import mods
|
||||
|
||||
def stringToBool(s):
|
||||
"""
|
||||
@@ -20,3 +21,33 @@ def hexString(s):
|
||||
"""
|
||||
|
||||
return ":".join("{:02x}".format(ord(c)) for c in s)
|
||||
|
||||
def readableMods(__mods):
|
||||
"""
|
||||
Return a string with readable std mods.
|
||||
Used to convert a mods number for oppai
|
||||
|
||||
__mods -- mods bitwise number
|
||||
return -- readable mods string, eg HDDT
|
||||
"""
|
||||
r = ""
|
||||
if __mods == 0:
|
||||
return r
|
||||
if __mods & mods.NoFail > 0:
|
||||
r += "NF"
|
||||
if __mods & mods.Easy > 0:
|
||||
r += "EZ"
|
||||
if __mods & mods.Hidden > 0:
|
||||
r += "HD"
|
||||
if __mods & mods.HardRock > 0:
|
||||
r += "HR"
|
||||
if __mods & mods.DoubleTime > 0:
|
||||
r += "DT"
|
||||
if __mods & mods.HalfTime > 0:
|
||||
r += "HT"
|
||||
if __mods & mods.Flashlight > 0:
|
||||
r += "FL"
|
||||
if __mods & mods.SpunOut > 0:
|
||||
r += "SO"
|
||||
|
||||
return r
|
||||
|
@@ -110,7 +110,7 @@ def packData(__data, __dataType):
|
||||
# Non empty string
|
||||
data += b"\x0B"
|
||||
data += uleb128Encode(len(__data))
|
||||
data += str.encode(__data, "latin_1")
|
||||
data += str.encode(__data, "utf-8")
|
||||
elif __dataType == dataTypes.uInt16:
|
||||
packType = "<H"
|
||||
elif __dataType == dataTypes.sInt16:
|
||||
|
Reference in New Issue
Block a user