Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization Support For Crosshair Setup #2148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions garrysmod/lua/menu/crosshair_setup.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

local crosshair_sliders = {
{ title = "Style", cvar = "cl_crosshairstyle", values = { ["0"] = "Half-Life 2", ["1"] = "Dot Image", ["2"] = "Classic" } },
{ title = "Gap", cvar = "cl_crosshairgap", min = 0, max = 200 },
{ title = "Size", cvar = "cl_crosshairsize", min = 0, max = 200 },
{ title = "Thickness", cvar = "cl_crosshairthickness", min = 0, max = 200 },
{ title = "Dot", cvar = "cl_crosshairdot" },
{ title = "T-Style", cvar = "cl_crosshair_t" },
{ title = "Use Alpha", cvar = "cl_crosshairusealpha" },
{ title = "Quick Info", cvar = "hud_quickinfo" },
{ title = "Outline", cvar = "cl_crosshair_drawoutline" },
{ title = "Outline Thickness", cvar = "cl_crosshair_outlinethickness", min = 0.1, max = 3 },
{ title = "Style", cvar = "cl_crosshairstyle", values = { ["0"] = "#option_crosshair.style_hl2", ["1"] = "#option_crosshair.style_dot", ["2"] = "#option_crosshair.style_classic" } },
{ title = "#option_crosshair.gap", cvar = "cl_crosshairgap", min = 0, max = 200 },
{ title = "#option_crosshair.size", cvar = "cl_crosshairsize", min = 0, max = 200 },
{ title = "#option_crosshair.thickness", cvar = "cl_crosshairthickness", min = 0, max = 200 },
{ title = "#option_crosshair.dot", cvar = "cl_crosshairdot" },
{ title = "#option_crosshair.t_style", cvar = "cl_crosshair_t" },
{ title = "#option_crosshair.alpha", cvar = "cl_crosshairusealpha" },
{ title = "#option_crosshair.quick_info", cvar = "hud_quickinfo" },
{ title = "#option_crosshair.outline", cvar = "cl_crosshair_drawoutline" },
{ title = "#option_crosshair.outline_thickness", cvar = "cl_crosshair_outlinethickness", min = 0.1, max = 3 },
}

local function GetCrosshairColor()
Expand Down Expand Up @@ -95,7 +95,7 @@ concommand.Add( "crosshair_setup", function()
local frame = vgui.Create( "DFrame" )
frame:SetSize( 600, 480 )
frame:Center()
frame:SetTitle( "Default Crosshair Setup" )
frame:SetTitle( "#option_crosshair.title" )
frame:MakePopup()

local crosshairMat = Material( "gui/crosshair.png" )
Expand Down Expand Up @@ -137,10 +137,10 @@ concommand.Add( "crosshair_setup", function()
local img1btn = vgui.Create( "DButton", previewBtns )
img1btn:Dock( LEFT )
img1btn:SetWide( 320 / 2 )
img1btn:SetText( "Preview 1" )
img1btn:SetText( "#option_crosshair.preview_1" )
img1btn.DoClick = function() preview:SetImage( "gui/crosshair_bg.png" ) end
local img2btn = vgui.Create( "DButton", previewBtns )
img2btn:SetText( "Preview 2" )
img2btn:SetText( "#option_crosshair.preview_2" )
img2btn.DoClick = function() preview:SetImage( "gui/crosshair_bg2.png" ) end
img2btn:Dock( FILL )

Expand Down Expand Up @@ -204,7 +204,7 @@ concommand.Add( "crosshair_setup", function()
mixer:SetColor( color_white ) -- hack
HideUselessStuff()
end
resetCrosshair:SetText( "Reset Crosshair" )
resetCrosshair:SetText( "#option_crosshair.reset_crosshair" )
resetCrosshair:Dock( BOTTOM )

end )
16 changes: 16 additions & 0 deletions garrysmod/resource/localization/en/main_menu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,19 @@ ugc_upload.tag_scenes_save=Scene / Pose
ugc_upload.tag_courses=Course
ugc_upload.tag_posed=Pose / Ragdoll

option_crosshair.title=Default Crosshair Setup
option_crosshair.style_hl2=Half-Life 2
option_crosshair.style_dot=Dot Image
option_crosshair.style_classic=Classic
option_crosshair.gap=Gap
option_crosshair.size=Size
option_crosshair.thickness=Thickness
option_crosshair.dot=Dot
option_crosshair.t_style=T-Style
option_crosshair.alpha=Use Alpha
option_crosshair.quick_info=Quick Info
option_crosshair.outline=Outline
option_crosshair.outline_thickness=Outline Thickness
option_crosshair.preview_1=Preview 1
option_crosshair.preview_2=Preview 2
option_crosshair.reset_crosshair=Reset Crosshair