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
14 changes: 11 additions & 3 deletions mods/RFA/RFA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ function Main(isReplay)

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

---@param key string
local function IsPreviewKeyDown(key)
if key == "EITHER" then
return IsKeyDown("Shift") or IsKeyDown("Control")
end
return IsKeyDown(key)
end

local Enumerate = ReUI.LINQ.Enumerate
local IPairsEnumerator = ReUI.LINQ.IPairsEnumerator
local PairsEnumerator = ReUI.LINQ.PairsEnumerator
Expand Down Expand Up @@ -797,22 +805,22 @@ function Main(isReplay)
local notIssuingOrder = not commandMode[2]
self._isCachedSelection = false

if IsKeyDown(self.HoverPreviewKey) and notIssuingOrder then
if IsPreviewKeyDown(self.HoverPreviewKey) and notIssuingOrder then
self:UpdateHoverRings()
else
self:ClearHoverRings()
end

if notIssuingOrder or givingMoveOrder then
if IsKeyDown(self.SelectedPreviewKey) then
if IsPreviewKeyDown(self.SelectedPreviewKey) then
self:UpdateSelectionRings()
else
self:ClearSelectionRings()
end

if IsKeyDown(18) then --alt
self:UpdateReclaimRings()
elseif IsKeyDown(self.BuildPreviewKey) then
elseif IsPreviewKeyDown(self.BuildPreviewKey) then
self:UpdateBuildRings(true)
else
self:ClearBuildRings()
Expand Down
8 changes: 4 additions & 4 deletions mods/RFA/mod_info.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Rings For All"
uid = "rings-for-all-v1.0.0"
version = 6
uid = "rings-for-all-v1.1.0"
version = 7
copyright = ""
description = [[
Shows radiuses of weapons of selected units and build range. Also shows them with unit under mouse.
See options for mod in ReUI.Options menu!

]]
author = "4z0t, Nomander"
author = "4z0t, Nomander, HotCheese"
icon = "/mods/RFA/icon.png"
url = ""
selectable = true
Expand All @@ -20,4 +20,4 @@ conflicts = {}
before = {}
after = {}

ReUI = 'RFA=1.0.0'
ReUI = 'RFA=1.1.0'
9 changes: 6 additions & 3 deletions mods/RFA/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ function Main()
Options.Strings("Hover Preview key",
{
"SHIFT",
"CONTROL"
"CONTROL",
"EITHER"
},
options.hoverPreviewKey),
Options.Strings("Selected Preview key",
{
"SHIFT",
"CONTROL"
"CONTROL",
"EITHER"
},
options.selectedPreviewKey),
Options.Filter("Show range rings in minimap", options.showInMinimap, 4),
Expand All @@ -47,7 +49,8 @@ function Main()
Options.Strings("Build Preview key",
{
"SHIFT",
"CONTROL"
"CONTROL",
"EITHER"
},
options.buildPreviewKey),
})
Expand Down