Minor work on dialogue menu

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

@ -186,3 +186,9 @@ surface.CreateFont( "q_craft_hud_text", {
size = 25 * Quantum.Client.ResolutionScale,
antialias = true
})
surface.CreateFont( "q_dialogue_question", {
font = "Arial",
size = 38 * Quantum.Client.ResolutionScale,
antialias = true
})

@ -77,13 +77,28 @@ function menu.open( dt )
end
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
title:SetText(node.name)
title:SetFont("q_header_s")
title:SetTextColor(Color(255, 255, 255, 120))
title:SetTextColor(textColor)
title:SizeToContents()
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

Loading…
Cancel
Save