Jump to content

[REQ] Scoreboard Design


Recommended Posts

  • 2 weeks later...

Please help me this is what I got so far:

dxscoreboard_clientsettings.lua:

settings = { 
    ["useanimation"] = nil,
    ["toggleable"] = nil,
    ["showserverinfo"] = nil,
    ["showgamemodeinfo"] = nil,
    ["showteams"] = nil,
    ["usecolors"] = nil,
    ["drawspeed"] = nil,
    ["scale"] = nil,
    ["columnfont"] = nil,
    ["contentfont"] = nil,
    ["teamfont"] = nil,
    ["serverinfofont"] = nil,
    ["bg_color"] = {},
    ["selection_color"] = {},
    ["highlight_color"] = {},
    ["header_color"] = {},
    ["team_color"] = {},
    ["border_color"] = {},
    ["serverinfo_color"] = {},
    ["content_color"] = {}
}
defaultSettings = {
    ["useanimation"] = true,
    ["toggleable"] = false,
    ["showserverinfo"] = false,
    ["showgamemodeinfo"] = true,
    ["showteams"] = true,
    ["usecolors"] = true,
    ["drawspeed"] = 1.5,
    ["scale"] = 1.0,
    ["columnfont"] = "default-bold",
    ["contentfont"] = "default-bold",
    ["teamfont"] = "default-bold",
    ["serverinfofont"] = "default",
    ["bg_color"] = {
        ["r"] = 0,
        ["g"] = 0,
        ["b"] = 0,
        ["a"] = 255
    },
    ["selection_color"] = {
        ["r"] = 82,
        ["g"] = 103,
        ["b"] = 188,
        ["a"] = 170
    },
    ["highlight_color"] = {
        ["r"] = 255,
        ["g"] = 255,
        ["b"] = 255,
        ["a"] = 50
    },
    ["header_color"] = {
        ["r"] = 255,
        ["g"] = 158,
        ["b"] = 0,
        ["a"] = 255
    },
    ["team_color"] = {
        ["r"] = 255,
        ["g"] = 255,
        ["b"] = 255,
        ["a"] = 0
    },
    ["border_color"] = {
        ["r"] = 100,
        ["g"] = 100,
        ["b"] = 100,
        ["a"] = 0
    },
    ["serverinfo_color"] = {
        ["r"] = 255,
        ["g"] = 158,
        ["b"] = 0,
        ["a"] = 255
    },
    ["content_color"] = {
        ["r"] = 255,
        ["g"] = 255,
        ["b"] = 255,
        ["a"] = 255
    }
}
 
tempColors = {
    ["bg_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["selection_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["highlight_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["header_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["team_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["border_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["serverinfo_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    },
    ["content_color"] = {
        ["r"] = nil,
        ["g"] = nil,
        ["b"] = nil,
        ["a"] = nil
    }
}
MAX_DRAWSPEED = 4.0
MIN_DRAWSPEED = 0.5
MAX_SCALE = 2.5
MIN_SCALE = 0.5
fontIndexes = {
    ["column"] = 1,
    ["content"] = 1,
    ["team"] = 1,
    ["serverinfo"] = 1
}
fontNames = { "default", "default-bold", "clear", "arial",
 
"sans","pricedown", "bankgothic", "diploma", "beckett" }
 
function readScoreboardSettings()
    local settingsFile = xmlLoadFile( "settings.xml" )
    if not settingsFile then
        settingsFile = xmlCreateFile( "settings.xml",
 
"settings" )
        if not settingsFile then return false end
       
        local useanimationTag = xmlCreateChild(
 
settingsFile, "useanimation" )
            xmlNodeSetValue( useanimationTag,
 
tostring( defaultSettings.useanimation ) )
        local toggleableTag = xmlCreateChild( settingsFile,
 
"toggleable" )
            xmlNodeSetValue( toggleableTag,
 
tostring( defaultSettings.toggleable ) )
        local showserverinfoTag = xmlCreateChild(
 
settingsFile, "showserverinfo" )
            xmlNodeSetValue( showserverinfoTag,
 
tostring( defaultSettings.showserverinfo ) )
        local showgamemodeinfoTag = xmlCreateChild(
 
settingsFile, "showgamemodeinfo" )
            xmlNodeSetValue(
 
showgamemodeinfoTag, tostring( defaultSettings.showgamemodeinfo )
 
)
        local showteamsTag = xmlCreateChild(
 
settingsFile, "showteams" )
            xmlNodeSetValue( showteamsTag,
 
tostring( defaultSettings.showteams ) )
        local usecolorsTag = xmlCreateChild( settingsFile,
 
"usecolors" )
            xmlNodeSetValue( usecolorsTag,
 
tostring( defaultSettings.usecolors ) )
        local drawspeedTag = xmlCreateChild( settingsFile,
 
"drawspeed" )
            xmlNodeSetValue( drawspeedTag,
 
tostring( defaultSettings.drawspeed ) )
        local scaleTag = xmlCreateChild( settingsFile,
 
"scale" )
            xmlNodeSetValue( scaleTag, tostring(
 
defaultSettings.scale ) )
        local columnfontTag = xmlCreateChild( settingsFile,
 
"columnfont" )
            xmlNodeSetValue( columnfontTag,
 
tostring( defaultSettings.columnfont ) )
        local contentfontTag = xmlCreateChild( settingsFile,
 
"contentfont" )
            xmlNodeSetValue( contentfontTag,
 
tostring( defaultSettings.contentfont ) )
        local teamfontTag = xmlCreateChild( settingsFile,
 
"teamfont" )
            xmlNodeSetValue( teamfontTag, tostring(
 
defaultSettings.teamfont ) )
        local serverinfofontTag = xmlCreateChild(
 
settingsFile, "serverinfofont" )
            xmlNodeSetValue( serverinfofontTag,
 
tostring( defaultSettings.serverinfofont ) )
        local bg_colorTag = xmlCreateChild( settingsFile,
 
"bg_color" )
            xmlNodeSetAttribute( bg_colorTag, "r",
 
tostring( defaultSettings.bg_color.r ) )
            xmlNodeSetAttribute( bg_colorTag, "g",
 
tostring( defaultSettings.bg_color.g ) )
            xmlNodeSetAttribute( bg_colorTag, "b",
 
tostring( defaultSettings.bg_color.b ) )
            xmlNodeSetAttribute( bg_colorTag, "a",
 
tostring( defaultSettings.bg_color.a ) )
        local selection_colorTag = xmlCreateChild(
 
settingsFile, "selection_color" )
            xmlNodeSetAttribute( selection_colorTag,
 
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...