Refonte pour utiliser le systeme de GUI #112

Merged
kazhnuz merged 102 commits from feat/gui into master 2022-01-06 19:15:16 +01:00
12 changed files with 22 additions and 25 deletions
Showing only changes of commit 7218b7892e - Show all commits

View file

@ -1,14 +1,12 @@
local Scene = require("birb.modules.scenes") local Scene = require("game.scenes")
local PlayStyle = Scene:extend() local PlayStyle = Scene:extend()
local PauseMenu = require("game.modules.subgames.pause") local PauseMenu = require("game.modules.subgames.pause")
local TestWorld = require("game.modules.subgames.world.parent") local TestWorld = require("game.modules.subgames.world.parent")
function PlayStyle:new(supportedLevels, missionfile) function PlayStyle:new(supportedLevels, missionfile)
PlayStyle.super.new(self) PlayStyle.super.new(self)
self.timer = 0 self.timer = 0
self.assets:batchImport("assets.commons")
self.assets:batchImport("assets.subgames") self.assets:batchImport("assets.subgames")
--self:loadMissionFile(supportedLevels, missionfile) --self:loadMissionFile(supportedLevels, missionfile)

View file

@ -0,0 +1,13 @@
local BirbScene = require "birb.modules.scenes"
local RadianceScene = BirbScene:extend()
function RadianceScene:new()
RadianceScene.super.new(self)
-- Importation Global des assets
self.assets:batchImport("assets.commons")
self.assets.fonts["small"]:setLineHeight(16/18)
self.assets.fonts["small"]:setFilter("shadow")
end
return RadianceScene

View file

@ -1,4 +1,4 @@
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local BattleSystem = Scene:extend() local BattleSystem = Scene:extend()
@ -14,7 +14,6 @@ local TweenManager = require "birb.classes.time"
function BattleSystem:new(battleData) function BattleSystem:new(battleData)
BattleSystem.super.new(self) BattleSystem.super.new(self)
self.assets:batchImport("assets.commons")
self.assets:batchImport("assets.battle") self.assets:batchImport("assets.battle")
self:playMusic(battleData.music) self:playMusic(battleData.music)

View file

@ -1,4 +1,4 @@
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local menu = require "scenes.menus.debugmenus.animation.menu" local menu = require "scenes.menus.debugmenus.animation.menu"
local CharAnimViewer = Scene:extend() local CharAnimViewer = Scene:extend()
@ -8,7 +8,6 @@ local Sprite = require "birb.modules.assets.types.sprites"
function CharAnimViewer:new() function CharAnimViewer:new()
CharAnimViewer.super.new(self) CharAnimViewer.super.new(self)
self.assets:batchImport("assets.commons")
self.assets:batchImport("assets.debug") self.assets:batchImport("assets.debug")
local mainMenu = menu.commons.DebugMenu(self, "MainMenu") local mainMenu = menu.commons.DebugMenu(self, "MainMenu")

View file

@ -1,4 +1,4 @@
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local menu = require "scenes.menus.debugmenus.battleBack.menu" local menu = require "scenes.menus.debugmenus.battleBack.menu"
local BackgroundViewer = Scene:extend() local BackgroundViewer = Scene:extend()
@ -8,7 +8,6 @@ local backgroundList = require "datas.gamedata.maps.shoot.zones"
function BackgroundViewer:new() function BackgroundViewer:new()
BackgroundViewer.super.new(self) BackgroundViewer.super.new(self)
self.assets:batchImport("assets.commons")
self.assets:batchImport("assets.debug") self.assets:batchImport("assets.debug")
menu.commons.DebugMenu(self, "MainMenu") menu.commons.DebugMenu(self, "MainMenu")

View file

@ -1,4 +1,4 @@
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local menu = require "scenes.menus.debugmenus.choregraphy.menu" local menu = require "scenes.menus.debugmenus.choregraphy.menu"
local ChoregraphyViewer = Scene:extend() local ChoregraphyViewer = Scene:extend()
@ -8,7 +8,6 @@ local Fighter = require "scenes.menus.debugmenus.choregraphy.mocks.fighter"
function ChoregraphyViewer:new() function ChoregraphyViewer:new()
ChoregraphyViewer.super.new(self) ChoregraphyViewer.super.new(self)
self.assets:batchImport("assets.commons")
self.assets:batchImport("assets.battle") self.assets:batchImport("assets.battle")
self.world = World(self) self.world = World(self)

View file

@ -1,4 +1,4 @@
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local menu = require "scenes.menus.mainmenu.menu" local menu = require "scenes.menus.mainmenu.menu"
local DebugMenu = Scene:extend() local DebugMenu = Scene:extend()
@ -11,7 +11,6 @@ local TweenManager = require "birb.classes.time"
function DebugMenu:new() function DebugMenu:new()
DebugMenu.super.new(self) DebugMenu.super.new(self)
self.assets:batchImport("assets.commons")
menu.commons.MainMenu(self, "BaseMenu") menu.commons.MainMenu(self, "BaseMenu")
menu.StartGameWidget(self, "BaseMenu") menu.StartGameWidget(self, "BaseMenu")
menu.commons.SceneWidget(self, "BaseMenu", scenes.menus.options, "Options") menu.commons.SceneWidget(self, "BaseMenu", scenes.menus.options, "Options")

View file

@ -1,4 +1,4 @@
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local OptionsMenu = Scene:extend() local OptionsMenu = Scene:extend()
local OptionMenu = require "scenes.menus.options.menu" local OptionMenu = require "scenes.menus.options.menu"
@ -10,7 +10,6 @@ local MenuBack = require "game.modules.gui.menuback"
function OptionsMenu:new() function OptionsMenu:new()
OptionsMenu.super.new(self) OptionsMenu.super.new(self)
self.assets:batchImport("assets.commons")
self:addMenu("main", true) self:addMenu("main", true)
self:addSubMenu("video", "Video") self:addSubMenu("video", "Video")
self:addSubMenu("audio", "Audio") self:addSubMenu("audio", "Audio")

View file

@ -21,7 +21,7 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]] ]]
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local TitleScreen = Scene:extend() local TitleScreen = Scene:extend()
local gui = require "game.modules.gui" local gui = require "game.modules.gui"
@ -34,11 +34,8 @@ function TitleScreen:new(fromMenu)
local fromMenu = (fromMenu == true) local fromMenu = (fromMenu == true)
self.borders = gui.newBorder(424, 30, 8) self.borders = gui.newBorder(424, 30, 8)
self.assets:batchImport("assets.commons")
self.assets:addImage("logo", "assets/artworks/logo.png") self.assets:addImage("logo", "assets/artworks/logo.png")
self.assets:addTileset("charicons", "assets/sprites/characters/charicons") self.assets:addTileset("charicons", "assets/sprites/characters/charicons")
self.assets.fonts["small"]:setLineHeight(16/18)
self.assets.fonts["small"]:setFilter("shadow")
self.tweens = TweenManager(self) self.tweens = TweenManager(self)
self:initBackground() self:initBackground()

View file

@ -21,7 +21,7 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]] ]]
local Scene = require "birb.modules.scenes" local Scene = require "game.scenes"
local OverWorld = Scene:extend() local OverWorld = Scene:extend()
local World = require "scenes.overworld.world" local World = require "scenes.overworld.world"
@ -38,10 +38,7 @@ local MessageQueue = require "game.modules.messagequeue"
function OverWorld:new(area, playerx, playery) function OverWorld:new(area, playerx, playery)
OverWorld.super.new(self) OverWorld.super.new(self)
self.charsetManager = CharsetManager(self) self.charsetManager = CharsetManager(self)
self.assets:batchImport("assets.commons")
self.assets:batchImport("assets.overworld") self.assets:batchImport("assets.overworld")
self.assets.fonts["small"]:setLineHeight(16/18)
self.assets.fonts["small"]:setFilter("shadow")
self.tweens = TweenManager(self) self.tweens = TweenManager(self)
self.screens = screens self.screens = screens

View file

@ -72,7 +72,6 @@ function CharacterScreen:setMenu()
end end
function CharacterScreen:draw() function CharacterScreen:draw()
self.scene.assets.fonts["small"]:setLineHeight(16/18)
if (self.page ~= nil) then if (self.page ~= nil) then
self.page:draw() self.page:draw()
end end

View file

@ -90,7 +90,6 @@ function ItemsScreen:removeUseMenu()
end end
function ItemsScreen:draw() function ItemsScreen:draw()
self.scene.assets.fonts["small"]:setLineHeight(16/18)
self:drawPocket() self:drawPocket()
self:drawDescription(const.X, const.Y2 - (88+16)) self:drawDescription(const.X, const.Y2 - (88+16))
self:drawEffects(const.X, const.Y2 - 40) self:drawEffects(const.X, const.Y2 - 40)