Minor work on dialogue menu

master
E. Almqvist 5 years ago
parent 70c73b3a67
commit 56ed89173c
  1. 8
      gamemode/engine/core/client/cl_fonts.lua
  2. 21
      gamemode/engine/derma/menus/menu_dialogue.lua

@ -185,4 +185,10 @@ surface.CreateFont( "q_craft_hud_text", {
font = "Cambria", font = "Cambria",
size = 25 * Quantum.Client.ResolutionScale, size = 25 * Quantum.Client.ResolutionScale,
antialias = true antialias = true
}) })
surface.CreateFont( "q_dialogue_question", {
font = "Arial",
size = 38 * Quantum.Client.ResolutionScale,
antialias = true
})

@ -76,14 +76,29 @@ function menu.open( dt )
end end
end end
f.w, f.h = f:GetSize() f.w, f.h = f:GetSize()
f.dialogue = {}
local textColor = Color(255, 255, 255, 120)
-- Title is static, can't be changed mid dialogue.
local title = vgui.Create( "DLabel", f ) -- dialogue title, useally the npcs name or something local title = vgui.Create( "DLabel", f ) -- dialogue title, useally the npcs name or something
title:SetText(node.name) title:SetText(node.name)
title:SetFont("q_header_s") title:SetFont("q_header_s")
title:SetTextColor(Color(255, 255, 255, 120)) title:SetTextColor(textColor)
title:SizeToContents() title:SizeToContents()
title.w, title.h = title:GetSize() title.w, title.h = title:GetSize()
title:SetPos( padding*2, borderHeight/2 - title.h/2 ) title:SetPos(padding*2, borderHeight/2 - title.h/2)
-- Dialogue question
f.dialogue.q = vgui.Create("DLabel", f)
f.dialogue.q:SetText(dialogue["init"].question)
f.dialogue.q:SetFont("q_dialogue_question")
f.dialogue.q:SetTextColor(textColor)
f.dialogue.q:SizeToContents()
f.dialogue.q.w, f.dialogue.q.h = f.dialogue.q:GetSize()
f.dialogue.q:SetPos(padding*2, sh - borderHeight/2 - f.dialogue.q.h)
return f
end end
end end

Loading…
Cancel
Save