-- An all-in-one status update script.
-- TODO: finish and make usable.

local function AutoText()
	return "todo: this"
end

return function(inText, isCurSong, updateGameType)
	local newText = inText == "auto" and AutoText() or inText

	if isCurSong then
		local player = GAMESTATE:GetMasterPlayerNumber()
		local stats = STATSMAN:GetCurStageStats()
		
		local courselength = function()
			if GAMESTATE:IsCourseMode() then
				if GAMESTATE:GetPlayMode() ~= "PlayMode_Endless" then
					return GAMESTATE:GetCurrentCourse():GetDisplayFullTitle().. " (Song ".. stats:GetPlayerStageStats( player ):GetSongsPassed()+1 .. " of ".. GAMESTATE:GetCurrentCourse():GetEstimatedNumStages() ..")" or ""
				end
				return newText .. " (Song ".. stats:GetPlayerStageStats( player ):GetSongsPassed()+1 .. ")" or ""
			end
		end
		GAMESTATE:UpdateDiscordSongPlaying(GAMESTATE:IsCourseMode() and courselength() or newText,songname,GAMESTATE:GetCurrentSong():GetLastSecond())
	else
		GAMESTATE:UpdateDiscordScreenInfo(newText,"",1)
	end
	
	
	
	if updateGameType then
		GAMESTATE:UpdateDiscordGameMode(GAMESTATE:GetCurrentGame():GetName())
	end
end
