From 2705f3d3436a5e438cb7c70ee15f8cf73f73eda6 Mon Sep 17 00:00:00 2001 From: AlmTech Date: Mon, 14 Oct 2019 19:28:39 +0200 Subject: [PATCH] Fixed server banner in menus and stuff --- gamemode/cl_init.lua | 1 + gamemode/engine/derma/menus/menu_character.lua | 13 +++++++------ gamemode/init.lua | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua index f3f46bf..bfed309 100644 --- a/gamemode/cl_init.lua +++ b/gamemode/cl_init.lua @@ -9,6 +9,7 @@ if CLIENT then include( "shared.lua" ) Quantum.Client = {} Quantum.Client.ResolutionScale = ScrH() / 1080 + Quantum.Client.ServerBannerPath = "gamemodes/" .. GAMEMODE.FolderName .. "/gamemode/content/materials/quantum/server_banner.png" local function loadCoreFiles() local fol = GM.FolderName .. "/gamemode/engine/core/" diff --git a/gamemode/engine/derma/menus/menu_character.lua b/gamemode/engine/derma/menus/menu_character.lua index 75f2c6f..995048b 100644 --- a/gamemode/engine/derma/menus/menu_character.lua +++ b/gamemode/engine/derma/menus/menu_character.lua @@ -120,12 +120,6 @@ function menu.open( dt ) f.page = p f.page:SetVisible( true ) - local banner = vgui.Create( "DImage", p ) - banner:SetSize( 480 * resScale, 120 * resScale ) - banner:SetImage( "content/materials/quantum/server_banner.png" ) - banner.w, banner.h = banner:GetSize() - banner:SetPos( padding, padding ) - local clist = vgui.Create( "DScrollPanel", p ) clist:SetSize( 380 * resScale, sh - padding*15 ) clist.w, clist.h = clist:GetSize() @@ -148,6 +142,13 @@ function menu.open( dt ) end --- + local banner = vgui.Create( "DImage", p ) + banner:SetImage( Quantum.Client.ServerBannerPath ) + banner:SizeToContents() + banner.w, banner.h = banner:GetSize() + banner:SetSize( (banner.w * resScale)/2.8, (banner.h * resScale)/2.8 ) + banner:SetPos( padding, padding ) + local header = vgui.Create( "DLabel", p ) header:SetText( "Characters" ) header:SetFont( "q_header" ) diff --git a/gamemode/init.lua b/gamemode/init.lua index 1e589c5..36f2264 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -12,8 +12,8 @@ if SERVER then AddCSLuaFile( "shared.lua" ) -- Content -- - resource.AddFile("content/materials/quantum/server_banner.png") - ------------- + local path = "gamemodes/" .. GM.FolderName .. "/gamemode/content/materials/quantum/server_banner.png" + resource.AddSingleFile( path ) include( "shared.lua" )