script to set up argument completion for loadsky

Generates a list of all available skymaps under packages/textures/skymaps
by checking for files with the ending "_ft.jpg".

Note: argument completion does not work properly for arguments with spaces.
This commit is contained in:
ac-stef
2015-05-18 14:46:03 +02:00
parent 5bd9105a8c
commit fe478d13ca
+6
View File
@@ -91,6 +91,12 @@ looplist [
] [ cmd options ] [ listcomplete $cmd (listoptions $options)
]
// set up list of skymaps
push skies ""
looplist (gettexturelist skymaps/ "" _ft.jpg) [c1 c2 c3 c4] [skies = (concat $skies (escape (concatword $c3 "/" $c4)))]
listcomplete loadsky (pop skies)
// Game mode descriptions...
gamemodedesc 0 [Team Deathmatch: Shred the enemy team to pieces!]
gamemodedesc 1 [Co-operative edit: Edit maps with others online!]