Apply auto formatting to all source files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
-- Copyright 2023 <omicron.me@protonmail.com>
|
||||
--
|
||||
-- This file is part of Omicron Frames
|
||||
--
|
||||
--
|
||||
-- Omicron Frames is free software: you can redistribute it and/or modify it
|
||||
-- under the terms of the GNU General Public License as published by the Free
|
||||
-- Software Foundation, either version 3 of the License, or (at your option)
|
||||
@@ -13,7 +13,7 @@
|
||||
-- more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License along with
|
||||
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
|
||||
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
|
||||
local omi = select(2, ...)
|
||||
local types = omi.GetModule("types")
|
||||
local UnitGroup = types.CreateClass("UnitGroup")
|
||||
@@ -38,7 +38,7 @@ local function UnitFrameDefaultCompare(lhs, rhs)
|
||||
end
|
||||
|
||||
local lunit, runit = lhs.unit, rhs.unit
|
||||
|
||||
|
||||
-- players < non-players
|
||||
local player = UnitIsPlayer(lunit)
|
||||
if UnitIsPlayer(lunit) ~= UnitIsPlayer(runit) then
|
||||
@@ -50,16 +50,16 @@ local function UnitFrameDefaultCompare(lhs, rhs)
|
||||
if UnitIsUnit(lunit, "player") ~= UnitIsUnit(runit, "player") then
|
||||
return UnitIsUnit(lunit, "player")
|
||||
end
|
||||
|
||||
|
||||
-- tank < healer < damage < ?
|
||||
local lrole = RoleValue(UnitGroupRolesAssigned(lunit))
|
||||
local rrole = RoleValue(UnitGroupRolesAssigned(runit))
|
||||
|
||||
|
||||
if lrole ~= rrole then
|
||||
return lrole < rrole
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return lunit < runit
|
||||
end
|
||||
|
||||
@@ -121,14 +121,14 @@ function UnitGroup:Sort()
|
||||
table.sort(self.units, UnitFrameDefaultCompare)
|
||||
local left, top, width, height = self.left, self.top, self.width, self.height
|
||||
local maxFrameIndex = #self.units
|
||||
for y=0,5 do
|
||||
for x=0,4 do
|
||||
local num = y*5 + x + 1
|
||||
for y = 0, 5 do
|
||||
for x = 0, 4 do
|
||||
local num = y * 5 + x + 1
|
||||
if num > maxFrameIndex then
|
||||
return
|
||||
end
|
||||
local frame = self.units[num]
|
||||
frame:SetPosition(left + (x-2)*width, top - y*height)
|
||||
frame:SetPosition(left + (x - 2) * width, top - y * height)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user