high_score.rml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <rml>
  2. <head>
  3. <title>High Scores</title>
  4. <link type="text/template" href="window.rml" />
  5. <style>
  6. body
  7. {
  8. width: 440px;
  9. height: 440px;
  10. margin: auto;
  11. }
  12. div#title_bar div#icon
  13. {
  14. decorator: image( icon-hiscore );
  15. }
  16. datagrid
  17. {
  18. margin-bottom: 20px;
  19. }
  20. datagrid datagridbody
  21. {
  22. min-height: 200px;
  23. }
  24. datagrid datagridrow
  25. {
  26. padding-top: 7px;
  27. padding-bottom: 7px;
  28. }
  29. defender
  30. {
  31. display: block;
  32. width: 64px;
  33. height: 16px;
  34. decorator: defender( high_scores_defender.tga );
  35. }
  36. </style>
  37. <script>
  38. HighScore = HighScore or {}
  39. function HighScore.OnKeyDown(event)
  40. if event.parameters['key_identifier'] == rmlui.key_identifier.RETURN then
  41. Game.SetHighScoreName(Element.As.ElementFormControlInput(event.current_element).value)
  42. end
  43. end
  44. </script>
  45. </head>
  46. <body template="luawindow" onload="Window.OnWindowLoad(document) Game.SubmitHighScore()">
  47. <datagrid id="datagrid" source="high_scores.scores">
  48. <col fields="name,name_required" formatter="name" width="40%">Pilot</col>
  49. <col fields="colour" formatter="ship" width="20%">Ship</col>
  50. <col fields="wave" width="20%">Wave</col>
  51. <col fields="score" width="20%">Score</col>
  52. </datagrid>
  53. <button onclick="Game.SetHighScoreName('Anon') Window.LoadMenu('main_menu',document)">Main Menu</button>
  54. </body>
  55. </rml>