This commit is contained in:
chrys 2019-02-12 23:32:46 +01:00
parent 1922a47cb5
commit 721bc4a3b7
2 changed files with 10 additions and 21 deletions

View File

@ -33,18 +33,14 @@ class helpManager():
try:
self.env['bindings'] = self.bindingsBackup.copy()
self.bindingsBackup = None
#del(self.env['bindings'][str([1, ['KEY_ESC']])])
#del(self.env['bindings'][str([1, ['KEY_UP']])])
#del(self.env['bindings'][str([1, ['KEY_DOWN']])])
#del(self.env['bindings'][str([1, ['KEY_SPACE']])])
except:
pass
def isTutorialMode(self):
return self.env['general']['tutorialMode']
return self.env['general']['tutorialMode']
def getCommandHelpText(self, command, section = 'commands'):
commandName = command.lower()
commandName = commandName.split('__-__')[0]
commandName = commandName.replace('_',' ')
commandName = commandName.split('__-__')[0]
commandName = commandName.replace('_',' ')
commandName = commandName.replace('_',' ')
if command == 'TOGGLE_TUTORIAL_MODE':
commandDescription = _('toggles the tutorial mode')
@ -54,22 +50,22 @@ class helpManager():
commandDescription = 'no Description available'
commandShortcut = self.env['runtime']['commandManager'].getShortcutForCommand( command)
commandShortcut = commandShortcut.replace('KEY_',' ')
commandShortcut = commandShortcut.replace('[','')
commandShortcut = commandShortcut.replace(']','')
commandShortcut = commandShortcut.replace("'",'')
commandShortcut = commandShortcut.replace('[','')
commandShortcut = commandShortcut.replace(']','')
commandShortcut = commandShortcut.replace("'",'')
if commandShortcut == '':
commandShortcut = 'unbound'
helptext = commandName + ', Shortcut ' + commandShortcut + ', Description ' + commandDescription
return helptext
def createHelpDict(self, section = 'commands'):
self.helpDict = {}
self.helpDict = {}
for command in sorted(self.env['commands'][section].keys()):
self.helpDict[len(self.helpDict)] = self.getCommandHelpText(command, section)
self.helpDict[len(self.helpDict)] = self.getCommandHelpText(command, section)
if len(self.helpDict) > 0:
self.tutorialListIndex = 0
else:
self.tutorialListIndex = None
def getHelpForCurrentIndex(self):
self.tutorialListIndex = None
def getHelpForCurrentIndex(self):
if self.tutorialListIndex == None:
return ''
return self.helpDict[self.tutorialListIndex]

View File

@ -147,13 +147,6 @@ class vmenuManager():
self.currIndex = None
self.env['bindings'] = self.bindingsBackup.copy()
self.bindingsBackup = None
#del(self.env['bindings'][str([1, ['KEY_ESC']])])
#del(self.env['bindings'][str([1, ['KEY_UP']])])
#del(self.env['bindings'][str([1, ['KEY_DOWN']])])
#del(self.env['bindings'][str([1, ['KEY_SPACE']])])
#del(self.env['bindings'][str([1, ['KEY_LEFT']])])
#del(self.env['bindings'][str([1, ['KEY_RIGHT']])])
#del(self.env['bindings'][str([1, ['KEY_ENTER']])])
except:
pass
def createMenuTree(self):