Skip to content

Commit

Permalink
Fix Simple Centered Dialog crash
Browse files Browse the repository at this point in the history
  • Loading branch information
r-e-d committed Sep 3, 2022
1 parent 9d7f83f commit 163c3a8
Show file tree
Hide file tree
Showing 10 changed files with 302 additions and 21 deletions.
2 changes: 1 addition & 1 deletion EEUITweaks/EEUITweaks.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ALWAYS
END
END

VERSION ~4.0~
VERSION ~4.0.1~

LANGUAGE
~English~ ~EEUITweaks/languages/english~ ~EEUITweaks/languages/english/setup.tra~
Expand Down
2 changes: 1 addition & 1 deletion EEUITweaks/Installation.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EEUITweaks - Version 4.0
EEUITweaks - Version 4.0.1

This mod is configured as a WeiDU mod and consists of a setup program
named setup-EEUITweaks.exe and a mod files directory named EEUITweaks.
Expand Down
4 changes: 2 additions & 2 deletions EEUITweaks/include/CenteredDialog.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DEFINE_ACTION_MACRO CenteredDialog.WorldDialogConfirmPatch2
BEGIN
LOCAL_SPRINT tempstr $UIMenuIF("Body")
LOCAL_SET found = 0
LOCAL_SPRINT adder ~%TAB%offset 0 93%LE%%TAB%align center center%LE%~
LOCAL_SPRINT adder ~%TAB%offset 0 164%LE%%TAB%align center center%LE%~

// Put current menu definition into inline file
COPY - ~ToInlineTemplate~ ~.../CounterInLine~
Expand Down Expand Up @@ -102,7 +102,7 @@ END
/*******************************************************************************
* WorldDialogPatch1
*
* Changes alignment and removes offset for LeUI WORLD_CONFIRM
* Changes alignment and removes offset for LeUI WORLD_DIALOG
*
* On completion $UIMenuIF("Succeeded") 1 => Success, 0 => Failure
*
Expand Down
51 changes: 49 additions & 2 deletions EEUITweaks/menu/CenteredDialog/worlddialogmenu.menu
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ menu
align center center
ignoreEsc
onOpen
"
"
Infinity_PopMenu('ITEM_DESCRIPTION')
Infinity_PushMenu('WORLD_MESSAGES')
Infinity_PushMenu('WORLD_DIALOG_CONFIRM')
if(isTouchActionbar() and not dialogViewMode) then
Infinity_PushMenu('WORLD_DIALOG_LEFT')
Infinity_PushMenu('WORLD_DIALOG_RIGHT')
end
greySidebars()
"
onClose
"
Infinity_PopMenu('WORLD_DIALOG_CONFIRM')
Infinity_PopMenu('WORLD_MESSAGES')
Infinity_PopMenu('WORLD_DIALOG_LEFT')
Infinity_PopMenu('WORLD_DIALOG_RIGHT')
ungreySidebars()
"
label
Expand All @@ -35,6 +42,46 @@ menu
text style "gamelog"
scrollbar 'GUISCRC'
}
text
{
name "worldDialogMessageBox"
enabled "showWorldMessages"
area 20 -175 824 124
text lua "worldMessageBoxText"
text style "gamelog"
scrollbar 'GUISCRC'
scrollbar func "chatboxScroll"
}
handle
{
enabled "showWorldMessages"
name "dialogHandleY"
area 0 -47 863 32
actionDrag
"
dragDialogMessagesY(motionY)
"
}
text
{
enabled "showWorldMessages"
name "worldDialogShowMessagesButton"
area 764 -39 62 31
tooltip lua "t('LOG_HISTORY_TOOLTIP')"
bam "CHATHIST"
frame lua "showMessagesButtonFrame()"
action
"
toggleDialogShowMessages()
"
}
text
{
name "worldDialogMessageDivider"
enabled "showWorldMessages"
area 33 -47 800 8
mosaic "DLGDIVI"
}
list
{
column
Expand Down Expand Up @@ -76,7 +123,7 @@ menu
action
"
--In confirm mode, just highlight the choice.
if(gameOptions.m_bConfirmDialog == true) then return end
if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0) or (worldPlayerDialogSelection > #worldPlayerDialogChoices)) then return end
worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
worldPlayerDialogSelection = 0
"
Expand Down
55 changes: 51 additions & 4 deletions EEUITweaks/menu/CenteredDialog/worlddialogmenu2.menu
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ menu
align center center
ignoreEsc
onOpen
"
"
Infinity_PopMenu('ITEM_DESCRIPTION')
Infinity_PushMenu('WORLD_MESSAGES')
Infinity_PushMenu('WORLD_DIALOG_CONFIRM')
if(isTouchActionbar() and not dialogViewMode) then
Infinity_PushMenu('WORLD_DIALOG_LEFT')
Infinity_PushMenu('WORLD_DIALOG_RIGHT')
end
greySidebars()
"
onClose
"
Infinity_PopMenu('WORLD_DIALOG_CONFIRM')
Infinity_PopMenu('WORLD_MESSAGES')
Infinity_PopMenu('WORLD_DIALOG_LEFT')
Infinity_PopMenu('WORLD_DIALOG_RIGHT')
ungreySidebars()
"
label
Expand All @@ -32,8 +39,48 @@ menu
name "worldNPCDialog"
area 84 22 749 38
text lua "worldNPCDialogText"
text style "normal"
text style "gamelog"
scrollbar 'GUISCRC'
}
text
{
name "worldDialogMessageBox"
enabled "showWorldMessages"
area 20 -124 813 124
text lua "worldMessageBoxText"
text style "gamelog"
scrollbar 'GUISCRC'
scrollbar func "chatboxScroll"
}
handle
{
enabled "showWorldMessages"
name "dialogHandleY"
area 0 0 863 32
actionDrag
"
dragDialogMessagesY(motionY)
"
}
text
{
enabled "showWorldMessages"
name "worldDialogShowMessagesButton"
area 754 16 62 28
tooltip lua "t('LOG_HISTORY_TOOLTIP')"
bam "CHATHIST"
frame lua "showMessagesButtonFrame()"
action
"
toggleDialogShowMessages()
"
}
text
{
name "worldDialogMessageDivider"
enabled "showWorldMessages"
area 33 0 800 8
mosaic "DLGDIVI"
}
list
{
Expand All @@ -51,7 +98,7 @@ menu
{
area 0 0 -1 -1
text lua "getDialogEntryText(rowNumber)"
text style "normal"
text style "gamelog"
}
}
name "worldPlayerDialogChoicesList"
Expand All @@ -76,7 +123,7 @@ menu
action
"
--In confirm mode, just highlight the choice.
if(gameOptions.m_bConfirmDialog == true) then return end
if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0) or (worldPlayerDialogSelection > #worldPlayerDialogChoices)) then return end
worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
worldPlayerDialogSelection = 0
"
Expand Down
51 changes: 49 additions & 2 deletions EEUITweaks/menu/CenteredDialog/worlddialogmenu3.menu
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ menu
align center center
ignoreEsc
onOpen
"
"
Infinity_PopMenu('ITEM_DESCRIPTION')
Infinity_PushMenu('WORLD_MESSAGES')
Infinity_PushMenu('WORLD_DIALOG_CONFIRM')
if(isTouchActionbar() and not dialogViewMode) then
Infinity_PushMenu('WORLD_DIALOG_LEFT')
Infinity_PushMenu('WORLD_DIALOG_RIGHT')
end
greySidebars()
"
onClose
"
Infinity_PopMenu('WORLD_DIALOG_CONFIRM')
Infinity_PopMenu('WORLD_MESSAGES')
Infinity_PopMenu('WORLD_DIALOG_LEFT')
Infinity_PopMenu('WORLD_DIALOG_RIGHT')
ungreySidebars()
"
label
Expand All @@ -35,6 +42,46 @@ menu
text style "gamelog_sod"
scrollbar 'GUISCRC'
}
text
{
name "worldDialogMessageBox"
enabled "showWorldMessages"
area 20 -175 824 124
text lua "worldMessageBoxText"
text style "gamelog"
scrollbar 'GUISCRC'
scrollbar func "chatboxScroll"
}
handle
{
enabled "showWorldMessages"
name "dialogHandleY"
area 0 -47 863 32
actionDrag
"
dragDialogMessagesY(motionY)
"
}
text
{
enabled "showWorldMessages"
name "worldDialogShowMessagesButton"
area 764 -39 62 31
tooltip lua "t('LOG_HISTORY_TOOLTIP')"
bam "CHATHIST"
frame lua "showMessagesButtonFrame()"
action
"
toggleDialogShowMessages()
"
}
text
{
name "worldDialogMessageDivider"
enabled "showWorldMessages"
area 33 -47 800 8
mosaic "DLGDIVI"
}
list
{
column
Expand Down Expand Up @@ -76,7 +123,7 @@ menu
action
"
--In confirm mode, just highlight the choice.
if(gameOptions.m_bConfirmDialog == true) then return end
if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0) or (worldPlayerDialogSelection > #worldPlayerDialogChoices)) then return end
worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
worldPlayerDialogSelection = 0
"
Expand Down
52 changes: 49 additions & 3 deletions EEUITweaks/menu/CenteredDialog/worlddialogmenu4.menu
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ menu
align center center
ignoreEsc
onOpen
"
"
Infinity_PopMenu('ITEM_DESCRIPTION')
Infinity_PushMenu('WORLD_MESSAGES')
Infinity_PushMenu('WORLD_DIALOG_CONFIRM')
if(isTouchActionbar() and not dialogViewMode) then
Infinity_PushMenu('WORLD_DIALOG_LEFT')
Infinity_PushMenu('WORLD_DIALOG_RIGHT')
end
greySidebars()
"
onClose
"

Infinity_PopMenu('WORLD_DIALOG_CONFIRM')
Infinity_PopMenu('WORLD_MESSAGES')
Infinity_PopMenu('WORLD_DIALOG_LEFT')
Infinity_PopMenu('WORLD_DIALOG_RIGHT')
ungreySidebars()
"
label
Expand All @@ -36,6 +42,46 @@ menu
text style "gamelog"
scrollbar 'GUISCRC'
}
text
{
name "worldDialogMessageBox"
enabled "showWorldMessages"
area 20 -175 824 124
text lua "worldMessageBoxText"
text style "gamelog"
scrollbar 'GUISCRC'
scrollbar func "chatboxScroll"
}
handle
{
enabled "showWorldMessages"
name "dialogHandleY"
area 0 -47 863 32
actionDrag
"
dragDialogMessagesY(motionY)
"
}
text
{
enabled "showWorldMessages"
name "worldDialogShowMessagesButton"
area 764 -39 62 31
tooltip lua "t('LOG_HISTORY_TOOLTIP')"
bam "CHATHIST"
frame lua "showMessagesButtonFrame()"
action
"
toggleDialogShowMessages()
"
}
text
{
name "worldDialogMessageDivider"
enabled "showWorldMessages"
area 33 -47 800 8
mosaic "DLGDIVI"
}
list
{
column
Expand Down Expand Up @@ -77,7 +123,7 @@ menu
action
"
--In confirm mode, just highlight the choice.
if(gameOptions.m_bConfirmDialog == true) then return end
if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0) or (worldPlayerDialogSelection > #worldPlayerDialogChoices)) then return end
worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
worldPlayerDialogSelection = 0
"
Expand Down
Loading

0 comments on commit 163c3a8

Please sign in to comment.