Revision Difference
SourceScheme#561653
<cat>Dev.UI</cat>
<title>SourceScheme</title>
<note> This page is best read by those pretty familiar with garrysmod already, New and Junior Developers are **NOT** encourage to _MODIFY_ these files without having a proper understanding of not only how source games handle their files but also how garrysmod itself handles its filesystem as modifying these files without proper due diligence can break the game in unexpected ways.</note>
<warning> Modifying these files are not apart of the addon system which means there are very limited or no safeguards, Before doing anything ensure you have an unedited version of the file you can restore should your edits not be fixable.</warning>
# What is the SourceScheme File
The `SourceScheme.res` file found [HERE](https://github.com/Facepunch/garrysmod/blob/master/garrysmod/resource/SourceScheme.res) this file is a [Valve KeyValues](https://developer.valvesoftware.com/wiki/KeyValues) format document that defines VGUI panels. Similar files include ChatScheme, ClientScheme and LoadingDialogVAC. There may be more but at the time of writing these are the other ones I see.
# Why Customize it?
Above all else, there is absolutely no **NEED** to customize file. the game runs and functions perfectly with the regular file shipped to game. However with that being said, modifying these files can allow for some customization of panels you cant access through Derma. In this file that's most notably the Console and the Options Menu panels.
# File Structure
The first value is the `Scheme` key, this will be the root key in which all other keys will need to be stored.
## Colors
The first subsection within the file, this will contain all the color variables that we will use in the following subsection of `BaseSettings`
The default colors contained within this section are
| Color Name | RGBA Value | Image Color |
| --- | :---: | --- |⤶
| White | 255 255 255 255 | <image src="aaf9e/8dc51ec7447ad9a.png" size="199" name="image.png" /> |⤶
| OffWhite | 221 221 221 255 | <image src="aaf9e/8dc51ec7e558a7d.png" size="200" name="image.png" /> |⤶
| DullWhite | 190 190 190 255 | <image src="aaf9e/8dc51ec9bd42804.png" size="202" name="image.png" /> |⤶
| Orange | 255 155 0 255 | <image src="aaf9e/8dc51ecb0530448.png" size="200" name="image.png" /> |⤶
| TransparentBlack | 0 0 0 128 | <image src="aaf9e/8dc51eccd298761.png" size="193" name="image.png" /> |⤶
| Black | 0 0 0 255 | <image src="aaf9e/8dc51eced7bfa4e.png" size="198" name="image.png" /> |⤶
| Blank | 0 0 0 0 | |⤶
| GMod_BG_Opaque | 108 111 114 250 | <image src="aaf9e/8dc51ed1401c1d8.png" size="201" name="image.png" /> |⤶
| GMod_BG | 108 111 114 0 | |⤶
| GMod_WhiteBlank | 255 255 255 0 | |⤶
| SteamLightGreen | 157 194 80 255 | <image src="aaf9e/8dc51ed5b95fddc.png" size="200" name="image.png" /> |⤶
| AchievementsLightGrey | 79 79 79 255 | <image src="aaf9e/8dc51ed71cef9f1.png" size="198" name="image.png" /> |⤶
| AchievementsDarkGrey | 55 55 55 255 | <image src="aaf9e/8dc51ed985da823.png" size="198" name="image.png" /> |⤶
| AchievementsInactiveFG | 130 130 130 255 | <image src="aaf9e/8dc51edaf881a6f.png" size="197" name="image.png" /> |⤶
| RGBA | Preview | Name |
|:----:|:-------:|:-----|⤶
| `255` `255` `255` `255` | ![White] | `White`⤶
| `221` `221` `221` `255` | ![OffWhite] | `OffWhite` ⤶
| `190` `190` `190` `255` | ![DullWhite] | `DullWhite`⤶
| `255` `155` ` 0` `255` | ![Orange] | `Orange` ⤶
| ` 0` ` 0` ` 0` `128` | ![TransparentBlack] | `TransparentBlack` ⤶
| ` 0` ` 0` ` 0` `255` | ![Black] | `Black` ⤶
| ` 0` ` 0` ` 0` ` 0` | ![Blank] | `Blank` ⤶
| `108` `111` `114` `250` | ![GMod_BG_Opaque] | `GMod_BG_Opaque` ⤶
| `108` `111` `114` ` 0` | ![GMod_BG] | `GMod_BG` ⤶
| `255` `255` `255` ` 0` | ![GMod_WhiteBlank] | `GMod_WhiteBlank` ⤶
| `157` `194` ` 80` `255` | ![SteamLightGreen] | `SteamLightGreen` ⤶
| ` 79` ` 79` ` 79` `255` | ![AchievementsLightGrey] | `AchievementsLightGrey` ⤶
| ` 55` ` 55` ` 55` `255` | ![AchievementsDarkGrey] | `AchievementsDarkGrey` ⤶
| `130` `130` `130` `255` | ![AchievementsInactiveFG] | `AchievementsInactiveFG` ⤶
Adding your own colors this key is simple just follow the formatting of the document.
⤶
[White]: https://files.facepunch.com/wiki/files/b5608/8dc54e5b3c9eec6.webp⤶
[OffWhite]: https://files.facepunch.com/wiki/files/b5608/8dc54e6bf24176f.webp⤶
[DullWhite]: https://files.facepunch.com/wiki/files/b5608/8dc54e6c4aebdd5.webp⤶
[Orange]: https://files.facepunch.com/wiki/files/b5608/8dc54e6cb7f40f8.webp⤶
[TransparentBlack]: https://files.facepunch.com/wiki/files/b5608/8dc54e93d7b20bd.webp⤶
[Black]: https://files.facepunch.com/wiki/files/b5608/8dc54e6d6d03fd5.webp⤶
[Blank]: https://files.facepunch.com/wiki/files/b5608/8dc54e6e2551d8e.webp⤶
[GMod_BG_Opaque]: https://files.facepunch.com/wiki/files/b5608/8dc54e6dbf82b3e.webp⤶
[GMod_BG]: https://files.facepunch.com/wiki/files/b5608/8dc54e6e9171d6b.webp⤶
[GMod_WhiteBlank]: https://files.facepunch.com/wiki/files/b5608/8dc54e6f0912bf2.webp⤶
[SteamLightGreen]: https://files.facepunch.com/wiki/files/b5608/8dc54e6f704cee4.webp⤶
[AchievementsLightGrey]: https://files.facepunch.com/wiki/files/b5608/8dc54e6fb19274d.webp⤶
[AchievementsDarkGrey]: https://files.facepunch.com/wiki/files/b5608/8dc54e6ff3f637c.webp⤶
[AchievementsInactiveFG]: https://files.facepunch.com/wiki/files/b5608/8dc54e703ed210e.webp⤶
⤶
## BaseSettings
## BaseSettings
Here is where you can actually customize the color of the panels.
<note>Because of Garrys Mods progression over time some of these panels are not used anywhere anymore but their remains still exist in this file, I will point out all the values that I could note identify.
Also some fields are conditional, indicated by the `[$WIN32]` or `[$X360]` [Here is the relevant Source 2013 SDK code for how these are elvaluated](https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/tier1/KeyValues.cpp#L2055C1-L2086C2)
</note>
For Each Chunk of keys I break them out in a code block that will have enhanced descriptions and unknown keys commented out
### Border
```
// The Default Border that surrounds most/all of the vgui elements
//Border.Bright "UNKNOWN"
//Border.Dark "UNKNOWN"
Border.Selection "Black" // Border for Elements that should standout for selection - Option Menu "Accept Button"
Border.DarkSolid "40 40 40 255" // Border used to make elements stand out from Background
Border.Subtle "80 80 80 255" // Subtle Border used on elements.
```
### Button
```
// Button - Single Click Action Buttons
Button.TextColor "82 82 82 255" // Default Text Color
Button.BgColor "227 227 227 255" // Default Background Color
Button.ArmedTextColor "46 114 178 255" // Hover Text Color
Button.ArmedBgColor "240 240 240 255" // Hover Background Color
Button.DepressedTextColor "White" // Clicked Text Color
Button.DepressedBgColor "84 178 245 255" // Clicked Background Color
//Button.FocusBorderColor "UNKNOWN"
```
### CheckButtons
```
// CheckButtons
CheckButton.TextColor "White" // Text Label Color
CheckButton.SelectedTextColor "White" // Checked Text Label Color
CheckButton.BgColor "White" // Background of Checkbox Area
CheckButton.Border1 "Border.Subtle" // Border Color of Left and Top Walls
CheckButton.Border2 "Border.Subtle" // Border Color of Right and Bottom Walls
CheckButton.Check "Black" // color of the check itself
CheckButton.DisabledFgColor "Black" // color of the check itself when disabled
CheckButton.HighlightFgColor "OffWhite" // Hovered Text Color
CheckButton.ArmedBgColor "Blank" // Hovered Background Color
//CheckButton.DepressedBgColor "UNKNOWN"
CheckButton.DisabledBgColor "180 180 180 255" // Disabled Background Color
```
### ComboBoxButton
This references the arrow within the ComboBox and not the actual ComboBox
```
ComboBoxButton.ArrowColor "81 81 81 255" // Default Color of Triangle
ComboBoxButton.ArmedArrowColor "110 110 110 255" // Hovered Triangle Color
ComboBoxButton.BgColor "GMod_WhiteBlank" // Box Surrounding Triangle
ComboBoxButton.DisabledBgColor "GMod_WhiteBlank" // Disabled Background
```
### Frames
```
// Frames
Frame.TitleTextInsetX 16 // Title Text Inset
Frame.ClientInsetX 8 // Frame Padding for Child Elements Along X Axis
Frame.ClientInsetY 6 // Frame Padding for Child Elements Along Y Axis
Frame.BgColor "GMod_BG_Opaque" // Default Background Color
Frame.OutOfFocusBgColor "97 100 102 240" // Color When Not Focused
Frame.FocusTransitionEffectTime "0.3" // Time it takes to transition between focus states
Frame.TransitionEffectTime "0.3" // Time it takes for panel to open (and close?)
Frame.AutoSnapRange "0" // Distance (In Pixels?) it takes to snap to another object
FrameGrip.Color1 "200 200 200 196" // Bottom Right Grip Smaller Lines
FrameGrip.Color2 "0 0 0 196" // Bottom Right Grid Larger Lines
FrameTitleButton.FgColor "200 200 200 196" // In Focus Color of X for close button
FrameTitleButton.BgColor "GMod_BG" // In Focus Color of Background Surrounding X
FrameTitleButton.DisabledFgColor "255 255 255 192" // Out of Focus Color of X
FrameTitleButton.DisabledBgColor "GMod_BG" // Out of Focus Color of Background Surrounding X
FrameTitleBar.Font "UiBold" // Font Used for Name of Frame
FrameTitleBar.TextColor "255 255 255 204" // Default / Focused Text Color
FrameTitleBar.BgColor "GMod_BG" // Default / Focused Background Color
FrameTitleBar.DisabledTextColor "255 255 255 91" // Out of Focus Text Color
FrameTitleBar.DisabledBgColor "GMod_BG" // Out of Focus Background Color
// UnUsed in Gmod - Frame Button for Min, Max, Close Actions
// This also isnt positioned properly so it just needs to stay invis
FrameSystemButton.FgColor "Blank"
FrameSystemButton.BgColor "Blank"
FrameSystemButton.Icon ""
FrameSystemButton.DisabledIcon ""
```
### Graph Panel
I could not locate this panel anywhere in my testing
```
// UNKNOWN
//GraphPanel.FgColor "White"
//GraphPanel.BgColor "TransparentBlack"
```
### Labels
```
// Labels
Label.TextDullColor "DullWhite" // Color of non Interactive Label
Label.TextColor "OffWhite" // Default Label Color
//Label.TextBrightColor "UNKNOWN"
Label.SelectedTextColor "White" // Color When Text Is Selected
Label.BgColor "GMod_BG" // Default Label Background Color
Label.DisabledFgColor1 "110 110 110 255" // DropShadow Color of Disabled Labels
Label.DisabledFgColor2 "50 50 50 255" // Main Color of Disabled Labels
```
### Menu
```
// Menu - Console Autocompletion
Menu.TextColor "80 80 80 255"
Menu.BgColor "233 233 233 255"
Menu.ArmedTextColor "White"
Menu.ArmedBgColor "132 183 241 255"
Menu.TextInset "6"
```
### Panels
```
//Panel.FgColor "UNKNOWN"
Panel.BgColor "108 111 114 0" // Fun Fact Changing this Fills the entire screen with this color, dont know why this value works but it does.
```
### ProgressBar
```
// Progress Bar Used When Joining a Server
ProgressBar.FgColor "White" // The White Boxes that Fill Up
ProgressBar.BgColor "TransparentBlack" // The Background
```
### PropertySheet
```
// PropertySheet - Main Parts of the Options Menu
PropertySheet.TextColor "10 10 10 200" // Default Text
PropertySheet.SelectedTextColor "10 10 10 255" // Text Color for Currently Slected Tab
//PropertySheet.SelectedBgColor "UNKNOWN"
PropertySheet.TransitionEffectTime "0.25" // time to change from one tab to another
//PropertySheet.BgColor "UNKNOWN"
```
### Radio Button
Could Not Locate
```
//RadioButton.TextColor "OffWhite"
//RadioButton.SelectedTextColor "White"
```
### RichText
```
// Console Text
RichText.TextColor "OffWhite" // Default Text Color
RichText.BgColor "TransparentBlack" // Background for the Text Area
RichText.SelectedTextColor "White" // Text Color when highlighted
RichText.SelectedBgColor "0 168 255 204" // Background Color for selected text characters
```
### ScrollBar
```
// Scrollbar
ScrollBar.Wide 15
// Scrollbar Up and Down Buttons (Console)
ScrollBarButton.FgColor "60 60 60 255" // Color of Arrows
ScrollBarButton.BgColor "207 207 207 255" // Background of Buttons
ScrollBarButton.ArmedFgColor "20 65 72 255" // Hover Text Color
ScrollBarButton.ArmedBgColor "210 237 255 255" // Hover Background Color
ScrollBarButton.DepressedFgColor "9 119 226 255" // Clicked Text Color
ScrollBarButton.DepressedBgColor "31 207 248 255" // Clicked Background
// Scrollbar Track and Grip
ScrollBarSlider.FgColor "220 220 220 255" // Slider Grip Color
ScrollBarSlider.BgColor "184 184 184 229" // Sliders Track Color
```
### SectionedListPanel
```
// Options --> KeyBoard
SectionedListPanel.HeaderTextColor "50 50 50 255" // Header Text Color
SectionedListPanel.HeaderBgColor "Blank" // Header Background Color
SectionedListPanel.DividerColor "0 0 0 150" // Divider Color
//SectionedListPanel.TextColor "UNKNOWN"
SectionedListPanel.BrightTextColor "40 40 40 255" // Text Color of Each Item in List
SectionedListPanel.BgColor "White" // Background of Entire Element
SectionedListPanel.SelectedTextColor "White" // Color of Selected Text
SectionedListPanel.SelectedBgColor "0 168 255 204" // Color of Selected Text Background
SectionedListPanel.OutOfFocusSelectedTextColor "Black" // Selected Text Color When Out of Focus
SectionedListPanel.OutOfFocusSelectedBgColor "132 183 241 100" // Background of Selected Text When out of Focus
```
### Slider
```
// Slider - Numerical Range Selector Thing
Slider.NobColor "220 220 220 255" // Color of The Thing you Grab
Slider.TextColor "180 180 180 255" // Text and Markers Below Element
Slider.TrackColor "184 184 184 229" // Track Color
Slider.DisabledTextColor1 "110 110 110 255" // Accent Color of Disabled Markers
Slider.DisabledTextColor2 "50 50 50 255" // Main Color of Disabled Markers
```
### Text Entry
```
// Text Entry
TextEntry.TextColor "10 10 10 255" // Default Text Color
TextEntry.BgColor "White" // Default Background Color
TextEntry.CursorColor "10 10 10 255" // Blinking Cursor Color
TextEntry.DisabledTextColor "128 128 128 255" // Disabled Text Color
TextEntry.DisabledBgColor "192 192 192 255" // Disabled Background Color
TextEntry.SelectedTextColor "10 10 10 255" // Selected Text Color
TextEntry.SelectedBgColor "0 168 255 204" // Selected Background Color
TextEntry.OutOfFocusSelectedBgColor "132 183 241 100" // Out of Focus Background Color
TextEntry.FocusEdgeColor "UNKNOWN"
```
### ToggleButton
Could Not Locate
```
// UNKNOWN
//ToggleButton.SelectedTextColor "UNKOWN"
```
### ToolTip
```
// ToolTip
Tooltip.TextColor "110 102 60 255" // Color of Text in Popup Tooltip
Tooltip.BgColor "249 238 181 255" // Color of Background in Popup Tooltip
```
### Rest of section (Unable to identify)
```
// UNKNOWN
//TreeView.BgColor "TransparentBlack"
// UNKNOWN
//WizardSubPanel.BgColor "Blank"
// scheme-specific colors
// UNKNOWN
//MainMenu.TextColor "White"
//MainMenu.ArmedTextColor "200 200 200 255"
//MainMenu.DepressedTextColor "192 186 80 255"
//MainMenu.MenuItemHeight "30"
//MainMenu.Inset "32"
//MainMenu.Backdrop "0 0 0 156"
// UNKNOWN
//Console.TextColor "OffWhite"
//Console.DevTextColor "White"
// UNKNOWN
//NewGame.TextColor "White"
//NewGame.FillColor "Black"
//NewGame.SelectionColor "Orange"
//NewGame.DisabledColor "128 128 128 196"
// UNKNOWN
//"QuickListBGDeselected" "AchievementsDarkGrey"
//"QuickListBGSelected" "AchievementsLightGrey"
```
# BitmapFontFiles
Contains a singular special bitmap font used by the UI buttons.
Source:
```
// Bitmap Fonts are ****VERY*** expensive static memory resources so they are purposely sparse
BitmapFontFiles
{
// UI buttons, custom font, (256x64)
"Buttons" "materials/vgui/fonts/buttons_32.vbf"
}
```
# Fonts
This is where all the fonts on <page>Default Fonts</page> are created. We strongly advise against changing the default ones in any way as some addons may use these. However you could potentially add your own for your own `SourceScheme.res` Modifications, like changing the font of the console.
# Borders
<validate> These keys have not been tested at the writing of this page. Although they should be relatively self explanatory. </validate>
# Custom Font Files
Description provided in code
Source:
```
// specifies all the custom (non-system) font files that need to be loaded to service the above described fonts
CustomFontFiles
{
"1" "resource/HALFLIFE2.ttf"
"2" "resource/HL2EP2.ttf"
"3" "resource/marlett.ttf"
}
```