Skip to content

Commit

Permalink
Fixed live clear error for LS2 beatmaps
Browse files Browse the repository at this point in the history
The screen now sleep in all menus except while playing

Fixed CBF loading error (again)
  • Loading branch information
MikuAuahDark committed May 20, 2017
1 parent 2afaa4d commit 261c028
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
9 changes: 9 additions & 0 deletions AquaShine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ function AquaShine.LoadEntryPoint(name, arg)
else
love.window.setTitle(AquaShine.WindowName)
end

love.window.setDisplaySleepEnabled(true)
end

--! Function used to replace extension on file
Expand Down Expand Up @@ -217,6 +219,13 @@ end
function AquaShine.IsSlowSystem()
return not(jit) or AquaShine.OperatingSystem == "Android" or AquaShine.OperatingSystem == "iOS"
end

--! @brief Disable screen sleep
--! @note Should be called only in Start function
function AquaShine.DisableSleep()
love.window.setDisplaySleepEnabled(false)
end

----------------------------
-- AquaShine Font Caching --
----------------------------
Expand Down
4 changes: 2 additions & 2 deletions about_screen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function AboutScreen.Draw()
end
end

function AboutScreen.KeyPressed(key, scancode, repeat_bit)
if not(repeat_bit) and key == "escape" then
function AboutScreen.KeyReleased(key, scancode)
if key == "escape" then
AquaShine.LoadEntryPoint("main_menu.lua")
end
end
Expand Down
3 changes: 2 additions & 1 deletion livesim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ end
function DEPLS.Start(argv)
DEPLS.Arg = argv
_G.DEPLS = DEPLS -- TODO: Should be avoided
AquaShine.DisableSleep()
EffectPlayer.Clear()

-- Load tap sound. High priority
Expand Down Expand Up @@ -933,7 +934,7 @@ function DEPLS.MousePressed(x, y, button, touch_id)
for i = 1, 9 do
local idolpos = DEPLS.IdolPosition[i]

if distance(x - (idolpos[1] + 64), y - (idolpos[2] + 64)) <= 77 then
if distance(x - (idolpos[1] + 64), y - (idolpos[2] + 64)) <= 80 then
TouchTracking[touch_id] = i
DEPLS.NoteManager.SetTouch(i, touch_id)

Expand Down
2 changes: 1 addition & 1 deletion ls2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ function ls2.parsestream(stream, path)
output.cover = process_COVR(stream)
elseif section == "LCLR" then
assert(output.live_clear == nil, "Only one LCLR can exist")
output.live_clear = process_ADIO(stream)
output.live_clear = love.audio.newSource(process_ADIO(stream))
else
io.write("Invalid section ", section, "\n")
end
Expand Down
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- Since AquaShine is special for Live Simulator: 2, it's not available as standalone Lua script.
-- Please see docs/AquaShine.md for more information.

DEPLS_VERSION = "1.0.2-pre1"
DEPLS_VERSION = "1.0.2"

----------------------
-- AquaShine loader --
Expand Down
2 changes: 1 addition & 1 deletion main_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local draw = love.graphics.draw
local drawtext = love.graphics.print
local setColor = love.graphics.setColor
local setFont = love.graphics.setFont
local versionText = "Live Simulator: 2 version "..DEPLS_VERSION.." using "..(jit and jit.version or _VERSION).." for Lua interpreter\nPowered by AquaShine loader\nR/W Directory: "..love.filesystem.getSaveDirectory()
local versionText = "Live Simulator: 2 version "..DEPLS_VERSION.." using "..(jit and jit.version or _VERSION).." for Lua interpreter\nUses AquaShine loader & LOVE2D game framework\nR/W Directory: "..love.filesystem.getSaveDirectory()
function MainMenu.Draw(deltaT)
-- Draw background
draw(background, 0, 0)
Expand Down
4 changes: 3 additions & 1 deletion noteloader/load_cbf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ function CBFBeatmap.Load(file)

-- If loading from "Cards" folder and "Custom Cards" folder fails,
-- Load in current beatmap directory instead or in unit_icon folder
local index_name = getmetatable(UnitIconCache).__index
local index_name = getmetatable(UnitIconCache)
if index_name then index_name = index_name.__index end

setmetatable(UnitIconCache, {
__index = function(_, var)
if index_name then
Expand Down
Binary file modified test/oneway_LS2.ls2
Binary file not shown.

0 comments on commit 261c028

Please sign in to comment.