Beispiel #1
0
 def activate(self, clientId):
     """
     convenience function. pushes menu cmdMap and prompt, and displays menu
     """
     pushCmdHandler(clientId, self.cmdMap)
     pushPrompt(clientId, lambda x: self.prompt)
     sendToClient(clientId, self.menu)
Beispiel #2
0
 def activate( self, clientId ):
     """
     convenience function. pushes menu cmdMap and prompt, and displays menu
     """
     pushCmdHandler( clientId, self.cmdMap )
     pushPrompt( clientId, lambda x: self.prompt )
     sendToClient( clientId, self.menu( clientId ) )
Beispiel #3
0
def zoneListCmd( clientId, remaining ):
    zoneTemplates = zoneList()

    zones = "{!{FGZone Templates:{FC" + endl
    for zt in zoneTemplates:
        zones += " " + str(zt) + endl

    sendToClient( clientId, zones )
Beispiel #4
0
def mobListCmd(clientId, remaining):
    mobTemplates = mobList()

    mobs = "{!{FGMob Templates:{FC" + endl
    for mt in mobTemplates:
        mobs += " " + str(mt) + endl

    sendToClient(clientId, mobs)
Beispiel #5
0
def zoneListCmd(clientId, remaining):
    zoneTemplates = zoneList()

    zones = "{!{FGZone Templates:{FC" + endl
    for zt in zoneTemplates:
        zones += " " + str(zt) + endl

    sendToClient(clientId, zones)
Beispiel #6
0
def mobListCmd( clientId, remaining ):
    mobTemplates = mobList()

    mobs = "{!{FGMob Templates:{FC" + endl
    for mt in mobTemplates:
        mobs += " " + str(mt) + endl

    sendToClient( clientId, mobs )
Beispiel #7
0
def mobEditCmd(clientId, remaining):
    if remaining:
        (token, remaining) = first_token(remaining)
        templateId = toInt(token)

        if templateId:
            mobTemplate = getMobTemplate(templateId)

            if mobTemplate:
                _editMob(clientId, mobTemplate)
                return

        _invalidMobId(clientId, token)

    # MobTemplateSelector
    sendToClient(clientId, "MobTemplateSelector not impl")
Beispiel #8
0
def zoneEditCmd( clientId, remaining):
    if remaining:
        (token, remaining) = first_token(remaining)
        templateId = toInt(token)

        if templateId:
            zoneTemplate = getZoneTemplate( templateId )

            if zoneTemplate:
                _editZone( clientId, zoneTemplate )
                return
            
        _invalidZoneId( clientId, token )

    # ZoneTemplateSelector
    sendToClient( clientId, "ZoneTemplateSelector not impl" )
Beispiel #9
0
def zoneEditCmd(clientId, remaining):
    if remaining:
        (token, remaining) = first_token(remaining)
        templateId = toInt(token)

        if templateId:
            zoneTemplate = getZoneTemplate(templateId)

            if zoneTemplate:
                _editZone(clientId, zoneTemplate)
                return

        _invalidZoneId(clientId, token)

    # ZoneTemplateSelector
    sendToClient(clientId, "ZoneTemplateSelector not impl")
Beispiel #10
0
def defaultInvalidSelectionCallback(clientId, menuStr):
    sendToClient(clientId, menuStr)
Beispiel #11
0
def welcomeCallback(clientId):
    sendToClient(clientId, welcomeMessage % rootCmdMap.commands())
Beispiel #12
0
def cmdChat(clientId, remaining):
    if not remaining or len(remaining) == 0:
        sendToClient(clientId, "Usage: chat msg\r\n")
        return

    cmdChatFromMsg(clientId, remaining)
Beispiel #13
0
def cmdColumnsDemo( clientId, remaining ):
    sendToClient( clientId, "\r\n{!{FYColumns Demo:\r\n\r\n" + toColumns( [ rootCmdMap.commands(), "no color\r\n{!bold\r\n{FMfore magenta\r\n" + rootCmdMap.commands(), demoMsg ], [9, 15, 40], True ) + noSeps )
Beispiel #14
0
def defaultInvalidSelectionCallback( clientId, menuFunc ):
    sendToClient( clientId, menuFunc( clientId ) )
Beispiel #15
0
def submitEdit(clientId, text):
    sendToClient(clientId, endl + "{!{FUYou edited:%s{@%s" % (endl, text) + endl)
Beispiel #16
0
 def use( self, clientId ):
     sendToClient( clientId, self.menuStr )
     pushCmdHandler( clientId, self.menuMap )
Beispiel #17
0
def textCallback( clientId, text ):
    sendToClient( clientId, "{!{FUYou typed:{FG %s" % text )
    popPrompt( clientId )
Beispiel #18
0
def cmdChat( clientId, remaining ):
    if not remaining or len(remaining) == 0:
        sendToClient( clientId, "Usage: chat msg\r\n")
        return

    cmdChatFromMsg( clientId, remaining )
Beispiel #19
0
def _invalidMobId(clientId, token):
    sendToClient(clientId, "Invalid mob id '%s'" % token)
Beispiel #20
0
def _activate( clientId, textEditor ):
    pushCmdHandler( clientId, textEditor.cmdMap )
    pushPrompt( clientId, lambda clientId: _prompt )
    sendToClient( clientId, textEditor.menu )
Beispiel #21
0
def submenuSelectionCallback(clientId):
    sendToClient(clientId, menu(clientId))
Beispiel #22
0
def submenuSelectionCallback(clientId):
    sendToClient(clientId, menu(clientId))
Beispiel #23
0
def textCallback(clientId, text):
    sendToClient(clientId, "{!{FUYou typed:{FG %s" % text)
    popPrompt(clientId)
Beispiel #24
0
def _defaultInvalidSelectionCallback( clientId, menu ):
    sendToClient( clientId, menu )
Beispiel #25
0
def _editMobShortNameCallback(clientId, mobTemplateForm, mobShortName):
    mobTemplateForm.mobTemplate.sname = mobShortName
    popPrompt(clientId)
    sendToClient(clientId, mobTemplateForm.form.menu(clientId))
Beispiel #26
0
def _displayText( clientId, textEditor ):
    sendToClient( clientId, textEditor.text + endl + textEditor.menu )
Beispiel #27
0
def _invalidZoneId(clientId, token):
    sendToClient(clientId, "Invalid zone id '%s'" % token)
Beispiel #28
0
def submitEdit( clientId, text ):
    sendToClient( clientId, endl + "{!{FUYou edited:%s{@%s" % (endl, text) + endl )
Beispiel #29
0
def welcomeCallback( clientId ):
    sendToClient( clientId, welcomeMessage % rootCmdMap.commands() )
Beispiel #30
0
def _invalidZoneId( clientId, token ):
    sendToClient( clientId, "Invalid zone id '%s'" % token )
Beispiel #31
0
def _activate(clientId, textEditor):
    pushCmdHandler(clientId, textEditor.cmdMap)
    pushPrompt(clientId, lambda clientId: _prompt)
    sendToClient(clientId, textEditor.menu)
Beispiel #32
0
def _editZoneNameCallback(clientId, zoneTemplateForm, zoneName):
    zoneTemplateForm.zoneTemplate.name = zoneName
    popPrompt(clientId)
    sendToClient(clientId, zoneTemplateForm.form.menu(clientId))
Beispiel #33
0
def _displayText(clientId, textEditor):
    sendToClient(clientId, textEditor.text + endl + textEditor.menu)
Beispiel #34
0
def _editZoneNameCallback( clientId, zoneTemplateForm, zoneName ):
    zoneTemplateForm.zoneTemplate.name = zoneName
    popPrompt( clientId )
    sendToClient( clientId, zoneTemplateForm.form.menu( clientId ) )
Beispiel #35
0
def _editMobShortNameCallback(clientId, mobTemplateForm, mobShortName):
    mobTemplateForm.mobTemplate.sname = mobShortName
    popPrompt(clientId)
    sendToClient(clientId, mobTemplateForm.form.menu(clientId))
Beispiel #36
0
 def use(self, clientId):
     sendToClient(clientId, self.menuStr)
     pushCmdHandler(clientId, self.menuMap)
Beispiel #37
0
def cmdColumnsDemo(clientId, remaining):
    sendToClient(
        clientId, "\r\n{!{FYColumns Demo:\r\n\r\n" + toColumns([
            rootCmdMap.commands(), "no color\r\n{!bold\r\n{FMfore magenta\r\n"
            + rootCmdMap.commands(), demoMsg
        ], [9, 15, 40], True) + noSeps)