@@ -4200,6 +4200,7 @@ function itemDescLeftButtonAction()
4200
4200
if(itemDesc.item.identified == 0) then
4201
4201
Infinity_OnSpellIdentify(itemDesc.id)
4202
4202
itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item
4203
+ computeSplitPosition(itemDesc.item.description, 'itemDescriptionSplit')
4203
4204
else
4204
4205
Infinity_PushMenu('ITEM_ABILITIES',0,0)
4205
4206
end
@@ -4228,6 +4229,7 @@ function itemDescRightButtonAction()
4228
4229
if(itemDesc.item.identified == 0) then
4229
4230
Infinity_OnScrollIdentify(itemDesc.id)
4230
4231
itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item
4232
+ computeSplitPosition(itemDesc.item.description, 'itemDescriptionSplit')
4231
4233
else
4232
4234
Infinity_PopMenu()
4233
4235
Infinity_OnUseButtonClick(itemDesc.id, itemDesc.useMode)
@@ -4245,6 +4247,7 @@ function computeSplitPosition(str, name)
4245
4247
elseif firstChar == 195 then startPos = 3 end
4246
4248
splitPos = startPos
4247
4249
curPos = startPos
4250
+ local newLine = false
4248
4251
while splitPos ~= -1 do
4249
4252
local b = str:byte(curPos)
4250
4253
if b == nil then
@@ -4255,7 +4258,10 @@ function computeSplitPosition(str, name)
4255
4258
curPos = curPos + 2
4256
4259
elseif b >= 194 then
4257
4260
curPos = curPos + 1
4258
- elseif b == 10 or b == 32 then
4261
+ elseif b == 10 then
4262
+ splitPos = curPos
4263
+ newLine = true
4264
+ elseif b == 32 and not newLine then
4259
4265
splitPos = curPos
4260
4266
end
4261
4267
Infinity_ScaleToText(name)
@@ -4272,7 +4278,7 @@ menu
4272
4278
modal
4273
4279
onOpen
4274
4280
"
4275
- -- Infinity_PlaySound('GAM_03')
4281
+ Infinity_PlaySound('GAM_03')
4276
4282
computeSplitPosition(itemDesc.item.description, 'itemDescriptionSplit')
4277
4283
"
4278
4284
onClose
@@ -4307,7 +4313,7 @@ menu
4307
4313
{
4308
4314
name "itemDescriptionSplit"
4309
4315
enabled "false"
4310
- area 0 0 380 -1
4316
+ area 44 0 370 -1
4311
4317
text lua "itemDesc.item.description:sub(startPos, curPos)"
4312
4318
text style "parchment"
4313
4319
scrollbar 'GUISBR'
@@ -4327,14 +4333,15 @@ menu
4327
4333
label
4328
4334
{
4329
4335
enabled "rowNumber == 1"
4330
- area 44 0 386 -1
4336
+ area 44 0 370 -1
4331
4337
text lua "itemDesc.item.description:sub(startPos, splitPos - 1)"
4332
4338
text style "parchment"
4333
4339
}
4334
4340
label
4335
4341
{
4336
4342
enabled "rowNumber == 2"
4337
- area 0 0 430 -1
4343
+ area 0 0 -1 -1
4344
+ pad 0 0 16 0
4338
4345
text lua "itemDesc.item.description:sub(splitPos + 1)"
4339
4346
text style "parchment"
4340
4347
}
@@ -4389,7 +4396,6 @@ menu
4389
4396
area 327 638 201 44
4390
4397
text "DONE_BUTTON"
4391
4398
text style "button"
4392
- sound ""
4393
4399
action
4394
4400
"
4395
4401
Infinity_PopMenu()
@@ -8781,7 +8787,7 @@ menu
8781
8787
{
8782
8788
name "spellDescriptionSplit"
8783
8789
enabled "false"
8784
- area 0 0 665 -1
8790
+ area 44 0 655 -1
8785
8791
text lua "Infinity_FetchString(currentSpell.description):sub(startPos, curPos)"
8786
8792
text style "parchment"
8787
8793
scrollbar 'GUISBR'
@@ -8801,14 +8807,15 @@ menu
8801
8807
label
8802
8808
{
8803
8809
enabled "rowNumber == 1"
8804
- area 44 0 671 -1
8810
+ area 44 0 655 -1
8805
8811
text lua "Infinity_FetchString(currentSpell.description):sub(startPos, splitPos - 1)"
8806
8812
text style "parchment"
8807
8813
}
8808
8814
label
8809
8815
{
8810
8816
enabled "rowNumber == 2"
8811
- area 0 0 715 -1
8817
+ area 0 0 -1 -1
8818
+ pad 0 0 16 0
8812
8819
text lua "Infinity_FetchString(currentSpell.description):sub(splitPos + 1)"
8813
8820
text style "parchment"
8814
8821
}
@@ -8835,7 +8842,6 @@ menu
8835
8842
bam GUIOSTUM
8836
8843
text "DONE_BUTTON"
8837
8844
text style "button"
8838
- sound ""
8839
8845
action "Infinity_PopMenu('SPELL_DESCRIPTION')"
8840
8846
}
8841
8847
button
@@ -9064,7 +9070,7 @@ menu
9064
9070
{
9065
9071
name "popupDetailsSplit"
9066
9072
enabled "false"
9067
- area 0 0 665 -1
9073
+ area 44 0 655 -1
9068
9074
text lua "Infinity_FetchString(PopupDetails.description):sub(startPos, curPos)"
9069
9075
text style "parchment"
9070
9076
scrollbar 'GUISBR'
@@ -9084,14 +9090,15 @@ menu
9084
9090
label
9085
9091
{
9086
9092
enabled "rowNumber == 1"
9087
- area 44 0 671 -1
9093
+ area 44 0 655 -1
9088
9094
text lua "Infinity_FetchString(PopupDetails.description):sub(startPos, splitPos - 1)"
9089
9095
text style "parchment"
9090
9096
}
9091
9097
label
9092
9098
{
9093
9099
enabled "rowNumber == 2"
9094
- area 0 0 715 -1
9100
+ area 0 0 -1 -1
9101
+ pad 0 0 16 0
9095
9102
text lua "Infinity_FetchString(PopupDetails.description):sub(splitPos + 1)"
9096
9103
text style "parchment"
9097
9104
}
@@ -9118,7 +9125,6 @@ menu
9118
9125
text "DONE_BUTTON"
9119
9126
text style "button"
9120
9127
on escape
9121
- sound ""
9122
9128
action
9123
9129
"
9124
9130
Infinity_PopMenu('POPUP_DETAILS')
@@ -10491,7 +10497,7 @@ menu
10491
10497
{
10492
10498
name "chapterSplit"
10493
10499
enabled "false"
10494
- area 0 0 782 -1
10500
+ area 44 0 772 -1
10495
10501
text lua "text_CHAPTERSCROLL:sub(startPos, curPos)"
10496
10502
text style normal
10497
10503
scrollbar 'GUISCRC'
@@ -10513,15 +10519,16 @@ menu
10513
10519
{
10514
10520
enabled "rowNumber == 1"
10515
10521
opacity lua "textOpacity"
10516
- area 44 0 788 -1
10522
+ area 44 0 772 -1
10517
10523
text lua "text_CHAPTERSCROLL:sub(startPos, splitPos - 1)"
10518
10524
text style normal
10519
10525
}
10520
10526
label
10521
10527
{
10522
10528
enabled "rowNumber == 2"
10523
10529
opacity lua "textOpacity"
10524
- area 0 0 832 -1
10530
+ area 0 0 -1 -1
10531
+ pad 0 0 16 0
10525
10532
text lua "text_CHAPTERSCROLL:sub(splitPos + 1)"
10526
10533
text style normal
10527
10534
}
@@ -10609,7 +10616,7 @@ menu
10609
10616
{
10610
10617
name "epilogueSplit"
10611
10618
enabled "false"
10612
- area 0 0 490 -1
10619
+ area 44 0 480 -1
10613
10620
text lua "text_CHAPTERSCROLL:sub(startPos, curPos)"
10614
10621
text style normal
10615
10622
scrollbar 'GUISCRC'
@@ -10631,15 +10638,16 @@ menu
10631
10638
{
10632
10639
enabled "rowNumber == 1"
10633
10640
opacity lua "textOpacity"
10634
- area 44 0 496 -1
10641
+ area 44 0 480 -1
10635
10642
text lua "text_CHAPTERSCROLL:sub(startPos, splitPos - 1)"
10636
10643
text style normal
10637
10644
}
10638
10645
label
10639
10646
{
10640
10647
enabled "rowNumber == 2"
10641
10648
opacity lua "textOpacity"
10642
- area 0 0 540 -1
10649
+ area 0 0 -1 -1
10650
+ pad 0 0 16 0
10643
10651
text lua "text_CHAPTERSCROLL:sub(splitPos + 1)"
10644
10652
text style normal
10645
10653
}
@@ -14157,14 +14165,14 @@ menu
14157
14165
{
14158
14166
enabled "rowNumber == 1"
14159
14167
opacity lua "step == 1 and 0 or 255"
14160
- area 0 0 752 -1
14168
+ area 0 0 736 -1
14161
14169
text lua "getDialogText(1)"
14162
14170
text style "normal"
14163
14171
}
14164
14172
text
14165
14173
{
14166
14174
enabled "rowNumber == 2"
14167
- area 0 0 752 -1
14175
+ area 0 0 736 -1
14168
14176
pad 0 0 0 12
14169
14177
text lua "getDialogText(2)"
14170
14178
text style "normal"
0 commit comments