gump error with latest pol100 core
Posted: Sat Dec 14, 2019 7:02 pm
Hello ,
I updated to the latest version of POL100, to use uicode function, it works!
But for some gump, I got error, for example:
when I use acctinfo command, and I click "Default CmdLevel:" button to change default cmdlevel for me, then no gump pup up and an error message in game :" Error - Unable to display gump. Error text is -> B1 message specified too many ints and/or strings."
It worked with older POL100 version (in 2018), so I guess maybe caused by unicode support core.....
Can someone help me to have a look?
in acctinfo.src:
======================
var input := RequestGump( mobile, "What do you want to sent this account's default cmdlevel to?","", account.defaultcmdlevel, CANCEL_BTN_ON );
======================
in requestgump function:
function RequestGump(mobile, question, option := "", pre_val := "", cancel_btn:=CANCEL_BTN_OFF)
if ( !pre_val || pre_val == error )
pre_val := "";
endif
var r_gump := GFCreateGump(140, 100);
GFClosable(r_gump, 0);
GFResizePic(r_gump, 0, 0, GFGetCfgConst("Defaults", "BackGround"), 400, 205);
GFResizePic(r_gump, 15, 15, GFGetCfgConst("Defaults", "ForeGround"), 370, 175);
GFAddAlphaRegion( r_gump, 0, 0, 400, 205 );
var y_pos := 20;
foreach line in (GFWordWrap(question, 370))
GFTextLine(r_gump, 20, y_pos, 1153, line);
y_pos += 20;
SleepMS(2);
endforeach
y_pos := 75;
foreach line in (GFWordWrap(option, 370))
GFTextLine(r_gump, 20, y_pos, 1153, line);
y_pos += 20;
SleepMS(2);
endforeach
GFResizePic(r_gump, 20, 100, GFGetCfgConst("BackGrounds", "GOLDTRIM"), 360, 30);
var r_txt := GFTextEntry(r_gump, 30, 105, 335, 25, 1153, pre_val);
if ( cancel_btn )
GFAddButton(r_gump, 90, 160, 2128, 2129, GF_CLOSE_BTN, 100);
GFAddButton(r_gump, 240, 160, 2119, 2120, GF_CLOSE_BTN, 200);
else
GFAddButton(r_gump, 180, 160, 2128, 2129, GF_CLOSE_BTN, 100);
endif
var input := GFSendGump(mobile, r_gump);
var text_area := GFExtractData(input, r_txt);
if ( input[200] )
return error;
elseif ( !text_area || text_area == error )
return 0;
else
return text_area;
endif
endfunction
I updated to the latest version of POL100, to use uicode function, it works!
But for some gump, I got error, for example:
when I use acctinfo command, and I click "Default CmdLevel:" button to change default cmdlevel for me, then no gump pup up and an error message in game :" Error - Unable to display gump. Error text is -> B1 message specified too many ints and/or strings."
It worked with older POL100 version (in 2018), so I guess maybe caused by unicode support core.....
Can someone help me to have a look?
in acctinfo.src:
======================
var input := RequestGump( mobile, "What do you want to sent this account's default cmdlevel to?","", account.defaultcmdlevel, CANCEL_BTN_ON );
======================
in requestgump function:
function RequestGump(mobile, question, option := "", pre_val := "", cancel_btn:=CANCEL_BTN_OFF)
if ( !pre_val || pre_val == error )
pre_val := "";
endif
var r_gump := GFCreateGump(140, 100);
GFClosable(r_gump, 0);
GFResizePic(r_gump, 0, 0, GFGetCfgConst("Defaults", "BackGround"), 400, 205);
GFResizePic(r_gump, 15, 15, GFGetCfgConst("Defaults", "ForeGround"), 370, 175);
GFAddAlphaRegion( r_gump, 0, 0, 400, 205 );
var y_pos := 20;
foreach line in (GFWordWrap(question, 370))
GFTextLine(r_gump, 20, y_pos, 1153, line);
y_pos += 20;
SleepMS(2);
endforeach
y_pos := 75;
foreach line in (GFWordWrap(option, 370))
GFTextLine(r_gump, 20, y_pos, 1153, line);
y_pos += 20;
SleepMS(2);
endforeach
GFResizePic(r_gump, 20, 100, GFGetCfgConst("BackGrounds", "GOLDTRIM"), 360, 30);
var r_txt := GFTextEntry(r_gump, 30, 105, 335, 25, 1153, pre_val);
if ( cancel_btn )
GFAddButton(r_gump, 90, 160, 2128, 2129, GF_CLOSE_BTN, 100);
GFAddButton(r_gump, 240, 160, 2119, 2120, GF_CLOSE_BTN, 200);
else
GFAddButton(r_gump, 180, 160, 2128, 2129, GF_CLOSE_BTN, 100);
endif
var input := GFSendGump(mobile, r_gump);
var text_area := GFExtractData(input, r_txt);
if ( input[200] )
return error;
elseif ( !text_area || text_area == error )
return 0;
else
return text_area;
endif
endfunction