Add filter option to AGS

This commit is contained in:
Mathieu Comandon 2016-10-17 11:09:25 -07:00
parent 932eff1357
commit 3c18f16abb

View file

@ -11,7 +11,7 @@ class ags(Runner):
game_options = [{
'option': 'main_file',
'type': 'file',
'label': 'blopblup '
'label': 'Game executable or directory'
}]
runner_options = [
{
@ -19,16 +19,34 @@ class ags(Runner):
'type': 'bool',
'label': 'Fullscreen',
'default': True
},
{
'option': 'filter',
'type': 'choice',
'choices': [
('None', 'none'),
('Standard scaling', 'stdscale'),
('HQ2x', 'hq2x'),
('HQ3x', 'hq3x'),
]
}
]
def play(self):
"""Run the game."""
arguments = [self.get_executable()]
if self.runner_config.get('fullscreen', True):
arguments.append('-f')
main_file = self.game_config.get('main_file') or ''
if not os.path.exists(main_file):
return {'error': 'FILE_NOT_FOUND', 'file': main_file}
arguments = [self.get_executable()]
if self.runner_config.get('fullscreen', True):
arguments.append('--fullscreen')
else:
arguments.append('--windowed')
if self.runner_config.get('filter'):
arguments.append('--gfxfilter')
arguments.append(self.runner_config['filter'])
arguments.append(main_file)
return {"command": arguments}