Skip to content

Commit

Permalink
Merge pull request #18 from Nats-ji/proper-theme-impl
Browse files Browse the repository at this point in the history
modularize theme
  • Loading branch information
Nats-ji authored Nov 29, 2022
2 parents 729ed6a + 7a192ff commit 3c9347b
Show file tree
Hide file tree
Showing 14 changed files with 537 additions and 275 deletions.
2 changes: 0 additions & 2 deletions scripts/modules/CETMM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ end
function CETMM.Render()
registerForEvent("onDraw", function()
m_gui.Initialize()
m_gui.GetStyle().PushTheme()
m_gui.Render()
m_gui.GetStyle().PopTheme()
end)
end

Expand Down
13 changes: 9 additions & 4 deletions scripts/modules/gui/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local CETMM = require ("modules/CETMM")
---@class gui
local gui = {}
local m_dpi = require ("modules/gui/dpi")
local m_style = require ("modules/gui/style")
local m_themeSys = require ("modules/gui/themeSys")
local m_widgets = require ("modules/gui/widgets")
local m_window = require ("modules/gui/window")
local m_windows = require ("modules/gui/windows")
Expand All @@ -13,8 +13,8 @@ function gui.GetDPI()
return m_dpi
end

function gui.GetStyle()
return m_style
function gui.GetThemeSys()
return m_themeSys
end

function gui.GetWindow()
Expand All @@ -25,19 +25,24 @@ function gui.Initialize()
if not m_initialized then
m_showUninstall = CETMM.IsUninstalled()
m_dpi.Initialize()
if not m_showUninstall then
if m_showUninstall then
m_themeSys.Load("default", true)
else
m_themeSys.Initialize()
m_window.Initialize()
end
m_initialized = true
end
end

function gui.Render()
m_themeSys.PushTheme()
if m_showUninstall then
m_windows.uninstall.Render()
else
m_window.Render()
end
m_themeSys.PopTheme()
end

return gui
47 changes: 0 additions & 47 deletions scripts/modules/gui/style.lua

This file was deleted.

195 changes: 0 additions & 195 deletions scripts/modules/gui/theme.lua

This file was deleted.

Loading

0 comments on commit 3c9347b

Please sign in to comment.