Skip to content

Commit

Permalink
Add an option to have a factional UI font color
Browse files Browse the repository at this point in the history
Can change both in lobby (settings) and ingame (options)
  • Loading branch information
TheKeyBlue authored and aeoncleanse committed Jun 16, 2017
1 parent fa0e77a commit 145e433
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 5 deletions.
3 changes: 3 additions & 0 deletions loc/CZ/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
Objective="Úkol"
Ops="Operační"
Ops_Choir_010_010="[{i Choir}]: Civilní budovy pod útokem!"
Expand Down Expand Up @@ -5206,6 +5208,7 @@ lobui_0407="Concept Art"
lobui_0408="Snímek obrazovky"
lobui_0409="Mapa"
lobui_0410="None"
lobui_0411="Faction Font Color"
lobui_0412="Co je nového na FAF?"
lobui_0413="Stát"
lobui_0414="%d Stavebních Omezení"
Expand Down
3 changes: 3 additions & 0 deletions loc/DE/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
Objective="Ziel"
Ops="Ops"
Ops_Choir_010_010="[{i Choir}]: Zivile Gebäude werden angegriffen!"
Expand Down Expand Up @@ -4969,6 +4971,7 @@ lobui_0407="Illustration"
lobui_0408="Screenshot"
lobui_0409="Karte"
lobui_0410="Keine"
lobui_0411="Faction Font Color"
lobui_0412="Was is neu in der FAF?"
lobui_0413="Land"
lobui_0414="%d Bau Einschränkung"
Expand Down
3 changes: 3 additions & 0 deletions loc/ES/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0275="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
Objective="Objetivo"
Ops="Ops"
Ops_Choir_010_010="[{i Choir}]: ¡Edificios civiles atacados!"
Expand Down Expand Up @@ -5139,6 +5141,7 @@ lobui_0407="Arte Conceptual"
lobui_0408="Captura de pantalla"
lobui_0409="Mapa"
lobui_0410="Ninguno"
lobui_0411="Faction Font Color"
lobui_0412="¿Qué hay de nuevo en el Lobby?"
lobui_0413="País"
lobui_0414="%d Restricciones de construcción"
Expand Down
3 changes: 3 additions & 0 deletions loc/FR/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5126,6 +5126,7 @@ lobui_0402="Windowed Mode"
lobui_0403="Lobby is windowed until launch"
lobui_0404="Chat Font Size:"
lobui_0405="Lobby Background"
lobui_0411="Faction Font Color"

# Lobby background options
lobui_0406="Factions"
Expand Down Expand Up @@ -7816,6 +7817,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
lobui_0414 = "%d Build Restrictions"
lobui_0415 = "1 Build Restriction"
lobui_0416 = "Check Unit Manager"
Expand Down
3 changes: 3 additions & 0 deletions loc/IT/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5126,6 +5126,7 @@ lobui_0402="Windowed Mode"
lobui_0403="Lobby is windowed until launch"
lobui_0404="Chat Font Size:"
lobui_0405="Lobby Background"
lobui_0411="Faction Font Color"

# Lobby background options
lobui_0406="Factions"
Expand Down Expand Up @@ -7816,6 +7817,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
lobui_0414 = "%d restrizioni alle costruzioni"
lobui_0415 = "1 restrizione alle costruzioni"
lobui_0416 = "controlla la gestione delle unità"
Expand Down
3 changes: 3 additions & 0 deletions loc/PL/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
Objective="Cel"
Ops="Operacje"
Ops_Choir_010_010="[{i Choir}]: Budynki cywilne są atakowane!"
Expand Down Expand Up @@ -5205,6 +5207,7 @@ lobui_0407="Concept Art"
lobui_0408="Screenshot"
lobui_0409="Map"
lobui_0410="None"
lobui_0411="Faction Font Color"
lobui_0412="What's new to FAF?"
lobui_0413="Country"
lobui_0414="%d Build Restrictions"
Expand Down
3 changes: 3 additions & 0 deletions loc/RU/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4905,6 +4905,7 @@ lobui_0394="Случайный выбор жульнического ИИ"
lobui_0395="ИИ: Случайный"
lobui_0396="Неизвестная команда: %s"

lobui_0411="Faction Font Color"
# Lobby changelog panel
lobui_0412="Что нового в FAF?"

Expand Down Expand Up @@ -7978,6 +7979,8 @@ OPTIONS_0275="Максимальное количество полей с вос
OPTIONS_0276="При отображении полей с количеством восстановленой материи, будет показано полей не больше чем это число"
OPTIONS_0277="Минимальное количество массы восстанавливаемой материи"
OPTIONS_0278="При отображении поля с количеством восстановленой материи, объекты с массой материи меньше, чем эта - не будут включены"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"

restricted_units_data_0016 = "Боевые единицы на воздушной подушке недоступны"
restricted_units_data_0030 = "Воздушные боевые единицы ТУ3 недоступны"
Expand Down
3 changes: 3 additions & 0 deletions loc/TZM/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5121,6 +5121,7 @@ lobui_0402="Windowed Mode"
lobui_0403="Lobby is windowed until launch"
lobui_0404="Chat Font Size:"
lobui_0405="Lobby Background"
lobui_0411="Faction Font Color"

# Lobby background options
lobui_0406="Tiɣusal"
Expand Down Expand Up @@ -7798,6 +7799,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
lobui_0414 = "%d Build Restrictions"
lobui_0415 = "1 Build Restriction"
lobui_0416 = "Check Unit Manager"
Expand Down
3 changes: 3 additions & 0 deletions loc/US/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4363,6 +4363,7 @@ lobui_0402="Windowed Mode"
lobui_0403="Lobby is windowed until launch"
lobui_0404="Chat Font Size:"
lobui_0405="Lobby Background"
lobui_0411="Faction Font Color"

# Lobby background options
lobui_0406="Factions"
Expand Down Expand Up @@ -7026,6 +7027,8 @@ OPTIONS_0275="Maximum Reclaim Label Count"
OPTIONS_0276="When showing the reclaim label overlay, no more than this many labels will be shown"
OPTIONS_0277="Minimum Reclaim Label Amount"
OPTIONS_0278="When showing the reclaim label overlay, items with mass values less than this won't be shown"
OPTIONS_0279="Use Factional UI Font Color"
OPTIONS_0280="When on, the UI font color will change to match the faction you are playing"
lobui_0414 = "%d Build Restrictions"
lobui_0415 = "1 Build Restriction"
lobui_0416 = "Check Unit Manager"
Expand Down
15 changes: 15 additions & 0 deletions lua/options/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,21 @@ options = {
},
},
},
{
title = "<LOC OPTIONS_0213>Use Factional UI Font Color",
key = 'faction_font_color',
type = 'toggle',
default = true,
set = function(key,value,startup)
import('/lua/ui/uiutil.lua').UpdateCurrentSkin({faction_font_color = value})
end,
custom = {
states = {
{text = "<LOC _On>", key = true},
{text = "<LOC _Off>", key = false},
},
},
},
{
title = "<LOC OPTIONS_0226>Enable Cycle Preview for Hotbuild",
key = 'hotbuild_cycle_preview',
Expand Down
9 changes: 6 additions & 3 deletions lua/skins/skins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ skins = {
imagerMeshDetails = "/meshes/game/map-border_squ_aeon_a_mesh",
imagerMeshHorz = "/meshes/game/map-border_hor_aeon_mesh",
imagerMeshDetailsHorz = "/meshes/game/map-border_hor_aeon_a_mesh",
bodyColor = "FFc7e98a", --#FFc7e98a
bodyColor = "FF18d606", --#FFc7e98a
factionTextColor = "FF34CB0B", --#FF34CB0B
factionBackColor = "FF31AB10", --#FF31AB10
factionFontOverColor = "FFa4ff00", --#FFa4ff00
Expand All @@ -40,6 +40,7 @@ skins = {
dialogColumnColor = "FF6FAFAF", --#FF6FAFAF
dialogButtonColor = "FF69AB4D", --#FF69AB4D
dialogButtonFont = "Zeroes Three",
fontColor = "FFc7e98a",
highlightColor = "FF7FA8A4", --#FF7FA8A4
disabledColor = "FF3b5511", --#FF3b5511
tooltipBorderColor = "FF609541", --#FF609541
Expand All @@ -50,7 +51,7 @@ skins = {
texturesPath = "/textures/ui/cybran",
imagerMesh = "/meshes/game/map-border_squ_cybran_mesh",
imagerMeshHorz = "/meshes/game/map-border_hor_cybran_mesh",
bodyColor = "FFe24f2d", --#FFe24f2d
bodyColor = "FFb00101", --#FFe24f2d
factionTextColor = "FFF43B1F", --#FFDC1F02
factionBackColor = "FFBE2912", --#FFBE2912
factionFontOverColor = "FFff0000", --#FFff0000
Expand All @@ -59,6 +60,7 @@ skins = {
dialogColumnColor = "FF6FAFAF", --#FF6FAFAF
dialogButtonColor = "FF69AB4D", --#FF69AB4D
dialogButtonFont = "Zeroes Three",
fontColor = "FFe24f2d",
highlightColor = "FF7FA8A4", --#FF7FA8A4
disabledColor = "FF640505", --#FF640505
tooltipBorderColor = "FFb62929", --#FFb62929
Expand All @@ -71,7 +73,7 @@ skins = {
imagerMeshDetails = "/meshes/game/map-border_squ_sera_a_mesh",
imagerMeshHorz = "/meshes/game/map-border_hor_sera_mesh",
imagerMeshDetailsHorz = "/meshes/game/map-border_hor_sera_a_mesh",
bodyColor = "FFffd700", --#FFffd700
bodyColor = "FF927b00", --#FFffd700
factionTextColor = "FFCBA21C", --#FFCBA21C
factionBackColor = "FFB08A0D", --#FFB08A0D
factionFontOverColor = "FFfffe84",--#FFfffe84
Expand All @@ -80,6 +82,7 @@ skins = {
dialogColumnColor = "FF6FAFAF", --#FF6FAFAF
dialogButtonColor = "FF69AB4D", --#FF69AB4D
dialogButtonFont = "Zeroes Three",
fontColor = "FFffd700",
highlightColor = "FF7FA8A4", --#FF7FA8A4
disabledColor = "FF685f16", --#FF685f16
tooltipBorderColor = "FFeee274", --#FFeee274
Expand Down
4 changes: 4 additions & 0 deletions lua/ui/help/tooltips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,10 @@ Tooltips = {
title = "<LOC OPTIONS_0211>Use Factional UI Skin",
description = "<LOC OPTIONS_0220>When on, the UI skin will change to match the faction you are playing",
},
options_faction_font_color = {
title = "<LOC OPTIONS_0279>Use Factional UI Font Color",
description = "<LOC OPTIONS_0280>When on, the UI font color will change to match the faction you are playing",
},
options_hotbuild_cycle_preview = {
title = "<LOC OPTIONS_0247>Enable Cycle Preview for Hotbuild",
description = "<LOC OPTIONS_0248>When on, you can cycle the Hotbuild preview",
Expand Down
14 changes: 14 additions & 0 deletions lua/ui/lobby/lobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5126,6 +5126,17 @@ function ShowLobbyOptionsDialog()
end
RefreshLobbyBackground()
end

local cbox_FactionFontColor = UIUtil.CreateCheckbox(dialogContent, '/CHECKBOX/', LOC("<LOC lobui_0411>Faction Font Color"))
LayoutHelpers.AtRightTopIn(cbox_FactionFontColor, dialogContent, 20, 94)
cbox_FactionFontColor.OnCheck = function(self, checked)
if checked then
Prefs.SetOption('faction_font_color', true)
else
Prefs.SetOption('faction_font_color', false)
end
UIUtil.UpdateCurrentSkin()
end
-- Quit button
local QuitButton = UIUtil.CreateButtonWithDropshadow(dialogContent, '/BUTTON/medium/', LOC("<LOC _Close>Close"))
LayoutHelpers.AtHorizontalCenterIn(QuitButton, dialogContent, 0)
Expand All @@ -5144,6 +5155,9 @@ function ShowLobbyOptionsDialog()
--
local LobbyBackgroundStretch = Prefs.GetFromCurrentProfile('LobbyBackgroundStretch') or 'true'
cbox_StretchBG:SetCheck(LobbyBackgroundStretch == 'true', true)
--
local FactionFontColor = Prefs.GetOption('faction_font_color')
cbox_FactionFontColor:SetCheck(FactionFontColor, true)
end

-- Load and return the current list of presets from persistent storage.
Expand Down
12 changes: 10 additions & 2 deletions lua/ui/uiutil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function UpdateWorldBorderState(skin, isOn)
end

--* skin control, sets the current skin table
function SetCurrentSkin(skin)
function SetCurrentSkin(skin, overrideTable)
local skinTable = skins[skin]
if not skinTable then
skin = 'uef'
Expand All @@ -265,7 +265,11 @@ function SetCurrentSkin(skin)
bodyColor:Set(skinTable.bodyColor)
factionTextColor:Set(skinTable.factionTextColor)
factionBackColor:Set(skinTable.factionBackColor)
fontColor:Set(skinTable.fontColor)
if (overrideTable.faction_font_color == nil and Prefs.GetOption('faction_font_color')) or overrideTable.faction_font_color then
fontColor:Set(skinTable.fontColor)
else
fontColor:Set(skins["default"].fontColor)
end
fontOverColor:Set(skinTable.fontOverColor)
fontDownColor:Set(skinTable.fontDownColor)
dialogCaptionColor:Set(skinTable.dialogCaptionColor)
Expand Down Expand Up @@ -305,6 +309,10 @@ function SetCurrentSkin(skin)
Prefs.SetToCurrentProfile("skin", skin)
end

function UpdateCurrentSkin(overrideTable)
SetCurrentSkin(currentSkin(), overrideTable)
end

--* cycle through all available skins
function RotateSkin(direction)
if not SessionIsActive() or import('/lua/ui/game/gamemain.lua').IsNISMode() then
Expand Down

0 comments on commit 145e433

Please sign in to comment.