window.rml 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template name="luawindow" content="content">
  2. <head>
  3. <link type="text/template" href="../../assets/window.rml" />
  4. <script>
  5. Window = Window or {} --namespace
  6. function Window.OnWindowLoad(document)
  7. document:GetElementById('title').inner_rml = document.title
  8. end
  9. function Window.LoadMenu(name,document)
  10. local doc = document.context:LoadDocument('lua_invaders/data/' .. name .. '.rml')
  11. if doc then
  12. doc:Show()
  13. document:Close()
  14. end
  15. return doc
  16. end
  17. function Window.OpenDocument(name,document)
  18. local doc = document.context:LoadDocument('lua_invaders/data/' .. name .. '.rml')
  19. if doc then
  20. doc:Show()
  21. end
  22. return doc
  23. end
  24. function Window.EscapePressed(event)
  25. return event.parameters['key_identifier'] == rmlui.key_identifier.ESCAPE
  26. end
  27. </script>
  28. </head>
  29. <body template="window">
  30. </body>
  31. </template>