-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathmisc.lua
More file actions
52 lines (40 loc) · 1.12 KB
/
misc.lua
File metadata and controls
52 lines (40 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- fix turning '0' into 'o'
local zeroWasInput = false
local text_input_keyRef = G.FUNCS.text_input_key
function G.FUNCS.text_input_key(args)
if args.key == '0' then
zeroWasInput = true
end
local text_input_key = text_input_keyRef(args)
zeroWasInput = false
return text_input_key
end
local modify_text_inputRef = MODIFY_TEXT_INPUT
function MODIFY_TEXT_INPUT(args)
if zeroWasInput then
args.letter = '0'
end
local modify_text_input = modify_text_inputRef(args)
return modify_text_input
end
-- prevent achievements from being unlocked
local unlock_achievementRef = unlock_achievement
function unlock_achievement(achievement_name)
if isAPProfileLoaded() then
return
end
return unlock_achievementRef(achievement_name)
end
function split_text_to_lines(text, max_word)
local lines = {}
local count = 0
max_word = max_word or 4
for word in text:gmatch("%S+") do
if count % max_word == 0 then
lines[#lines + 1] = ""
end
count = count + 1
lines[#lines] = lines[#lines] .. " " .. word
end
return lines
end