Garry's Mod

Garry's Mod

[CW2] Advanced UI Upgrade
 This topic has been pinned, so it's probably important
Moka  [developer] 7 Dec, 2020 @ 2:22pm
Info for CW2 Weapon Creators
GUIDE
This guide will hopefully explain what everything does that has been introduced in this addon, and how you, as a content creator, can use it to further customize your CW2 weapons.

NOTE
Everything here begins with "SWEP." in the LUA files.

Headers
These are the headers, or backgrounds, for the customization menu.

CusMenuHeaderGradient
The header gradient behind the attachment name.
Must be placed in a CLIENT format.

CusMenuDescGradient
The header gradient behind the attachment descriptions.
This scales automatically.
Must be placed in a CLIENT format.

CusMenuGradientTrivia
The header gradient behind the trivia tab.
Must be placed in a CLIENT format.

CusMenuHeaderPos
The position of the header. Uses an X and Y position.

CusMenuHeaderSize
The size of the header. Uses an X and Y position.

CusMenuHeaderCol
The colour of the header.
Uses R, G, B and Alpha values.

Example:
if CLIENT then
local headergradient = surface.GetTextureID("mwr_icons/gradient/header")
local descgradient = surface.GetTextureID("mwr_icons/gradient/desc")
local triviagradient = surface.GetTextureID("mwr_icons/gradient/desc")

SWEP.CusMenuHeaderGradient = headergradient
SWEP.CusMenuDescGradient = descgradient
SWEP.CusMenuGradientTrivia = triviagradient
end

SWEP.CusMenuHeaderPos = {X = -8, Y = -3}
SWEP.CusMenuHeaderSize = {X = 975, Y = 175}
SWEP.CusMenuHeaderCol = {R = 0, G = 0, B = 0, Alpha = 200}

Att. Name Text
Everything related to the attachment's display name.

CusMenuAttNameFont
The font it uses.

CusMenuAttNamePos
The position it uses. Uses an X and Y position.

CusMenuAttNameCol
Which color the text should be.

CusMenuAttNameAlignment
How it should be aligned. Written with "TEXT_ALIGN_" and "LEFT", "CENTER" or "RIGHT".

CusMenuAttNameShortPos
The position for the short name. Uses an X and Y position.

CusMenuAttNameShortAlignment
Same as above, but for the short name.

Example:
SWEP.CusMenuAttNameFont = "CW_HUD36"
SWEP.CusMenuAttNamePos = {X = -1, Y = -20}
SWEP.CusMenuAttNameCol = CustomizableWeaponry.textColors.REGULAR
SWEP.CusMenuAttNameAlignment = {X = TEXT_ALIGN_LEFT, Y = TEXT_ALIGN_CENTER}

SWEP.CusMenuAttNameShortPos = {X = 0, Y = 0}
SWEP.CusMenuAttNameShortAlignment = {X = TEXT_ALIGN_LEFT, Y = TEXT_ALIGN_CENTER}

Att. Category Text
Everything related to the attachment category display text.

CusMenuAttCategoryFont
The font it uses.

CusMenuAttCategoryPos
The position it uses. Uses an X and Y position.

CusMenuAttCategoryAlignment
How it should be aligned.
Written with "TEXT_ALIGN_" and "LEFT", "CENTER" or "RIGHT".

CusMenuAttNameSeperateFromBind
If the keybind (ex. "1") should be seperate from the category name.

CusMenuAttCategoryNameFont
The font it uses.
Requires CusMenuAttNameSeperateFromBind.

CusMenuAttCategoryNamePos
The position it uses. Uses an X and Y position.
Requires CusMenuAttNameSeperateFromBind.

CusMenuAttCategoryNameAlignment
How it should be aligned.
Written with "TEXT_ALIGN_" and "LEFT", "CENTER" or "RIGHT".
Requires CusMenuAttNameSeperateFromBind.

Example:
SWEP.CusMenuAttCategoryFont = "CW_HUD48"
SWEP.CusMenuAttCategoryPos = {X = 0, Y = 20}
SWEP.CusMenuAttCategoryAlignment = {X = TEXT_ALIGN_LEFT, Y = TEXT_ALIGN_CENTER}

SWEP.CusMenuAttNameSeperateFromBind = false

SWEP.CusMenuAttCategoryNameFont = "CW_HUD48"
SWEP.CusMenuAttCategoryNamePos = {X = 400, Y = 20}
SWEP.CusMenuAttCategoryNameAlignment = {X = TEXT_ALIGN_LEFT, Y = TEXT_ALIGN_CENTER}

Att. Description
Everything related the the attachment descriptions.

CusMenuDescPos
The position of the desc. header. Uses an X and Y position.

CusMenuDescSize
The size of the desc. header. Uses an X and Y position.

CusMenuDescCol
The colour of the desc. header.
Uses R, G, B and Alpha values.

CusMenuDescFont
Which font the desc. text should use.

CusMenuDescTextPos
The position of the desc. text. Uses an X and Y position.

Example:
SWEP.CusMenuDescPos = {X = -5, Y = 175}
SWEP.CusMenuDescSize = {X = 50, Y = 975}
SWEP.CusMenuDescCol = {R = 150, G = 255, B = 150, Alpha = 255}
SWEP.CusMenuDescFont = "CW_HUD38"
SWEP.CusMenuDescTextPos = {X = 1, Y = 185}

Att. Icon
Everything related to the attachment icon and its background.

CusMenuAttIconAlignment
How far apart the att. icons should be.

CusMenuAttIconColAct
The background colour the currently active att. icon.

CusMenuAttIconBG
The background colour of inactive att. icons.

CusMenuAttIconBGLocked
The background colour of unavailable att. icons.

CusMenuAttIconOutline
If the attachment icons should be filled in or have an outline.

CusMenuAttIconOutlineThick
If the outlines should be thicker.
Requires CusMenuAttIconOutline.

CusMenuAttIconOutlineCol
The outline colour of all inactive att. icons.
Requires CusMenuAttIconOutline.

Example:
SWEP.CusMenuAttIconAlignment = 125

SWEP.CusMenuAttIconColAct = {R = 100, G = 255, B = 100, Alpha = 150}
SWEP.CusMenuAttIconOutlineCol = {R = 255, G = 255, B = 255, Alpha = 100}

SWEP.CusMenuAttIconBG = {R = 0, G = 0, B = 0, Alpha = 0}
SWEP.CusMenuAttIconBGLocked = {R = 255, G = 175, B = 175, Alpha = 150}

SWEP.CusMenuAttIconOutline = true
SWEP.CusMenuAttIconOutlineThick = true

Trivia
Everything related to the trivia text.

TriviaTextX
The X position of the text.

TriviaTextY
The Y position of the text.

TriviaFont
The font it uses.

Example:
SWEP.TriviaTextX = 100
SWEP.TriviaTextY = -25
SWEP.TriviaFont = "CW_HUD48"
Last edited by Moka; 7 Dec, 2020 @ 3:10pm
< >
Showing 1-1 of 1 comments
Le Kuen 11 Dec, 2021 @ 12:17am 
nice
< >
Showing 1-1 of 1 comments
Per page: 1530 50