示例#1
0
def loadChars():
    window.charList.clear()
    window.char2List.clear()
    window.actionList.clear()
    dataFiles.configFile, dataFiles.Characters, dataFiles.Items, dataFiles.Actions = dataFiles.reloadFiles()
    fillCharList()
    fillActionList()
示例#2
0
def loadGame():
    window.charList.clear()
    window.char2List.clear()
    window.actionList.clear()
    dataFiles.configFile, dataFiles.Characters, dataFiles.Items, dataFiles.Actions, dataFiles.PrintColors = dataFiles.reloadFiles()
    fillCharList()
    fillActionList()
    log ("Data reloaded.")
示例#3
0
    # A function which is used in rouding a value from 0 to 1 by a specified in UI threshold.
    tr = graphDialog.missTrSB.value()
    if v > tr:
        v = 1.0
    else:
        v = 0.0
    return v


def showOutput(text):
    #prints output bbcode in one window, and html formatted version in another.
    window.outbox.setText(text)
    window.fancyOutbox.setText(bbcode.render_html(text))
    log("Output written.")

dataFiles.reloadFiles()

def log(text):
    #A function for pretty logging with time and date
    print ">>>",datetime.now(),": "+text
    window.statusbar.showMessage(text,0)

#region CharacterEditFunctions
def addChar():
    #Adds a new character to the list and into the character dict
    name = "New Character"
    dataFiles.Characters.update({name:dataFiles.AllAttrsAndInv})
    window.charList.addItem (name)
    window.char2List.addItem (name)
    log ("Character added: "+name)
示例#4
0
def loadGame():
    window.charList.clear()
    window.char2List.clear()
    window.actionList.clear()
    dataFiles.configFile, dataFiles.Characters, dataFiles.Items, dataFiles.Actions, dataFiles.PrintColors = dataFiles.reloadFiles(
    )
    fillCharList()
    fillActionList()
    log("Data reloaded.")
示例#5
0
    tr = graphDialog.missTrSB.value()
    if v > tr:
        v = 1.0
    else:
        v = 0.0
    return v


def showOutput(text):
    #prints output bbcode in one window, and html formatted version in another.
    window.outbox.setText(text)
    window.fancyOutbox.setText(bbcode.render_html(text))
    log("Output written.")


dataFiles.reloadFiles()


def log(text):
    #A function for pretty logging with time and date
    print ">>>", datetime.now(), ": " + text
    window.statusbar.showMessage(text, 0)


#region CharacterEditFunctions
def addChar():
    #Adds a new character to the list and into the character dict
    name = "New Character"
    dataFiles.Characters.update({name: dataFiles.AllAttrsAndInv})
    window.charList.addItem(name)
    window.char2List.addItem(name)