Skip to content

Commit 789f197

Browse files
committed
stylua: the styluaing
shoutouts to the ascii art in russian localization
1 parent 54df2f3 commit 789f197

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+53463
-52273
lines changed

.github/workflows/pull_request.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Stylua
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
stylua:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v4
17+
18+
- name: Run stylua
19+
uses: JohnnyMorganz/stylua-action@v4
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
version: latest
23+
# CLI arguments
24+
args: --check .

Cryptid.lua

Lines changed: 119 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ end
5656
local function process_items(f, mod)
5757
local ret = f()
5858
if not ret.disabled then
59-
if ret.init then ret:init() end
59+
if ret.init then
60+
ret:init()
61+
end
6062
if ret.items then
6163
for _, item in ipairs(ret.items) do
6264
if mod then
@@ -72,10 +74,14 @@ local function process_items(f, mod)
7274
item.atlas = mod.prefix .. "_" .. item.atlas
7375
end
7476
-- this will also display the mod's own badge
75-
if not item.dependencies then item.dependencies = {} end
77+
if not item.dependencies then
78+
item.dependencies = {}
79+
end
7680
item.dependencies[#item.dependencies + 1] = mod.id
7781
end
78-
if item.init then item:init() end
82+
if item.init then
83+
item:init()
84+
end
7985
--[[if not item.gameset_config then
8086
-- by default, disable on modest
8187
item.gameset_config = {
@@ -183,113 +189,124 @@ function SMODS.injectItems(...)
183189
cry_update_obj_registry()
184190
end
185191

186-
local cryptidTabs = function() return {
187-
{
188-
label = localize("cry_set_features"),
189-
chosen = true,
190-
tab_definition_function = function()
191-
cry_nodes = {
192-
{
193-
n = G.UIT.R,
194-
config = { align = "cm" },
195-
nodes = {
196-
{
197-
n = G.UIT.O,
198-
config = {
199-
object = DynaText({
200-
string = localize("cry_set_enable_features"),
201-
colours = { G.C.WHITE },
202-
shadow = true,
203-
scale = 0.4,
204-
}),
192+
local cryptidTabs = function()
193+
return {
194+
{
195+
label = localize("cry_set_features"),
196+
chosen = true,
197+
tab_definition_function = function()
198+
cry_nodes = {
199+
{
200+
n = G.UIT.R,
201+
config = { align = "cm" },
202+
nodes = {
203+
{
204+
n = G.UIT.O,
205+
config = {
206+
object = DynaText({
207+
string = localize("cry_set_enable_features"),
208+
colours = { G.C.WHITE },
209+
shadow = true,
210+
scale = 0.4,
211+
}),
212+
},
205213
},
206214
},
207215
},
208-
},
209-
}
210-
left_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
211-
right_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
212-
config = { n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { left_settings, right_settings } }
213-
cry_nodes[#cry_nodes + 1] = config
214-
cry_nodes[#cry_nodes + 1] = UIBox_button({button = 'your_collection_content_sets', label = {localize('b_content_sets')}, count = modsCollectionTally(G.P_CENTER_POOLS["Content Set"]), minw = 5, minh = 1.7, scale = 0.6, id = 'your_collection_jokers'})
216+
}
217+
left_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
218+
right_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
219+
config =
220+
{ n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { left_settings, right_settings } }
221+
cry_nodes[#cry_nodes + 1] = config
222+
cry_nodes[#cry_nodes + 1] = UIBox_button({
223+
button = "your_collection_content_sets",
224+
label = { localize("b_content_sets") },
225+
count = modsCollectionTally(G.P_CENTER_POOLS["Content Set"]),
226+
minw = 5,
227+
minh = 1.7,
228+
scale = 0.6,
229+
id = "your_collection_jokers",
230+
})
215231

216-
return {
217-
n = G.UIT.ROOT,
218-
config = {
219-
emboss = 0.05,
220-
minh = 6,
221-
r = 0.1,
222-
minw = 10,
223-
align = "cm",
224-
padding = 0.2,
225-
colour = G.C.BLACK,
226-
},
227-
nodes = cry_nodes,
228-
}
229-
end,
230-
},
231-
{
232-
label = localize("cry_set_music"),
233-
tab_definition_function = function()
234-
-- TODO: Add a button here to reset all Cryptid achievements.
235-
-- If you want to do that now, add this to the SMODS.InjectItems in Steamodded/loader/loader.lua
236-
--[[fetch_achievements()
232+
return {
233+
n = G.UIT.ROOT,
234+
config = {
235+
emboss = 0.05,
236+
minh = 6,
237+
r = 0.1,
238+
minw = 10,
239+
align = "cm",
240+
padding = 0.2,
241+
colour = G.C.BLACK,
242+
},
243+
nodes = cry_nodes,
244+
}
245+
end,
246+
},
247+
{
248+
label = localize("cry_set_music"),
249+
tab_definition_function = function()
250+
-- TODO: Add a button here to reset all Cryptid achievements.
251+
-- If you want to do that now, add this to the SMODS.InjectItems in Steamodded/loader/loader.lua
252+
--[[fetch_achievements()
237253
for k, v in pairs(SMODS.Achievements) do
238254
G.SETTINGS.ACHIEVEMENTS_EARNED[k] = nil
239255
G.ACHIEVEMENTS[k].earned = nil
240256
end
241257
fetch_achievements()]]
242-
cry_nodes = {
243-
{
244-
n = G.UIT.R,
245-
config = { align = "cm" },
246-
nodes = {
247-
--{n=G.UIT.O, config={object = DynaText({string = "", colours = {G.C.WHITE}, shadow = true, scale = 0.4})}},
258+
cry_nodes = {
259+
{
260+
n = G.UIT.R,
261+
config = { align = "cm" },
262+
nodes = {
263+
--{n=G.UIT.O, config={object = DynaText({string = "", colours = {G.C.WHITE}, shadow = true, scale = 0.4})}},
264+
},
265+
},
266+
}
267+
settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
268+
settings.nodes[#settings.nodes + 1] = create_toggle({
269+
label = localize("cry_mus_jimball"),
270+
ref_table = Cryptid_config.Cryptid,
271+
ref_value = "jimball_music",
272+
})
273+
settings.nodes[#settings.nodes + 1] = create_toggle({
274+
label = localize("cry_mus_code"),
275+
ref_table = Cryptid_config.Cryptid,
276+
ref_value = "code_music",
277+
})
278+
settings.nodes[#settings.nodes + 1] = create_toggle({
279+
label = localize("cry_mus_exotic"),
280+
ref_table = Cryptid_config.Cryptid,
281+
ref_value = "exotic_music",
282+
})
283+
settings.nodes[#settings.nodes + 1] = create_toggle({
284+
label = localize("cry_mus_high_score"),
285+
ref_table = Cryptid_config.Cryptid,
286+
ref_value = "big_music",
287+
})
288+
settings.nodes[#settings.nodes + 1] = create_toggle({
289+
label = localize("cry_mus_alt_bg"),
290+
ref_table = Cryptid_config.Cryptid,
291+
ref_value = "alt_bg_music",
292+
})
293+
config = { n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { settings } }
294+
cry_nodes[#cry_nodes + 1] = config
295+
return {
296+
n = G.UIT.ROOT,
297+
config = {
298+
emboss = 0.05,
299+
minh = 6,
300+
r = 0.1,
301+
minw = 10,
302+
align = "cm",
303+
padding = 0.2,
304+
colour = G.C.BLACK,
248305
},
249-
},
250-
}
251-
settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
252-
settings.nodes[#settings.nodes + 1] = create_toggle({
253-
label = localize("cry_mus_jimball"),
254-
ref_table = Cryptid_config.Cryptid,
255-
ref_value = "jimball_music",
256-
})
257-
settings.nodes[#settings.nodes + 1] = create_toggle({
258-
label = localize("cry_mus_code"),
259-
ref_table = Cryptid_config.Cryptid,
260-
ref_value = "code_music",
261-
})
262-
settings.nodes[#settings.nodes + 1] = create_toggle({
263-
label = localize("cry_mus_exotic"),
264-
ref_table = Cryptid_config.Cryptid,
265-
ref_value = "exotic_music",
266-
})
267-
settings.nodes[#settings.nodes + 1] = create_toggle({
268-
label = localize("cry_mus_high_score"),
269-
ref_table = Cryptid_config.Cryptid,
270-
ref_value = "big_music",
271-
})
272-
settings.nodes[#settings.nodes + 1] = create_toggle({
273-
label = localize("cry_mus_alt_bg"),
274-
ref_table = Cryptid_config.Cryptid,
275-
ref_value = "alt_bg_music",
276-
})
277-
config = { n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { settings } }
278-
cry_nodes[#cry_nodes + 1] = config
279-
return {
280-
n = G.UIT.ROOT,
281-
config = {
282-
emboss = 0.05,
283-
minh = 6,
284-
r = 0.1,
285-
minw = 10,
286-
align = "cm",
287-
padding = 0.2,
288-
colour = G.C.BLACK,
289-
},
290-
nodes = cry_nodes,
291-
}
292-
end,
293-
},
294-
} end
306+
nodes = cry_nodes,
307+
}
308+
end,
309+
},
310+
}
311+
end
295312
SMODS.current_mod.extra_tabs = cryptidTabs

config.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
return {
22
["Cryptid"] = {
3-
["jimball_music"] = true,
4-
["code_music"] = true,
5-
["exotic_music"] = true,
6-
["big_music"] = true,
7-
["alt_bg_music"] = true,
8-
},
3+
["jimball_music"] = true,
4+
["code_music"] = true,
5+
["exotic_music"] = true,
6+
["big_music"] = true,
7+
["alt_bg_music"] = true,
8+
},
99
}

https/thread.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "love.system"
1+
require("love.system")
22

33
-- mac/linux support?
44

@@ -10,9 +10,9 @@ package.cpath = script_dir .. "?.so;" .. package.cpath
1010

1111
local index_os = love.system.getOS()
1212

13-
if index_os == 'OS X' then
13+
if index_os == "OS X" then
1414
loc_https = require("macos-https")
15-
elseif index_os == 'Linux' then
15+
elseif index_os == "Linux" then
1616
loc_https = require("linux-https")
1717
else
1818
loc_https = require("https")
@@ -24,11 +24,13 @@ while true do
2424
if (os.time() - last_update_time >= 60) or initial then
2525
initial = nil
2626
last_update_time = os.time()
27-
local resp, txt = loc_https.request("https://discord.com/api/v10/invites/eUf9Ur6RyB?with_counts=true".."&v=" .. tostring(os.time()))
27+
local resp, txt = loc_https.request(
28+
"https://discord.com/api/v10/invites/eUf9Ur6RyB?with_counts=true" .. "&v=" .. tostring(os.time())
29+
)
2830
if resp == 200 then
29-
love.thread.getChannel('member_count'):push(txt)
31+
love.thread.getChannel("member_count"):push(txt)
3032
else
31-
love.thread.getChannel('member_error'):push("Failed to get count: "..resp)
33+
love.thread.getChannel("member_error"):push("Failed to get count: " .. resp)
3234
end
3335
end
34-
end
36+
end

items/achievement.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,4 +447,4 @@ local achievement_objects = {
447447
traffic_jam,
448448
perfectly_balanced,
449449
}
450-
return { name = "Achievements", items = achievement_objects, }
450+
return { name = "Achievements", items = achievement_objects }

0 commit comments

Comments
 (0)