- Lapper version: 5.843
I worked all day yesterday on implementing the langengine into the Pitboard code.
After a hard day of work I fired it up last night and ran into some troubles.
I've fixed most of them but two things aren't working so far.
Maybe those things aren't bugs in the end but as far as I do know now, they are.
First thing is about putting some text+values in a variable, where the text should be extracted for the language engine:
Sub OnSpbSplit1_Pitboard() # Player event
### Set colors when current S1 is best S1 or within set limit of best S1 ###
IF ( GetCurrentPlayerVar("isBestSectorSplit1") == 1)
THEN
$Color_split1 = "^2";
SetCurrentPlayerVar("Lastsplit1_color","^1" );
IF ( GetCurrentPlayerVar( "lost_gained_messages" ) == "yes")
THEN
IF ( GetCurrentPlayerVar("Information_2") == "")
THEN
SetCurrentPlayerVar("Information_2", langEngine( "%{pitboard_gained_time}%") . NumToMSH(GetCurrentPlayerVar( "DiffSectorSplit1" )) );
ENDIF
ENDIF
ENDIF
EndSub
Lang "EN"
pitboard_gained_time="^2you've gained^7: ";
EndLang
But when the event is displayed it shows: [[TranslateEngine]]-0.07.11
While it should say: You've gained : -0.07.11
--------
Second thing is about the same event but then with only text displayed.
### Text-mode when people choose not to use the Pitboard ###
IF ( GetCurrentPlayerVar("isBestSectorSplit1") == 1)
THEN
PrivMsg ( langEngine( "%{pitboard_text_current_sector_1}%") . $Color_split1 . NumToMSH(GetCurrentPlayerVar( "SectorSplit1" )) . langEngine( "%{pitboard_text_last_sector_1}%") . GetCurrentPlayerVar( "Lastsplit1_color" ) . GetCurrentPlayerVar( "Lastsplit1" ) . langEngine( "%{pitboard_text_best_sector_1}%") . NumToMSH(GetCurrentPlayerVar( "SectorSplit1" )) );
ELSE
PrivMsg ( langEngine( "%{pitboard_text_current_sector_1}%") . $Color_split1 . NumToMSH(GetCurrentPlayerVar( "SectorSplit1" )) . langEngine( "%{pitboard_text_last_sector_1}%") . GetCurrentPlayerVar( "Lastsplit1_color" ) . GetCurrentPlayerVar( "Lastsplit1" ) . langEngine( "%{pitboard_text_best_sector_1}%") . NumToMSH(GetCurrentPlayerVar( "BestSectorSplit1" )) );
ENDIF
Lang "EN"
pitboard_text_current_sector_1="^7CS1: ";
pitboard_text_last_sector_1=" ^7| LS1: ";
pitboard_text_best_sector_1=" ^7| BS1: ";
EndLang
All text parts coming from the language engine are displayed as: [[TranslateEngine]]
--------
Third thing is about the button for text input.
### Set value (in milliseconds) when split has to be shown in yellow. ###
openPrivButton( "config_pb_split_setting_txt",$lr_coordinate+1,$tb_coordinate+51,48,5,5,-1,32,langEngine( "%{pitboard_config_yellow_split_setting}%") );
IF ( GetCurrentPlayerVar ("split_setting") == "")
THEN
openPrivTextButton( "config_pb_split_setting_value",$lr_coordinate+1,$tb_coordinate+56,48,5,5,32,langEngine( "%{pitboard_config_time_milliseconds_long}%"),langEngine( "%{pitboard_config_time_milliseconds_short}%"),5,config_pb_split_setting_value );
ELSE
openPrivTextButton( "config_pb_split_setting_value",$lr_coordinate+1,$tb_coordinate+56,48,5,5,32,langEngine( "%{pitboard_config_time_milliseconds_long}%"),"^3".GetCurrentPlayerVar ("split_setting"),5,config_pb_split_setting_value );
ENDIF
### End ###
The button is working as intended but the title of the button is again displayed [[TranslateEngine]] (see screenshots below)