You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if self.strings[k].H > self.config.H then self.config.H = self.strings[k].H; self.strings[k].H_offset = 0 end'''
14
+
position = 'after'
15
+
payload = '''
16
+
if first_pass and type(mem_v) == "table" and mem_v.condition then
17
+
self.strings[k].condition = mem_v.condition
18
+
end
19
+
'''
20
+
match_indent = true
21
+
22
+
[[patches]]
23
+
[patches.pattern]
24
+
target = 'engine/text.lua'
25
+
pattern = ''' for k, v in ipairs(self.config.string) do'''
26
+
position = 'after'
27
+
payload = '''
28
+
local mem_v = v
29
+
'''
30
+
match_indent = true
31
+
32
+
# check conditionals
33
+
[[patches]]
34
+
[patches.pattern]
35
+
target = 'engine/text.lua'
36
+
pattern = '''self.focused_string = (self.config.random_element and math.random(1, #self.strings)) or self.focused_string == #self.strings and 1 or self.focused_string+1'''
37
+
position = 'at'
38
+
payload = '''
39
+
while true do
40
+
self.focused_string = (self.config.random_element and math.random(1, #self.strings)) or self.focused_string == #self.strings and 1 or self.focused_string+1
41
+
if type(self.strings[self.focused_string]) ~= 'table' or not self.strings[self.focused_string].condition then break
42
+
elseif self.strings[self.focused_string].condition() then break end
43
+
end
44
+
'''
45
+
match_indent = true
46
+
47
+
# Check condition for the initial string
48
+
[[patches]]
49
+
[patches.pattern]
50
+
target = 'engine/text.lua'
51
+
pattern = '''for k, v in ipairs(self.strings) do'''
52
+
position = 'before'
53
+
payload = '''
54
+
if first_pass and type(self.strings[self.focused_string]) == 'table' and
55
+
type(self.strings[self.focused_string].condition) == 'function' and not self.strings[self.focused_string].condition() then
56
+
while true do
57
+
self.focused_string = (self.config.random_element and math.random(1, #self.strings)) or self.focused_string == #self.strings and 1 or self.focused_string+1
58
+
if type(self.strings[self.focused_string]) ~= 'table' or not self.strings[self.focused_string].condition then break
59
+
elseif self.strings[self.focused_string].condition() then break end
0 commit comments