2
0

high_score.rml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <rml>
  2. <head>
  3. <title>High Scores</title>
  4. <link type="text/template" href="../../assets/window.rml" />
  5. <style>
  6. body
  7. {
  8. width: 440dp;
  9. height: 440dp;
  10. margin: auto;
  11. }
  12. div#title_bar div#icon
  13. {
  14. decorator: image( icon-hiscore );
  15. }
  16. defender
  17. {
  18. display: inline-block;
  19. width: 64dp;
  20. height: 16dp;
  21. decorator: defender( high_scores_defender.tga );
  22. }
  23. table {
  24. margin-top: 5dp;
  25. height: 345dp;
  26. }
  27. tbody tr {
  28. height: 30dp;
  29. }
  30. tbody tr:last-child {
  31. height: auto;
  32. background-color: transparent;
  33. }
  34. tbody td
  35. {
  36. padding-top: 5dp;
  37. height: 30dp;
  38. white-space: nowrap;
  39. overflow: hidden;
  40. }
  41. button {
  42. margin-top: 20dp;
  43. }
  44. </style>
  45. </head>
  46. <body template="window" onload="add_score">
  47. <table data-model="high_scores">
  48. <thead>
  49. <tr>
  50. <td style="width: 200%; margin-left: 10dp;">Pilot</td>
  51. <td style="min-width: 64dp;">Ship</td>
  52. <td>Wave</td>
  53. <td style="min-width: 64dp;">Score</td>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. <tr data-for="score : scores">
  58. <td data-if="score.name_required">
  59. <input id="player_input" type="text" name="name" onkeydown="enter_name" autofocus/>
  60. </td>
  61. <td data-if="!score.name_required">
  62. {{score.name}}
  63. </td>
  64. <td>
  65. <defender data-style-color="score.colour"/>
  66. </td>
  67. <td>
  68. {{score.wave}}
  69. </td>
  70. <td>
  71. {{score.score}}
  72. </td>
  73. </tr>
  74. <tr data-if="scores.size == 0">
  75. <td colspan="4" style="vertical-align: middle"><em>No scores recorded. Play a game!</em></td>
  76. </tr>
  77. <tr data-if="scores.size > 0"/>
  78. </tbody>
  79. </table>
  80. <button onclick="check_name; goto main_menu; close game_window">Main Menu</button>
  81. </body>
  82. </rml>