Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
C1XTZ committed Jul 29, 2024
1 parent 8dd7394 commit a85eab3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mobilephone/manifest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ABOUT]
NAME = Mobilephone
AUTHOR = C1XTZ, CheesyManiac
VERSION = 1.63
VERSION = 1.64
DESCRIPTION = A phone that displays ingame chat, time and the current song.

[WINDOW_...]
Expand Down
45 changes: 30 additions & 15 deletions mobilephone/mobilephone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ local nowPlaying = {
final = '',
length = 0,
pstr = '   PAUSED ll',
lstr = '   LOADING...',
isPaused = false,
spaces = string.rep("", settings.spaces),
FUCK = false
Expand Down Expand Up @@ -575,7 +576,7 @@ function updateSpacing()
end

function updateSong()
if ac.currentlyPlaying().artist == nil then nowPlaying.final = '   LOADING...' end
if ac.currentlyPlaying().artist == nil then nowPlaying.final = nowPlaying.lstr end
local currentSong = ac.currentlyPlaying()
if currentSong.isPlaying then
local artistChanged = nowPlaying.artist ~= currentSong.artist
Expand Down Expand Up @@ -632,9 +633,13 @@ end
--#region APP EVENTS

function onShowWindow()
if settings.nowPlaying then nowPlaying.final = '   LOADING...' end
nowPlaying.FUCK = true
nowPlaying.isPaused = false
if settings.nowPlaying then
nowPlaying.final = nowPlaying.lstr
nowPlaying.FUCK = true
nowPlaying.isPaused = false
updateSong()
end

updateTime()
runUpdate()
if (settings.autoUpdate and doUpdate) or settings.updateAvailable then updateCheckVersion() end
Expand Down Expand Up @@ -740,8 +745,6 @@ function script.windowMainSettings(dt)
ui.tabItem('Display', function()
if ac.getPatchVersionCode() >= 3044 then
if ui.checkbox('Force App to Bottom', settings.forceBottom) then settings.forceBottom = not settings.forceBottom end
else
settings.forceBottom = false
end

if ui.checkbox('Custom Color', settings.customColor) then
Expand Down Expand Up @@ -805,10 +808,16 @@ function script.windowMainSettings(dt)
nowPlaying.FUCK = true
updateSong()
else
clearInterval(updateInterval)
clearInterval(scrollInterval)
updateInterval = nil
scrollInterval = nil
if updateInterval then
clearInterval(updateInterval)
updateInterval = nil
end

if scrollInterval then
clearInterval(scrollInterval)
scrollInterval = nil
end

runUpdate()
end
end
Expand All @@ -823,8 +832,11 @@ function script.windowMainSettings(dt)
ui.sameLine()
settings.scrollSpeed, speedChange = ui.slider('##ScrollSpeed', settings.scrollSpeed, 0, 15, 'Scroll Speed: ' .. '%.1f')
if speedChange and not nowPlaying.isPaused then
clearInterval(scrollInterval)
scrollInterval = nil
if scrollInterval then
clearInterval(scrollInterval)
scrollInterval = nil
end

scrollText()
end

Expand Down Expand Up @@ -947,7 +959,7 @@ end
local VecTR = vec2(app.padding.x, phone.size.y - phone.size.y - app.padding.y)
local VecBL = vec2(phone.size.x + app.padding.x, phone.size.y - app.padding.y)
function script.windowMain(dt)
if settings.forceBottom then forceAppToBottom() end
if ac.getPatchVersionCode() >= 3044 and settings.forceBottom then forceAppToBottom() end
updateChatMovement(dt)

local phoneHovered = ui.windowHovered(ui.HoveredFlags.ChildWindows)
Expand Down Expand Up @@ -1086,8 +1098,11 @@ function script.windowMain(dt)
setTimeout(function() chat.sendCd = false end, 1)
elseif ui.mouseClicked(ui.MouseButton.left) and not nowPlaying.isPaused then
settings.scrollDirection = 1 - settings.scrollDirection
clearInterval(scrollInterval)
scrollInterval = nil
if scrollInterval then
clearInterval(scrollInterval)
scrollInterval = nil
end

scrollText()
end
end
Expand Down

0 comments on commit a85eab3

Please sign in to comment.