summaryrefslogtreecommitdiffstats
path: root/cwd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cwd/assets/altcraft/scripts/init.lua7
-rw-r--r--cwd/assets/altcraft/ui/main-menu-styles.rcss (renamed from cwd/test.rcss)0
-rw-r--r--cwd/assets/altcraft/ui/main-menu.rml (renamed from cwd/test.rml)6
3 files changed, 8 insertions, 5 deletions
diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua
index 96b5ec3..b9b34a7 100644
--- a/cwd/assets/altcraft/scripts/init.lua
+++ b/cwd/assets/altcraft/scripts/init.lua
@@ -9,11 +9,14 @@ local plugin = {
}
function plugin.onLoad ()
- print("Loaded AltCraft plugin!")
+ rmlui:LoadFontFace("altcraft/fonts/OpenSans-Regular")
end
function plugin.onChangeState (newState)
- AC.LogWarning("New state: "..newState)
+ if newState == "MainMenu" then
+ local con = rmlui.contexts["default"]
+ con:LoadDocument("altcraft/ui/main-menu"):Show()
+ end
end
function plugin.onUnload ()
diff --git a/cwd/test.rcss b/cwd/assets/altcraft/ui/main-menu-styles.rcss
index ee86894..ee86894 100644
--- a/cwd/test.rcss
+++ b/cwd/assets/altcraft/ui/main-menu-styles.rcss
diff --git a/cwd/test.rml b/cwd/assets/altcraft/ui/main-menu.rml
index de48053..9fd2898 100644
--- a/cwd/test.rml
+++ b/cwd/assets/altcraft/ui/main-menu.rml
@@ -1,6 +1,6 @@
<rml>
<head>
- <link type="text/rcss" href="test.rcss" />
+ <link type="text/rcss" href="main-menu-styles" />
</head>
<body>
<strong class="mc-title" id="title">AltCraft</strong>
@@ -10,8 +10,8 @@
<input class="mc-text" id="username" value="HelloOne"/>
<button class="mc-button" id="connect" onclick="
AC.ConnectToServer(
- document: GetElementById('hostname'): GetAttribute('value'),
- document: GetElementById('username'): GetAttribute('value'));
+ document:GetElementById('hostname'):GetAttribute('value'),
+ document:GetElementById('username'):GetAttribute('value'));
document:Close()">Connect</button>
<button class="mc-button" id="options">Options...</button>
<button class="mc-button" id="exit" onclick="AC.Exit()">Quit game</button>