parent
8abd42b020
commit
9ea2e659d3
5 changed files with 13 additions and 2 deletions
|
@ -28,9 +28,11 @@ function CharacterScreen:update(dt)
|
||||||
local keys = self.scene:getKeys(1)
|
local keys = self.scene:getKeys(1)
|
||||||
if (keys["left"].isPressed) then
|
if (keys["left"].isPressed) then
|
||||||
self:setPage(self.pageIndex - 1)
|
self:setPage(self.pageIndex - 1)
|
||||||
|
self.scene.assets.sfx["mBeep"]:play()
|
||||||
end
|
end
|
||||||
if (keys["right"].isPressed) then
|
if (keys["right"].isPressed) then
|
||||||
self:setPage(self.pageIndex + 1)
|
self:setPage(self.pageIndex + 1)
|
||||||
|
self.scene.assets.sfx["mBeep"]:play()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -66,6 +68,7 @@ function CharacterScreen:setMenu()
|
||||||
customMenu.isLocked = true
|
customMenu.isLocked = true
|
||||||
customMenu.isVisible = true
|
customMenu.isVisible = true
|
||||||
end
|
end
|
||||||
|
self.scene.menusystem:setSoundFromSceneAssets("mBeep")
|
||||||
end
|
end
|
||||||
|
|
||||||
function CharacterScreen:draw()
|
function CharacterScreen:draw()
|
||||||
|
|
|
@ -41,6 +41,7 @@ end
|
||||||
|
|
||||||
function Widget:action()
|
function Widget:action()
|
||||||
self.page:menuResponses(self.num)
|
self.page:menuResponses(self.num)
|
||||||
|
self.scene.assets.sfx["mBeep"]:play()
|
||||||
end
|
end
|
||||||
|
|
||||||
return PageParent
|
return PageParent
|
||||||
|
|
|
@ -11,6 +11,7 @@ local PLAYER_MESSAGE = 240 - 24
|
||||||
function StatPage:new(view, character)
|
function StatPage:new(view, character)
|
||||||
StatPage.super.new(self, view, character, {"See skill"})
|
StatPage.super.new(self, view, character, {"See skill"})
|
||||||
self.message = ""
|
self.message = ""
|
||||||
|
self.showMessage = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function StatPage:getCustomMenus()
|
function StatPage:getCustomMenus()
|
||||||
|
@ -20,11 +21,12 @@ end
|
||||||
function StatPage:menuResponses(i)
|
function StatPage:menuResponses(i)
|
||||||
if (#self.character.skills > 0) then
|
if (#self.character.skills > 0) then
|
||||||
self.view.scene.menusystem:switchMenu("equip")
|
self.view.scene.menusystem:switchMenu("equip")
|
||||||
|
self.showMessage = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function StatPage:drawOverEverything()
|
function StatPage:drawOverEverything()
|
||||||
if (not utils.string.isEmpty(self.message)) then
|
if (not utils.string.isEmpty(self.message) and self.showMessage) then
|
||||||
love.graphics.setColor(0,0,0, 0.66)
|
love.graphics.setColor(0,0,0, 0.66)
|
||||||
love.graphics.rectangle("fill", 0, PLAYER_MESSAGE, 424, 16)
|
love.graphics.rectangle("fill", 0, PLAYER_MESSAGE, 424, 16)
|
||||||
self.view.scene.assets.fonts["small"]:setColor(1,1,1, 1)
|
self.view.scene.assets.fonts["small"]:setColor(1,1,1, 1)
|
||||||
|
@ -52,7 +54,8 @@ end
|
||||||
|
|
||||||
function SkillMenu:cancelAction()
|
function SkillMenu:cancelAction()
|
||||||
self.scene.menusystem.menus["menu"]:getFocus()
|
self.scene.menusystem.menus["menu"]:getFocus()
|
||||||
self.page:setMessage("")
|
self.page.showMessage = false
|
||||||
|
self.scene.assets.sfx["mBack"]:play()
|
||||||
end
|
end
|
||||||
|
|
||||||
function SkillWidget:new(page, skill)
|
function SkillWidget:new(page, skill)
|
||||||
|
|
|
@ -60,6 +60,7 @@ end
|
||||||
|
|
||||||
function EquipMenu:cancelAction()
|
function EquipMenu:cancelAction()
|
||||||
self.scene.menusystem.menus["menu"]:getFocus()
|
self.scene.menusystem.menus["menu"]:getFocus()
|
||||||
|
self.scene.assets.sfx["mBack"]:play()
|
||||||
end
|
end
|
||||||
|
|
||||||
function EquipWidget:new(page, type)
|
function EquipWidget:new(page, type)
|
||||||
|
@ -82,6 +83,7 @@ function EquipWidget:action()
|
||||||
self.page:removeEquip(self.type)
|
self.page:removeEquip(self.type)
|
||||||
self.label = self:getLabel()
|
self.label = self:getLabel()
|
||||||
self:redrawCanvas()
|
self:redrawCanvas()
|
||||||
|
self.scene.assets.sfx["mSelect"]:play()
|
||||||
end
|
end
|
||||||
|
|
||||||
return StatPage
|
return StatPage
|
||||||
|
|
|
@ -32,10 +32,12 @@ function ItemsScreen:update(dt)
|
||||||
if (keys["left"].isPressed) then
|
if (keys["left"].isPressed) then
|
||||||
self.widgetIndex = 1
|
self.widgetIndex = 1
|
||||||
self:getMenu(self.menuIndex - 1)
|
self:getMenu(self.menuIndex - 1)
|
||||||
|
self.scene.assets.sfx["mBeep"]:play()
|
||||||
end
|
end
|
||||||
if (keys["right"].isPressed) then
|
if (keys["right"].isPressed) then
|
||||||
self.widgetIndex = 1
|
self.widgetIndex = 1
|
||||||
self:getMenu(self.menuIndex + 1)
|
self:getMenu(self.menuIndex + 1)
|
||||||
|
self.scene.assets.sfx["mBeep"]:play()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue