Profiling improvements
contains_comments turns out is a very expensive function for big files...
We do some reorganisation and reduce the reliance on this function. We should try and remove its use completely.
For large files (6MB+), this change makes formatting complete in time :) https://github.com/WeakAuras/WeakAuras2/blob/main/WeakAurasModelPaths/ModelPaths.lua originally did not complete formatting (20min+), but now completes in <=100s.
Still some room for improvements
Codecov Report
Base: 97.64% // Head: 97.61% // Decreases project coverage by -0.02% :warning:
Coverage data is based on head (
579fdda) compared to base (3e3fd03). Patch coverage: 94.87% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## main #591 +/- ##
==========================================
- Coverage 97.64% 97.61% -0.03%
==========================================
Files 14 14
Lines 5595 5615 +20
==========================================
+ Hits 5463 5481 +18
- Misses 132 134 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/formatters/trivia_util.rs | 95.07% <93.10%> (-0.11%) |
:arrow_down: |
| src/formatters/assignment.rs | 97.97% <100.00%> (-0.03%) |
:arrow_down: |
| src/formatters/block.rs | 97.90% <100.00%> (-0.02%) |
:arrow_down: |
| src/formatters/table.rs | 98.72% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Repo Comparison Test
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..9e24393 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -349,126 +349,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)
Repo Comparison Test
diff --git ORI/roact/src/Config.lua ALT/roact/src/Config.lua
index 8d1b3d5..9d91b26 100644
--- ORI/roact/src/Config.lua
+++ ALT/roact/src/Config.lua
@@ -37,10 +37,7 @@ function Config.new()
self._currentConfig = setmetatable({}, {
__index = function(_, key)
- local message = ("Invalid global configuration key %q. Valid configuration keys are: %s"):format(
- tostring(key),
- table.concat(defaultConfigKeys, ", ")
- )
+ local message = ("Invalid global configuration key %q. Valid configuration keys are: %s"):format(tostring(key), table.concat(defaultConfigKeys, ", "))
error(message, 3)
end,
diff --git ORI/neovim/runtime/lua/vim/diagnostic.lua ALT/neovim/runtime/lua/vim/diagnostic.lua
index 98dbe07..bb133b5 100644
--- ORI/neovim/runtime/lua/vim/diagnostic.lua
+++ ALT/neovim/runtime/lua/vim/diagnostic.lua
@@ -956,14 +956,7 @@ M.handlers.underline = {
higroup = underline_highlight_map.Error
end
- vim.highlight.range(
- bufnr,
- underline_ns,
- higroup,
- { diagnostic.lnum, diagnostic.col },
- { diagnostic.end_lnum, diagnostic.end_col },
- { priority = vim.highlight.priorities.diagnostics }
- )
+ vim.highlight.range(bufnr, underline_ns, higroup, { diagnostic.lnum, diagnostic.col }, { diagnostic.end_lnum, diagnostic.end_col }, { priority = vim.highlight.priorities.diagnostics })
end
save_extmarks(underline_ns, bufnr)
end,
@@ -997,10 +990,7 @@ M.handlers.virtual_text = {
if opts.virtual_text.format then
diagnostics = reformat_diagnostics(opts.virtual_text.format, diagnostics)
end
- if
- opts.virtual_text.source
- and (opts.virtual_text.source ~= 'if_many' or count_sources(bufnr) > 1)
- then
+ if opts.virtual_text.source and (opts.virtual_text.source ~= 'if_many' or count_sources(bufnr) > 1) then
diagnostics = prefix_source(diagnostics)
end
if opts.virtual_text.severity then
@@ -1288,9 +1278,7 @@ function M.open_float(opts, ...)
-- LSP servers can send diagnostics with `end_col` past the length of the line
local line_length = #vim.api.nvim_buf_get_lines(bufnr, lnum, lnum + 1, true)[1]
diagnostics = vim.tbl_filter(function(d)
- return d.lnum == lnum
- and math.min(d.col, line_length - 1) <= col
- and (d.end_col >= col or d.end_lnum > lnum)
+ return d.lnum == lnum and math.min(d.col, line_length - 1) <= col and (d.end_col >= col or d.end_lnum > lnum)
end, diagnostics)
end
diff --git ORI/neovim/runtime/lua/vim/lsp.lua ALT/neovim/runtime/lua/vim/lsp.lua
index 22933d8..97b367f 100644
--- ORI/neovim/runtime/lua/vim/lsp.lua
+++ ALT/neovim/runtime/lua/vim/lsp.lua
@@ -1301,13 +1301,7 @@ function lsp.start_client(config)
local mt = {}
mt.__index = function(table, key)
if key == 'resolved_capabilities' then
- vim.notify_once(
- '[LSP] Accessing client.resolved_capabilities is deprecated, '
- .. 'update your plugins or configuration to access client.server_capabilities instead.'
- .. 'The new key/value pairs in server_capabilities directly match those '
- .. 'defined in the language server protocol',
- vim.log.levels.WARN
- )
+ vim.notify_once('[LSP] Accessing client.resolved_capabilities is deprecated, ' .. 'update your plugins or configuration to access client.server_capabilities instead.' .. 'The new key/value pairs in server_capabilities directly match those ' .. 'defined in the language server protocol', vim.log.levels.WARN)
rawset(table, key, protocol._resolve_capabilities_compat(client.server_capabilities))
return rawget(table, key)
else
diff --git ORI/neovim/runtime/lua/vim/lsp/_snippet.lua ALT/neovim/runtime/lua/vim/lsp/_snippet.lua
index 3488639..841dbbe 100644
--- ORI/neovim/runtime/lua/vim/lsp/_snippet.lua
+++ ALT/neovim/runtime/lua/vim/lsp/_snippet.lua
@@ -248,101 +248,45 @@ S.format = P.any(
capture_index = values[3],
}, Node)
end),
- P.map(
- P.seq(
- S.dollar,
- S.open,
- S.int,
- S.colon,
- S.slash,
- P.any(
- P.token('upcase'),
- P.token('downcase'),
- P.token('capitalize'),
- P.token('camelcase'),
- P.token('pascalcase')
- ),
- S.close
- ),
- function(values)
- return setmetatable({
- type = Node.Type.FORMAT,
- capture_index = values[3],
- modifier = values[6],
- }, Node)
- end
- ),
- P.map(
- P.seq(
- S.dollar,
- S.open,
- S.int,
- S.colon,
- P.seq(
- S.question,
- P.opt(P.take_until({ ':' }, { '\\' })),
- S.colon,
- P.opt(P.take_until({ '}' }, { '\\' }))
- ),
- S.close
- ),
- function(values)
- return setmetatable({
- type = Node.Type.FORMAT,
- capture_index = values[3],
- if_text = values[5][2] and values[5][2].esc or '',
- else_text = values[5][4] and values[5][4].esc or '',
- }, Node)
- end
- ),
- P.map(
- P.seq(
- S.dollar,
- S.open,
- S.int,
- S.colon,
- P.seq(S.plus, P.opt(P.take_until({ '}' }, { '\\' }))),
- S.close
- ),
- function(values)
- return setmetatable({
- type = Node.Type.FORMAT,
- capture_index = values[3],
- if_text = values[5][2] and values[5][2].esc or '',
- else_text = '',
- }, Node)
- end
- ),
- P.map(
- P.seq(
- S.dollar,
- S.open,
- S.int,
- S.colon,
- S.minus,
- P.opt(P.take_until({ '}' }, { '\\' })),
- S.close
- ),
- function(values)
- return setmetatable({
- type = Node.Type.FORMAT,
- capture_index = values[3],
- if_text = '',
- else_text = values[6] and values[6].esc or '',
- }, Node)
- end
- ),
- P.map(
- P.seq(S.dollar, S.open, S.int, S.colon, P.opt(P.take_until({ '}' }, { '\\' })), S.close),
- function(values)
- return setmetatable({
- type = Node.Type.FORMAT,
- capture_index = values[3],
- if_text = '',
- else_text = values[5] and values[5].esc or '',
- }, Node)
- end
- )
+ P.map(P.seq(S.dollar, S.open, S.int, S.colon, S.slash, P.any(P.token('upcase'), P.token('downcase'), P.token('capitalize'), P.token('camelcase'), P.token('pascalcase')), S.close), function(values)
+ return setmetatable({
+ type = Node.Type.FORMAT,
+ capture_index = values[3],
+ modifier = values[6],
+ }, Node)
+ end),
+ P.map(P.seq(S.dollar, S.open, S.int, S.colon, P.seq(S.question, P.opt(P.take_until({ ':' }, { '\\' })), S.colon, P.opt(P.take_until({ '}' }, { '\\' }))), S.close), function(values)
+ return setmetatable({
+ type = Node.Type.FORMAT,
+ capture_index = values[3],
+ if_text = values[5][2] and values[5][2].esc or '',
+ else_text = values[5][4] and values[5][4].esc or '',
+ }, Node)
+ end),
+ P.map(P.seq(S.dollar, S.open, S.int, S.colon, P.seq(S.plus, P.opt(P.take_until({ '}' }, { '\\' }))), S.close), function(values)
+ return setmetatable({
+ type = Node.Type.FORMAT,
+ capture_index = values[3],
+ if_text = values[5][2] and values[5][2].esc or '',
+ else_text = '',
+ }, Node)
+ end),
+ P.map(P.seq(S.dollar, S.open, S.int, S.colon, S.minus, P.opt(P.take_until({ '}' }, { '\\' })), S.close), function(values)
+ return setmetatable({
+ type = Node.Type.FORMAT,
+ capture_index = values[3],
+ if_text = '',
+ else_text = values[6] and values[6].esc or '',
+ }, Node)
+ end),
+ P.map(P.seq(S.dollar, S.open, S.int, S.colon, P.opt(P.take_until({ '}' }, { '\\' })), S.close), function(values)
+ return setmetatable({
+ type = Node.Type.FORMAT,
+ capture_index = values[3],
+ if_text = '',
+ else_text = values[5] and values[5].esc or '',
+ }, Node)
+ end)
)
S.transform = P.map(
@@ -454,23 +398,13 @@ S.variable = P.any(
transform = values[4],
}, Node)
end),
- P.map(
- P.seq(
- S.dollar,
- S.open,
- S.var,
- S.colon,
- P.many(P.any(S.toplevel, S.text({ '$', '}' }, { '\\' }))),
- S.close
- ),
- function(values)
- return setmetatable({
- type = Node.Type.VARIABLE,
- name = values[3],
- children = values[5],
- }, Node)
- end
- )
+ P.map(P.seq(S.dollar, S.open, S.var, S.colon, P.many(P.any(S.toplevel, S.text({ '$', '}' }, { '\\' }))), S.close), function(values)
+ return setmetatable({
+ type = Node.Type.VARIABLE,
+ name = values[3],
+ children = values[5],
+ }, Node)
+ end)
)
S.snippet = P.map(P.many(P.any(S.toplevel, S.text({ '$' }, { '}', '\\' }))), function(values)
diff --git ORI/neovim/runtime/lua/vim/lsp/buf.lua ALT/neovim/runtime/lua/vim/lsp/buf.lua
index 2ce565e..997a876 100644
--- ORI/neovim/runtime/lua/vim/lsp/buf.lua
+++ ALT/neovim/runtime/lua/vim/lsp/buf.lua
@@ -474,8 +474,7 @@ function M.rename(new_name, options)
local function rename(name)
local params = util.make_position_params(win, client.offset_encoding)
params.newName = name
- local handler = client.handlers['textDocument/rename']
- or vim.lsp.handlers['textDocument/rename']
+ local handler = client.handlers['textDocument/rename'] or vim.lsp.handlers['textDocument/rename']
client.request('textDocument/rename', params, function(...)
handler(...)
try_use_client(next(clients, idx))
@@ -489,8 +488,7 @@ function M.rename(new_name, options)
if next(clients, idx) then
try_use_client(next(clients, idx))
else
- local msg = err and ('Error on prepareRename: ' .. (err.message or ''))
- or 'Nothing to rename'
+ local msg = err and ('Error on prepareRename: ' .. (err.message or '')) or 'Nothing to rename'
vim.notify(msg, vim.log.levels.INFO)
end
return
@@ -522,10 +520,7 @@ function M.rename(new_name, options)
end)
end, bufnr)
else
- assert(
- client.supports_method('textDocument/rename'),
- 'Client must support textDocument/rename'
- )
+ assert(client.supports_method('textDocument/rename'), 'Client must support textDocument/rename')
if new_name then
rename(new_name)
return
diff --git ORI/neovim/runtime/lua/vim/lsp/handlers.lua ALT/neovim/runtime/lua/vim/lsp/handlers.lua
index 624436b..5fa897b 100644
--- ORI/neovim/runtime/lua/vim/lsp/handlers.lua
+++ ALT/neovim/runtime/lua/vim/lsp/handlers.lua
@@ -104,9 +104,7 @@ end
--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#client_registerCapability
M['client/registerCapability'] = function(_, _, ctx)
local client_id = ctx.client_id
- local warning_tpl = 'The language server %s triggers a registerCapability '
- .. 'handler despite dynamicRegistration set to false. '
- .. 'Report upstream, this warning is harmless'
+ local warning_tpl = 'The language server %s triggers a registerCapability ' .. 'handler despite dynamicRegistration set to false. ' .. 'Report upstream, this warning is harmless'
local client = vim.lsp.get_client_by_id(client_id)
local client_name = client and client.name or string.format('id=%d', client_id)
local warning = string.format(warning_tpl, client_name)
@@ -125,8 +123,7 @@ M['workspace/applyEdit'] = function(_, workspace_edit, ctx)
if workspace_edit.label then
print('Workspace edit', workspace_edit.label)
end
- local status, result =
- pcall(util.apply_workspace_edit, workspace_edit.edit, client.offset_encoding)
+ local status, result = pcall(util.apply_workspace_edit, workspace_edit.edit, client.offset_encoding)
return {
applied = status,
failureReason = result,
@@ -138,11 +135,7 @@ M['workspace/configuration'] = function(_, result, ctx)
local client_id = ctx.client_id
local client = vim.lsp.get_client_by_id(client_id)
if not client then
- err_message(
- 'LSP[',
- client_id,
- '] client has shut down after sending a workspace/configuration request'
- )
+ err_message('LSP[', client_id, '] client has shut down after sending a workspace/configuration request')
return
end
if not result.items then
@@ -515,13 +508,12 @@ end
-- Add boilerplate error validation and logging for all of these.
for k, fn in pairs(M) do
M[k] = function(err, result, ctx, config)
- local _ = log.trace()
- and log.trace('default_handler', ctx.method, {
- err = err,
- result = result,
- ctx = vim.inspect(ctx),
- config = config,
- })
+ local _ = log.trace() and log.trace('default_handler', ctx.method, {
+ err = err,
+ result = result,
+ ctx = vim.inspect(ctx),
+ config = config,
+ })
if err then
-- LSP spec:
diff --git ORI/neovim/runtime/lua/vim/lsp/log.lua ALT/neovim/runtime/lua/vim/lsp/log.lua
index 6c6ba0f..7574187 100644
--- ORI/neovim/runtime/lua/vim/lsp/log.lua
+++ ALT/neovim/runtime/lua/vim/lsp/log.lua
@@ -102,13 +102,7 @@ do
return false
end
local info = debug.getinfo(2, 'Sl')
- local header = string.format(
- '[%s][%s] ...%s:%s',
- level,
- os.date(log_date_format),
- string.sub(info.short_src, #info.short_src - 15),
- info.currentline
- )
+ local header = string.format('[%s][%s] ...%s:%s', level, os.date(log_date_format), string.sub(info.short_src, #info.short_src - 15), info.currentline)
local parts = { header }
for i = 1, argc do
local arg = select(i, ...)
diff --git ORI/neovim/runtime/lua/vim/lsp/protocol.lua ALT/neovim/runtime/lua/vim/lsp/protocol.lua
index 27da60b..3d673b0 100644
--- ORI/neovim/runtime/lua/vim/lsp/protocol.lua
+++ ALT/neovim/runtime/lua/vim/lsp/protocol.lua
@@ -864,10 +864,7 @@ function protocol._resolve_capabilities_compat(server_capabilities)
text_document_will_save = if_nil(textDocumentSync.willSave, false),
text_document_will_save_wait_until = if_nil(textDocumentSync.willSaveWaitUntil, false),
text_document_save = if_nil(textDocumentSync.save, false),
- text_document_save_include_text = if_nil(
- type(textDocumentSync.save) == 'table' and textDocumentSync.save.includeText,
- false
- ),
+ text_document_save_include_text = if_nil(type(textDocumentSync.save) == 'table' and textDocumentSync.save.includeText, false),
}
else
return nil, string.format('Invalid type for textDocumentSync: %q', type(textDocumentSync))
@@ -977,8 +974,7 @@ function protocol._resolve_capabilities_compat(server_capabilities)
signature_help_properties = {
signature_help = true,
-- The characters that trigger signature help automatically.
- signature_help_trigger_characters = server_capabilities.signatureHelpProvider.triggerCharacters
- or {},
+ signature_help_trigger_characters = server_capabilities.signatureHelpProvider.triggerCharacters or {},
}
else
error('The server sent invalid signatureHelpProvider')
diff --git ORI/neovim/runtime/lua/vim/lsp/util.lua ALT/neovim/runtime/lua/vim/lsp/util.lua
index 1909dbd..0d3804a 100644
--- ORI/neovim/runtime/lua/vim/lsp/util.lua
+++ ALT/neovim/runtime/lua/vim/lsp/util.lua
@@ -401,11 +401,7 @@ function M.apply_text_edits(text_edits, bufnr, offset_encoding)
index = index + 1
text_edit._index = index
- if
- text_edit.range.start.line > text_edit.range['end'].line
- or text_edit.range.start.line == text_edit.range['end'].line
- and text_edit.range.start.character > text_edit.range['end'].character
- then
+ if text_edit.range.start.line > text_edit.range['end'].line or text_edit.range.start.line == text_edit.range['end'].line and text_edit.range.start.character > text_edit.range['end'].character then
local start = text_edit.range.start
text_edit.range.start = text_edit.range['end']
text_edit.range['end'] = start
diff --git ORI/zombie-strike/src/hub/ReplicatedStorage/Components/BuyCaps.lua ALT/zombie-strike/src/hub/ReplicatedStorage/Components/BuyCaps.lua
index 33764d0..972d385 100644
--- ORI/zombie-strike/src/hub/ReplicatedStorage/Components/BuyCaps.lua
+++ ALT/zombie-strike/src/hub/ReplicatedStorage/Components/BuyCaps.lua
@@ -113,16 +113,15 @@ function BuyCaps:render()
end
if self.state.buying then
- purchasePrompt = self.state.buying
- and e(BrainsPurchase, {
- Cost = self.state.buying.Cost,
- Scale = self.props.ConfirmPromptScale,
- Name = FormatNumber(self.state.buying.Caps) .. " caps",
- Window = self.props[Roact.Ref],
-
- OnBuy = self.finishBuy,
- OnClose = self.closeBuy,
- })
+ purchasePrompt = self.state.buying and e(BrainsPurchase, {
+ Cost = self.state.buying.Cost,
+ Scale = self.props.ConfirmPromptScale,
+ Name = FormatNumber(self.state.buying.Caps) .. " caps",
+ Window = self.props[Roact.Ref],
+
+ OnBuy = self.finishBuy,
+ OnClose = self.closeBuy,
+ })
end
for index, product in ipairs(CapsDictionary) do
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Equipment/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Equipment/init.lua
index 25eeb05..535a615 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Equipment/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Equipment/init.lua
@@ -43,10 +43,7 @@ function EquipmentButton:init()
self.activated = function()
if self.props.Owned then
- ReplicatedStorage.Remotes.UpdateEquipmentInventory:FireServer(
- self.props.Type == "HealthPack" and 1 or 2,
- self.props.Index
- )
+ ReplicatedStorage.Remotes.UpdateEquipmentInventory:FireServer(self.props.Type == "HealthPack" and 1 or 2, self.props.Index)
end
end
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Inventory2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Inventory2/init.lua
index e35f869..4d6c90e 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Inventory2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Inventory2/init.lua
@@ -50,9 +50,7 @@ function Inventory2:init()
self.equipCosmetic = Memoize(function(key)
return function(item, forceIsEquipped)
- local isEquipped = forceIsEquipped
- or self.props.cosmetics.equipped[key] == item.Index
- or self.lastEquipped == item.Index
+ local isEquipped = forceIsEquipped or self.props.cosmetics.equipped[key] == item.Index or self.lastEquipped == item.Index
if isEquipped then
UpdateCosmetics:FireServer(key)
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Settings/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Settings/init.lua
index 0d07b72..94730bc 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Settings/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Settings/init.lua
@@ -286,10 +286,7 @@ function SettingsMenu:render()
Size = UDim2.fromScale(1, 1),
[Roact.Event.MouseButton1Click] = function()
- self:SetSetting(
- "First Person",
- self.state.settings["First Person"] == "On" and "Off" or "On"
- )
+ self:SetSetting("First Person", self.state.settings["First Person"] == "On" and "Off" or "On")
end,
}, {
Label = e("TextLabel", {
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..ef6ccbc 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -177,10 +177,7 @@ function OpenedItem:render()
Size = UDim2.fromScale(1, 1),
}, {
Prompt = e(ConfirmPrompt2, {
- Text = ("Are you sure you want to upgrade %s for %s caps?"):format(
- perk.Perk.Name,
- FormatNumber(self.state.upgradeCost)
- ),
+ Text = ("Are you sure you want to upgrade %s for %s caps?"):format(perk.Perk.Name, FormatNumber(self.state.upgradeCost)),
Scale = 1.8,
Buttons = {
Yes = {
@@ -349,126 +346,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Vouchers/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Vouchers/init.lua
index a560577..76dd688 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Vouchers/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Vouchers/init.lua
@@ -105,10 +105,7 @@ function Vouchers:init()
self.setCounter(counter)
if not celebrated then
- local timeUntilShow = ANIMATION_SETUP_TIME
- + ANIMATION_VOUCHER_GO_IN_DELAY
- + ANIMATION_VOUCHER_GO_IN_TIME
- + ANIMATION_SHOW_ITEM_DELAY
+ local timeUntilShow = ANIMATION_SETUP_TIME + ANIMATION_VOUCHER_GO_IN_DELAY + ANIMATION_VOUCHER_GO_IN_TIME + ANIMATION_SHOW_ITEM_DELAY
if counter >= timeUntilShow then
celebrated = true
diff --git ORI/zombie-strike/src/mission/ReplicatedStorage/BossSequences/Egg.lua ALT/zombie-strike/src/mission/ReplicatedStorage/BossSequences/Egg.lua
index 0cc5629..a358590 100644
--- ORI/zombie-strike/src/mission/ReplicatedStorage/BossSequences/Egg.lua
+++ ALT/zombie-strike/src/mission/ReplicatedStorage/BossSequences/Egg.lua
@@ -33,16 +33,7 @@ function Sequence.Start(boss)
boss:SetPrimaryPartCFrame(goal)
connection:Disconnect()
else
- boss:SetPrimaryPartCFrame(
- initial:Lerp(
- goal,
- TweenService:GetValue(
- total / MOVE_FORWARD_TIME,
- Enum.EasingStyle.Quart,
- Enum.EasingDirection.Out
- )
- )
- )
+ boss:SetPrimaryPartCFrame(initial:Lerp(goal, TweenService:GetValue(total / MOVE_FORWARD_TIME, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)))
end
end)
end
diff --git ORI/zombie-strike/src/mission/ReplicatedStorage/Components/LootResults.lua ALT/zombie-strike/src/mission/ReplicatedStorage/Components/LootResults.lua
index f6b2ef4..a8e7f5c 100644
--- ORI/zombie-strike/src/mission/ReplicatedStorage/Components/LootResults.lua
+++ ALT/zombie-strike/src/mission/ReplicatedStorage/Components/LootResults.lua
@@ -234,8 +234,7 @@ function Reward:render()
value = e(Counter, {
Render = function(counter)
valueProps.Text = counter:map(function(counter)
- local timeNeeded =
- math.min(FULL_TIME_ANIMATION, lerp(0, FULL_TIME_ANIMATION, props.Value / props.FullTime))
+ local timeNeeded = math.min(FULL_TIME_ANIMATION, lerp(0, FULL_TIME_ANIMATION, props.Value / props.FullTime))
if counter >= timeNeeded and props.OnFinish and not self.state.calledFinished then
self:setState({
diff --git ORI/zombie-strike/src/mission/StarterPlayer/StarterPlayerScripts/OpenGate/Factory.lua ALT/zombie-strike/src/mission/StarterPlayer/StarterPlayerScripts/OpenGate/Factory.lua
index 8552143..62bd9f7 100644
--- ORI/zombie-strike/src/mission/StarterPlayer/StarterPlayerScripts/OpenGate/Factory.lua
+++ ALT/zombie-strike/src/mission/StarterPlayer/StarterPlayerScripts/OpenGate/Factory.lua
@@ -42,8 +42,7 @@ function Factory.Open(gate)
connection = RunService.Heartbeat:Connect(function(delta)
total = math.min(total + delta, 1)
- local alpha =
- TweenService:GetValue(total / GATE_OPEN_TIME, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)
+ local alpha = TweenService:GetValue(total / GATE_OPEN_TIME, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)
model:SetPrimaryPartCFrame(origin:Lerp(goal, alpha))
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Alert.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Alert.lua
index 52c91c8..5f3240d 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Alert.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Alert.lua
@@ -33,9 +33,7 @@ function Alert:Open()
local total = 0
self.animateConnection = RunService.Heartbeat:connect(function(delta)
total = total + delta
- self.updateFadeBinding(
- TweenService:GetValue(total / self.props.AlertTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.In)
- )
+ self.updateFadeBinding(TweenService:GetValue(total / self.props.AlertTime, Enum.EasingStyle.Cubic, Enum.EasingDirection.In))
if total >= self.props.AlertTime then
self:setState({
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Fireworks.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Fireworks.lua
index 2d95ea8..1994bf5 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Fireworks.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Fireworks.lua
@@ -51,11 +51,7 @@ function Fireworks:render()
end
end),
Position = counter:map(function(t)
- return UDim2.fromScale(particlePositions.x, particlePositions.y)
- + UDim2.fromScale(
- t * self.props.ParticleSpeed * particlePositions.direction,
- (-(-((2 * t - 1) ^ 2) + 1) * particlePositions.peak) * particlePositions.peak
- )
+ return UDim2.fromScale(particlePositions.x, particlePositions.y) + UDim2.fromScale(t * self.props.ParticleSpeed * particlePositions.direction, (-(-((2 * t - 1) ^ 2) + 1) * particlePositions.peak) * particlePositions.peak)
end),
Size = self.props.ParticleSize,
}, {
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/GradientButton.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/GradientButton.lua
index f345205..d90b9ad 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/GradientButton.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/GradientButton.lua
@@ -49,10 +49,7 @@ function GradientButton:init()
end
self.colorMap = function(total)
- return ColorSequence.new(
- self.props.MinGradient,
- Color3Lerp(self.props.MaxGradient, self.props.HoveredMaxGradient, math.sin(total * (math.pi / 2)))
- )
+ return ColorSequence.new(self.props.MinGradient, Color3Lerp(self.props.MaxGradient, self.props.HoveredMaxGradient, math.sin(total * (math.pi / 2))))
end
end
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/PerkDetails.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/PerkDetails.lua
index c6ab038..a0b4b2a 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/PerkDetails.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/PerkDetails.lua
@@ -59,8 +59,7 @@ local function PerkDetails(props)
Icon = e("ImageLabel", {
BackgroundTransparency = 1,
Image = ImagePanel2,
- ImageColor3 = perk.Perk.LegendaryPerk and Color3.fromRGB(219, 144, 83)
- or Color3.fromRGB(77, 77, 77),
+ ImageColor3 = perk.Perk.LegendaryPerk and Color3.fromRGB(219, 144, 83) or Color3.fromRGB(77, 77, 77),
LayoutOrder = index,
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(13, 10, 369, 82),
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/UserThumbnail.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/UserThumbnail.lua
index 81ebfc0..9ab74c1 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/UserThumbnail.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/UserThumbnail.lua
@@ -13,8 +13,7 @@ local function retrieveAvatar(userId)
userThumbnails[userId] = Promise.new(function(resolve)
coroutine.wrap(function()
while true do
- local thumbnail, finished =
- Players:GetUserThumbnailAsync(userId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size180x180)
+ local thumbnail, finished = Players:GetUserThumbnailAsync(userId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size180x180)
if finished then
resolve(thumbnail)
diff --git ORI/zombie-strike/src/shared/ServerScriptService/ZombiePassRewards.lua ALT/zombie-strike/src/shared/ServerScriptService/ZombiePassRewards.lua
index be8a09b..d6d9833 100644
--- ORI/zombie-strike/src/shared/ServerScriptService/ZombiePassRewards.lua
+++ ALT/zombie-strike/src/shared/ServerScriptService/ZombiePassRewards.lua
@@ -79,9 +79,7 @@ ZombiePassRewards.GrantRewards = function(player, levels)
local promises = {}
for _, level in ipairs(levels) do
- for _, reward in
- pairs(ZombiePassRewards.GetLootForLevel(level, Data.GetPlayerData(player, "ZombiePass").Premium))
- do
+ for _, reward in pairs(ZombiePassRewards.GetLootForLevel(level, Data.GetPlayerData(player, "ZombiePass").Premium)) do
table.insert(promises, grantReward(player, reward))
end
end
diff --git ORI/zombie-strike/src/shared/StarterPlayer/StarterPlayerScripts/DamageNumbers.client.lua ALT/zombie-strike/src/shared/StarterPlayer/StarterPlayerScripts/DamageNumbers.client.lua
index 9faeba0..e163ab5 100644
--- ORI/zombie-strike/src/shared/StarterPlayer/StarterPlayerScripts/DamageNumbers.client.lua
+++ ALT/zombie-strike/src/shared/StarterPlayer/StarterPlayerScripts/DamageNumbers.client.lua
@@ -96,12 +96,7 @@ ReplicatedStorage.Remotes.DamageNumber.OnClientEvent:connect(function(humanoid,
local deathStray = 2 * (deathSpring:Update(dt).X + 10 / 2) - 10
- damageNumber.ExtentsOffsetWorldSpace = base
- + Vector3.new(
- offset.stray * timeSinceLast * STRAY_SCALE + deathStray,
- ((LIFETIME - timeSinceLast) * HEIGHT_SCALE) ^ 2,
- 0
- )
+ damageNumber.ExtentsOffsetWorldSpace = base + Vector3.new(offset.stray * timeSinceLast * STRAY_SCALE + deathStray, ((LIFETIME - timeSinceLast) * HEIGHT_SCALE) ^ 2, 0)
local sizeY = math.clamp(lerp(0.2, baseSizeY, (LIFETIME - timeSinceLast) / LIFETIME), 0.2, baseSizeY)
diff --git ORI/nvim-lspconfig/scripts/docgen.lua ALT/nvim-lspconfig/scripts/docgen.lua
index 93d57eb..c5890d9 100644
--- ORI/nvim-lspconfig/scripts/docgen.lua
+++ ALT/nvim-lspconfig/scripts/docgen.lua
@@ -109,15 +109,14 @@ local function make_lsp_sections()
if not template_def.commands or #vim.tbl_keys(template_def.commands) == 0 then
return
end
- return '**Commands:**\n'
- .. make_section(0, '\n', {
- sorted_map_table(template_def.commands, function(name, def)
- if def.description then
- return string.format('- %s: %s', name, def.description)
- end
- return string.format('- %s', name)
- end),
- })
+ return '**Commands:**\n' .. make_section(0, '\n', {
+ sorted_map_table(template_def.commands, function(name, def)
+ if def.description then
+ return string.format('- %s: %s', name, def.description)
+ end
+ return string.format('- %s', name)
+ end),
+ })
end,
})
diff --git ORI/nvim-treesitter/lua/nvim-treesitter/configs.lua ALT/nvim-treesitter/lua/nvim-treesitter/configs.lua
index 04099d3..697fd77 100644
--- ORI/nvim-treesitter/lua/nvim-treesitter/configs.lua
+++ ALT/nvim-treesitter/lua/nvim-treesitter/configs.lua
@@ -229,16 +229,15 @@ end
-- @param process_function function used as the `process` parameter
-- for vim.inspect (https://github.com/kikito/inspect.lua#optionsprocess)
local function config_info(process_function)
- process_function = process_function
- or function(item, path)
- if path[#path] == vim.inspect.METATABLE then
- return
- end
- if path[#path] == "is_supported" then
- return
- end
- return item
+ process_function = process_function or function(item, path)
+ if path[#path] == vim.inspect.METATABLE then
+ return
end
+ if path[#path] == "is_supported" then
+ return
+ end
+ return item
+ end
print(vim.inspect(config, { process = process_function }))
end
diff --git ORI/nvim-treesitter/lua/nvim-treesitter/install.lua ALT/nvim-treesitter/lua/nvim-treesitter/install.lua
index 271220d..b20cabd 100644
--- ORI/nvim-treesitter/lua/nvim-treesitter/install.lua
+++ ALT/nvim-treesitter/lua/nvim-treesitter/install.lua
@@ -166,14 +166,7 @@ function M.iter_cmd(cmd_list, i, lang, success_message)
end
local err_msg = complete_error_output[handle] or ""
- api.nvim_err_writeln(
- "nvim-treesitter["
- .. lang
- .. "]: "
- .. (attr.err or ("Failed to execute the following command:\n" .. vim.inspect(attr)))
- .. "\n"
- .. err_msg
- )
+ api.nvim_err_writeln("nvim-treesitter[" .. lang .. "]: " .. (attr.err or ("Failed to execute the following command:\n" .. vim.inspect(attr))) .. "\n" .. err_msg)
return
end
M.iter_cmd(cmd_list, i + 1, lang, success_message)
diff --git ORI/luvit/deps/json.lua ALT/luvit/deps/json.lua
index c776684..aa37da7 100644
--- ORI/luvit/deps/json.lua
+++ ALT/luvit/deps/json.lua
@@ -382,14 +382,7 @@ encode2 = function(value, indent, level, buffer, buflen, tables, globalorder, st
end
tables[value] = nil
else
- return exception(
- "unsupported type",
- value,
- state,
- buffer,
- buflen,
- "type '" .. valtype .. "' is not supported by JSON."
- )
+ return exception("unsupported type", value, state, buffer, buflen, "type '" .. valtype .. "' is not supported by JSON.")
end
return buflen
end
diff --git ORI/luvit/tests/test-tls-server-verify.lua ALT/luvit/tests/test-tls-server-verify.lua
index 4ddd2f0..75d889b 100644
--- ORI/luvit/tests/test-tls-server-verify.lua
+++ ALT/luvit/tests/test-tls-server-verify.lua
@@ -167,9 +167,7 @@ local function theTest(options)
print("- authed connection: " .. tostring(c:getPeerCertificate():subject()))
c:write("\n_authed\n")
else
- print(
- "- unauthed connection: " .. (c.authorizationError and c.authorizationError.error_string or "undefined")
- )
+ print("- unauthed connection: " .. (c.authorizationError and c.authorizationError.error_string or "undefined"))
c:write("\n_unauthed\n")
end
c:on("data", function(chunk)
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)
diff --git ORI/lit/deps/json.lua ALT/lit/deps/json.lua
index c776684..aa37da7 100644
--- ORI/lit/deps/json.lua
+++ ALT/lit/deps/json.lua
@@ -382,14 +382,7 @@ encode2 = function(value, indent, level, buffer, buflen, tables, globalorder, st
end
tables[value] = nil
else
- return exception(
- "unsupported type",
- value,
- state,
- buffer,
- buflen,
- "type '" .. valtype .. "' is not supported by JSON."
- )
+ return exception("unsupported type", value, state, buffer, buflen, "type '" .. valtype .. "' is not supported by JSON.")
end
return buflen
end
Repo Comparison Test
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..9e24393 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -349,126 +349,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)
Repo Comparison Test
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..9e24393 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -349,126 +349,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)
Repo Comparison Test
diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..9e24393 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -349,126 +349,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)