Exemplo n.º 1
0
def readQuestConditions(section):
    result = []
    valuesSec = section['quest-conditions']
    if valuesSec is not None:
        for name, conditionsSection in valuesSec.items():
            valueType, valueSec = conditionsSection.items()[0]
            result.append(readVarValue(valueType, valueSec))

    return result
Exemplo n.º 2
0
def readLoadViewDataSection(xmlCtx, section, flags):
    settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
    alias = None
    if 'alias' in section.keys():
        alias = _xml.readString(xmlCtx, section, 'alias')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting name')
    scope = EVENT_BUS_SCOPE.DEFAULT
    if 'scope' in section.keys():
        scope = _xml.readInt(xmlCtx, section, 'scope')
    else:
        _xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting value')
    ctx = None
    if 'context' in section.keys():
        ctx = readVarValue('asDict', section['context'])
    return chapter.LoadViewData(settingID, alias, scope, ctx)