diff --git a/modules/mainmenu/ui/infowindow.otui b/modules/about/aboutwindow.otui similarity index 100% rename from modules/mainmenu/ui/infowindow.otui rename to modules/about/aboutwindow.otui diff --git a/modules/background/background.lua b/modules/background/background.lua new file mode 100644 index 00000000..9df08f07 --- /dev/null +++ b/modules/background/background.lua @@ -0,0 +1,22 @@ +Background = { } + +-- private variables +local background + +-- public functions +function Background.create() + background = UI.loadAndDisplay('/background/background.otui') +end + +function Background.destroy() + background:destroy() + background = nil +end + +function Background.hide() + background:hide() +end + +function Background.show() + background:show() +end diff --git a/modules/background/background.otmod b/modules/background/background.otmod new file mode 100644 index 00000000..8523717d --- /dev/null +++ b/modules/background/background.otmod @@ -0,0 +1,18 @@ +Module + name: background + description: Handles the background of the login screen + author: OTClient team + website: https://github.com/edubart/otclient + autoLoad: true + dependencies: + - core + - topmenu + + onLoad: | + require 'background' + Background.create() + return true + + onUnload: + Background.destroy() + diff --git a/modules/mainmenu/ui/mainmenu.otui b/modules/background/background.otui similarity index 59% rename from modules/mainmenu/ui/mainmenu.otui rename to modules/background/background.otui index 1e39566c..b81d91ac 100644 --- a/modules/mainmenu/ui/mainmenu.otui +++ b/modules/background/background.otui @@ -1,13 +1,7 @@ -MenuButton < Button - margin.bottom: 11 - margin.left: 20 - margin.right: 20 - - Panel - id: mainMenuBackground + id: background image: - source: /mainmenu/ui/background.png + source: /background/background.png smooth: true fixed ratio: true anchors.top: topMenu.bottom diff --git a/modules/mainmenu/ui/background.png b/modules/background/background.png similarity index 100% rename from modules/mainmenu/ui/background.png rename to modules/background/background.png diff --git a/modules/console/console.otmod b/modules/console/console.otmod index 95f86650..5f38397d 100644 --- a/modules/console/console.otmod +++ b/modules/console/console.otmod @@ -3,7 +3,6 @@ Module description: Console for executing lua functions author: OTClient team website: https://github.com/edubart/otclient - version: 0.2 autoLoad: true dependencies: - core diff --git a/modules/core/core.otmod b/modules/core/core.otmod index 291b0e64..02d49237 100644 --- a/modules/core/core.otmod +++ b/modules/core/core.otmod @@ -7,19 +7,17 @@ Module autoLoad: true dependencies: - core_fonts - - core_ui + - core_styles onLoad: | require 'ext/table' require 'ext/string' require 'constants' require 'util' + require 'dispatcher' require 'widget' + require 'ui' + require 'gfx' require 'messagebox/messagebox' - require 'dispatcher' - return true - onUnload: | - rootWidget = nil - diff --git a/modules/gfx/gfx.lua b/modules/core/gfx.lua similarity index 100% rename from modules/gfx/gfx.lua rename to modules/core/gfx.lua diff --git a/modules/core_ui/ui.lua b/modules/core/ui.lua similarity index 62% rename from modules/core_ui/ui.lua rename to modules/core/ui.lua index b80bfd72..535a1e7e 100644 --- a/modules/core_ui/ui.lua +++ b/modules/core/ui.lua @@ -20,11 +20,3 @@ function UI.displayLocked(widget) UI.root:addChild(widget) UI.root:lockChild(widget) end - -importStyles('styles/buttons.otui') -importStyles('styles/labels.otui') -importStyles('styles/panels.otui') -importStyles('styles/separators.otui') -importStyles('styles/lineedits.otui') -importStyles('styles/windows.otui') -importStyles('styles/listboxes.otui') diff --git a/modules/core_fonts/core_fonts.otmod b/modules/core_fonts/core_fonts.otmod index ed74aaee..42b7db29 100644 --- a/modules/core_fonts/core_fonts.otmod +++ b/modules/core_fonts/core_fonts.otmod @@ -3,8 +3,6 @@ Module description: Contains fonts used by core author: OTClient team website: https://github.com/edubart/otclient - version: 0.2 - autoLoad: true onLoad: | importFont('verdana-11px-antialised') importFont('verdana-11px-monochrome') diff --git a/modules/core_fonts/sans-11px-antialised.png b/modules/core_fonts/sans-11px-antialised.png new file mode 100644 index 00000000..2178d684 Binary files /dev/null and b/modules/core_fonts/sans-11px-antialised.png differ diff --git a/modules/core_fonts/terminus-14px-bold.otfont b/modules/core_fonts/terminus-14px-bold.otfont index 01107b8a..92a83003 100644 --- a/modules/core_fonts/terminus-14px-bold.otfont +++ b/modules/core_fonts/terminus-14px-bold.otfont @@ -1,7 +1,6 @@ Font name: terminus-14px-bold height: 16 - spacing: 0 0 top margin: 2 texture: terminus-14px-bold.png glyph size: 16 16 diff --git a/modules/core_fonts/verdana-11px-antialised.otfont b/modules/core_fonts/verdana-11px-antialised.otfont index 7707d3d9..19d3689d 100644 --- a/modules/core_fonts/verdana-11px-antialised.otfont +++ b/modules/core_fonts/verdana-11px-antialised.otfont @@ -1,7 +1,7 @@ Font name: verdana-11px-antialised - height: 14 texture: verdana-11px-antialised.png + height: 14 glyph size: 16 16 glyph widths: diff --git a/modules/core_fonts/verdana-11px-monochrome.otfont b/modules/core_fonts/verdana-11px-monochrome.otfont index 3f7d83f2..fefb1c03 100644 --- a/modules/core_fonts/verdana-11px-monochrome.otfont +++ b/modules/core_fonts/verdana-11px-monochrome.otfont @@ -1,7 +1,7 @@ Font name: verdana-11px-monochrome - height: 14 texture: verdana-11px-monochrome.png + height: 14 glyph size: 16 16 glyph widths: diff --git a/modules/core_fonts/verdana-11px-rounded.otfont b/modules/core_fonts/verdana-11px-rounded.otfont index 8d427ba4..7ca49b5d 100644 --- a/modules/core_fonts/verdana-11px-rounded.otfont +++ b/modules/core_fonts/verdana-11px-rounded.otfont @@ -1,7 +1,7 @@ Font name: verdana-11px-rounded - height: 14 texture: verdana-11px-rounded.png + height: 14 glyph size: 16 16 glyph widths: diff --git a/modules/core_styles/core_styles.otmod b/modules/core_styles/core_styles.otmod new file mode 100644 index 00000000..cf03de56 --- /dev/null +++ b/modules/core_styles/core_styles.otmod @@ -0,0 +1,17 @@ +Module + name: core_styles + description: Contains ui styles used by other modules + author: OTClient team + website: https://github.com/edubart/otclient + dependencies: + - core_fonts + onLoad: | + importStyles 'styles/buttons.otui' + importStyles 'styles/labels.otui' + importStyles 'styles/panels.otui' + importStyles 'styles/separators.otui' + importStyles 'styles/lineedits.otui' + importStyles 'styles/windows.otui' + importStyles 'styles/listboxes.otui' + return true + diff --git a/modules/core_ui/icons/about.png b/modules/core_styles/icons/about.png similarity index 100% rename from modules/core_ui/icons/about.png rename to modules/core_styles/icons/about.png diff --git a/modules/core_ui/icons/exit.png b/modules/core_styles/icons/exit.png similarity index 100% rename from modules/core_ui/icons/exit.png rename to modules/core_styles/icons/exit.png diff --git a/modules/core_ui/icons/login.png b/modules/core_styles/icons/login.png similarity index 100% rename from modules/core_ui/icons/login.png rename to modules/core_styles/icons/login.png diff --git a/modules/core_ui/icons/logout.png b/modules/core_styles/icons/logout.png similarity index 100% rename from modules/core_ui/icons/logout.png rename to modules/core_styles/icons/logout.png diff --git a/modules/core_ui/icons/settings.png b/modules/core_styles/icons/settings.png similarity index 100% rename from modules/core_ui/icons/settings.png rename to modules/core_styles/icons/settings.png diff --git a/modules/core_ui/images/button.png b/modules/core_styles/images/button.png similarity index 100% rename from modules/core_ui/images/button.png rename to modules/core_styles/images/button.png diff --git a/modules/core_ui/images/button_down.png b/modules/core_styles/images/button_down.png similarity index 100% rename from modules/core_ui/images/button_down.png rename to modules/core_styles/images/button_down.png diff --git a/modules/core_ui/images/button_hover.png b/modules/core_styles/images/button_hover.png similarity index 100% rename from modules/core_ui/images/button_hover.png rename to modules/core_styles/images/button_hover.png diff --git a/modules/core_ui/images/container_bg.png b/modules/core_styles/images/container_bg.png similarity index 100% rename from modules/core_ui/images/container_bg.png rename to modules/core_styles/images/container_bg.png diff --git a/modules/core_ui/images/empty_rect.png b/modules/core_styles/images/empty_rect.png similarity index 100% rename from modules/core_ui/images/empty_rect.png rename to modules/core_styles/images/empty_rect.png diff --git a/modules/core_ui/images/empty_rounded_rect.png b/modules/core_styles/images/empty_rounded_rect.png similarity index 100% rename from modules/core_ui/images/empty_rounded_rect.png rename to modules/core_styles/images/empty_rounded_rect.png diff --git a/modules/core_ui/images/horizontal_separator.png b/modules/core_styles/images/horizontal_separator.png similarity index 100% rename from modules/core_ui/images/horizontal_separator.png rename to modules/core_styles/images/horizontal_separator.png diff --git a/modules/core_ui/images/horizotal_separator.png b/modules/core_styles/images/horizotal_separator.png similarity index 100% rename from modules/core_ui/images/horizotal_separator.png rename to modules/core_styles/images/horizotal_separator.png diff --git a/modules/core_ui/images/panel_flat.png b/modules/core_styles/images/panel_flat.png similarity index 100% rename from modules/core_ui/images/panel_flat.png rename to modules/core_styles/images/panel_flat.png diff --git a/modules/core_ui/images/panel_rounded.png b/modules/core_styles/images/panel_rounded.png similarity index 100% rename from modules/core_ui/images/panel_rounded.png rename to modules/core_styles/images/panel_rounded.png diff --git a/modules/core_ui/images/top_button.png b/modules/core_styles/images/top_button.png similarity index 100% rename from modules/core_ui/images/top_button.png rename to modules/core_styles/images/top_button.png diff --git a/modules/core_ui/images/top_panel.png b/modules/core_styles/images/top_panel.png similarity index 100% rename from modules/core_ui/images/top_panel.png rename to modules/core_styles/images/top_panel.png diff --git a/modules/core_ui/images/window.png b/modules/core_styles/images/window.png similarity index 100% rename from modules/core_ui/images/window.png rename to modules/core_styles/images/window.png diff --git a/modules/core_ui/styles/buttons.otui b/modules/core_styles/styles/buttons.otui similarity index 68% rename from modules/core_ui/styles/buttons.otui rename to modules/core_styles/styles/buttons.otui index 8305969a..4551809c 100644 --- a/modules/core_ui/styles/buttons.otui +++ b/modules/core_styles/styles/buttons.otui @@ -5,18 +5,18 @@ Button < UIButton size: 106 24 text-translate: 0 0 border-image: - source: /core_ui/images/button.png + source: /core_styles/images/button.png border: 5 state.hover: border-image: - source: /core_ui/images/button_hover.png + source: /core_styles/images/button_hover.png border: 5 state.pressed: text-translate: 1 1 border-image: - source: /core_ui/images/button_down.png + source: /core_styles/images/button_down.png border: 5 state.disabled: @@ -28,13 +28,13 @@ TopButton < UIButton size: 26 25 text-translate: 0 0 border-image: - source: /core_ui/images/top_button.png + source: /core_styles/images/top_button.png size: 26 25 border: 3 state.hover: border-image: - source: /core_ui/images/top_button.png + source: /core_styles/images/top_button.png size: 26 25 offset: 26 0 border: 3 @@ -42,7 +42,7 @@ TopButton < UIButton state.pressed: text-translate: 1 1 border-image: - source: /core_ui/images/top_button.png + source: /core_styles/images/top_button.png size: 26 25 offset: 52 0 border: 3 diff --git a/modules/core_ui/styles/labels.otui b/modules/core_styles/styles/labels.otui similarity index 100% rename from modules/core_ui/styles/labels.otui rename to modules/core_styles/styles/labels.otui diff --git a/modules/core_ui/styles/lineedits.otui b/modules/core_styles/styles/lineedits.otui similarity index 79% rename from modules/core_ui/styles/lineedits.otui rename to modules/core_styles/styles/lineedits.otui index a8f3dabd..6bf81f26 100644 --- a/modules/core_ui/styles/lineedits.otui +++ b/modules/core_styles/styles/lineedits.otui @@ -4,7 +4,7 @@ LineEdit < UILineEdit size: 86 20 text margin: 3 border-image: - source: /core_ui/images/panel_flat.png + source: /core_styles/images/panel_flat.png border: 1 PasswordLineEdit < LineEdit diff --git a/modules/core_styles/styles/listboxes.otui b/modules/core_styles/styles/listboxes.otui new file mode 100644 index 00000000..1c7c980c --- /dev/null +++ b/modules/core_styles/styles/listboxes.otui @@ -0,0 +1,5 @@ +TextList < UIWidget + layout: verticalBox + border-image: + source: /core_styles/images/panel_flat.png + border: 4 \ No newline at end of file diff --git a/modules/core_ui/styles/panels.otui b/modules/core_styles/styles/panels.otui similarity index 56% rename from modules/core_ui/styles/panels.otui rename to modules/core_styles/styles/panels.otui index 365eb86e..9baaf638 100644 --- a/modules/core_ui/styles/panels.otui +++ b/modules/core_styles/styles/panels.otui @@ -3,21 +3,21 @@ Panel < UIWidget FlatPanel < Panel border-image: - source: /core_ui/images/panel_flat.png + source: /core_styles/images/panel_flat.png border: 4 TopPanel < Panel height: 34 image: - source: /core_ui/images/top_panel.png + source: /core_styles/images/top_panel.png repeated: true RoundedPanel < Panel background-color: #ffffffdd border-image: - source: /core_ui/images/panel_rounded.png + source: /core_styles/images/panel_rounded.png border: 4 RectPanel < UIWidget - image: /core_ui/images/empty_rect.png \ No newline at end of file + image: /core_styles/images/empty_rect.png \ No newline at end of file diff --git a/modules/core_ui/styles/separators.otui b/modules/core_styles/styles/separators.otui similarity index 62% rename from modules/core_ui/styles/separators.otui rename to modules/core_styles/styles/separators.otui index 144c78c6..c2593730 100644 --- a/modules/core_ui/styles/separators.otui +++ b/modules/core_styles/styles/separators.otui @@ -1,6 +1,6 @@ HorizontalSeparator < UIWidget border-image: - source: /core_ui/images/horizontal_separator.png + source: /core_styles/images/horizontal_separator.png border.top: 2 height: 2 phantom: true diff --git a/modules/core_ui/styles/windows.otui b/modules/core_styles/styles/windows.otui similarity index 78% rename from modules/core_ui/styles/windows.otui rename to modules/core_styles/styles/windows.otui index a100c52a..a23bf97e 100644 --- a/modules/core_ui/styles/windows.otui +++ b/modules/core_styles/styles/windows.otui @@ -6,7 +6,7 @@ Window < UIWindow head height: 20 head text align: center border-image: - source: /core_ui/images/window.png + source: /core_styles/images/window.png border: 4 border.top: 20 diff --git a/modules/core_ui/core_ui.otmod b/modules/core_ui/core_ui.otmod deleted file mode 100644 index 1b0fb1ef..00000000 --- a/modules/core_ui/core_ui.otmod +++ /dev/null @@ -1,13 +0,0 @@ -Module - name: core_ui - description: Contains ui styles used by other modules - author: OTClient team - website: https://github.com/edubart/otclient - version: 0.2 - autoLoad: true - dependencies: - - core_fonts - onLoad: | - require 'ui' - return true - diff --git a/modules/core_ui/images/topbar.png b/modules/core_ui/images/topbar.png deleted file mode 100644 index a4ccc8f2..00000000 Binary files a/modules/core_ui/images/topbar.png and /dev/null differ diff --git a/modules/core_ui/styles/listboxes.otui b/modules/core_ui/styles/listboxes.otui deleted file mode 100644 index ccab396b..00000000 --- a/modules/core_ui/styles/listboxes.otui +++ /dev/null @@ -1,5 +0,0 @@ -TextList < UIWidget - layout: verticalBox - border-image: - source: /core_ui/images/panel_flat.png - border: 4 \ No newline at end of file diff --git a/modules/mainmenu/characterlist.lua b/modules/entergame/characterlist.lua similarity index 96% rename from modules/mainmenu/characterlist.lua rename to modules/entergame/characterlist.lua index 7c3392e3..921d2a3f 100644 --- a/modules/mainmenu/characterlist.lua +++ b/modules/entergame/characterlist.lua @@ -56,7 +56,7 @@ function CharacterList.create(characters, premDays) charactersWindow:destroy() end - charactersWindow = UI.loadAndDisplay('/mainmenu/ui/charlist.otui') + charactersWindow = UI.loadAndDisplay('/entergame/characterlist.otui') characterList = charactersWindow:getChildById('characterList') local accountStatusLabel = charactersWindow:getChildById('accountStatusLabel') charactersWindow.onKeyPress = onCharactersWindowKeyPress @@ -89,7 +89,7 @@ function CharacterList.hide() charactersWindow:hide() end -function CharacterList.close() +function CharacterList.destroy() CharacterList.hide() EnterGame.show() end diff --git a/modules/mainmenu/ui/charlist.otui b/modules/entergame/characterlist.otui similarity index 90% rename from modules/mainmenu/ui/charlist.otui rename to modules/entergame/characterlist.otui index c5c624a4..b0cec258 100644 --- a/modules/mainmenu/ui/charlist.otui +++ b/modules/entergame/characterlist.otui @@ -1,5 +1,5 @@ CharacterListLabel < Label - image: /core_ui/images/empty_rect.png + image: /core_styles/images/empty_rect.png font: verdana-11px-monochrome background-color: #00000000 offset: 2 0 @@ -14,10 +14,10 @@ CharacterListLabel < Label MainWindow id: charactersWindow - title: Charlist + title: Character List size: 250 250 onEnter: CharacterList.doLogin() - onEscape: CharacterList.close() + onEscape: CharacterList.destroy() TextList id: characterList @@ -65,4 +65,4 @@ MainWindow anchors.bottom: parent.bottom margin.bottom: 16 margin.right: 16 - onClick: CharacterList.close() \ No newline at end of file + onClick: CharacterList.destroy() \ No newline at end of file diff --git a/modules/mainmenu/entergame.lua b/modules/entergame/entergame.lua similarity index 77% rename from modules/mainmenu/entergame.lua rename to modules/entergame/entergame.lua index d7f6c18a..8407404e 100644 --- a/modules/mainmenu/entergame.lua +++ b/modules/entergame/entergame.lua @@ -2,7 +2,7 @@ EnterGame = { } -- private variables local loadBox -local enterGameWindow +local enterGame local motdNumber local motdMessage @@ -32,25 +32,26 @@ local function onCharacterList(protocol, characters, premDays) end -- public functions -function EnterGame.show() - if not enterGameWindow then - enterGameWindow = UI.loadAndDisplay('/mainmenu/ui/entergamewindow.otui') - end - enterGameWindow:show() +function EnterGame.create() + enterGame = UI.loadAndDisplay('/entergame/entergame.otui') end -function EnterGame.hide() - enterGameWindow:hide() +function EnterGame.destroy() + enterGame:destroy() + enterGame = nil end -function EnterGame.destroy() - enterGameWindow:destroy() - enterGameWindow = nil +function EnterGame.show() + enterGame:show() +end + +function EnterGame.hide() + enterGame:hide() end function EnterGame.doLogin() - EnterGame.account = enterGameWindow:getChildById('accountNameLineEdit'):getText() - EnterGame.password = enterGameWindow:getChildById('accountPasswordLineEdit'):getText() + EnterGame.account = enterGame:getChildById('accountNameLineEdit'):getText() + EnterGame.password = enterGame:getChildById('accountPasswordLineEdit'):getText() EnterGame.hide() local protocolLogin = ProtocolLogin.create() diff --git a/modules/entergame/entergame.otmod b/modules/entergame/entergame.otmod new file mode 100644 index 00000000..ccfcb342 --- /dev/null +++ b/modules/entergame/entergame.otmod @@ -0,0 +1,21 @@ +Module + name: entergame + description: Manages enter game and character list windows + author: OTClient team + website: https://github.com/edubart/otclient + autoLoad: true + dependencies: + - core + - topmenu + - background + + onLoad: | + require 'entergame' + require 'characterlist' + EnterGame.create() + return true + + onUnload: + EnterGame.destroy() + + diff --git a/modules/mainmenu/ui/entergamewindow.otui b/modules/entergame/entergame.otui similarity index 89% rename from modules/mainmenu/ui/entergamewindow.otui rename to modules/entergame/entergame.otui index 7760f646..c76487fc 100644 --- a/modules/mainmenu/ui/entergamewindow.otui +++ b/modules/entergame/entergame.otui @@ -1,9 +1,9 @@ MainWindow - id: enterGameWindow + id: enterGame title: Enter Game size: 236 160 onEnter: EnterGame.doLogin() - onEscape: function(self) self:destroy() end + onEscape: EnterGame.hide() LargerLabel text: Account name @@ -54,4 +54,4 @@ MainWindow anchors.bottom: parent.bottom margin.bottom: 16 margin.right: 16 - onClick: function(self) self:getParent():destroy() end + onClick: EnterGame.hide() diff --git a/modules/game/game.lua b/modules/game/game.lua index ddb35e14..76c826f6 100644 --- a/modules/game/game.lua +++ b/modules/game/game.lua @@ -20,7 +20,7 @@ local function createMainInterface() Game.gameUi = loadUI('/game/ui/gameinterface.otui', UI.root) Game.gameMapUi = Game.gameUi:getChildById('gameMap') Game.gameUi.onKeyPress = onGameKeyPress - + createTextInterface() createVipWindow() end @@ -35,7 +35,7 @@ end -- public functions function Game.onLogin() - MainMenu.hide() + Background.hide() CharacterList.destroyLoadBox() createMainInterface() end @@ -53,7 +53,7 @@ function Game.onConnectionError(message) end function Game.onLogout() - MainMenu.show() + Background.show() CharacterList.show() destroyMainInterface() end diff --git a/modules/game/game.otmod b/modules/game/game.otmod index 861e28d3..fe0c91bd 100644 --- a/modules/game/game.otmod +++ b/modules/game/game.otmod @@ -8,10 +8,10 @@ Module dependencies: - core - tibiafiles + - topmenu + - entergame + - background onLoad: | require 'game' return true - - onUnload: | - -- nothing yet diff --git a/modules/game/ui/gameinterface.otui b/modules/game/ui/gameinterface.otui index be300d0e..619b27a2 100644 --- a/modules/game/ui/gameinterface.otui +++ b/modules/game/ui/gameinterface.otui @@ -1,14 +1,10 @@ UIWidget id: gameRootInterface anchors.fill: parent + anchors.top: topMenu.bottom + margin.top: 1 UIMap id: gameMap anchors.fill:parent - margin.right: 200 - - Button - anchors.left: gameMap.right - anchors.top: parent.top - text: Logout - onClick: Game.logout(false) \ No newline at end of file + margin.right: 200 \ No newline at end of file diff --git a/modules/gfx/gfx.otmod b/modules/gfx/gfx.otmod deleted file mode 100644 index 4b0b43c9..00000000 --- a/modules/gfx/gfx.otmod +++ /dev/null @@ -1,15 +0,0 @@ -Module - name: gfx - description: Contains utilities for generating graphics effects - author: OTClient team - website: https://github.com/edubart/otclient - version: 0.2 - autoLoad: true - dependencies: - - core - - onLoad: | - require 'gfx' - return true - - diff --git a/modules/mainmenu/mainmenu.lua b/modules/mainmenu/mainmenu.lua deleted file mode 100644 index 390eb0e8..00000000 --- a/modules/mainmenu/mainmenu.lua +++ /dev/null @@ -1,22 +0,0 @@ -MainMenu = { } - --- private variables -local mainMenu - --- public functions -function MainMenu.create() - mainMenu = UI.loadAndDisplay("/mainmenu/ui/mainmenu.otui") -end - -function MainMenu.destroy() - mainMenu:destroy() - mainMenu = nil -end - -function MainMenu.hide() - mainMenu:hide() -end - -function MainMenu.show() - mainMenu:show() -end diff --git a/modules/mainmenu/mainmenu.otmod b/modules/mainmenu/mainmenu.otmod deleted file mode 100644 index 6e33983e..00000000 --- a/modules/mainmenu/mainmenu.otmod +++ /dev/null @@ -1,27 +0,0 @@ -Module - name: mainmenu - description: Create the game main menu - author: OTClient team - website: https://github.com/edubart/otclient - version: 0.2 - autoLoad: true - dependencies: - - core - - topmenu - - onLoad: | - require 'mainmenu' - require 'entergame' - require 'characterlist' - - if not initialized then - MainMenu.create() - EnterGame.show() - initialized = true - end - return true - - onUnload: | - MainMenu.destroy() - initialized = false - diff --git a/modules/mainmenu/ui/loginpanel.otui b/modules/mainmenu/ui/loginpanel.otui deleted file mode 100644 index 57511512..00000000 --- a/modules/mainmenu/ui/loginpanel.otui +++ /dev/null @@ -1,47 +0,0 @@ -RoundedRectPanel - id: loginPanel - background-color: #000000e5 - size: 192 164 - anchors.centerIn: parent - margin.top: 64 - opacity: 0 - - LargerLabel - text: Account name - anchors.left: parent.left - anchors.top: parent.top - margin.left: 16 - margin.top: 12 - - LineEdit - id: accountNameLineEdit - text: otclient0 - anchors.left: parent.left - anchors.right: parent.right - anchors.top: prev.bottom - margin.left: 14 - margin.right: 14 - - LargerLabel - text: Password - anchors.left: parent.left - anchors.top: prev.bottom - margin.left: 16 - margin.top: 8 - - PasswordLineEdit - id: accountPasswordLineEdit - text: 123456 - anchors.left: parent.left - anchors.right: parent.right - anchors.top: prev.bottom - margin.left: 14 - margin.right: 14 - - Button - id: loginButton - text: Login - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - margin.bottom: 20 - onClick: EnterGame.doLogin() diff --git a/modules/mainmenu/ui/otclient_logo.png b/modules/mainmenu/ui/otclient_logo.png deleted file mode 100644 index 4bfef579..00000000 Binary files a/modules/mainmenu/ui/otclient_logo.png and /dev/null differ diff --git a/modules/mainmenu/ui/optionswindow.otui b/modules/options/optionswindow.otui similarity index 100% rename from modules/mainmenu/ui/optionswindow.otui rename to modules/options/optionswindow.otui diff --git a/modules/playground/playground.lua b/modules/playground/playground.lua index 455f45ff..805983c3 100644 --- a/modules/playground/playground.lua +++ b/modules/playground/playground.lua @@ -1 +1 @@ ---UI.loadAndDisplayLocked('/mainmenu/ui/charlist.otui') \ No newline at end of file +-- place any code for testing purposes here \ No newline at end of file diff --git a/modules/topmenu/topmenu.otui b/modules/topmenu/topmenu.otui index 635b4644..1d444644 100644 --- a/modules/topmenu/topmenu.otui +++ b/modules/topmenu/topmenu.otui @@ -6,6 +6,7 @@ TopPanel focusable: false TopButton + id: settingsButton anchors.top: parent.top anchors.left: parent.left margin.top: 3 @@ -13,7 +14,7 @@ TopPanel UIWidget size: 16 16 - image: /core_ui/icons/settings.png + image: /core_styles/icons/settings.png anchors.centerIn: parent phantom: true @@ -21,10 +22,11 @@ TopPanel anchors.top: prev.top anchors.left: prev.right margin.left: 6 + onClick: EnterGame.show() UIWidget size: 16 16 - image: /core_ui/icons/login.png + image: /core_styles/icons/login.png anchors.centerIn: parent phantom: true @@ -33,9 +35,15 @@ TopPanel anchors.right: parent.right margin.top: 3 margin.right: 6 + onClick: | + if Game.isOnline() then + Game.logout(false) + else + exit() + end UIWidget size: 16 16 - image: /core_ui/icons/logout.png + image: /core_styles/icons/logout.png anchors.centerIn: parent phantom: true \ No newline at end of file