Compare commits

...

2 commits

Author SHA1 Message Date
714e4f787b
Write the version after first launch 2024-07-24 14:23:03 +05:00
bc88a68ad0
Simple version checker 2024-07-24 14:16:00 +05:00
4 changed files with 39 additions and 9 deletions

View file

@ -131,13 +131,24 @@ local function BeatrunHUD()
surface.SetFont("DebugFixedSmall")
local vtext = VERSIONGLOBAL
local tw, _ = surface.GetTextSize(vtext)
surface.SetTextColor(255, 255, 255, 15)
local tw, _ = surface.GetTextSize("v" .. VERSIONGLOBAL)
surface.SetTextColor(255, 255, 255, 20)
surface.SetTextPos(scrw - tw, 0)
surface.DrawText(vtext)
surface.DrawText("v" .. VERSIONGLOBAL)
surface.SetFont("BeatrunHUD")
if file.Exists("beatrun/version.txt", "DATA") then
local latest_version = file.Read("beatrun/version.txt", "DATA")
if latest_version ~= VERSIONGLOBAL then
local notlatest_w, _ = surface.GetTextSize("Update available!")
surface.SetTextColor(255, 255, 255, 30)
surface.SetTextPos(scrw - notlatest_w, 10)
surface.DrawText("Update available!")
surface.SetFont("BeatrunHUD")
end
end
local pl = ply:GetNW2Int("PLoss")
local CT = CurTime()

View file

@ -2,4 +2,22 @@ include("shared.lua")
for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME")) do
include("cl/" .. v)
end
end
http.Fetch("https://raw.githubusercontent.com/JonnyBro/beatrun/main/version.txt", function(body, size, headers, code)
if code == 200 then
if not file.Exists("beatrun/version.txt", "DATA") then
file.Write("beatrun/version.txt", body)
end
if body ~= VERSIONGLOBAL then
file.Write("beatrun/version.txt", body)
else
print("Latest version already")
end
else
print("Error while checking version:\n" .. body)
end
end, function(e)
print("Error while checking version:\n" .. e)
end)

View file

@ -1,11 +1,11 @@
VERSIONGLOBAL = "v1.0.7"
VERSIONGLOBAL = "1.0.8"
DeriveGamemode("sandbox")
GM.Name = "Beatrun"
GM.Author = "who cares"
GM.Email = "whocares@noone.com"
GM.Website = "www.mirrorsedge.com xd"
GM.Author = "N/A"
GM.Email = "N/A"
GM.Website = "github.com/JonnyBro/beatrun"
include("player_class/player_beatrun.lua")

1
version.txt Normal file
View file

@ -0,0 +1 @@
1.0.8