Skip to content
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
47 changes: 47 additions & 0 deletions mods/ReUI.GW/Main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ReUI.Require
{
"ReUI.Core >= 1.5.0",
"ReUI.Options >= 1.0.0"
}

function Main(isReplay)

local function IsGalacticWar()
if not exists('/lua/ui/gw/ranks.lua') then
return false
end
local ok, module = pcall(import, '/lua/ui/gw/ranks.lua')
if not ok then
return false
end

return true
end

if not IsGalacticWar() then
return
end

local options = ReUI.Options.Mods["ReUI.GW"]

local Score = ReUI.Exists "ReUI.Score < 1.3.0" --[[@as ReUI.Score?]]
if Score then
local Ranks = import("/lua/ui/gw/ranks.lua")
local data = import("/mods/ReUI.Score/Modules/Utils.lua").GetArmiesFormattedTable()
local sessionInfo = SessionGetScenarioInfo()
local ranks = sessionInfo.Options.Ranks


for _, army in ipairs(data) do
local nickname = army.nickname
local rank = ranks[nickname] or 1
army.rating = rank
local rankName = Ranks.GetRankName(army.faction, rank)
if rankName and options.displayRankNames() then
army.name = ("[%s] %s"):format(rankName, nickname)
end
end

end

end
6 changes: 6 additions & 0 deletions mods/ReUI.GW/ModuleMeta.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---@meta


---@class ReUI.GW : ReUI.Module
ReUI.GW = {}

14 changes: 14 additions & 0 deletions mods/ReUI.GW/Options.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local Opt = ReUI.Options.Opt
ReUI.Options.Mods["ReUI.GW"] = {
displayRankNames = Opt(true),
}

function Main(isReplay)
local Options = ReUI.Options.Builder
local options = ReUI.Options.Mods["ReUI.GW"]

Options.AddOptions("ReUI.GW", "ReUI.GW", {
Options.Filter("Display rank names", options.displayRankNames, 4),
})

end
22 changes: 22 additions & 0 deletions mods/ReUI.GW/mod_info.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name = "ReUI.GW"
uid = "reui-gw-1.0.0"
version = 1
copyright = ""
description = [[Check on Github and official Discord server for mode details.
https://github.com/4z0t/FAF-UI-Mods
https://discord.gg/UZeAEXHV
]]
author = "4z0t"
icon = "/mods/ReUI.GW/icon.png"
url = "https://github.com/4z0t/FAF-UI-Mods"
selectable = true
enabled = true
exclusive = false
ui_only = true
requires = {}
requiresNames = {}
conflicts = {}
before = {}
after = {}

ReUI = 'ReUI.GW=1.0.0'