Compare commits

..

No commits in common. "5fe7a6966a79bfb2d6f7119fca8c1485dd996ff8" and "2f5db0f3c73d81a12921b3f2d5d9a8320017631c" have entirely different histories.

View File

@ -12,8 +12,6 @@ local ZoneAct = lb_ZoneAct
local TicsToTime = lb_TicsToTime local TicsToTime = lb_TicsToTime
----------------------------- -----------------------------
local cv_kartencore
local function mapIndexOffset(n) local function mapIndexOffset(n)
return (mapIndex + n + #maps - 1) % #maps + 1 return (mapIndex + n + #maps - 1) % #maps + 1
end end
@ -55,7 +53,6 @@ local mappY = 26
local ttlY = mappY + FixedMul(30, FRACUNIT / scalar) local ttlY = mappY + FixedMul(30, FRACUNIT / scalar)
local scoresY = ttlY + 16 local scoresY = ttlY + 16
local sin = sin
local function drawMapPatch(v, offset) local function drawMapPatch(v, offset)
local scale = FRACUNIT / (abs(offset) + scalar) local scale = FRACUNIT / (abs(offset) + scalar)
local mapName = G_BuildMapName(getMap(offset)) local mapName = G_BuildMapName(getMap(offset))
@ -71,26 +68,6 @@ local function drawMapPatch(v, offset)
scale, scale,
mapp mapp
) )
end
local function drawEncore(v)
if not cv_kartencore then
cv_kartencore = CV_FindVar("kartencore")
end
if not cv_kartencore.value then
return
end
local rubyp = v.cachePatch("RUBYICON")
local bob = sin(leveltime * ANG10) * 2
v.drawScaled(
hlfScrnWdth * FRACUNIT,
mappY * FRACUNIT + bob,
FRACUNIT,
rubyp
)
end end
local colors = { local colors = {
@ -342,7 +319,6 @@ local function drawBrowser(v)
-- current map -- current map
drawMapPatch(v, 0) drawMapPatch(v, 0)
drawEncore(v)
drawMapStrings(v) drawMapStrings(v)
drawGamemode(v) drawGamemode(v)
@ -419,8 +395,6 @@ local function resetKeyRepeat()
repeatCount = 0 repeatCount = 0
end end
local ValidButtons = BT_ACCELERATE | BT_BRAKE | BT_FORWARD | BT_BACKWARD | BT_DRIFT | BT_ATTACK
-- return value indicates we want to exit the browser -- return value indicates we want to exit the browser
local function controller(player) local function controller(player)
keyRepeat = max(0, $ - 1) keyRepeat = max(0, $ - 1)
@ -431,38 +405,32 @@ local function controller(player)
local cmd = player.cmd local cmd = player.cmd
if not keyRepeat then if not keyRepeat then
if not (cmd.buttons & ValidButtons or cmd.driftturn) then if cmd.driftturn > 0 then
return updateMapIndex(-1)
end updateKeyRepeat()
elseif cmd.driftturn < 0 then
updateKeyRepeat() updateMapIndex(1)
updateKeyRepeat()
if cmd.buttons & BT_BRAKE then
S_StartSound(nil, 115)
return true
elseif cmd.buttons & BT_ACCELERATE then
COM_BufInsertText(player, "changelevel "..G_BuildMapName(maps[mapIndex]))
return true
elseif cmd.buttons & BT_ATTACK then
COM_BufInsertText(player, "encore")
elseif cmd.driftturn then
local dir = cmd.driftturn > 0 and -1 or 1
if encoremode then
updateMapIndex(-dir)
else
updateMapIndex(dir)
end
elseif cmd.buttons & BT_FORWARD then elseif cmd.buttons & BT_FORWARD then
scrollPos = $ - 1 scrollPos = $ - 1
updateKeyRepeat()
elseif cmd.buttons & BT_BACKWARD then elseif cmd.buttons & BT_BACKWARD then
scrollPos = $ + 1 scrollPos = $ + 1
updateKeyRepeat()
elseif cmd.buttons & BT_DRIFT then elseif cmd.buttons & BT_DRIFT then
scrollPos = 1 scrollPos = 1
if modes and #modes then if modes and #modes then
mode = $ % #modes + 1 mode = $ % #modes + 1
prefMode = modes[mode] prefMode = modes[mode]
end end
updateKeyRepeat()
elseif cmd.buttons & BT_BRAKE then
S_StartSound(nil, 115)
return true
elseif cmd.buttons & BT_ACCELERATE then
S_StartSound(nil, 143)
COM_BufInsertText(player, "changelevel "..G_BuildMapName(maps[mapIndex]))
return true
end end
end end
end end