From 8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Fri, 18 Jun 2021 17:14:19 +0500 Subject: Implemented RmlFileInterface --- cwd/assets/altcraft/scripts/init.lua | 7 +- cwd/assets/altcraft/ui/main-menu-styles.rcss | 105 +++++++++++++++++++++++++++ cwd/assets/altcraft/ui/main-menu.rml | 19 +++++ 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 cwd/assets/altcraft/ui/main-menu-styles.rcss create mode 100644 cwd/assets/altcraft/ui/main-menu.rml (limited to 'cwd/assets/altcraft') 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/assets/altcraft/ui/main-menu-styles.rcss b/cwd/assets/altcraft/ui/main-menu-styles.rcss new file mode 100644 index 0000000..ee86894 --- /dev/null +++ b/cwd/assets/altcraft/ui/main-menu-styles.rcss @@ -0,0 +1,105 @@ +body { + background-color: #160f08; + color: white; + font-family: "open sans"; + width: 100%; + height: 100%; + text-align: center; +} + +.menu { + width: 50%; + margin: auto; + background-color: #a79f9c; +} + +.mc-title { + color: #8e8e8e; + display: block; +} + +.mc-p { + color: #d6d4d6; + display: block; + text-align: left; + font-size: 4vh; +} + +.mc-text { + border-width: 2dp; + border-color: #9f9793; + background-color: #010001; + color: #d6d4d6; + text-align: center; + vertical-align: middle; + font-size: 5vh; +} + +.mc-button { + border-width: 2dp; + border-color: #14110c; + background-color: #6e6f70; + color: #c5c6c7; + text-align: center; + vertical-align: middle; + font-size: 5vh; +} + +.mc-button:hover { + background-color: #7e86bc; +} + +#title { + margin: 0% auto auto; + font-size: 20vh; +} + +#disclaimer { + width: 70%; + margin: 0 auto; +} + +#hostname-text { + width: 70%; + margin: 5% auto; +} + +#hostname { + display: inline-block; + width: 45%; + height: 8%; + position: fixed; + margin: 0% auto auto; +} + +#username { + display: inline-block; + width: 45%; + height: 8%; + position: fixed; + margin: 10% auto auto; +} + +#connect { + display: inline-block; + width: 45%; + height: 8%; + position: fixed; + margin: 20% auto auto; +} + +#options { + display: inline-block; + width: 22%; + height: 8%; + position: fixed; + margin: 33% auto auto 27.5%; +} + +#exit { + display: inline-block; + width: 22%; + height: 8%; + position: fixed; + margin: 33% 27.5% auto auto; +} diff --git a/cwd/assets/altcraft/ui/main-menu.rml b/cwd/assets/altcraft/ui/main-menu.rml new file mode 100644 index 0000000..9fd2898 --- /dev/null +++ b/cwd/assets/altcraft/ui/main-menu.rml @@ -0,0 +1,19 @@ + + + + + + AltCraft +

AltCraft is currently not finished, but there is some buggy early testing going on.

+

Enter the hostname of a server and your username to connect to it:

+ + + + + + +
-- cgit v1.2.3