| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <rml>
- <head>
- <title>Start Game</title>
- <link type="text/template" href="window.rml" />
- <style>
- body
- {
- width: 300dp;
- height: 225dp;
- margin: auto;
- }
- div#title_bar div#icon
- {
- decorator: image( icon-game );
- }
- form div
- {
- width: 200dp;
- margin: auto;
- }
- color
- {
- display: inline-block;
- width: 9dp;
- height: 9dp;
- border: 1dp #666;
- margin-right: 0.5em;
- }
- </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" onkeydown="if Window.EscapePressed(event) then Window.LoadMenu('main_menu',document) end">
- <form onsubmit="StartGame.SetupGame(event,document)">
- <div>
- <p>
- Difficulty<br />
- <label><input type="radio" name="difficulty" value="easy" checked="true" /> Easy</label><br />
- <label><input type="radio" name="difficulty" value="hard" /> Hard</label>
- </p>
- <p>
- Colour<br />
- <select name="colour">
- <option value="233,116,81"><color style="background: rgb(233,116,81)"/>Burnt Sienna</option>
- <option value="127,255,0"><color style="background: rgb(127,255,0)"/>Chartreuse</option>
- <option value="21,96,189"><color style="background: rgb(21,96,189)"/>Denim</option>
- <option value="246,74,138"><color style="background: rgb(246,74,138)"/>French Rose</option>
- <option value="255,0,255"><color style="background: rgb(255,0,255)"/>Fuchsia</option>
- <option value="218,165,32"><color style="background: rgb(218,165,32)"/>Goldenrod</option>
- <option selected value="255,255,240"><color style="background: rgb(255,255,240)"/>Ivory</option>
- </select>
- </p>
- </div>
- <input type="submit">Start Game!</input>
- </form>
- </body>
- </rml>
|