| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <rml>
- <head>
- <title>Start Game</title>
- <link type="text/template" href="window.rml" />
- <style>
- body
- {
- width: 300px;
- height: 225px;
-
- margin: auto;
- }
-
- div#title_bar div#icon
- {
- decorator: image( icon-game );
- }
-
- form div
- {
- width: 200px;
- margin: auto;
- }
- </style>
- <script>
- StartGame = StartGame or {}
- function StartGame.SetupGame(event,document)
- if event.parameters['difficulty'] == 'hard' then
- Game.SetDifficulty(Game.difficulty.HARD)
- else
- Game.SetDifficulty(Game.difficulty.EASY)
- end
-
- --some lua trickery coming up. Compiling a string at runtime that will return the values,
- --because they are comma separated. For example, if the user chose "Denim", then the
- --compiled string would look like "return 21,96,189"
- local red,green,blue = load('return '..event.parameters['colour']) ()
- Game.SetDefenderColour(Colourb.new(red,green,blue,255))
-
- local elem = Window.LoadMenu('game',document):GetElementById('game')
- elem:Focus()
- end
- </script>
- </head>
- <body template="luawindow">
- <form onsubmit="StartGame.SetupGame(event,document)">
- <div>
- <p>
- Difficulty:<br />
- <input type="radio" name="difficulty" value="easy" checked="true" /> Easy<br />
- <input type="radio" name="difficulty" value="hard" /> Hard
- </p>
- <p>
- Colour:<br />
- <select name="colour">
- <option value="233,116,81">Burnt Sienna</option>
- <option value="127,255,0">Chartreuse</option>
- <option value="21,96,189">Denim</option>
- <option value="246,74,138">French Rose</option>
- <option value="255,0,255">Fuschia</option>
- <option value="218,165,32">Goldenrod</option>
- <option selected value="255,255,240">Ivory</option>
- </select>
- </p>
- </div>
- <input type="submit">Start Game!</input>
- </form>
- </body>
- </rml>
|