@@ -13,61 +13,17 @@ listMetaInfo = {}
13
13
combatLog = {}
14
14
15
15
function updateAttrTable()
16
- if (characters[currentID] ~= nil) then
17
- attributeItems = {
18
- { characters[currentID].attr.str, 9582 },
19
- { characters[currentID].attr.dex, 9584 },
20
- { characters[currentID].attr.con, 9583 },
21
- { characters[currentID].attr.int, 9585 },
22
- { characters[currentID].attr.wis, 9586 },
23
- { characters[currentID].attr.cha, 9587 }
24
- }
25
- buildRecordStats()
26
- buildRecordInfos()
27
- end
28
- end
29
-
30
- function characterDescString(char)
31
- return Infinity_FetchString(char.gender) .. "\n" .. Infinity_FetchString(char.race) .. "\n" .. char.class .. "\n" .. Infinity_FetchString(char.alignment)
32
- end
33
-
34
- function displaySTR()
35
- local txt = characters[currentID].attr.str.current
36
-
37
- if (characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra ~= 0) then
38
- txt = txt .. '/' .. string.format('%02d', characters[currentID].attr.str.extra % 100)
39
- end
40
- if (characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then
41
- txt = '^G' .. txt .. '^-'
42
- end
43
- if (characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then
44
- txt = '^R' .. txt .. '^-'
45
- end
46
- return txt
47
- end
48
-
49
- function displayBuff(current, base)
50
- if(current > base) then
51
- return '^G' .. current .. '^-'
52
- elseif (current < base) then
53
- return '^R' .. current .. '^-'
54
- end
55
- return current
56
- end
16
+ if (characters[currentID] == nil) then return end
57
17
58
- function displayAttr(index)
59
- if (index == 1) then
60
- return displaySTR()
61
- else
62
- return displayBuff(attributeItems[index][1].current, attributeItems[index][1].base)
63
- end
64
- end
65
-
66
- function CurrentlyInGame()
67
- return characterScreen:IsInGame()
68
- end
18
+ attributeItems = {
19
+ { characters[currentID].attr.str, 9582 },
20
+ { characters[currentID].attr.dex, 9584 },
21
+ { characters[currentID].attr.con, 9583 },
22
+ { characters[currentID].attr.int, 9585 },
23
+ { characters[currentID].attr.wis, 9586 },
24
+ { characters[currentID].attr.cha, 9587 }
25
+ }
69
26
70
- function buildRecordStats()
71
27
recordStats = {}
72
28
73
29
table.insert(recordStats, {1,t("ABILITIES_TITLE")})
@@ -97,25 +53,7 @@ function buildRecordStats()
97
53
local pos = s:find(":", 1)
98
54
table.insert(recordStats, {2,s:sub(1, pos - 1),s:sub(pos + 2)})
99
55
end
100
- end
101
- function isEmpty(t)
102
- if next(t) == nil then
103
- return true
104
- end
105
- return false
106
- end
107
- function getClassString()
108
- table.insert(recordInfos, {1,characters[currentID].classlevel.first.details})
109
- if characters[currentID].classlevel.second then
110
- table.insert(recordInfos, {1,""})
111
- table.insert(recordInfos, {1,characters[currentID].classlevel.second.details})
112
- end
113
- if characters[currentID].classlevel.third then
114
- table.insert(recordInfos, {1,""})
115
- table.insert(recordInfos, {1,characters[currentID].classlevel.third.details})
116
- end
117
- end
118
- function buildRecordInfos()
56
+
119
57
recordInfos = {}
120
58
121
59
if characters[currentID].classlevel.second then
@@ -175,6 +113,64 @@ function buildRecordInfos()
175
113
end
176
114
end
177
115
end
116
+
117
+ function characterDescString(char)
118
+ return Infinity_FetchString(char.gender) .. "\n" .. Infinity_FetchString(char.race) .. "\n" .. char.class .. "\n" .. Infinity_FetchString(char.alignment)
119
+ end
120
+
121
+ function displaySTR()
122
+ local txt = characters[currentID].attr.str.current
123
+
124
+ if (characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra ~= 0) then
125
+ txt = txt .. '/' .. string.format('%02d', characters[currentID].attr.str.extra % 100)
126
+ end
127
+ if (characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then
128
+ txt = '^G' .. txt .. '^-'
129
+ end
130
+ if (characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then
131
+ txt = '^R' .. txt .. '^-'
132
+ end
133
+ return txt
134
+ end
135
+
136
+ function displayBuff(current, base)
137
+ if(current > base) then
138
+ return '^G' .. current .. '^-'
139
+ elseif (current < base) then
140
+ return '^R' .. current .. '^-'
141
+ end
142
+ return current
143
+ end
144
+
145
+ function displayAttr(index)
146
+ if (index == 1) then
147
+ return displaySTR()
148
+ else
149
+ return displayBuff(attributeItems[index][1].current, attributeItems[index][1].base)
150
+ end
151
+ end
152
+
153
+ function CurrentlyInGame()
154
+ return characterScreen:IsInGame()
155
+ end
156
+
157
+ function isEmpty(t)
158
+ if next(t) == nil then
159
+ return true
160
+ end
161
+ return false
162
+ end
163
+ function getClassString()
164
+ table.insert(recordInfos, {1,characters[currentID].classlevel.first.details})
165
+ if characters[currentID].classlevel.second then
166
+ table.insert(recordInfos, {1,""})
167
+ table.insert(recordInfos, {1,characters[currentID].classlevel.second.details})
168
+ end
169
+ if characters[currentID].classlevel.third then
170
+ table.insert(recordInfos, {1,""})
171
+ table.insert(recordInfos, {1,characters[currentID].classlevel.third.details})
172
+ end
173
+ end
178
174
function getStatusString(strRef)
179
175
if type(dwAddCharacterIcon2) == 'function' then
180
176
strRef = dwAddCharacterIcon2(strRef)
0 commit comments