Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Added SCHEMA:PlayerFootstep Hook & splash screen among other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sophfee committed Dec 18, 2021
1 parent 97e27b8 commit 98e4e3a
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 51 deletions.
2 changes: 2 additions & 0 deletions entities/entities/landis_loot_container/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
include("cl_init.lua")
include("shared.lua")

function ENT:Initialize()
end

function ENT:Think()
end

1 change: 0 additions & 1 deletion gamemode/core/cl_skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local SKIN = {}
--PrintTable(derma.GetDefaultSkin())

SKIN.Colours = table.Copy(derma.SkinList.Default.Colours)
PrintTable(SKIN.Colours)
SKIN.Colours.Window.TitleActive = Color(255, 255, 255)
SKIN.Colours.Window.TitleInactive = Color(255, 255, 255)
SKIN.fontFrame = "landis-24"
Expand Down
8 changes: 8 additions & 0 deletions gamemode/core/hooks/sv_hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ function GM:PlayerSpawn(ply)
ply:Give("landis_hands")
hook.Run("PlayerLoadout", ply)
end

function GM:PlayerFootstep(ply,pos,foot,sound)
if SCHEMA.PlayerFootstep then
SCHEMA:PlayerFootstep(ply,pos,foot,sound)
return true
end
end

function GM:PlayerSetHandsModel( ply, ent )
local teamData = ply:GetTeamData()
if teamData then
Expand Down
2 changes: 1 addition & 1 deletion gamemode/core/sh_anim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ landis.Anim.overwatch = {
[ACT_MP_RUN] = {ACT_RUN_RIFLE, ACT_RUN_RIFLE}
},
ar2 = {
[ACT_MP_STAND_IDLE] = {ACT_IDLE_SMG1, ACT_IDLE_ANGRY},
[ACT_MP_STAND_IDLE] = {ACT_IDLE_SMG1, ACT_IDLE_ANGRY_SMG1},
[ACT_MP_CROUCH_IDLE] = {ACT_CROUCHIDLE, ACT_CROUCHIDLE},
[ACT_MP_WALK] = {ACT_WALK_RIFLE, ACT_WALK_AIM_RIFLE},
[ACT_MP_CROUCHWALK] = {ACT_WALK_CROUCH_RIFLE, ACT_WALK_CROUCH_RIFLE},
Expand Down
46 changes: 43 additions & 3 deletions gamemode/core/vgui/cl_intro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@ local PANEL = {}

local math = math
local floor = math.floor

local function getRandomSlideShow()
local t = {}
for v,k in RandomPairs(SCHEMA.MenuCamSlideShow) do
table.ForceInsert(t, k)
end
return t
end
function PANEL:Init()
SCHEMA:SetHUDElement("Crosshair",false)
SCHEMA:SetHUDElement("Health",false)
SCHEMA:SetHUDElement("Armor",false)
SCHEMA:SetHUDElement("Ammo",false)
hook.Add("HUDShouldDraw", "removeall", function(name)
if not( name == "CHudGMod" )then return false end
end)
self:SetSize(ScrW(),ScrH())
self:Center()
self:MakePopup()
self:SetText("")
end
function PANEL:Paint(w,h)

draw.RoundedBox(0,0,0,w,h,Color(0,0,0,100))

landis.blur(self,255,16,24)

local c = landis.Config.MainColor
Expand All @@ -27,11 +42,36 @@ function PANEL:Paint(w,h)
end

function PANEL:DoClick()
MainMenu = MainMenu or vgui.Create("landisMainMenu")
self:Remove()
end

landis.Splash = landis.Splash or nil

vgui.Register("landisSplash", PANEL, "DLabel")

concommand.Add("landis_open_splash", function()
local a = vgui.Create("landisSplash")
net.Receive("landisStartMenu", function()
Slides = getRandomSlideShow()
CanChangeAt= CurTime() + 18
Current = 1
hook.Add("CalcView", "landisMAINMENUCALCVIEW", function()
if CurTime() > CanChangeAt then
CanChangeAt = CurTime() + 18
LocalPlayer():ScreenFade(SCREENFADE.OUT, Color(0,0,0), 1, 0.25)
timer.Simple(1.125, function()
LocalPlayer():ScreenFade(SCREENFADE.IN, Color(0,0,0), 1, 0.25)
Current = Current + 1
if Current > #Slides then
Current = 1
end
end)
end
return {
origin = Slides[Current].pos,
angles = Slides[Current].ang + Angle(math.sin(CurTime()/2)*0.8,math.cos(CurTime())*1.2,0), --+ Angle((gui.MouseY()/ScrH())*45,(gui.MouseX()/ScrW())*45,0),
fov = 70,
drawviewer = true
}
end)
landis.Splash = landis.Splash or vgui.Create("landisSplash")
end)
55 changes: 9 additions & 46 deletions gamemode/core/vgui/cl_mainmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ function PANEL:Init()
self:Remove()
return
end
self:SetPopupStayAtBack(true)
--MainMenuMusic = MainMenuMusic or CreateSound(LocalPlayer(), "music/hl2_intro.mp3")
--MainMenuMusic:Play()
SCHEMA:SetHUDElement("Crosshair",false)
SCHEMA:SetHUDElement("Health",false)
SCHEMA:SetHUDElement("Armor",false)
SCHEMA:SetHUDElement("Ammo",false)
menuOpen = true
hook.Add("HUDShouldDraw", "removeall", function(name)
hook.Add("HUDShouldDraw", "removeall", function(name)
if not( name == "CHudGMod" )then return false end
end)
self:SetPopupStayAtBack(true)
MainMenuMusic = MainMenuMusic or CreateSound(LocalPlayer(), "music/hl2_song16.mp3")
MainMenuMusic:Play()

menuOpen = true

GlobalAlpha = 255
local fadeOut = false
self:SetSize(ScrW(),ScrH())
Expand All @@ -36,7 +38,7 @@ function PANEL:Init()
net.Start("landisRPNameChange")
net.WriteString(name)
net.SendToServer()
--MainMenuMusic:FadeOut(1.125)
MainMenuMusic:FadeOut(1.125)
hook.Remove("HUDShouldDraw", "removeall")

MainMenu = nil
Expand All @@ -57,7 +59,7 @@ function PANEL:Init()
end)
end)
else
--MainMenuMusic:FadeOut(1.125)
MainMenuMusic:FadeOut(1.125)
hook.Remove("HUDShouldDraw", "removeall")

MainMenu = nil
Expand Down Expand Up @@ -152,45 +154,6 @@ vgui.Register("landisMainMenu", PANEL, "DPanel")

MainMenu = MainMenu or nil

local function getRandomSlideShow()
local t = {}
for v,k in RandomPairs(SCHEMA.MenuCamSlideShow) do
table.ForceInsert(t, k)
end
return t
end

net.Receive("landisStartMenu", function()
--Derma_Message("Hello! Welcome to Landis Development Build 0.2\n\nThis is an experimental version of the Landis framework, things may tend to destroy themselves.\nBugs may occur! This is normal for a development build. Make sure to report them!\n\nOverall, have fun toying with the new tools!\n\nEnjoy!\n- Nick","Welcome to the Landis Framework!","Let me play now!")
--surface.PlaySound(Sound("music/hl2_intro.mp3"))
timer.Simple(0.5, function()
landis.DefineSetting("mod-esp",{type="tickbox",value=false,default=false,category="Mod",name="Noclip ESP"})
MainMenu = MainMenu or vgui.Create("landisMainMenu")
Slides = getRandomSlideShow()
CanChangeAt= CurTime() + 18
Current = 1
hook.Add("CalcView", "landisMAINMENUCALCVIEW", function()
if CurTime() > CanChangeAt then
CanChangeAt = CurTime() + 18
LocalPlayer():ScreenFade(SCREENFADE.OUT, Color(0,0,0), 1, 0.25)
timer.Simple(1.125, function()
LocalPlayer():ScreenFade(SCREENFADE.IN, Color(0,0,0), 1, 0.25)
Current = Current + 1
if Current > #Slides then
Current = 1
end
end)
end
return {
origin = Slides[Current].pos,
angles = Slides[Current].ang, --+ Angle((gui.MouseY()/ScrH())*45,(gui.MouseX()/ScrW())*45,0),
fov = 70,
drawviewer = true
}
end)
end)
end)

hook.Add("PlayerButtonDown", "landisMenuOpener", function(_,btn)
if not menuOpen then
if btn == KEY_F1 then
Expand Down
1 change: 1 addition & 0 deletions plugins/base_hud/cl_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ landis.DefineSetting("!C-crosshairBlue",{name="Crosshair Color (Blue)",type="sli
landis.DefineSetting("!D-crosshairLength",{name="Crosshair Length",type="slider",category="Crosshair",min=1,max=16,dec=0,default=5})
landis.DefineSetting("!E-crosshairGap",{name="Crosshair Gap",type="slider",category="Crosshair",min=1,max=16,dec=0,default=5})
landis.DefineSetting("deathScreenDim",{name="Dim Death Screen",type="tickbox",category="UI",default=true})
landis.DefineSetting("mod-esp",{type="tickbox",value=false,default=false,category="Mod",name="Noclip ESP"})

hook.Add("HUDPaint", "hudPlugin_draw", function()
if not IsValid(ply) then
Expand Down

0 comments on commit 98e4e3a

Please sign in to comment.