@@ -14034,21 +14034,21 @@ end
14034
14034
function dragDialogMessagesY(newY)
14035
14035
local x,y,w,hOld = Infinity_GetArea("worldDialogBackground")
14036
14036
h = hOld - newY
14037
- if h < 100 then
14038
- newY = hOld - 100
14039
- elseif h > 500 then
14040
- newY = hOld - 500
14037
+ if h < 210 then
14038
+ newY = hOld - 210
14039
+ elseif h > 700 then
14040
+ newY = hOld - 700
14041
14041
end
14042
14042
14043
14043
adjustItemGroup({"dialogHandleY","worldDialogPortraitArea"},0,newY,0,0)
14044
- adjustItemGroup({"worldDialogBackground","worldPlayerDialogChoicesList"},0,newY,0,-newY)
14044
+ adjustItemGroup({"worldDialogBackground","worldPlayerDialogChoicesList","worldPlayerDialogFake" },0,newY,0,-newY)
14045
14045
end
14046
14046
14047
14047
function getDialogEntryText(row)
14048
- local text = worldPlayerDialogChoices[row - 2 ].text
14048
+ local text = worldPlayerDialogChoices[row].text
14049
14049
if (row == worldPlayerDialogSelection) then
14050
14050
--Color the text white when selected
14051
- text = string.gsub(text, "%^0xff212eff", "^0xFFFFFFFF ")
14051
+ text = string.gsub(text, "%^0xff212eff", "^0xffffffff ")
14052
14052
end
14053
14053
return text
14054
14054
end
@@ -14088,11 +14088,50 @@ function getDialogText(row)
14088
14088
return trim(row == 1 and worldMessageBoxText:sub(1, idx1) or worldMessageBoxText:sub(idx1 + 1))
14089
14089
end
14090
14090
14091
+ function B3Split(inputstr, sep)
14092
+ sep = sep or "%s"
14093
+ local t = {}
14094
+ for field, s in string.gmatch(inputstr, "([^"..sep.."]*)("..sep.."?)") do
14095
+ table.insert(t, field)
14096
+ if s == "" then
14097
+ return t
14098
+ end
14099
+ end
14100
+ end
14101
+
14102
+ B3DialogTable = {}
14103
+ B3DialogTextI = -1
14104
+ B3DialogResponsesStart = -1
14105
+ B3DialogResponsesEnd = -1
14106
+
14091
14107
function makeDialogTable()
14092
- if step == 1 then
14093
- return makeTable(1)
14108
+ B3DialogTable = B3Split(getDialogText(1), "\n")
14109
+ B3DialogTextI = #B3DialogTable + 1
14110
+ B3DialogResponsesStart = B3DialogTextI + 1
14111
+ B3DialogResponsesEnd = B3DialogResponsesStart + #worldPlayerDialogChoices - 1
14112
+ if step == 2 then
14113
+ table.insert(B3DialogTable, getDialogText(2))
14114
+ for _, v in pairs(worldPlayerDialogChoices) do
14115
+ table.insert(B3DialogTable, v.text)
14116
+ end
14117
+ local paddingText = getDialogPaddingText()
14118
+ table.insert(B3DialogTable, paddingText)
14119
+ end
14120
+ return B3DialogTable
14121
+ end
14122
+
14123
+ function getDialogPortrait()
14124
+ if worldNPCDialogPortrait == nil or worldNPCDialogPortrait == 'NONE' then
14125
+ return 'NOPORTLS'
14094
14126
end
14095
- return makeTable(#worldPlayerDialogChoices + 3)
14127
+ if worldNPCDialogPortrait:sub(-1) == 'S' then
14128
+ for _, entry in ipairs(Infinity_GetFilesOfType("BMP")) do
14129
+ if entry[1] == worldNPCDialogPortrait:sub(1, -2) .. 'M' then
14130
+ return entry[1]
14131
+ end
14132
+ end
14133
+ end
14134
+ return worldNPCDialogPortrait
14096
14135
end
14097
14136
`
14098
14137
menu
@@ -14103,6 +14142,7 @@ menu
14103
14142
ignoreEsc
14104
14143
onOpen
14105
14144
"
14145
+ step = 1
14106
14146
Infinity_PopMenu('ITEM_DESCRIPTION')
14107
14147
Infinity_PopMenu('POPUP_DETAILS')
14108
14148
Infinity_PushMenu('WORLD_DIALOG_CONFIRM')
@@ -14122,7 +14162,7 @@ menu
14122
14162
label
14123
14163
{
14124
14164
name "worldDialogBackground"
14125
- area 0 0 864 250
14165
+ area 0 0 864 350
14126
14166
rectangle 4
14127
14167
}
14128
14168
button
@@ -14144,8 +14184,8 @@ menu
14144
14184
label
14145
14185
{
14146
14186
name "worldDialogPortraitArea"
14147
- area 24 20 54 84
14148
- bitmap lua "worldNPCDialogPortrait "
14187
+ area 20 20 110 170
14188
+ bitmap lua "getDialogPortrait() "
14149
14189
}
14150
14190
handle
14151
14191
{
@@ -14156,51 +14196,59 @@ menu
14156
14196
dragDialogMessagesY(motionY)
14157
14197
"
14158
14198
}
14199
+ text
14200
+ {
14201
+ name "worldPlayerDialogFake"
14202
+ enabled "step == 1"
14203
+ area 138 20 702 210
14204
+ text lua "getDialogText(2)"
14205
+ text style "normal"
14206
+ }
14159
14207
list
14160
14208
{
14161
14209
column
14162
14210
{
14163
14211
width 100
14164
14212
text
14165
14213
{
14166
- enabled "rowNumber == 1 "
14214
+ enabled "rowNumber < B3DialogTextI "
14167
14215
opacity lua "step == 1 and 0 or 255"
14168
- area 0 0 736 -1
14169
- text lua "getDialogText(1)"
14216
+ area 0 0 -1 -1
14217
+ text lua 'B3DialogTable[rowNumber]'
14170
14218
text style "normal"
14171
14219
}
14172
14220
text
14173
14221
{
14174
- enabled "rowNumber == 2 "
14175
- area 0 0 736 -1
14222
+ enabled "rowNumber == B3DialogTextI "
14223
+ area 0 0 -1 -1
14176
14224
pad 0 0 0 12
14177
- text lua "getDialogText(2) "
14225
+ text lua "B3DialogTable[rowNumber] "
14178
14226
text style "normal"
14179
14227
}
14180
14228
label
14181
14229
{
14230
+ enabled "rowNumber >= B3DialogResponsesStart and rowNumber <= B3DialogResponsesEnd and dialogEntryGreyed()"
14182
14231
area 0 0 -1 -1
14183
- enabled "rowNumber > 2 and rowNumber < #worldPlayerDialogChoices + 3 and dialogEntryGreyed()"
14184
14232
rectangle 1
14185
14233
rectangle opacity 100
14186
14234
}
14187
14235
text
14188
14236
{
14189
- enabled "rowNumber > 2 and rowNumber < #worldPlayerDialogChoices + 3 "
14237
+ enabled "rowNumber >= B3DialogResponsesStart and rowNumber <= B3DialogResponsesEnd "
14190
14238
area 0 0 -1 -1
14191
- text lua "getDialogEntryText(rowNumber)"
14239
+ text lua "getDialogEntryText(rowNumber - B3DialogResponsesStart + 1 )"
14192
14240
text style "normal"
14193
14241
}
14194
14242
text
14195
14243
{
14196
- enabled "rowNumber == #worldPlayerDialogChoices + 3 "
14244
+ enabled "rowNumber > B3DialogResponsesEnd "
14197
14245
area 0 0 -1 -1
14198
- text lua "getDialogPaddingText()"
14246
+ text lua 'B3DialogTable[rowNumber]'
14199
14247
text style "normal"
14200
14248
}
14201
14249
}
14202
14250
name "worldPlayerDialogChoicesList"
14203
- area 88 20 752 210
14251
+ area 138 20 702 310
14204
14252
rowheight dynamic
14205
14253
hideHighlight
14206
14254
table "makeDialogTable()"
@@ -14210,7 +14258,7 @@ menu
14210
14258
actionEnter
14211
14259
"
14212
14260
if(gameOptions.m_bConfirmDialog == true) then return end
14213
- worldPlayerDialogSelection = mouseoverRow
14261
+ worldPlayerDialogSelection = mouseoverRow - B3DialogResponsesStart + 1
14214
14262
"
14215
14263
actionExit
14216
14264
"
@@ -14219,10 +14267,10 @@ menu
14219
14267
"
14220
14268
action
14221
14269
"
14270
+ worldPlayerDialogSelection = mouseoverRow - B3DialogResponsesStart + 1
14222
14271
--In confirm mode, just highlight the choice.
14223
- if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0)) then return end
14224
- if(worldPlayerDialogChoices[worldPlayerDialogSelection - 2] == nil) then return end
14225
- worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection - 2].marker)
14272
+ if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0) or (worldPlayerDialogSelection > #worldPlayerDialogChoices)) then return end
14273
+ worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
14226
14274
worldPlayerDialogSelection = 0
14227
14275
"
14228
14276
}
@@ -14238,7 +14286,7 @@ end
14238
14286
14239
14287
function getDialogButtonClickable()
14240
14288
if(gameOptions.m_bConfirmDialog == true) then
14241
- return (#worldPlayerDialogChoices == 0) or (worldPlayerDialogSelection and worldPlayerDialogSelection > 2 ) --no choices, or we've selected a choice.
14289
+ return (#worldPlayerDialogChoices == 0) or (worldPlayerDialogSelection > 0 and worldPlayerDialogSelection <= #worldPlayerDialogChoices ) --no choices, or we've selected a choice.
14242
14290
else
14243
14291
return true
14244
14292
end
@@ -14260,9 +14308,9 @@ menu
14260
14308
text style "button"
14261
14309
action
14262
14310
"
14263
- if(gameOptions.m_bConfirmDialog == true and ( #worldPlayerDialogChoices > 0) ) then
14311
+ if(gameOptions.m_bConfirmDialog == true and #worldPlayerDialogChoices > 0) then
14264
14312
-- if confirm dialog and choices available.
14265
- worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection - 2 ].marker)
14313
+ worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
14266
14314
worldPlayerDialogSelection = 0
14267
14315
else
14268
14316
-- no choices, just step.
0 commit comments