Late night update

Today I added loading screen support to lua now you can change the loading screen layout, also I changed quake3’s windows console color (the blue was getting annoying)

loadin

Here’s the script to do it:

local function centerText(y,str,tw,th)
local sw = string.len(str)*tw
draw.Text(320 – sw/2,y,str,tw,th)
return y + th
end

local function centerText2(y,str,ts)
local tw = 18*ts
local sw = string.len(str)*tw
draw.Text2(320 – sw/2,y,str,ts,0)
return y + 25
end

local console = LoadShader(“textures/sfx/console02″)
local t = 0
function d2d(tab)
draw.SetColor(0,0,0,1)
draw.Rect(0,0,640,480)

local svinfo = GetConfigString(CS_SERVERINFO)
local sysinfo = GetConfigString(CS_SYSTEMINFO)
local cheats = CS_ValueForKey(sysinfo,”sv_cheats”)
local pure = CS_ValueForKey(sysinfo,”sv_pure”)

local mapname = CS_ValueForKey(svinfo,”mapname”)
local host = CS_ValueForKey(svinfo,”sv_hostname”)
local maptext = GetConfigString(CS_MESSAGE)
local motd = GetConfigString(CS_MOTD)
local levelshot = LoadShader(“levelshots/” .. mapname .. “.tga”)
local detail = LoadShader(“levelShotDetail”)
if(levelshot == 0) then
levelshot = LoadShader(“menu/art/unknownmap”)
end

local w,h = 320,250

draw.SetColor(1,1,1,1)
local y = centerText2(10,”Connecting to ” .. host,1)
y = centerText2(y+2,”Loading ” .. tab.loadString,.5)

draw.Rect(320-w/2,240-h/2,w,h,levelshot)
draw.Rect(320-w/2,240-h/2,w,h,detail,0,0,2.5,2)

local ny = 240+h/2
ny = centerText2(ny,maptext,1)
centerText(ny,motd,10,10)

local x = 0
y = 400

for k,v in pairs(tab.playerIcons) do
draw.Rect(x,y,40,40,v)
x = x + 40
end

x = 0
y = y + 40

for k,v in pairs(tab.itemIcons) do
draw.Rect(x,y,30,30,v)
x = x + 32
end

draw.RectRotated(600,440,60,60,console,-t*10)
t = t + 1
end
hook.add(“DrawInfo”,”cl_ginfo”,d2d)

Pretty simple stuff.

My crowning achievment for the day was optimizing the lua downloader.

Instead of taking 45 seconds to download a 500 line lua file it takes about 6 seconds. woot

I’m thinking about releasing this very soon. It’ pretty stable now 🙂

I just need to tie up some lose ends.

By the way, if anyone is visiting this blog (and I think you are)

Please don’t hesitate to make suggestions. I’m at a bit of an inpass because I’m not sure what people will want to do with this.

So if you have any ideas, post them in the comments or email me at Hxrmn@comcast.net

-Thank you

2 Responses to “Late night update”

  1. Mio's avatar Mio Says:

    Can U make a loading screen for q3/ta just like QUAKE LIVE?

Leave a comment


Design a site like this with WordPress.com
Get started