Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Fix for theme errors. #1

Open
alexgrist opened this issue Oct 28, 2014 · 0 comments
Open

Fix for theme errors. #1

alexgrist opened this issue Oct 28, 2014 · 0 comments

Comments

@alexgrist
Copy link
Owner

You will need to remove a lot of code in your gamemodes/(schema name)/schema/cl_theme.lua file so that you only have the following functions (your version may differ slightly).

You need to only keep the

  • local THEME = Clockwork.theme:Begin();
  • THEME:CreateFonts() function.
  • THEME:Initialize() function.
  • Finally Clockwork.theme:Finish(THEME);

For HL2 RP it should now look like this:

local THEME = Clockwork.theme:Begin();

-- Called when fonts should be created.
function THEME:CreateFonts()
    surface.CreateFont("hl2_ThickArial", 
    {
        font        = "Arial",
        size        = Clockwork.kernel:FontScreenScale(8),
        weight      = 700,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_PlayerInfoText", 
    {
        font        = "Verdana",
        size        = Clockwork.kernel:FontScreenScale(7),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_Large3D2D", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:GetFontSize3D(),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_IntroTextSmall", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(10),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_IntroTextTiny", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(9),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_CinematicText", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(8),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_IntroTextBig", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(18),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_MainText", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(7),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_TargetIDText", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(7),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_MenuTextHuge", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(30),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
    surface.CreateFont("hl2_MenuTextBig", 
    {
        font        = "Mailart Rubberstamp",
        size        = Clockwork.kernel:FontScreenScale(18),
        weight      = 600,
        antialiase  = true,
        additive    = false
    });
end;

-- Called when to initialize the theme.
function THEME:Initialize()
    Clockwork.option:SetColor( "information", Color(65, 105, 225, 255) );
    Clockwork.option:SetColor( "background", Color(72, 60, 50, 255) );
    Clockwork.option:SetColor( "target_id", Color(65, 105, 225, 255) );
    Clockwork.option:SetFont("bar_text", "hl2_TargetIDText");
    Clockwork.option:SetFont("main_text", "hl2_MainText");
    Clockwork.option:SetFont("hints_text", "hl2_IntroTextTiny");
    Clockwork.option:SetFont("large_3d_2d", "hl2_Large3D2D");
    Clockwork.option:SetFont("menu_text_big", "hl2_MenuTextBig");
    Clockwork.option:SetFont("menu_text_huge", "hl2_MenuTextHuge");
    Clockwork.option:SetFont("target_id_text", "hl2_TargetIDText");
    Clockwork.option:SetFont("cinematic_text", "hl2_CinematicText");
    Clockwork.option:SetFont("date_time_text", "hl2_IntroTextSmall");
    Clockwork.option:SetFont("intro_text_big", "hl2_IntroTextBig");
    Clockwork.option:SetFont("menu_text_tiny", "hl2_IntroTextTiny");
    Clockwork.option:SetFont("menu_text_small", "hl2_IntroTextSmall");
    Clockwork.option:SetFont("intro_text_tiny", "hl2_IntroTextTiny");
    Clockwork.option:SetFont("intro_text_small", "hl2_IntroTextSmall");
    Clockwork.option:SetFont("player_info_text", "hl2_PlayerInfoText");
end;

Clockwork.theme:Finish(THEME);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant