Skip to content

Commit

Permalink
fix(zq): Crash in ZInfo menu if descriptions are long
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Apr 3, 2024
1 parent 20ba0bc commit cef01b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dialog/zinfodlg.cpp
Expand Up @@ -81,6 +81,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
),
Label(text = "Itemclass Name:"),
fields[FLD_IC_NAME] = TextField(
maxwidth = 20_em,
maxLength = 255, text = ((*icnameptr) ? (*icnameptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand All @@ -100,6 +101,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
}),
Label(text = "Itemclass Help Text:"),
fields[FLD_IC_HELP] = TextField(
maxwidth = 20_em,
maxLength = 65535, text = ((*ichelpptr) ? (*ichelpptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand Down Expand Up @@ -188,6 +190,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
),
Label(text = "Combo Type Name:"),
fields[FLD_CT_NAME] = TextField(
maxwidth = 20_em,
maxLength = 255, text = ((*ctnameptr) ? (*ctnameptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand All @@ -207,6 +210,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
}),
Label(text = "Combo Type Help Text:"),
fields[FLD_CT_HELP] = TextField(
maxwidth = 20_em,
maxLength = 65535, text = ((*cthelpptr) ? (*cthelpptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand Down Expand Up @@ -295,6 +299,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
),
Label(text = "Mapflag Name:"),
fields[FLD_MF_NAME] = TextField(
maxwidth = 20_em,
maxLength = 255, text = ((*mfnameptr) ? (*mfnameptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand All @@ -314,6 +319,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
}),
Label(text = "Mapflag Help Text:"),
fields[FLD_MF_HELP] = TextField(
maxwidth = 20_em,
maxLength = 65535, text = ((*mfhelpptr) ? (*mfhelpptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand Down Expand Up @@ -397,6 +403,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
),
Label(text = "Weapon Name:"),
fields[FLD_WPN_NAME] = TextField(
maxwidth = 20_em,
maxLength = 255, text = ((*wpnptr) ? (*wpnptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand Down Expand Up @@ -454,6 +461,7 @@ std::shared_ptr<GUI::Widget> ZInfoDialog::view()
),
Label(text = "Counter Name:"),
fields[FLD_CTR_NAME] = TextField(
maxwidth = 20_em,
maxLength = 255, text = ((*ctrnameptr) ? (*ctrnameptr) : ""),
onValChangedFunc = [&](GUI::TextField::type,std::string_view sv,int32_t)
{
Expand Down

0 comments on commit cef01b5

Please sign in to comment.