Remove ucstring from lua and UI

ryzomclassic-develop
kaetemi 4 years ago
parent d11936a035
commit 380722e2e6

@ -48,7 +48,7 @@ function bgdownloader:setProgressText(ucstr, color, progress, ellipsis)
local text = self:getProgressGroup():find("text")
local ellipsisTxt = self:getProgressGroup():find("ellipsis")
text.color = color
text.uc_hardtext = ucstr
text.text = ucstr
if ellipsis then
ellipsisTxt.hardtext = ellipsis
else
@ -60,7 +60,7 @@ function bgdownloader:setProgressText(ucstr, color, progress, ellipsis)
-- any current download to finish, otherwise connection may be lost)
self:setIcon("bgd_pause.tga")
ellipsisTxt.hardtext = ""
text.uc_hardtext = pausedText
text.text = pausedText
else
self:setIcon("")
local progressCtrl = self:getProgressBar()
@ -88,7 +88,7 @@ function bgdownloader:setPatchProgress(progress)
local progressDate = nltime.getLocalTime() / 500
local colValue = math.floor(230 + 24 * math.sin(progressDate))
local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255)
self:setProgressText(concatUCString(i18n.get("uiBGD_Progress"), ucstring(progressPercentText)), color, progress, progressSymbol[progressPostfix + 1])
self:setProgressText(concatString(i18n.get("uiBGD_Progress"), progressPercentText), color, progress, progressSymbol[progressPostfix + 1])
end
------------------------------------------------------------------------------------------------------------
@ -110,7 +110,7 @@ function bgdownloader:setPatchError()
self:getProgressGroup().active = true
end
local errMsg = getPatchLastErrorMessage()
if errMsg == ucstring() then
if errMsg == "" then
self:setProgressText(i18n.get("uiBGD_PatchError"), "255 0 0 255", 0)
else
self:setProgressText(errMsg, "255 0 0 255", 0)

@ -366,7 +366,7 @@
<instance template="box_widget" id="box1" posref="TL TL" sizeref="w" w="-18" h="16" x="18" />
<view type="text" id="val1" posparent="box1" posref="MR MR" x="-3" y="-2" color="135 243 28 255" shadow="true" fontsize="10" hardtext="" global_color="false" />
<ctrl type="tooltip" id="tt" instant_help="true" posref="TL TL" x="0" y="0" sizeref="wh" w="0" h="0" />
<link expr="getPriceWithFame(@#value,@#value_fame)" target="val1:uc_hardtext" />
<link expr="getPriceWithFame(@#value,@#value_fame)" target="val1:hardtext" />
<link expr="ifthenelse(eq(@UI:TEMP:TRADE_ITEM:IS_SELL_DLG,1),ifthenelse(eq(@#value,@#value_fame),localize('uittPriceWithFameEqual'),localize('uittPriceWithFameDiff')),'')" target="tt:tooltip" />
</group>
</template>
@ -376,7 +376,7 @@
<view type="bitmap" id="icone" posref="TL TL" texture="money_seve.tga" global_color="false" />
<instance template="box_widget" id="box1" posref="TL TL" sizeref="w" w="-18" h="16" x="18" />
<view type="text" id="val1" posparent="box1" posref="MR MR" x="-3" y="-2" color="135 243 28 255" shadow="true" fontsize="10" hardtext="" global_color="false" />
<link expr="getBonusOnResale(@#value_high,@#value_low)" target="val1:uc_hardtext" />
<link expr="getBonusOnResale(@#value_high,@#value_low)" target="val1:hardtext" />
</group>
</template>
<!-- the modal -->

@ -100,7 +100,7 @@ function GameR2Loading:setScenarioLanguage(header)
local lvlWidget = win:find("Language")
if header.Language then
local language = "uiR2ED"..header.Language
lvlWidget.hardtext = i18n.get(language):toUtf8()
lvlWidget.hardtext = i18n.get(language)
else
lvlWidget.hardtext = ""
end
@ -124,7 +124,7 @@ function GameR2Loading:setScenarioRingAccess(header)
local okButton = win:find("validate")
if getDbProp("SERVER:USER:IS_NEWBIE") == 1 and isPlayerFreeTrial() and not header.OtherCharAccess or header.OtherCharAccess ~= "RoSOnly" then
accessWidget.hardtext = i18n.get("uiR2EDLoadScenario_No"):toUtf8()
accessWidget.hardtext = i18n.get("uiR2EDLoadScenario_No")
okButton.frozen = true
end
@ -132,9 +132,9 @@ function GameR2Loading:setScenarioRingAccess(header)
self.RingAccess = game.checkRingAccess(header.RingPointLevel)
if self.RingAccess == true then
accessWidget.hardtext = i18n.get("uiR2EDLoadScenario_Yes"):toUtf8()
accessWidget.hardtext = i18n.get("uiR2EDLoadScenario_Yes")
else
accessWidget.hardtext = i18n.get("uiR2EDLoadScenario_No"):toUtf8()
accessWidget.hardtext = i18n.get("uiR2EDLoadScenario_No")
end
okButton.frozen = not self.RingAccess
@ -561,9 +561,9 @@ function GameR2Loading:getTreeTooltip()
local isInNoobLand = getDbProp("SERVER:USER:IS_NEWBIE")
if isInNoobLand == 1 and isPlayerFreeTrial() then
tree.tooltip = i18n.get("uiR2EdPropertyToolTip_LoadScenario_LoadScenario_NewbieTreeInfo"):toUtf8()
tree.tooltip = i18n.get("uiR2EdPropertyToolTip_LoadScenario_LoadScenario_NewbieTreeInfo")
else
tree.tooltip = i18n.get("uiR2EdPropertyToolTip_LoadScenario_LoadScenario_TreeInfo"):toUtf8()
tree.tooltip = i18n.get("uiR2EdPropertyToolTip_LoadScenario_LoadScenario_TreeInfo")
end
end

@ -61,13 +61,13 @@ function game:guildBuildInterface()
uiMember.name.hardtext = getGuildMemberName(i);
local memberGrade = getGuildMemberGrade(i);
if (memberGrade == 'Leader') then
uiMember.grade.uc_hardtext = i18n.get('uiGuildLeader');
uiMember.grade.text = i18n.get('uiGuildLeader');
elseif (memberGrade == 'HighOfficer') then
uiMember.grade.uc_hardtext = i18n.get('uiGuildHighOfficer');
uiMember.grade.text = i18n.get('uiGuildHighOfficer');
elseif (memberGrade == 'Officer') then
uiMember.grade.uc_hardtext = i18n.get('uiGuildOfficer');
uiMember.grade.text = i18n.get('uiGuildOfficer');
else
uiMember.grade.uc_hardtext = i18n.get('uiGuildMember');
uiMember.grade.text = i18n.get('uiGuildMember');
end
uiMemberList:addChild(uiMember);
end

@ -121,7 +121,7 @@ function game:displayMagicProtect(dbVal)
local uiText= ui.val;
-- set the text (percentage)
uiText.uc_hardtext= tostring(val) .. "%";
uiText.text= tostring(val) .. "%";
-- set color and global color according to maximum reached or not
if(val >= vMax) then
@ -215,7 +215,7 @@ function game:displayMagicResist(dbVal)
local uiText= ui.val;
-- set the text (final value)
uiText.uc_hardtext= tostring(val);
uiText.text= tostring(val);
-- set color and global color according to maximum reached or not
if(val >= vMax) then
@ -273,14 +273,14 @@ function game:onDrawNpcWebPage()
if(available) then
local ucUrl
if config.Local == 1 then
ucUrl = ucstring(NicoMagicURL) -- for test in local mode
ucUrl = NicoMagicURL -- for test in local mode
else
ucUrl = getDynString(self.NpcWebPage.UrlTextId);
end
-- browse
local uiStr= getUIId(getUICaller());
-- if the url
local utf8Url = ucUrl:toUtf8()
local utf8Url = ucUrl
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
if isRing then
-- when in ring mode, add the parameters ourselves. 60 sec timeout because of zope...
@ -585,30 +585,30 @@ function game:getPvpEffects()
fmt = i18n.get('uiPvPEffect_' .. getRegionByAlias(id) .. '_Bonus');
fmt = replacePvpEffectParam(fmt, param);
if (textBonus ~= '') then
textBonus = concatUCString(textBonus, '\n\n');
textBonus = concatString(textBonus, '\n\n');
end
textBonus = concatUCString(textBonus, fmt);
textBonus = concatString(textBonus, fmt);
else
hasMalus = true;
fmt = i18n.get('uiPvPEffect_' .. getRegionByAlias(id) .. '_Malus');
fmt = replacePvpEffectParam(fmt, param);
if (textMalus ~= '') then
textMalus = concatUCString(textMalus, '\n\n');
textMalus = concatString(textMalus, '\n\n');
end
textMalus = concatUCString(textMalus, fmt);
textMalus = concatString(textMalus, fmt);
end;
end
end
if (hasBonus) then
uiGroup.pvpEffectsBonusMalusInfo.uc_hardtext_format = i18n.get('uiPvpEffectBonus');
uiGroup.pvpEffectsBonusMalus.uc_hardtext_format = textBonus;
uiGroup.pvpEffectsBonusMalusInfo.text_format = i18n.get('uiPvpEffectBonus');
uiGroup.pvpEffectsBonusMalus.text_format = textBonus;
elseif (hasMalus) then
uiGroup.pvpEffectsBonusMalusInfo.uc_hardtext_format = i18n.get('uiPvpEffectMalus');
uiGroup.pvpEffectsBonusMalus.uc_hardtext_format = textMalus;
uiGroup.pvpEffectsBonusMalusInfo.text_format = i18n.get('uiPvpEffectMalus');
uiGroup.pvpEffectsBonusMalus.text_format = textMalus;
else
uiGroup.pvpEffectsBonusMalusInfo.uc_hardtext_format = '';
uiGroup.pvpEffectsBonusMalus.uc_hardtext_format = '';
uiGroup.pvpEffectsBonusMalusInfo.text_format = '';
uiGroup.pvpEffectsBonusMalus.text_format = '';
end
end
@ -651,7 +651,7 @@ function game:getAllegiancePoints()
text = findReplaceAll(text, '%faction', self:getFactionName(civ));
text = findReplaceAll(text, '%points', tostring(civPoints));
end
uiGroup.civ_allegiance_pts.uc_hardtext_format = text;
uiGroup.civ_allegiance_pts.text_format = text;
-- cult allegiance
if (cult == self.TPVPClan.None or cult == self.TPVPClan.Neutral) then
@ -661,7 +661,7 @@ function game:getAllegiancePoints()
text = findReplaceAll(text, '%faction', self:getFactionName(cult));
text = findReplaceAll(text, '%points', tostring(cultPoints));
end
uiGroup.cult_allegiance_pts.uc_hardtext_format = text;
uiGroup.cult_allegiance_pts.text_format = text;
end
------------------------------------------------------------------------------------------------------------
@ -669,7 +669,7 @@ function game:updateAllegiance(path, uiText)
local alleg = getDbProp(path);
local text = i18n.get('uiFameAllegiance' .. tostring(alleg) );
getUICaller()[uiText].uc_hardtext= text;
getUICaller()[uiText].text= text;
end
------------------------------------------------------------------------------------------------------------
@ -708,28 +708,28 @@ function game:tooltipDeltaValue(base, max)
local text;
if (val == 0) then
text = concatUCString('@{FFFF}', tostring(max));
text = concatString('@{FFFF}', tostring(max));
else
if (val > 0) then
-- bonus
text = concatUCString('@{FFFF}', tostring(max));
text = concatUCString(text, ' (');
text = concatUCString(text, tostring(base));
text = concatUCString(text, '@{0F0F}');
text = concatUCString(text, ' + ');
text = concatUCString(text, tostring(val));
text = concatUCString(text, '@{FFFF}');
text = concatUCString(text, ')');
text = concatString('@{FFFF}', tostring(max));
text = concatString(text, ' (');
text = concatString(text, tostring(base));
text = concatString(text, '@{0F0F}');
text = concatString(text, ' + ');
text = concatString(text, tostring(val));
text = concatString(text, '@{FFFF}');
text = concatString(text, ')');
else
-- malus
text = concatUCString('@{FFFF}', tostring(max));
text = concatUCString(text, ' (');
text = concatUCString(text, tostring(base));
text = concatUCString(text, '@{E42F}');
text = concatUCString(text, ' - ');
text = concatUCString(text, tostring(math.abs(val)));
text = concatUCString(text, '@{FFFF}');
text = concatUCString(text, ')');
text = concatString('@{FFFF}', tostring(max));
text = concatString(text, ' (');
text = concatString(text, tostring(base));
text = concatString(text, '@{E42F}');
text = concatString(text, ' - ');
text = concatString(text, tostring(math.abs(val)));
text = concatString(text, '@{FFFF}');
text = concatString(text, ')');
end
end
@ -958,7 +958,7 @@ function RingPlayerInfo:updateRRPSLevel(dbVal, tooltip)
local uiText= ui.val;
-- set the text
uiText.uc_hardtext= tostring(val)
uiText.text= tostring(val)
self:tooltipRRPs(dbVal, tooltip)
end
@ -1299,10 +1299,10 @@ function game:updateMissionJournalHeader()
win.header_active = headerActive
win.right_button_enabled = headerActive
if headerActive then
win.uc_title_opened = i18n.get("uiJournalTitle")
win.title_opened = i18n.get("uiJournalTitle")
win.content_y_offset = 0
else
win.uc_title_opened = ucstring("")
win.title_opened = ""
win.content_y_offset = win.header_opened.h_real + 3
end
end
@ -1336,8 +1336,8 @@ function game:updateMissionJournalFixedEntry()
id = id .. "_Mainland_" .. getUserRace()
end
end
fixedEntryMain.uc_hardtext = i18n.get(id)
fixedEntryRing.uc_hardtext = i18n.get(id)
fixedEntryMain.text = i18n.get(id)
fixedEntryRing.text = i18n.get(id)
self:updateMissionWindowLayout()
end

@ -796,7 +796,7 @@
<action handler="remove_link" params="id=mission_timer_link" />
<action handler="remove_link" params="id=mission_time2_link" />
<action handler="add_link" params="id=mission_timer_link|expr=secondsToTimeString(div(sub(@SERVER:MISSIONS:@0:END_DATE,@UI:VARIABLES:CURRENT_SERVER_TICK),10))|target=ui:interface:info_player_journal:content:desc:timer:t:uc_hardtext" />
<action handler="add_link" params="id=mission_timer_link|expr=secondsToTimeString(div(sub(@SERVER:MISSIONS:@0:END_DATE,@UI:VARIABLES:CURRENT_SERVER_TICK),10))|target=ui:interface:info_player_journal:content:desc:timer:t:hardtext" />
<action handler="add_link" params="id=mission_time2_link|expr=ne(@SERVER:MISSIONS:@0:END_DATE,0)|target=ui:interface:info_player_journal:content:desc:timer:active" />
<vector template="t_mission_proc_title_histo" _size="%ipj_nb_histo" nb="$i" />
@ -884,7 +884,7 @@
<action handler="remove_link" params="id=mission_timer_link" />
<action handler="remove_link" params="id=mission_time2_link" />
<action handler="add_link" params="id=mission_timer_link|expr=secondsToTimeString(div(sub(@SERVER:GROUP:MISSIONS:@0:END_DATE,@UI:VARIABLES:CURRENT_SERVER_TICK),10))|target=ui:interface:info_player_journal:content:desc:timer:t:uc_hardtext" />
<action handler="add_link" params="id=mission_timer_link|expr=secondsToTimeString(div(sub(@SERVER:GROUP:MISSIONS:@0:END_DATE,@UI:VARIABLES:CURRENT_SERVER_TICK),10))|target=ui:interface:info_player_journal:content:desc:timer:t:hardtext" />
<action handler="add_link" params="id=mission_time2_link|expr=ne(@SERVER:GROUP:MISSIONS:@0:END_DATE,0)|target=ui:interface:info_player_journal:content:desc:timer:active" />
<vector template="t_group_mission_proc_title_histo" _size="%ipj_nb_histo" nb="$i" />

@ -60,12 +60,12 @@ function game:updateEmoteMenu(prop, tooltip, tooltip_pushed, name, param)
if (key ~= nil and key ~= '') then
key = ' @{T25}@{2F2F}(' .. key .. ')';
text = concatUCString(text, key);
text = concatString(text, key);
end
-- if we don't do the full getUI, it doesn't work (don't understand why)
local uiQC= getUI("ui:interface:user_chat_emote_menu:quick_chat:" .. "qc" .. i);
uiQC.uc_hardtext_format= text;
uiQC.text_format= text;
end
end
@ -358,7 +358,7 @@ function game:updateTargetConsiderUI()
end
if impossible then
wgToolTip.tooltip = concatUCString(wgToolTip.tooltip, ucstring("\n"), i18n.get("uittConsiderUnknownLevel"))
wgToolTip.tooltip = concatString(wgToolTip.tooltip, "\n", i18n.get("uittConsiderUnknownLevel"))
end
end

@ -28,7 +28,7 @@
<define id="force_level_8" value="consider_7.tga" />
<proc id="proc_target_changed">
<!-- Name -->
<action handler="set_target_name" params="slot=@@UI:VARIABLES:TARGET:SLOT|target=ui:interface:target:uc_title| title=ui:interface:target:header_opened:target_title:uc_hardtext" />
<action handler="set_target_name" params="slot=@@UI:VARIABLES:TARGET:SLOT|target=ui:interface:target:title| title=ui:interface:target:header_opened:target_title:hardtext" />
<!-- Region force & Force level of the creature/player -->
<!-- old consider system -->
<!--
@ -145,7 +145,7 @@
<group type="modal" id="add_contact" exit_click_out="true" posref="MM MR" w="212" child_resize_h="true" child_resize_hmargin="14" options="skin_modal" on_active="set_keyboard_focus" on_active_params="target=ui:interface:add_contact:add_contact_eb:eb|select_all=false">
<view type="text" id="text" posref="TL TL" x="8" y="-8" color="255 255 255 255" global_color="false" fontsize="12" shadow="true" hardtext="uiPeopleAddContact" />
<instance template="edit_box_widget" id="add_contact_eb" posref="TL TL" x="6" y="-24" child_resize_h="true" w="200" onenter="add_contact" max_num_chars="255" entry_type="playername" />
<instance template="edit_box_widget" id="add_contact_eb" posref="TL TL" x="6" y="-24" child_resize_h="true" w="200" onenter="add_contact" max_num_bytes="255" entry_type="playername" />
<instance template="button_ok_cancel" posparent="add_contact_eb" posref="BR TR" x="0" y="0" onclick_ok="add_contact" onclick_ok_param="" onclick_cancel="leave_modal" onclick_cancel_param="" />
</group>
<!-- ***************** -->
@ -469,7 +469,7 @@
<!-- link to display the group when the team member is present -->
<link expr="ne(@SERVER:GROUP:#team_mate_index:NAME, 0)" target="active" />
<!-- links to display the name of the team mate -->
<link expr="depends(@SERVER:GROUP:#team_mate_index:NAME)" action="set_server_id" params="value=@SERVER:GROUP:#team_mate_index:NAME|target=uc_title|remove_title=1" />
<link expr="depends(@SERVER:GROUP:#team_mate_index:NAME)" action="set_server_id" params="value=@SERVER:GROUP:#team_mate_index:NAME|target=title|remove_title=1" />
<!-- links to change the name color if it is the target -->
<link expr="ifthenelse(eq(@SERVER:GROUP:#team_mate_index:UID,@UI:VARIABLES:TARGET:UID),
'255 0 0 255',

@ -812,8 +812,8 @@
<group id="scroll_text" posparent="crop" posref="TM TM" x="0" y="-4" sizeref="w" child_resize_h="true" child_resize_hmargin="4" w="-4" max_sizeparent="crop" max_sizeref="h" max_h="-4" active="true">
<view type="bitmap" id="background" posref="TL TL" sizeref="w" x="0" y="-8" txtwidth="300" txtheight="360" texture="" global_color="false" render_layer="0" />
<view type="text" id="display" posref="TL TL" sizeref="w" color="255 255 255 160" x="2" y="-4" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" />
<instance template="edit_box_widget_multiline" max_num_chars="1024" max_num_return="50" id="edit_large" posref="TL TL" x="4" y="-8" sizeref="w" sizeref_eb="w" child_resize_h="true" w="-8" h="-30" text_x="0" text_y="0" text_ref="TL TL" fontsize="12" multi_line="true" enter_loose_focus="true" enter_recover_focus="false" prompt="" reset_focus_on_hide="true" want_return="true" active="false" render_layer="1" scale="false" />
<instance template="edit_box_widget_multiline" max_num_chars="256" max_num_return="16" id="edit_short" posref="TL TL" x="4" y="-8" sizeref="w" sizeref_eb="w" child_resize_h="true" w="-8" h="-30" text_x="0" text_y="0" text_ref="TL TL" fontsize="12" multi_line="true" enter_loose_focus="true" enter_recover_focus="false" prompt="" reset_focus_on_hide="true" want_return="true" active="false" render_layer="1" scale="false" />
<instance template="edit_box_widget_multiline" max_num_chars="1023" max_num_bytes="1023" max_num_return="50" id="edit_large" posref="TL TL" x="4" y="-8" sizeref="w" sizeref_eb="w" child_resize_h="true" w="-8" h="-30" text_x="0" text_y="0" text_ref="TL TL" fontsize="12" multi_line="true" enter_loose_focus="true" enter_recover_focus="false" prompt="" reset_focus_on_hide="true" want_return="true" active="false" render_layer="1" scale="false" />
<instance template="edit_box_widget_multiline" max_num_chars="255" max_num_bytes="255" max_num_return="16" id="edit_short" posref="TL TL" x="4" y="-8" sizeref="w" sizeref_eb="w" child_resize_h="true" w="-8" h="-30" text_x="0" text_y="0" text_ref="TL TL" fontsize="12" multi_line="true" enter_loose_focus="true" enter_recover_focus="false" prompt="" reset_focus_on_hide="true" want_return="true" active="false" render_layer="1" scale="false" />
</group>
<ctrl style="skin_scroll" id="scroll_bar_theme" align="T" target="scroll_text" posparent="crop" posref="TL TR" x="-8" y="0" />
<view type="bitmap" id="sep" x="0" y="-2" posparent="crop" posref="BR TR" scale="true" h="2" sizeparent="parent" sizeref="w" texture="W_line_hor.tga" />

@ -67,7 +67,7 @@
id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" on_focus="" on_focus_params=""
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
max_num_chars="256"
max_num_chars="255"
menu_r=""
onchange=""
onchange_params=""
@ -404,7 +404,7 @@
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
max_num_chars="256"
max_num_chars="255"
menu_r=""
onchange=""
onchange_params=""
@ -447,7 +447,7 @@
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true"
max_num_chars="256"
max_num_chars="255"
menu_r=""
onchange=""
onchange_params=""

@ -456,8 +456,8 @@
<proc id="respawn_map_activated">
<action handler="exit_free_look" />
<action handler="set" params="dblink=UI:VARIABLES:RESPAWN:MSG_SENT|value=0" />
<!-- <action handler="add_link" params="id=respawn_timer_link|expr=secondsToTimeString(div(mul(div(sub(%player_percent_max,abs(@%player_hp_percent)),%player_percent_max),%time_before_auto_respawn),10))|target=ui:interface:respawn_map:content:map_content:timer:t:uc_hardtext" /> -->
<action handler="add_link" params="id=respawn_timer_link|expr=secondsToTimeString(mul(div(sub(%player_percent_max,abs(@%player_hp_percent)),%player_percent_max),%time_before_auto_respawn))|target=ui:interface:respawn_map:content:map_content:timer:t:uc_hardtext" />
<!-- <action handler="add_link" params="id=respawn_timer_link|expr=secondsToTimeString(div(mul(div(sub(%player_percent_max,abs(@%player_hp_percent)),%player_percent_max),%time_before_auto_respawn),10))|target=ui:interface:respawn_map:content:map_content:timer:t:hardtext" /> -->
<action handler="add_link" params="id=respawn_timer_link|expr=secondsToTimeString(mul(div(sub(%player_percent_max,abs(@%player_hp_percent)),%player_percent_max),%time_before_auto_respawn))|target=ui:interface:respawn_map:content:map_content:timer:t:hardtext" />
<action handler="add_link" params="id=respawn_acttimer_link|expr=depends(@%player_hp_percent)|action=respawn_map_valid|params=map=ui:interface:respawn_map:content:map_content:actual_map|cond=and(eq(abs(@%player_hp_percent), %player_percent_max), and(lt(@%player_hp_percent,0), eq(@UI:VARIABLES:CDB_INIT_IN_PROGRESS, 0)) ,ne(@UI:VARIABLES:RESPAWN:MSG_SENT,1)) " />
<action handler="add_link" params="id=respawn_showtimer_link|expr=lt(abs(@%player_hp_percent), %player_percent_max)|target=ui:interface:respawn_map:content:map_content:timer:active" />
</proc>

@ -353,7 +353,7 @@ end
-- local text = self:getProgressGroup():find("text")
-- local ellipsisTxt = self:getProgressGroup():find("ellipsis")
-- text.color = color
-- text.uc_hardtext = ucstr
-- text.text = ucstr
-- if ellipsis then
-- ellipsisTxt.hardtext = ellipsis
-- else
@ -378,7 +378,7 @@ end
-- local progressDate = nltime.getLocalTime() / 500
-- local colValue = math.floor(230 + 24 * math.sin(progressDate))
-- local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255)
-- self:setProgressText(concatUCString(i18n.get("uiBGD_Progress"), ucstring(progressPercentText)), color, progress, progressSymbol[progressPostfix + 1])
-- self:setProgressText(concatString(i18n.get("uiBGD_Progress"), progressPercentText), color, progress, progressSymbol[progressPostfix + 1])
--end
--
--function outgame:setPatchSuccess()

@ -1560,7 +1560,7 @@
<proc id="proc_appear_name_enter">
<action handler="reset_keyboard_focus" />
<action handler="play_sound" params="name=summary_enter_name" />
<action handler="ask_valid_name" params="target=ui:outgame:appear_name:eb:uc_input_string|dblink=UI:TEMP:NAME_VALID" />
<action handler="ask_valid_name" params="target=ui:outgame:appear_name:eb:input_string|dblink=UI:TEMP:NAME_VALID" />
</proc>
<proc id="proc_appear_name_cancel">

@ -146,7 +146,7 @@
<action handler="set" params="target_property=ui:outgame:charsel:slot@0:cam:posz|value=add(0.06,getprop('ui:outgame:charsel:slot@0:char:headz'))" />
<action handler="set" params="target_property=ui:outgame:charsel:slot@0:cam:tgtz|value=add(0.06,getprop('ui:outgame:charsel:slot@0:char:headz'))" />
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@0))" params="prop=name|target=ui:outgame:charsel:but_slot@0:uc_hardtext|slot=@0" />
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@0))" params="prop=name|target=ui:outgame:charsel:but_slot@0:hardtext|slot=@0" />
</proc>
<proc id="proc_charsel_initslot_empty">

@ -109,11 +109,11 @@
</proc>
<proc id="proc_select_init_right_screen" >
<action handler="get_slot" params="prop=title |target=ui:outgame:character_selection:titles:title_txt:uc_hardtext|slot=@UI:NEW_SELECTED_SLOT" />
<!-- <action handler="get_slot" params="prop=job |target=ui:outgame:character_selection:titles:job_txt:uc_hardtext|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" params="prop=level |target=ui:outgame:character_selection:titles:level_txt:uc_hardtext|slot=@UI:NEW_SELECTED_SLOT" />-->
<action handler="get_slot" params="prop=title |target=ui:outgame:character_selection:titles:title_txt:hardtext|slot=@UI:NEW_SELECTED_SLOT" />
<!-- <action handler="get_slot" params="prop=job |target=ui:outgame:character_selection:titles:job_txt:hardtext|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" params="prop=level |target=ui:outgame:character_selection:titles:level_txt:hardtext|slot=@UI:NEW_SELECTED_SLOT" />-->
<action handler="get_slot" params="prop=pos |target=ui:outgame:character_selection:titles:pos_txt:textid|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" params="prop=name |target=ui:outgame:character_selection:titles:name_txt:uc_hardtext|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" params="prop=name |target=ui:outgame:character_selection:titles:name_txt:hardtext|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="reset_camera" params="target=ui:outgame:character_selection:char3d:cam" />
<action handler="set_db_from_slot" params="dblink=UI:TEMP:CHAR3D|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="proc" params="proc_charsel_init3d" />
@ -160,11 +160,11 @@
used to change at the end of full_to_full_1 anim the 3D view of the character and launch the second part
-->
<proc id="proc_click_slot2">
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=title |target=ui:outgame:character_selection:titles:title_txt:uc_hardtext|dbslot=UI:NEW_SELECTED_SLOT" />
<!-- <action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=job |target=ui:outgame:character_selection:titles:job_txt:uc_hardtext|dbslot=UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=level |target=ui:outgame:character_selection:titles:level_txt:uc_hardtext|dbslot=UI:NEW_SELECTED_SLOT" />-->
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=title |target=ui:outgame:character_selection:titles:title_txt:hardtext|dbslot=UI:NEW_SELECTED_SLOT" />
<!-- <action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=job |target=ui:outgame:character_selection:titles:job_txt:hardtext|dbslot=UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=level |target=ui:outgame:character_selection:titles:level_txt:hardtext|dbslot=UI:NEW_SELECTED_SLOT" />-->
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=pos |target=ui:outgame:character_selection:titles:pos_txt:textid|dbslot=UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=name |target=ui:outgame:character_selection:titles:name_txt:uc_hardtext|dbslot=UI:NEW_SELECTED_SLOT" />
<action handler="get_slot" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="prop=name |target=ui:outgame:character_selection:titles:name_txt:hardtext|dbslot=UI:NEW_SELECTED_SLOT" />
<action handler="reset_camera" cond="not(isCharSelSlotEmpty(@UI:NEW_SELECTED_SLOT))" params="target=ui:outgame:character_selection:char3d:cam" />
<action handler="set_db_from_slot" params="dblink=UI:TEMP:CHAR3D|slot=@UI:SELECTED_SLOT" />
<action handler="proc" params="proc_charsel_init3d" />

@ -184,12 +184,12 @@
<proc id="proc_sum_enter_name">
<action handler="reset_keyboard_focus" />
<action handler="play_sound" params="name=summary_enter_name" />
<action handler="ask_valid_name" params="target=ui:outgame:summary:eb:uc_input_string|dblink=UI:TEMP:VALID" />
<action handler="ask_valid_name" params="target=ui:outgame:summary:eb:input_string|dblink=UI:TEMP:VALID" />
</proc>
<!-- proc_sum_enter_name2 is called after the server reception of VALID look at SERVER_RECEIVED_VALID -->
<proc id="proc_sum_enter_name2">
<action handler="set" params="target_property=ui:outgame:summary:input_txt:uc_hardtext|value=getprop('ui:outgame:summary:eb:uc_input_string')"/>
<action handler="set" params="target_property=ui:outgame:summary:input_txt:hardtext|value=getprop('ui:outgame:summary:eb:input_string')"/>
<action handler="disp_info" params="str='isPeopleActive(@UI:TEMP:CHAR3D:PEOPLE) = '|val=isPeopleActive(@UI:TEMP:CHAR3D:PEOPLE)" />
<action handler="disp_info" params="str='isCareerActive(@UI:TEMP:CHAR3D:CAREER) = '|val=isCareerActive(@UI:TEMP:CHAR3D:CAREER)" />

@ -90,7 +90,8 @@
<template name="edit_box_widget" posref="TL TL" text_x="0" text_ref="BL BL" child_resize_h="true" multi_line="true" x="0" y="0" w="0" h="0"
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;"
max_num_chars="256"
max_num_chars="255"
max_num_bytes="0"
menu_r=""
onchange=""
onchange_params=""
@ -100,7 +101,7 @@
fontsize="12"
>
<group id="#id" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" sizeref="#sizeref" w="#w" h="#h">
<group type="edit_box" sizeref="w" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="true" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" >
<group type="edit_box" sizeref="w" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="true" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" max_num_bytes="#max_num_bytes" prompt="#prompt" enter_loose_focus="#enter_loose_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" >
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="W_box_blank.tga"/>
<view id="edit_text" type="text" x="#text_x" posref="#text_ref" multi_line="#multi_line" fontsize="#fontsize" shadow="true" hardtext="" global_color="false"/>
</group>

@ -45,7 +45,7 @@ end
function game:outpostDisplayTimeZone(uiLocal)
local tz= getDbProp('UI:SAVE:OUTPOST:TIME_ZONE');
local uiGroup= getUICaller();
uiGroup[uiLocal].uc_hardtext= 'GMT ' .. string.format('%+d', tz);
uiGroup[uiLocal].text= 'GMT ' .. string.format('%+d', tz);
end
------------------------------------------------------------------------------------------------------------
@ -57,7 +57,7 @@ function game:outpostAdjustHour(uiLocal, prop)
-- add time zone and clamp hour
h = math.fmod(h + tz + 24, 24);
uiGroup[uiLocal].uc_hardtext = string.format('%02d:00', h);
uiGroup[uiLocal].text = string.format('%02d:00', h);
end
------------------------------------------------------------------------------------------------------------
@ -220,9 +220,9 @@ function game:outpostInfoOnDraw()
-- readable form
if (status == self.OutpostEnums.Peace) then
uiGroup.Env.Timer.uc_hardtext= '';
uiGroup.Env.Timer.text= '';
else
uiGroup.Env.Timer.uc_hardtext= '(' .. runFct('secondsToTimeString', timeSec) .. ')';
uiGroup.Env.Timer.text= '(' .. runFct('secondsToTimeString', timeSec) .. ')';
end
end
@ -448,7 +448,7 @@ end
function game:outpostDisplayStatusInfo(statusExpr, id)
local uiGroup = getUICaller();
local text = self:outpostGetStatusInfo(statusExpr, -1, 'no');
uiGroup[id].uc_hardtext_format = text;
uiGroup[id].text_format = text;
end
------------------------------------------------------------------------------------------------------------
@ -487,7 +487,7 @@ function game:outpostChangeRoundLvlThreshold()
local val= getDbProp(path .. ':ROUND_LVL_THRESHOLD');
-- setup text
uiGroup.outpost_lvl_thre.uc_hardtext= tostring(val);
uiGroup.outpost_lvl_thre.text= tostring(val);
end
@ -504,9 +504,9 @@ function game:outpostChangeRoundLvlMaxAtt()
-- setup text (only relevant when attack period has begun)
if(status>=self.OutpostEnums.AttackRound) then
uiGroup.outpost_lvl_max_att.uc_hardtext= tostring(val);
uiGroup.outpost_lvl_max_att.text= tostring(val);
else
uiGroup.outpost_lvl_max_att.uc_hardtext= '- ';
uiGroup.outpost_lvl_max_att.text= '- ';
end
end
@ -524,9 +524,9 @@ function game:outpostChangeRoundLvlMaxDef()
-- setup text (only relevant in War)
if(status>=self.OutpostEnums.DefenseRound) then
uiGroup.outpost_lvl_max_def.uc_hardtext= tostring(val);
uiGroup.outpost_lvl_max_def.text= tostring(val);
else
uiGroup.outpost_lvl_max_def.uc_hardtext= '- ';
uiGroup.outpost_lvl_max_def.text= '- ';
end
end
@ -546,9 +546,9 @@ function game:outpostChangeRoundLvlCur()
-- setup text (only in a Attack/Defense Round)
if(self:outpostIsStatusWarRound(status)) then
uiGroup.outpost_lvl_cur.uc_hardtext= tostring(val);
uiGroup.outpost_lvl_cur.text= tostring(val);
else
uiGroup.outpost_lvl_cur.uc_hardtext= '- ';
uiGroup.outpost_lvl_cur.text= '- ';
end
end
@ -569,9 +569,9 @@ function game:outpostChangeRoundId()
-- setup text (only in a Attack/Defense Round)
if(self:outpostIsStatusWarRound(status)) then
uiGroup.outpost_round_cur.uc_hardtext= tostring(val) .. ' / ' .. tostring(maxRound);
uiGroup.outpost_round_cur.text= tostring(val) .. ' / ' .. tostring(maxRound);
else
uiGroup.outpost_round_cur.uc_hardtext= '- ';
uiGroup.outpost_round_cur.text= '- ';
end
end
@ -607,7 +607,7 @@ function game:outpostPvpJoinTimerOnDraw()
-- replace in str
local text= i18n.get('uiOutpostJoinPVPTimer');
text= findReplaceAll(text, "%time", tostring(timeSec));
uiGroup.Env.Timer.uc_hardtext_format= text;
uiGroup.Env.Timer.text_format= text;
end

@ -145,7 +145,7 @@
<link expr="and(ne(@SERVER:GUILD:OUTPOST:O#index:SHEET,0),
eq(@SERVER:GUILD:OUTPOST:O#index:OWNED,#owned))" target="#id:active" />
<!-- name of the outpost -->
<link expr="getOutpostName(@SERVER:GUILD:OUTPOST:O#index:SHEET)" target="#id:name:uc_hardtext" />
<link expr="getOutpostName(@SERVER:GUILD:OUTPOST:O#index:SHEET)" target="#id:name:hardtext" />
<!-- if the player has the rights to modify outposts let him destroy an outpost -->
<!-- the outpost must also be owned by the guild, and the guild must be able to delete the oupost -->
@ -338,13 +338,13 @@
<group id="global_state" sizeref="w" w="0" child_resize_h="true" posparent="sep_gs" posref="BL TL" x="0" y="-10" >
<!-- NAME -->
<view type="text" id="outpost_name" posref="TM TM" x="0" y="0" global_color="false" fontsize="12" shadow="true" />
<link expr="getOutpostName(@#outpost_db:SHEET)" target="outpost_name:uc_hardtext" />
<link expr="getOutpostName(@#outpost_db:SHEET)" target="outpost_name:hardtext" />
<!-- LEVEL -->
<view style="outpost_title" id="title_level" posparent="parent" posref="TL TL" x="0" y="-20" hardtext="uiOutpostLevel" />
<instance template="text_tt" posparent="title_level" tooltip="uittOutpostLevel" />
<view style="outpost_value_R" id="outpost_level" posparent="title_level" />
<link expr="@#outpost_db:LEVEL" target="outpost_level:uc_hardtext" />
<link expr="@#outpost_db:LEVEL" target="outpost_level:hardtext" />
<!-- OWNER: GUILD/TRIBE -->
<view style="outpost_title" id="title_owner" posparent="title_level" hardtext="uiOutpostOwner" />
@ -443,14 +443,14 @@
<instance template="text_tt" posparent="title_att_period" tooltip="uittOutpostAttPeriod" />
<view style="outpost_value_RC2" id="outpost_att_period" posparent="title_att_period" />
<link expr="getOutpostPeriod(@#outpost_db:TIME_RANGE_ATT, @#outpost_db:TIME_RANGE_LENGTH, @UI:SAVE:OUTPOST:TIME_ZONE, @#outpost_db:STATUS, 1)"
target="outpost_att_period:uc_hardtext" />
target="outpost_att_period:hardtext" />
<!-- ACTUAL DEFENDER PERIOD -->
<view style="outpost_title" id="title_def_period" posparent="title_att_period" hardtext="uiOutpostDefPeriod" case_mode="%case_normal" />
<instance template="text_tt" posparent="title_def_period" tooltip="uittOutpostDefPeriod" />
<view style="outpost_value_RC2" id="outpost_def_period" posparent="title_def_period" />
<link expr="getOutpostPeriod(@#outpost_db:TIME_RANGE_DEF, @#outpost_db:TIME_RANGE_LENGTH, @UI:SAVE:OUTPOST:TIME_ZONE, @#outpost_db:STATUS, 0)"
target="outpost_def_period:uc_hardtext" />
target="outpost_def_period:hardtext" />
<!-- TIME ZONE SELECTION -->
<instance template="t_outpost_time_zone_selector" id="time_zone_selector" posparent="title_def_period" />
@ -500,9 +500,9 @@
<!-- active the line if the squad slot is here -->
<link expr="ne(@%outpost_selected:SQUADS:SP#index:SHEET, 0)" target="#id:active" />
<!-- name of the squad -->
<link expr="getSquadName(@%outpost_selected:SQUADS:SP#index:SHEET)" target="#id:name:uc_hardtext" />
<link expr="getSquadName(@%outpost_selected:SQUADS:SP#index:SHEET)" target="#id:name:hardtext" />
<!-- squad cost -->
<link expr="getSquadCost(@%outpost_selected:SQUADS:SP#index:SHEET)" target="#id:cost:uc_hardtext" />
<link expr="getSquadCost(@%outpost_selected:SQUADS:SP#index:SHEET)" target="#id:cost:hardtext" />
</template>
@ -530,14 +530,14 @@
<!-- active the line if the squad slot is here -->
<link expr="ne(@%outpost_selected:SQUADS:T#index:SHEET, 0)" target="#id:active" />
<!-- name of the squad -->
<link expr="getSquadName(@%outpost_selected:SQUADS:T#index:SHEET)" target="#id:name:uc_hardtext" />
<link expr="getSquadName(@%outpost_selected:SQUADS:T#index:SHEET)" target="#id:name:hardtext" />
<!-- squad cost -->
<link expr="getSquadCost(@%outpost_selected:SQUADS:T#index:SHEET)" target="#id:cost:uc_hardtext" />
<link expr="getSquadCost(@%outpost_selected:SQUADS:T#index:SHEET)" target="#id:cost:hardtext" />
<!-- clickable only if allowed rights -->
<link expr="ne(@SERVER:USER:OUTPOST_ADMIN,0)" target="#id:select:active" />
<link expr="eq(@SERVER:USER:OUTPOST_ADMIN,0)" target="#id:spawn:frozen" />
<!-- spawn pos button -->
<link expr="add(@%outpost_selected:SQUADS:T#index:SPAWN,1)" target="#id:spawn:uc_hardtext" />
<link expr="add(@%outpost_selected:SQUADS:T#index:SPAWN,1)" target="#id:spawn:hardtext" />
</template>
@ -572,8 +572,8 @@
<view type="text" id="building_name" posparent="building_sheet" posref="TR TL" x="5" y="-4" color="255 255 255 255" fontsize="10" shadow="true" hardtext="" multi_line="true" multi_line_space="0" />
<view type="text" id="building_desc" posparent="building_name" posref="BL TL" x="0" y="-4" color="255 255 255 255" fontsize="10" shadow="true" hardtext="" multi_line="true" multi_line_space="0" />
<link expr="getOutpostBuildingName(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_name:uc_hardtext" />
<link expr="getOutpostBuildingDesc(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_desc:uc_hardtext" />
<link expr="getOutpostBuildingName(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_name:hardtext" />
<link expr="getOutpostBuildingDesc(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_desc:hardtext" />
<link expr="@UI:TEMP:OUTPOST:SELECTION" action="lua:game:outpostUpdateBuildingSheet(#index)" />
</group>
@ -631,7 +631,7 @@
<view type="text" id="explain_edit" posparent="sep_doc" posref="BL TL" x="0" y="-10" global_color="true" shadow="true" hardtext="" fontsize="10" multi_line="true" multi_line_space="0" />
<!-- Different Doc wether attacking or defending -->
<link expr="localize(ifthenelse(@%outpost_selected:OWNED, 'uiOutpostSquadEditDef', 'uiOutpostSquadEditAtt'))"
target="explain_edit:uc_hardtext_format" />
target="explain_edit:hardtext_format" />
<!-- Current Round -->
<view type="bitmap" id="sep_cur" posparent="explain_edit" posref="BL TL" scale="true" sizeref="w" w="0" h="2" x="0" y="-8" texture="W_line_hor.tga" sizeparent="parent" />
@ -665,7 +665,7 @@
<ctrl style="text_button_16" id="cap_but" posparent="cap_text" posref="MR ML" x="8" y="1"
hardtext="0" onclick_l="lua:game:outpostSelectSquadCapitalOpen()"
text_color_normal="255 255 255 255" text_color_over="255 255 255 255" text_color_pushed="255 255 255 255" />
<link expr="@%outpost_selected:SQUAD_CAPITAL" target="cap_but:uc_hardtext" />
<link expr="@%outpost_selected:SQUAD_CAPITAL" target="cap_but:hardtext" />
<link expr="eq(@SERVER:USER:OUTPOST_ADMIN,0)" target="cap_but:frozen" />
<link expr="ifthenelse(eq(@SERVER:USER:OUTPOST_ADMIN,0),
localize('uiOutpostCapitalEditKO'),
@ -680,7 +680,7 @@
<view type="bitmap" id="sep_building" posref="TL TL" scale="true" sizeref="w" w="0" h="2" x="0" y="0" texture="W_line_hor.tga" />
<view type="text" id="outpost_name" posref="TM TM" x="0" y="-12" global_color="false" fontsize="12" shadow="true" />
<link expr="getOutpostName(@%outpost_selected:SHEET)" target="outpost_name:uc_hardtext" />
<link expr="getOutpostName(@%outpost_selected:SHEET)" target="outpost_name:hardtext" />
<view type="text" id="building_info" posparent="parent" posref="TL TL" x="0" y="-50" global_color="false" fontsize="12" shadow="true" hardtext="uiOutpostBuildingInfoNotOwned" />
<instance template="t_outpost_building" id="building1" index="0" posparent="parent" posref="TL TL" y="-64" />
@ -689,7 +689,7 @@
<instance template="t_outpost_building" id="building4" index="3" posparent="building3" posref="BL TL"/>
<link expr="ifthenelse(eq(@%outpost_selected:OWNED,0), localize('uiOutpostBuildingInfoNotOwned'), localize('uiOutpostBuildingInfoOwned'))"
target="building_info:uc_hardtext" />
target="building_info:hardtext" />
<link expr="ifthenelse(eq(@%outpost_selected:OWNED,0), 0, 1)" target="building1:active" />
<link expr="ifthenelse(eq(@%outpost_selected:OWNED,0), 0, 1)" target="building2:active" />
@ -773,12 +773,12 @@
<group id="content" x="0" y="0" w="0" h="0" child_resize_h="true" child_resize_hmargin="8" posref="TL TL" >
<!-- NAME -->
<view type="text" id="outpost_name" posref="TM TM" x="0" y="-8" global_color="false" fontsize="12" shadow="true" />
<link expr="getOutpostName(@SERVER:OUTPOST_SELECTED:SHEET)" target="outpost_name:uc_hardtext" />
<link expr="getOutpostName(@SERVER:OUTPOST_SELECTED:SHEET)" target="outpost_name:hardtext" />
<!-- WAR COST -->
<view style="outpost_title" id="title_war_cost" posparent="parent" posref="TL TL" x="0" y="-30" hardtext="uiOutpostWarCost" />
<view style="outpost_value_R" id="outpost_war_cost" posparent="title_war_cost" />
<link expr="@SERVER:OUTPOST_SELECTED:WARCOST" target="outpost_war_cost:uc_hardtext" />
<link expr="@SERVER:OUTPOST_SELECTED:WARCOST" target="outpost_war_cost:hardtext" />
<view style="outpost_value_B" id="outpost_war_cost_desc" posparent="title_war_cost" hardtext="uiOutpostWarCostDesc" fontsize="10" />
<!-- TIME SETUP -->
@ -804,7 +804,7 @@
<view style="outpost_value_B" id="outpost_att_period" posparent="title_att_period" />
<!-- NB: emulate war for this text (don't want to display N/A) -->
<link expr="getOutpostPeriod(@UI:TEMP:OUTPOST:DECLARE_WAR_ACK_TIME_RANGE_ATT, @SERVER:OUTPOST_SELECTED:TIME_RANGE_LENGTH, @UI:SAVE:OUTPOST:TIME_ZONE, %outpost_status_WarDeclaration, 1)"
target="outpost_att_period:uc_hardtext" />
target="outpost_att_period:hardtext" />
<!-- Relevant only if ACK received -->
<link expr="@UI:TEMP:OUTPOST:DECLARE_WAR_ACK_RECEIVED" target="outpost_att_period:active" />
@ -966,9 +966,9 @@
<!-- active the line if the squad slot is here -->
<link expr="ne(@%outpost_selected:SQUAD_SHOP:#index:SHEET, 0)" target="#id:active,#id_select:active" />
<!-- squad name -->
<link expr="getSquadName(@%outpost_selected:SQUAD_SHOP:#index:SHEET)" target="#id:name:uc_hardtext" />
<link expr="getSquadName(@%outpost_selected:SQUAD_SHOP:#index:SHEET)" target="#id:name:hardtext" />
<!-- squad cost -->
<link expr="getSquadCost(@%outpost_selected:SQUAD_SHOP:#index:SHEET)" target="#id:cost:uc_hardtext" />
<link expr="getSquadCost(@%outpost_selected:SQUAD_SHOP:#index:SHEET)" target="#id:cost:hardtext" />
</template>
@ -1005,7 +1005,7 @@
<view type="text" id="squad_desc" posref="TL TL" x="300" y="-26" multi_line="true" multi_line_space="0" line_maxw="200" fontsize="10" />
<link expr="ifthenelse(eq(@UI:TEMP:OUTPOST:SQUAD_TO_BUY,-1),
'',
getSquadDesc(@%outpost_selected:SQUAD_SHOP:[UI:TEMP:OUTPOST:SQUAD_TO_BUY]:SHEET))" target="squad_desc:uc_hardtext" />
getSquadDesc(@%outpost_selected:SQUAD_SHOP:[UI:TEMP:OUTPOST:SQUAD_TO_BUY]:SHEET))" target="squad_desc:hardtext" />
<!-- SET / CANCEL -->
<instance template="button_ok_cancel" posref="BR BR" x="-8" y="4"

@ -730,7 +730,7 @@
<!-- NAME. Get the Name spell -->
<view type="text" id="spell_name" posref="TL TL" y="-1" w="120" h="10" shadow="true" fontsize="10"
global_color="false" />
<link expr="getSPhraseName(@SERVER:EXECUTE_PHRASE:LINK:#index:PHRASE)" target="spell_name:uc_hardtext" />
<link expr="getSPhraseName(@SERVER:EXECUTE_PHRASE:LINK:#index:PHRASE)" target="spell_name:hardtext" />
<!-- COSTS (HP, SAP, STA) -->
<!--

@ -329,7 +329,7 @@ function game:playerTTPvp()
elseif(buttonMode==1 and buttonPushed) then
text = i18n.get('uittPvPModeTagOnChange');
else
text = ucstring();
text = "";
end
-- timer
if(buttonTimer) then
@ -338,7 +338,7 @@ function game:playerTTPvp()
local tempsString = game:formatTime( pvpServerTagTimer - currentServerTick );
local timeFmt= i18n.get('uittPvPTagTimer');
timeFmt= findReplaceAll(timeFmt, '%temps', tempsString);
text= concatUCString(text, timeFmt);
text= concatString(text, timeFmt);
end
end
@ -367,12 +367,12 @@ end
function game:bonusMalusSetText(ui, slot, fmt)
local uiTextGroup= ui["text" .. tostring(slot) ];
if(uiTextGroup) then
uiTextGroup.shade0.uc_hardtext_format= fmt;
uiTextGroup.shade1.uc_hardtext_format= fmt;
uiTextGroup.shade2.uc_hardtext_format= fmt;
uiTextGroup.shade3.uc_hardtext_format= fmt;
uiTextGroup.text.uc_hardtext_format= fmt;
uiTextGroup.text2.uc_hardtext_format= fmt;
uiTextGroup.shade0.text_format= fmt;
uiTextGroup.shade1.text_format= fmt;
uiTextGroup.shade2.text_format= fmt;
uiTextGroup.shade3.text_format= fmt;
uiTextGroup.text.text_format= fmt;
uiTextGroup.text2.text_format= fmt;
end
end
@ -800,7 +800,7 @@ function game:setPhraseTooltipCarac(ttWin, name, value, textValue)
icon.active = true
text.active = true
if textValue ~= nil then
text.uc_hardtext = textValue
text.text = textValue
else
text.hardtext = tostring(value)
end
@ -813,9 +813,9 @@ function game:timeInSecondsToReadableTime(regenTime)
local minutes = math.fmod(math.floor(regenTime / 60), 60)
local hours = math.floor(regenTime / 3600)
local result = ""
if seconds > 0 then result = concatUCString(tostring(seconds), i18n.get("uittSecondsShort")) end
if minutes > 0 then result = concatUCString(tostring(minutes), i18n.get("uittMinutesShort"), result) end
if hours > 0 then result = concatUCString(tostring(hours), i18n.get("uittHoursShort"), result) end
if seconds > 0 then result = concatString(tostring(seconds), i18n.get("uittSecondsShort")) end
if minutes > 0 then result = concatString(tostring(minutes), i18n.get("uittMinutesShort"), result) end
if hours > 0 then result = concatString(tostring(hours), i18n.get("uittHoursShort"), result) end
return result
end
@ -827,15 +827,12 @@ function game:setPhraseTooltipPowerRegenTime(ttWin, regenTimeInTicks)
text.active = false
else
text.active = true
text.uc_hardtext_single_line_format = concatUCString(i18n.get("uittRegenTime"), game:timeInSecondsToReadableTime(math.floor((regenTimeInTicks + 9) * 0.1)))
text.text_single_line_format = concatString(i18n.get("uittRegenTime"), game:timeInSecondsToReadableTime(math.floor((regenTimeInTicks + 9) * 0.1)))
text:invalidateCoords()
ttWin:invalidateCoords()
end
end
local EmptyUCString = ucstring()
------------------------------------------------------------------------------------------------------------
-- called by C++ code when the tooltip of a phrase is about to be displayed
function game:updatePhraseTooltip(phrase)
@ -843,12 +840,12 @@ function game:updatePhraseTooltip(phrase)
local ttWin = getUI("ui:interface:action_context_help")
local text = phrase:getName()
if not text or text == EmptyUCString then
text = ucstring("")
if not text then
text = ""
end
local desc = phrase:getDesc()
if desc and desc ~= EmptyUCString then
if desc and desc ~= "" then
local str = tostring(desc)
local charFound = false
for k = 1, string.len(str) do
@ -858,22 +855,22 @@ function game:updatePhraseTooltip(phrase)
end
end
if charFound then
text = concatUCString(text, "\n@{CCCF}", desc)
text = concatString(text, "\n@{CCCF}", desc)
end
else
text = concatUCString(text, "@{CCCF}")
text = concatString(text, "@{CCCF}")
end
-- IMPORTANT : the following getters on 'phrase' take in account the 'total action malus' for the timebeing
self:setPhraseTooltipCarac(ttWin, "hp_cost", phrase:getHpCost())
self:setPhraseTooltipCarac(ttWin, "sta_cost", phrase:getStaCost())
self:setPhraseTooltipCarac(ttWin, "sap_cost", phrase:getSapCost())
self:setPhraseTooltipCarac(ttWin, "focus_cost", phrase:getFocusCost())
self:setPhraseTooltipCarac(ttWin, "cast_time", phrase:getCastTime(), concatUCString(string.format("%.1f", phrase:getCastTime()), i18n.get("uittSeconds")))
self:setPhraseTooltipCarac(ttWin, "cast_time", phrase:getCastTime(), concatString(string.format("%.1f", phrase:getCastTime()), i18n.get("uittSeconds")))
local castRange = phrase:getCastRange()
if not phrase:isMagicPhrase() then
castRange = 0
end
self:setPhraseTooltipCarac(ttWin, "cast_range", castRange, concatUCString(tostring(castRange), i18n.get("uittMeters")))
self:setPhraseTooltipCarac(ttWin, "cast_range", castRange, concatString(tostring(castRange), i18n.get("uittMeters")))
-- if the phrase is a power / aura, then we may want to display its regen time in the tooltip
if phrase:isPowerPhrase() then
setOnDraw(ttWin, "game:updatePowerPhraseTooltip()")
@ -887,7 +884,7 @@ function game:updatePhraseTooltip(phrase)
successRateText.active = false
else
successRateText.active = true
successRateText.uc_hardtext_single_line_format = concatUCString(i18n.get("uittSuccessRate"), tostring(successRate), " %")
successRateText.text_single_line_format = concatString(i18n.get("uittSuccessRate"), tostring(successRate), " %")
end
local disableTimeText = ttWin:find("disable_time")
@ -897,7 +894,7 @@ function game:updatePhraseTooltip(phrase)
disableTimeText.active = false
else
disableTimeText.active = true
disableTimeText.uc_hardtext_single_line_format = concatUCString(i18n.get("uittDisableTime"), game:timeInSecondsToReadableTime(disableTime / 10))
disableTimeText.text_single_line_format = concatString(i18n.get("uittDisableTime"), game:timeInSecondsToReadableTime(disableTime / 10))
end
else
disableTimeText.active = false

@ -208,7 +208,7 @@
<!-- link to connect the activation of this dialog to the database entry that given the signal to start -->
<link expr="@%exchange_begun" action="player_trade_start" target="player_trade:active" />
<link expr="depends(@%exchange_text)" action="set_server_string" params="value=@%exchange_text|target=ui:interface:player_trade:uc_title" />
<link expr="depends(@%exchange_text)" action="set_server_string" params="value=@%exchange_text|target=ui:interface:player_trade:title" />
<!-- ************************************* -->
@ -291,7 +291,7 @@
<!-- init the trade invitation modal box -->
<proc id="init_invitation_box">
<!-- set the name of the player that propose the invitation -->
<action handler="set_server_string" params="value=@@%other_player_name_id|target=other_player_name:uc_hardtext" />
<action handler="set_server_string" params="value=@@%other_player_name_id|target=other_player_name:hardtext" />
</proc>

@ -1227,7 +1227,7 @@
</group>
<instance template="edit_box_widget" id="mission_tag_eb" posref="MR ML" x="0" posparent="mission_tag_label" w="200"
onenter="lua"
negative_filter = '"{}[]'
negative_filter = ''
fontsize="12"
params="r2.ScenarioWindow:onScenarioMissionTagChanged()"
on_focus_lost="lua"
@ -1390,7 +1390,7 @@
<group id="content" x="0" y="0" sizeref="wh" w="0" h="0" posref="TL TL" >
<group id="enclosing" sizeref="wh" w="-16" h="0" posref="TL TL">
<instance template="edit_box_widget" text_y="-1" posref="TL TL" sizeref="w" w="-8" fontsize="14" x="0" reset_focus_on_hide="true"
negative_filter = '"{}[]'
negative_filter = ''
child_resize_hmargin="4"
max_historic="0"
y="-2"
@ -1809,7 +1809,7 @@ text_y="-2"
<group type="edit_box" id="edit_box_group" sizeref="w" posparent="label" posref="BL TL" x="0" y="-2"
onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params"
on_focus_lost="#on_focus_lost" on_focus_lost_params="#on_focus_lost_params"
negative_filter = '"{}[]'
negative_filter = ''
max_num_chars="#max_num_chars" prompt="" enter_loose_focus="true" entry_type="#entry_type" reset_focus_on_hide="true" menu_r="" >
<instance template="box_widget" id="back_edit_box" posref="TL TL" sizeref="w" h="20" />
@ -3019,7 +3019,7 @@ text_y="-2"
</proc>
<group type="container" id="feature_help" w="370" pop_min_w="370" pop_max_w="370" h="550" pop_min_h="550" pop_max_h="550"
title="" global_color="false" header_color="UI:SAVE:WIN:COLORS:R2_FEATURE_HELP" uc_title=""
title="" global_color="false" header_color="UI:SAVE:WIN:COLORS:R2_FEATURE_HELP"
title_bar_open="false" open_button="false" force_open_out="true" right_button="false"
lockable="true" openable="false" opened="true" movable="true" active="false" savable="true" >

@ -667,7 +667,7 @@
</group>
<instance template="edit_box_widget" id="title_eb" posref="MR ML" x="0" posparent="title_label" w="200"
onenter="lua"
negative_filter = '"{}[]'
negative_filter = ''
fontsize="12"
params="r2.ScenarioWindow:onTitleChanged()"
on_focus_lost="lua"
@ -695,12 +695,12 @@
<group id="crop_desc" posparent="back_small_description" posref="TL TL" x="4" y="-4" sizeref="wh" w="-4" h="-12"/>
<group type="edit_box" id="small_description" posparent="crop_desc" posref="TL TL" x="0" y="0" sizeref="w"
negative_filter = '"{}[]'
negative_filter = ''
child_resize_h="true" w="-15" child_resize_hmargin="10" max_sizeparent="crop_desc" max_sizeref="h"
max_h="-4" want_return="true"
on_focus_lost="lua"
on_focus_lost_params="r2.ScenarioWindow:setScenarioNotes() r2.ScenarioWindow:cancelFocusOnText()"
max_num_chars="256" max_num_return="20"
max_num_bytes="255" max_num_return="20"
>
<view type="text" id="edit_text" x="4" y="-1" posref="TL TL" multi_line="true"
@ -870,7 +870,7 @@
<group type="edit_box" id="small_description" posparent="crop_desc" posref="TL TL" x="0" y="0" sizeref="w"
child_resize_h="true" w="-15" child_resize_hmargin="10" max_sizeparent="crop_desc" max_sizeref="h"
max_h="-4" want_return="true" max_num_chars="256" max_num_return="20"
max_h="-4" want_return="true" max_num_bytes="255" max_num_return="20"
onenter="" params="" on_focus_lost="lua" on_focus_lost_params="r2.ScenarioWindow:setActNotes() r2.ScenarioWindow:cancelFocusOnText()" >
<view type="text" id="edit_text" x="4" y="-1" posref="TL TL" multi_line="true"
@ -1000,7 +1000,7 @@
</group>
<!-- title update -->
<link expr="depends(@%dm_gift_text)" action="set_server_string" params="value=@%dm_gift_text|target=ui:interface:r2ed_dm_gift:uc_title" />
<link expr="depends(@%dm_gift_text)" action="set_server_string" params="value=@%dm_gift_text|target=ui:interface:r2ed_dm_gift:title" />
<tree node="r2ed_dm_gift">
</tree>

@ -446,7 +446,7 @@
<!-- ************ -->
<!-- MISC -->
<!-- ************ -->
<action handler="lua" params="getUI('ui:interface:keys').uc_title = i18n.get('uiKeysTitle')"/>
<action handler="lua" params="getUI('ui:interface:keys').title = i18n.get('uiKeysTitle')"/>
<action handler="lua" params="local w = getUI('ui:interface:r2ed_toolbar_window', false) if w then w.active = (r2~=nil and r2.Mode~=nil and r2.Mode=='Test') end"/>
<!-- reenable missions, possibly hidden after a ring session -->
<action handler="lua:game:updateMissionJournalMode()"/>

@ -200,7 +200,7 @@ end
--***********************************************************************
function RingAccessPoint:initScenarioTypes()
for k = 0, 6 do
self.ScenarioTypeToUtf8[k] = i18n.get("uiRAP_ST_" .. tostring(k)):toUtf8()
self.ScenarioTypeToUtf8[k] = i18n.get("uiRAP_ST_" .. tostring(k))
end
end
@ -227,16 +227,12 @@ function RingAccessPoint:getColumn(name)
return getUI("ui:interface:ring_sessions:content:main:enclosing:columns:getw:column_group:" .. name .. ":values")
end
--***********************************************************************
function RingAccessPoint:getSelectList()
return getUI("ui:interface:ring_sessions:content:main:enclosing:columns:getw:select")
--return getUI("ui:interface:checkpass:content:enclosing:select")
end
local scratchUCStr = ucstring()
--***********************************************************************
function RingAccessPoint:newTemplate(name, cache)
local group
@ -249,16 +245,15 @@ function RingAccessPoint:newTemplate(name, cache)
return group
end
local lineFeed = ucstring("\n")
local lineEnd = ucstring(". ")
local lineFeed = "\n"
local lineEnd = ". "
--***********************************************************************
-- build a new text group from utf8 text
function RingAccessPoint:newTextLabel(value)
local group = self:newTemplate("rap_text", self.TextCache)
scratchUCStr:fromUtf8(value)
scratchUCStr = findReplaceAll(scratchUCStr, lineFeed, lineEnd)
group:find("t").uc_hardtext_single_line_format = scratchUCStr
local str = findReplaceAll(value, lineFeed, lineEnd)
group:find("t").text_single_line_format = str
return group
end
@ -266,15 +261,14 @@ end
-- build a new text group from utf8 text
function RingAccessPoint:newCenteredTextLabel(value)
local group = self:newTemplate("rap_text_centered", self.CenteredTextCache)
scratchUCStr:fromUtf8(value)
group:find("t").uc_hardtext_single_line_format = scratchUCStr
group:find("t").text_single_line_format = value
return group
end
--***********************************************************************
function RingAccessPoint:newNumberLabel(value)
local group = self:newTemplate("rap_number", self.NumberCache)
group:find("t").uc_hardtext_single_line_format = tostring(value)
group:find("t").text_single_line_format = tostring(value)
return group
end
@ -324,7 +318,7 @@ function RingAccessPoint:addLine(line)
local level = line.Level-1
if level >= 0 and level <= 5 then
self:getColumn("level"):addChild(self:newNumberLabel(i18n.get("uiRAP_Level" .. tostring(level)):toUtf8()))
self:getColumn("level"):addChild(self:newNumberLabel(i18n.get("uiRAP_Level" .. tostring(level))))
else
self:getColumn("level"):addChild(self:newNumberLabel("?"))
end
@ -333,7 +327,7 @@ function RingAccessPoint:addLine(line)
if self.LangToTex[line.Language] ~= nil then
self:getColumn("language"):addChild(self:newBitmap(self.LangToTex[line.Language]))
elseif i18n.hasTranslation("uiR2ED" .. line.Language) then
self:getColumn("language"):addChild(self:newCenteredTextLabel(i18n.get("uiR2ED" .. line.Language):toUtf8()))
self:getColumn("language"):addChild(self:newCenteredTextLabel(i18n.get("uiR2ED" .. line.Language)))
else
self:getColumn("language"):addChild(self:newCenteredTextLabel(line.Language))
end
@ -527,7 +521,7 @@ function RingAccessPoint:setMessage(msg, color)
-- The version below set the msg in the middle of the window
--local errorTxt = self:getWindow():find("errorMsg")
errorTxt.uc_hardtext = msg
errorTxt.text = msg
errorTxt.color = color
errorTxt.active=true
--self:getWindow():invalidateCoords()
@ -631,20 +625,20 @@ function RingAccessPoint:onLineSessionTooltip()
local activeLine = self.CurrActiveList[self:getSelectList():getElementIndex(getUICaller().parent) + 1]
local contextHelpText
if self:isInvited(activeLine.Flags) then
contextHelpText = i18n.get("uiRAP_HowToJoin"):toUtf8()
contextHelpText = i18n.get("uiRAP_HowToJoin")
else
contextHelpText = i18n.get("uiRAP_HowToBeInvited"):toUtf8()
contextHelpText = i18n.get("uiRAP_HowToBeInvited")
end
local desc = activeLine.Desc
if desc=="" then desc="-" end
contextHelpText = contextHelpText .. "\n\n@{6F6F}" .. i18n.get("uiR2EDProp_LoadScenario_Description"):toUtf8() .. " : @{FFFF}" .. ucstring(desc):toUtf8() .. "\n\n"
contextHelpText = contextHelpText .. "\n\n@{6F6F}" .. i18n.get("uiR2EDProp_LoadScenario_Description") .. " : @{FFFF}" .. desc .. "\n\n"
local rateFun = "@{6F6F}" .. i18n.get("uiRAP_RateFun"):toUtf8() .. " : @{FFFF}"
local rateDiff = "@{6F6F}" .. i18n.get("uiRAP_RateDifficulty"):toUtf8() .. " : @{FFFF}"
local rateAccess = "@{6F6F}" .. i18n.get("uiRAP_RateAccessibility"):toUtf8() .. " : @{FFFF}"
local rateOrig = "@{6F6F}" .. i18n.get("uiRAP_RateOriginality"):toUtf8() .. " : @{FFFF}"
local rateDirection = "@{6F6F}" .. i18n.get("uiRAP_RateDirection"):toUtf8() .. " : @{FFFF}"
local rateFun = "@{6F6F}" .. i18n.get("uiRAP_RateFun") .. " : @{FFFF}"
local rateDiff = "@{6F6F}" .. i18n.get("uiRAP_RateDifficulty") .. " : @{FFFF}"
local rateAccess = "@{6F6F}" .. i18n.get("uiRAP_RateAccessibility") .. " : @{FFFF}"
local rateOrig = "@{6F6F}" .. i18n.get("uiRAP_RateOriginality") .. " : @{FFFF}"
local rateDirection = "@{6F6F}" .. i18n.get("uiRAP_RateDirection") .. " : @{FFFF}"
if activeLine.NbRating>0 then
rateFun = rateFun .. tostring(math.min(100, activeLine.RateFun)) .. "/100"
@ -653,11 +647,11 @@ function RingAccessPoint:onLineSessionTooltip()
rateOrig = rateOrig .. tostring(math.min(100, activeLine.RateOriginality)) .. "/100"
rateDirection = rateDirection .. tostring(math.min(100, activeLine.RateDirection)) .. "/100"
else
rateFun = rateFun .. i18n.get("uiRAP_NoRate"):toUtf8()
rateDiff = rateDiff .. i18n.get("uiRAP_NoRate"):toUtf8()
rateAccess = rateAccess .. i18n.get("uiRAP_NoRate"):toUtf8()
rateOrig = rateOrig .. i18n.get("uiRAP_NoRate"):toUtf8()
rateDirection = rateDirection .. i18n.get("uiRAP_NoRate"):toUtf8()
rateFun = rateFun .. i18n.get("uiRAP_NoRate")
rateDiff = rateDiff .. i18n.get("uiRAP_NoRate")
rateAccess = rateAccess .. i18n.get("uiRAP_NoRate")
rateOrig = rateOrig .. i18n.get("uiRAP_NoRate")
rateDirection = rateDirection .. i18n.get("uiRAP_NoRate")
end
-- contextHelpText = contextHelpText .. rateFun .. "\n"
@ -666,9 +660,7 @@ function RingAccessPoint:onLineSessionTooltip()
-- contextHelpText = contextHelpText .. rateOrig .. "\n"
-- contextHelpText = contextHelpText .. rateDirection .. "\n"
local uc_contextHelpText = ucstring()
uc_contextHelpText:fromUtf8(contextHelpText)
setContextHelpText(uc_contextHelpText)
setContextHelpText(contextHelpText)
end
@ -724,10 +716,9 @@ end
--***********************************************************************
function RingAccessPoint:onTell()
--debugInfo("tell to owner of session" .. self.SelectedSessionId)
player = ucstring()
player:fromUtf8(self:getSessionFromId(self.SelectedSessionId).Owner)
player = self:getSessionFromId(self.SelectedSessionId).Owner
tell(player, i18n.get("uiRAP_AskForInvite"))
displaySystemInfo(concatUCString(i18n.get("uiRAP_TellSentTo"), player), "BC")
displaySystemInfo(concatString(i18n.get("uiRAP_TellSentTo"), player), "BC")
end
--***********************************************************************
@ -915,7 +906,7 @@ function RingAccessPoint:onDraw()
-- refreshText.active = false
--else
-- refreshText.active = true
-- refreshText.uc_hardtext = waitText
-- refreshText.text = waitText
--end
end
else

@ -45,24 +45,24 @@ function game.RingAccessPointFilter:init()
local levelCB = filterScenarioWnd:find("level"):find("combo_box")
assert(levelCB)
levelCB:resetTexts()
levelCB:addText(ucstring(i18n.get("uiScenarioLevel_Any")))
levelCB:addText(ucstring("1-50"))
levelCB:addText(ucstring("51-100"))
levelCB:addText(ucstring("101-150"))
levelCB:addText(ucstring("151-200"))
levelCB:addText(ucstring("201-250"))
levelCB:addText(i18n.get("uiScenarioLevel_Any"))
levelCB:addText("1-50")
levelCB:addText("51-100")
levelCB:addText("101-150")
levelCB:addText("151-200")
levelCB:addText("201-250")
levelCB.selection = 0
local genreCB = filterScenarioWnd:find("genre"):find("combo_box")
assert(genreCB)
genreCB:resetTexts()
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_Any")))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_NewbieTraining")))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_StoryTelling")))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_Mistery")))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_HackSlash")))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_GuildTraining")))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_Other")))
genreCB:addText(i18n.get("uiScenarioOrient_Any"))
genreCB:addText(i18n.get("uiScenarioOrient_NewbieTraining"))
genreCB:addText(i18n.get("uiScenarioOrient_StoryTelling"))
genreCB:addText(i18n.get("uiScenarioOrient_Mistery"))
genreCB:addText(i18n.get("uiScenarioOrient_HackSlash"))
genreCB:addText(i18n.get("uiScenarioOrient_GuildTraining"))
genreCB:addText(i18n.get("uiScenarioOrient_Other"))
genreCB.selection = 0
local name = filterScenarioWnd:find("name"):find("edit_box_group")
@ -85,10 +85,10 @@ function game.RingAccessPointFilter:getURLParameters()
local filterScenarioWnd = self:getWnd()
assert(filterScenarioWnd)
local owner = filterScenarioWnd:find("owner"):find("edit_box_group").uc_input_string
local owner = filterScenarioWnd:find("owner"):find("edit_box_group").input_string
local level = self.LevelToURLParam[filterScenarioWnd:find("level"):find("combo_box").selection]
local orientation = self.OrientationToURLParam[filterScenarioWnd:find("genre"):find("combo_box").selection]
local name = filterScenarioWnd:find("name"):find("edit_box_group").uc_input_string
local name = filterScenarioWnd:find("name"):find("edit_box_group").input_string
local charSlot = getCharSlot()
local result = string.format("&owner=%s&level=%s&orientation=%s&name=%s&charSlot=%u", encodeURLUnicodeParam(owner), level, orientation, encodeURLUnicodeParam(name), charSlot)
@ -107,12 +107,12 @@ function game.RingAccessPointFilter:validate()
end
local ucUrl
if config.Local == 1 then
ucUrl = ucstring(NicoMagicURL) -- for test in local mode
ucUrl = NicoMagicURL -- for test in local mode
else
ucUrl = getDynString(game.NpcWebPage.UrlTextId)
end
debugInfo(tostring(ucUrl))
local utf8Url = ucUrl:toUtf8()
local utf8Url = ucUrl
local browser = getUI("ui:interface:npc_web_browser"):find("html")
-- when in ring mode, add the parameters ourselves. 60 second is the timout for zope....
browseNpcWebPage(getUIId(browser), utf8Url .. self:getURLParameters(), false, 60)

@ -621,7 +621,7 @@
<view type="text" id="text" case_mode="%case_first_word_letter_up" posref="TL TL" x="6" y="-4" color="255 255 255 255" global_color="false" fontsize="14" shadow="true" hardtext="uiPeopleAddContact" />
<instance template="edit_box_widget" id="add_contact_eb" posref="TL TL" x="6" y="-24" child_resize_h="true" w="200" onenter="add_contact" max_num_chars="255" entry_type="playername" />
<instance template="edit_box_widget" id="add_contact_eb" posref="TL TL" x="6" y="-24" child_resize_h="true" w="200" onenter="add_contact" max_num_bytes="255" entry_type="playername" />
<instance template="button_ok_cancel" posparent="add_contact_eb" posref="BR TR" x="0" y="-4"
onclick_ok="r2ed_invite_character"
@ -832,7 +832,7 @@
onenter="" params=""
on_focus_lost="" on_focus_lost_params=""
reset_focus_on_hide="true"
max_num_chars="256"
max_num_bytes="255"
>
<view type="text" id="edit_text" x="4" y="-1" posref="TL TL" multi_line="true"

@ -28,7 +28,7 @@ function game:getMilkoTooltipWithKey(prop, tooltip, tooltip_pushed, name, param)
if (key ~= nil and key ~= '') then
key = ' @{2F2F}(' .. key .. ')'
text = concatUCString(text, key)
text = concatString(text, key)
end
setContextHelpText(text)

@ -579,9 +579,9 @@
<!-- ********************* -->
<!-- * EDIT BOX WIDGET * -->
<!-- ********************* -->
<template name="edit_box_widget" active="true" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" child_resize_hmargin="0" multi_line="false" x="0" y="0" w="0" h="0" sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" enter_loose_focus="true" prompt="&gt;" enter_recover_focus="true" max_num_chars="255" menu_r="" onchange="" onchange_params="" entry_type="text" keep="true" max_historic="40" fontsize="10" shadow="true" shadow_x="1" shadow_y="1" shadow_color="0 0 0 255" shadow_outline="false" backup_father_container_pos="false" want_return="false" clear_on_escape="false" color="255 255 255 255" continuous_text_update="false" bg_texture="W_box_blank.tga" on_focus_lost="" on_focus_lost_params="" max_float_prec="5" tooltip="" tooltip_parent="" negative_filter="" render_layer="0">
<template name="edit_box_widget" active="true" posref="TL TL" text_x="0" text_y="0" text_ref="BL BL" child_resize_h="true" child_resize_hmargin="0" multi_line="false" x="0" y="0" w="0" h="0" sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" enter_loose_focus="true" prompt="&gt;" enter_recover_focus="true" max_num_bytes="0" max_num_chars="255" menu_r="" onchange="" onchange_params="" entry_type="text" keep="true" max_historic="40" fontsize="10" shadow="true" shadow_x="1" shadow_y="1" shadow_color="0 0 0 255" shadow_outline="false" backup_father_container_pos="false" want_return="false" clear_on_escape="false" color="255 255 255 255" continuous_text_update="false" bg_texture="W_box_blank.tga" on_focus_lost="" on_focus_lost_params="" max_float_prec="5" tooltip="" tooltip_parent="" negative_filter="" render_layer="0">
<group id="#id" active="#active" posref="#posref" x="#x" y="#y" posparent="#posparent" child_resize_h="#child_resize_h" child_resize_hmargin="#child_resize_hmargin" sizeref="#sizeref" w="#w" h="#h" render_layer="#render_layer">
<group type="edit_box" sizeref="w" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="true" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" clear_on_escape="#clear_on_escape" backup_father_container_pos="#backup_father_container_pos" on_focus_lost="#on_focus_lost" on_focus_lost_params="#on_focus_lost_params" max_float_prec="#max_float_prec" tooltip="#tooltip" tooltip_parent="#tooltip_parent" negative_filter="#negative_filter" render_layer="#render_layer">
<group type="edit_box" sizeref="w" w="-8" id="eb" posref="TL TL" x="4" y="-4" child_resize_h="true" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params" max_num_bytes="#max_num_bytes" max_num_chars="#max_num_chars" prompt="#prompt" enter_loose_focus="#enter_loose_focus" enter_recover_focus="#enter_recover_focus" entry_type="#entry_type" reset_focus_on_hide="#reset_focus_on_hide" menu_r="#menu_r" max_historic="#max_historic" want_return="#want_return" clear_on_escape="#clear_on_escape" backup_father_container_pos="#backup_father_container_pos" on_focus_lost="#on_focus_lost" on_focus_lost_params="#on_focus_lost_params" max_float_prec="#max_float_prec" tooltip="#tooltip" tooltip_parent="#tooltip_parent" negative_filter="#negative_filter" render_layer="#render_layer">
<view type="bitmap" id="bg" scale="true" sizeref="hw" h="0" w="0" texture="#bg_texture" inherit_gc_alpha="true" render_layer="#render_layer" />
<view id="edit_text" type="text" continuous_update="#continuous_text_update" x="#text_x" y="#text_y" posref="#text_ref" multi_line="#multi_line" multi_line_space="0" fontsize="#fontsize" color="#color" shadow="#shadow" shadow_x="#shadow_x" shadow_y="#shadow_y" shadow_color="#shadow_color" shadow_outline="#shadow_outline" hardtext="" global_color="false" render_layer="#render_layer" />
</group>

@ -19,8 +19,8 @@ eltTemplateParams = {
multiMaxLine="3"
},
elementEditorTemplate = "template_edit_activity",
elementInitialName=i18n.get("uiR2EdActivity"):toUtf8(),
sequenceInitialName=i18n.get("uiR2EdSeq"):toUtf8(),
elementInitialName=i18n.get("uiR2EdActivity"),
sequenceInitialName=i18n.get("uiR2EdSeq"),
isInitialized = false,
@ -37,33 +37,33 @@ updatedEltUIID = nil, -- creation or update of element
activityTypeTranslation = {
["Stand Still"] ={trans=i18n.get("uiR2EdStandStill"):toUtf8(), zone=""},
["Follow Route"] ={trans=i18n.get("uiR2EdFollowRoad"):toUtf8(), zone="Road"},
["Patrol"] ={trans=i18n.get("uiR2EdPatrol"):toUtf8(), zone="Road"},
["Repeat Road"] ={trans=i18n.get("uiR2EdRepeatRoad"):toUtf8(), zone="Road"},
["Wander"] ={trans=i18n.get("uiR2EdWander"):toUtf8(), zone="Region"},
["Stand On Start Point"] ={trans=i18n.get("uiR2EdStandOnStartPoint"):toUtf8(), zone=""},
["Go To Start Point"] ={trans=i18n.get("uiR2EdGoToStartPoint"):toUtf8(), zone=""},
["Go To Zone"] ={trans=i18n.get("uiR2EdGoToZone"):toUtf8(), zone="Region"},
["Sit Down"] ={trans=i18n.get("uiR2EdSitDown"):toUtf8(), zone=""},
["Stand Up"] ={trans=i18n.get("uiR2EdStandUp"):toUtf8(), zone=""},
["Rest In Zone"] ={trans=i18n.get("uiR2EDRest"):toUtf8(), zone="Region"},
["Feed In Zone"] ={trans=i18n.get("uiR2EDFeed"):toUtf8(), zone="Region"},
["Work In Zone"] ={trans=i18n.get("uiR2EDWork"):toUtf8(), zone="Region"},
["Hunt In Zone"] ={trans=i18n.get("uiR2EDHunt"):toUtf8(), zone="Region"},
["Guard Zone"] ={trans=i18n.get("uiR2EDGuard"):toUtf8(), zone="Region"},
["Stand Still"] ={trans=i18n.get("uiR2EdStandStill"), zone=""},
["Follow Route"] ={trans=i18n.get("uiR2EdFollowRoad"), zone="Road"},
["Patrol"] ={trans=i18n.get("uiR2EdPatrol"), zone="Road"},
["Repeat Road"] ={trans=i18n.get("uiR2EdRepeatRoad"), zone="Road"},
["Wander"] ={trans=i18n.get("uiR2EdWander"), zone="Region"},
["Stand On Start Point"] ={trans=i18n.get("uiR2EdStandOnStartPoint"), zone=""},
["Go To Start Point"] ={trans=i18n.get("uiR2EdGoToStartPoint"), zone=""},
["Go To Zone"] ={trans=i18n.get("uiR2EdGoToZone"), zone="Region"},
["Sit Down"] ={trans=i18n.get("uiR2EdSitDown"), zone=""},
["Stand Up"] ={trans=i18n.get("uiR2EdStandUp"), zone=""},
["Rest In Zone"] ={trans=i18n.get("uiR2EDRest"), zone="Region"},
["Feed In Zone"] ={trans=i18n.get("uiR2EDFeed"), zone="Region"},
["Work In Zone"] ={trans=i18n.get("uiR2EDWork"), zone="Region"},
["Hunt In Zone"] ={trans=i18n.get("uiR2EDHunt"), zone="Region"},
["Guard Zone"] ={trans=i18n.get("uiR2EDGuard"), zone="Region"},
},
timeLimitsTranslation = {
["No Limit"] =i18n.get("uiR2EdNoTimeLimit"):toUtf8(),
["Chat"] =i18n.get("uiR2EdWhileChat"):toUtf8(),
["Few Sec"] =i18n.get("uiR2EdForCertainTime"):toUtf8(),
["No Limit"] =i18n.get("uiR2EdNoTimeLimit"),
["Chat"] =i18n.get("uiR2EdWhileChat"),
["Few Sec"] =i18n.get("uiR2EdForCertainTime"),
},
timeLimitsProperties = {
[i18n.get("uiR2EdNoTimeLimit"):toUtf8()] ="No Limit",
[i18n.get("uiR2EdWhileChat"):toUtf8()] ="Chat",
[i18n.get("uiR2EdForCertainTime"):toUtf8()] ="Few Sec"
[i18n.get("uiR2EdNoTimeLimit")] ="No Limit",
[i18n.get("uiR2EdWhileChat")] ="Chat",
[i18n.get("uiR2EdForCertainTime")] ="Few Sec"
},
}
@ -192,9 +192,8 @@ function r2.activities:initEditorAfterFirstCall()
self:triggerSelectSequence(activitySequences[selectedSequenceIndex].InstanceId)
end
local uc_title = ucstring()
uc_title:fromUtf8(i18n.get("uiR2EDActivitySequenceEditor"):toUtf8() .. entity.Name)
ui.uc_title = uc_title
local title = i18n.get("uiR2EDActivitySequenceEditor")..entity.Name
ui.title = title
self.isInitialized = true
end
@ -261,9 +260,7 @@ function r2.activities:openSequenceEditor()
end
end
local uc_sequ = ucstring()
uc_sequ:fromUtf8(tabName)
editName.uc_input_string = uc_sequ
editName.input_string = tabName
end
@ -279,7 +276,7 @@ function r2.activities:setSequenceName()
assert(editName)
local sequenceInstId = self:currentSequInstId()
r2.requestSetNode(sequenceInstId, "Name", editName.uc_input_string:toUtf8())
r2.requestSetNode(sequenceInstId, "Name", editName.input_string)
sequenceEditor.active = false
end
@ -318,8 +315,8 @@ function r2.activities:newSequenceUI(activitySequence)
local templateParams = {
newElt="r2.activities:newElementInst()",
newEltText=i18n.get("uiR2EdNewActivity"):toUtf8(),
eltOrderText=i18n.get("uiR2EdActivityOrder"):toUtf8(),
newEltText=i18n.get("uiR2EdNewActivity"),
eltOrderText=i18n.get("uiR2EdActivityOrder"),
upElt="r2.activities:upElementInst()",
downElt="r2.activities:downElementInst()",
maxMinElts="r2.activities:maximizeMinimizeElements()",
@ -433,9 +430,7 @@ function r2.activities:newSequenceUI(activitySequence)
sequName = self.sequenceInitialName .. (i+1)
end
local uc_name = ucstring()
uc_name:fromUtf8(sequName)
tabButton.uc_hardtext = uc_name
tabButton.text = sequName
end
end
@ -476,7 +471,7 @@ function r2.activities:removeSequenceUI(instance)
local buttonTab = tab:find("tab"..i)
assert(buttonTab)
if buttonTab.hardtext == self.sequenceInitialName..(i+1) then
buttonTab.uc_hardtext = self.sequenceInitialName..i
buttonTab.text = self.sequenceInitialName..i
end
end
end
@ -544,9 +539,7 @@ function r2.activities:updateSequenceUI(instance, attributeName)
local buttonTab = tab:find("tab"..tabId)
assert(buttonTab)
local uc_name = ucstring()
uc_name:fromUtf8(name)
buttonTab.uc_hardtext = uc_name
buttonTab.text = name
local viewText = buttonTab:getViewText()
assert(viewText)
@ -742,7 +735,7 @@ function r2.activities:createElementEditor()
local i = 0
while i < 20 do
i = i + 1
cb:addText(ucstring(tostring(i)))
cb:addText(tostring(i))
end
end
@ -784,7 +777,7 @@ function r2.activities:updateElementEditor()
assert(comboBox)
local value = select(instanceActivity.RoadCountLimit, instanceActivity.RoadCountLimit, "0")
if value == "0" then
value = i18n.get("uiR2EdNoRoadCountLimit"):toUtf8()
value = i18n.get("uiR2EdNoRoadCountLimit")
end
comboBox.Env.locked = true
comboBox.selection_text = value
@ -797,11 +790,11 @@ function r2.activities:updateElementEditor()
assert(comboBox)
local index = r2.logicComponents:searchElementIndex(instanceActivity)
local uc_activityName = ucstring(self.elementInitialName.." : ")
if index~= nil then
uc_activityName:fromUtf8(self.elementInitialName.." "..index.." : ")
activityName.text = self.elementInitialName.." "..index.." : "
else
activityName.text = self.elementInitialName.." : "
end
activityName.uc_hardtext = uc_activityName
-- activity type
local activityText = instanceActivity:getVerb()
@ -812,9 +805,7 @@ function r2.activities:updateElementEditor()
activityText = activityText .. " " .. place.Name
end
if activityText then
local uc_activityText = ucstring()
uc_activityText:fromUtf8(activityText)
activityButtonText.uc_hardtext = uc_activityText
activityButtonText.text = activityText
end
-- time limit
@ -832,27 +823,25 @@ function r2.activities:updateElementEditor()
local hoursNb, minNb, secNb = r2.logicComponents:calculHourMinSec(timeLimitValue)
local timeLimitText = i18n.get("uiR2EdFor"):toUtf8() .. " "
if hoursNb ~= 0 then timeLimitText = timeLimitText .. hoursNb .. i18n.get("uiR2EdShortHours"):toUtf8() .. " " end
if minNb ~= 0 then timeLimitText = timeLimitText .. minNb .. i18n.get("uiR2EdShortMinutes"):toUtf8() .. " " end
timeLimitText = timeLimitText .. secNb .. i18n.get("uiR2EdShortSeconds"):toUtf8()
local timeLimitText = i18n.get("uiR2EdFor") .. " "
if hoursNb ~= 0 then timeLimitText = timeLimitText .. hoursNb .. i18n.get("uiR2EdShortHours") .. " " end
if minNb ~= 0 then timeLimitText = timeLimitText .. minNb .. i18n.get("uiR2EdShortMinutes") .. " " end
timeLimitText = timeLimitText .. secNb .. i18n.get("uiR2EdShortSeconds")
certainTime.active = true
local hoursMenu = certainTime:find("hours"):find("text")
assert(hoursMenu)
hoursMenu.uc_hardtext = tostring(hoursNb)
hoursMenu.text = tostring(hoursNb)
local minutesMenu = certainTime:find("minutes"):find("text")
assert(minutesMenu)
minutesMenu.uc_hardtext = tostring(minNb)
minutesMenu.text = tostring(minNb)
local secondsMenu = certainTime:find("seconds"):find("text")
assert(secondsMenu)
secondsMenu.uc_hardtext = tostring(secNb)
secondsMenu.text = tostring(secNb)
local uc_time = ucstring()
uc_time:fromUtf8(timeLimitText)
comboBox.view_text = uc_time
comboBox.view_text = timeLimitText
end
else
certainTime.active = false
@ -959,14 +948,14 @@ function r2.activities:newElementInst(tableInit)
end
if roadAct then
actionToInitDefaultActivity = i18n.get("uiR2EdRoad"):toUtf8() .. " "
actionToInitDefaultActivity = i18n.get("uiR2EdRoad") .. " "
end
if regionAct then
if actionToInitDefaultActivity~="" then
actionToInitDefaultActivity = actionToInitDefaultActivity .. i18n.get("uiR2EdOr"):toUtf8().. " "
actionToInitDefaultActivity = actionToInitDefaultActivity .. i18n.get("uiR2EdOr").. " "
end
actionToInitDefaultActivity = actionToInitDefaultActivity .. i18n.get("uiR2EdRegion"):toUtf8() .. " "
actionToInitDefaultActivity = actionToInitDefaultActivity .. i18n.get("uiR2EdRegion") .. " "
end
end
@ -978,10 +967,8 @@ function r2.activities:newElementInst(tableInit)
r2.logicComponents:newElementInst(r2.activities)
elseif not existZone then
local message = i18n.get("uiR2EdCreateZone"):toUtf8() .. actionToInitDefaultActivity .. i18n.get("uiR2EdFor"):toUtf8() .. " " .. selectedInst.Name
local uc_message = ucstring()
uc_message:fromUtf8(message)
messageBox(uc_message)
local message = i18n.get("uiR2EdCreateZone") .. actionToInitDefaultActivity .. i18n.get("uiR2EdFor") .. " " .. selectedInst.Name
messageBox(message)
end
r2.requestForceEndMultiAction()
end
@ -1049,22 +1036,19 @@ function r2.activities:initActivityMenu()
local activityMenu = activityMenu:getRootMenu()
assert(activityMenu)
activityMenu:reset()
local uc_activity = ucstring()
local activitiesTable = {}
r2:getSelectedInstance():getAvailableActivities(activitiesTable)
local activitiesNb = 0
for k, actType in pairs(activitiesTable) do
local uc_activity = ucstring()
local translation = self.activityTypeTranslation[actType].trans
uc_activity:fromUtf8(translation)
local zone = self.activityTypeTranslation[actType].zone
if zone == "" then
activityMenu:addLine(uc_activity, "lua", "r2.activities:setActivityType('"..actType.."')", actType)
activityMenu:addLine(translation, "lua", "r2.activities:setActivityType('"..actType.."')", actType)
else
activityMenu:addLine(uc_activity, "", "", actType)
activityMenu:addLine(translation, "", "", actType)
local textureName = ""
if zone == "Road" then
@ -1079,8 +1063,7 @@ function r2.activities:initActivityMenu()
local zonesMenu = activityMenu:getSubMenu(activitiesNb)
local zonesTable = r2.Scenario:getAllInstancesByType(zone)
for key, z in pairs(zonesTable) do
uc_activity:fromUtf8(z.Name)
zonesMenu:addLine(uc_activity, "lua", "r2.activities:setActivityType('"..actType.."', '".. z.InstanceId .."')", z.InstanceId)
zonesMenu:addLine(z.Name, "lua", "r2.activities:setActivityType('"..actType.."', '".. z.InstanceId .."')", z.InstanceId)
end
if table.getn(zonesTable) == 0 then
zonesMenu:addLine(i18n.get("uiR2EdNoSelelection"), "lua", "r2.activities:setActivityType()", "")
@ -1126,7 +1109,7 @@ function r2.activities:setTimeLimit(timeLimit)
assert(activityInstId)
-- TimeLimitValue
if timeLimit == i18n.get("uiR2EdForCertainTime"):toUtf8() then
if timeLimit == i18n.get("uiR2EdForCertainTime") then
r2.requestSetNode(activityInstId, "TimeLimitValue", tostring(20))
else
r2.requestSetNode(activityInstId, "TimeLimitValue", "")
@ -1152,7 +1135,7 @@ function r2.activities:setRoadCountLimit(limit)
assert(activityInstId)
-- RoadCountLimit
if limit == i18n.get("uiR2EdNoRoadCountLimit"):toUtf8() then
if limit == i18n.get("uiR2EdNoRoadCountLimit") then
r2.requestSetNode(activityInstId, "RoadCountLimit", "0")
else
r2.requestSetNode(activityInstId, "RoadCountLimit", timeLimit)
@ -1171,17 +1154,17 @@ function r2.activities:initTimeMenu(timeFunction, isHours)
timeMenu:reset()
for i=0,9 do
timeMenu:addLine(ucstring(tostring(i)), "lua", timeFunction .. "(" .. tostring(i) .. ")", tostring(i))
timeMenu:addLine(tostring(i), "lua", timeFunction .. "(" .. tostring(i) .. ")", tostring(i))
end
if isHours == true then
timeMenu:addLine(ucstring(tostring(10)), "lua", timeFunction .. "(" .. tostring(10) .. ")", tostring(10))
timeMenu:addLine(tostring(10), "lua", timeFunction .. "(" .. tostring(10) .. ")", tostring(10))
else
local lineNb = 9
for i=10, 50, 10 do
local lineStr = tostring(i).."/"..tostring(i+9)
timeMenu:addLine(ucstring(lineStr), "", "", tostring(i))
timeMenu:addLine(lineStr, "", "", tostring(i))
lineNb = lineNb+1
timeMenu:addSubMenu(lineNb)
@ -1189,7 +1172,7 @@ function r2.activities:initTimeMenu(timeFunction, isHours)
for s=0,9 do
lineStr = tostring(i+s)
subMenu:addLine(ucstring(lineStr), "lua", timeFunction .. "(" .. tostring(i+s) .. ")", lineStr)
subMenu:addLine(lineStr, "lua", timeFunction .. "(" .. tostring(i+s) .. ")", lineStr)
end
end
end

@ -336,7 +336,7 @@ end
-- helper : add "delete : name_of_the_thing_being_deleted" in the action historic as the name of the delete action that is about
-- to be done
function baseClass.setDeleteActionName(this)
r2.requestNewAction(concatUCString(i18n.get("uiR2EDDeleteAction"), this:getDisplayName()))
r2.requestNewAction(concatString(i18n.get("uiR2EDDeleteAction"), this:getDisplayName()))
end
@ -456,9 +456,9 @@ end
---------------------------------------------------------------------------------------------------------
-- Get the display name (in i18n format). This name will be displayed in the property sheet or inthe instance tree
function baseClass.getDisplayName(this)
local displayName = ucstring()
local displayName = ""
if this.Name ~= nil and this.Name ~= "" then
displayName:fromUtf8(this.Name)
displayName = this.Name
else
return i18n.get("uiR2EDNoName")
-- local className = this.Class
@ -469,15 +469,15 @@ function baseClass.getDisplayName(this)
-- end
-- end
-- className = className .. " : " .. this.InstanceId
-- displayName:fromUtf8(className)
-- displayName = className
end
return displayName
end
---------------------------------------------------------------------------------------------------------
-- Get the base name for instance name generation (should return a ucstring)
-- Get the base name for instance name generation (should return a utf-8 string)
function baseClass.getBaseName(this)
return ucstring("")
return ""
end
@ -576,7 +576,7 @@ function baseClass.onSetupMenu(this)
-- for i = 1,9 do
-- if parent == nil or parent.Parent == nil then break end
-- menu["selectParent" .. tostring(i)].active = true
-- menu["selectParent" .. tostring(i)].uc_hardtext = i18n.get("uimR2EDSelectParent") + (parent.InstanceId .. " (" .. parent.Class .. ")")
-- menu["selectParent" .. tostring(i)].text = i18n.get("uimR2EDSelectParent") + (parent.InstanceId .. " (" .. parent.Class .. ")")
-- --debugInfo(colorTag(0, 255, 255) .. tostring(i))
-- parent = parent.ParentInstance
-- end
@ -764,11 +764,11 @@ function baseClass.setRefIdValue(this, refIdName, targetId)
local name = this:getDisplayName()
local refIdUCName = r2:getPropertyTranslation(this:getClass().NameToProp[refIdName])
if targetId == "" then
r2.requestNewAction(concatUCString(i18n.get("uiR2EDRemovingTargetAction"), name,
r2.requestNewAction(concatString(i18n.get("uiR2EDRemovingTargetAction"), name,
i18n.get("uiR2EDAddingReferenceSeparator"), refIdname))
else
local targetName = r2:getInstanceFromId(targetId):getDisplayName()
r2.requestNewAction(concatUCString(i18n.get("uiR2EDAddingReferenceAction"), name,
r2.requestNewAction(concatString(i18n.get("uiR2EDAddingReferenceAction"), name,
i18n.get("uiR2EDAddingReferenceSeparator"), refIdUCName,
i18n.get("uiR2EDAddingReferenceToAction"), targetName))
end

@ -134,8 +134,8 @@ function baseClass.newCopy(this)
local result = cloneNode(this, srcToCopyMapping)
renameRefIds(result, srcToCopyMapping)
-- if the name is a generated one, create a new name
if result.Name ~= nil and r2:isPostFixedByNumber(ucstring(result.Name)) then
result.Name = r2:genInstanceName(ucstring(result.Name)):toUtf8()
if result.Name ~= nil and r2:isPostFixedByNumber(result.Name) then
result.Name = r2:genInstanceName(result.Name)
end
-- the copy of a undeletable object is a deltable object

@ -298,9 +298,8 @@ r2.registerHighLevel = function()
----------------------------------------------------------------------------
-- add a line to the event sub menu
function classScenario.initLogicEntitiesInstancesMenu(this, subMenu, calledFunction)
local uc_name = ucstring()
uc_name:fromUtf8(r2.Scenario:getName())
subMenu:addLine(uc_name, "lua", calledFunction.."('".. r2.Scenario.InstanceId .."')", r2.Scenario.InstanceId)
local name = r2.Scenario:getName()
subMenu:addLine(name, "lua", calledFunction.."('".. r2.Scenario.InstanceId .."')", r2.Scenario.InstanceId)
end
----------------------------------------------------------------------------
@ -308,24 +307,24 @@ r2.registerHighLevel = function()
function classScenario:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
--["Start Scenario Timing"] = { menu=i18n.get( "uiR2AA0ScenarioStartTiming" ):toUtf8(),
-- text=i18n.get( "uiR2AA1ScenarioStartTiming" ):toUtf8()},
--["Stop Scenario Timing"] = { menu=i18n.get( "uiR2AA0ScenarioStopTiming" ):toUtf8(),
-- text=i18n.get( "uiR2AA1ScenarioStopTiming" ):toUtf8()},
--["add scenario points"] = { menu=i18n.get( "uiR2AA0ScenarioAddPoints" ):toUtf8(),
-- text=i18n.get( "uiR2AA1ScenarioAddPoints" ):toUtf8()},
--["succeed scenario"] = { menu=i18n.get( "uiR2AA0ScenarioSucceed" ):toUtf8(),
-- text=i18n.get( "uiR2AA1ScenarioSucceed" ):toUtf8()},
--["fail scenario"] = { menu=i18n.get( "uiR2AA0ScenarioFail" ):toUtf8(),
-- text=i18n.get( "uiR2AA1ScenarioFail" ):toUtf8()},
--["Start Scenario Timing"] = { menu=i18n.get( "uiR2AA0ScenarioStartTiming" ),
-- text=i18n.get( "uiR2AA1ScenarioStartTiming" )},
--["Stop Scenario Timing"] = { menu=i18n.get( "uiR2AA0ScenarioStopTiming" ),
-- text=i18n.get( "uiR2AA1ScenarioStopTiming" )},
--["add scenario points"] = { menu=i18n.get( "uiR2AA0ScenarioAddPoints" ),
-- text=i18n.get( "uiR2AA1ScenarioAddPoints" )},
--["succeed scenario"] = { menu=i18n.get( "uiR2AA0ScenarioSucceed" ),
-- text=i18n.get( "uiR2AA1ScenarioSucceed" )},
--["fail scenario"] = { menu=i18n.get( "uiR2AA0ScenarioFail" ),
-- text=i18n.get( "uiR2AA1ScenarioFail" )},
},
["Events"] = {
--["On Scenario Started"] = { menu=i18n.get( "uiR2Event0ScenarioStart" ):toUtf8(),
-- text=i18n.get( "uiR2Event1ScenarioStart" ):toUtf8()},
--["on scenario succeeded"] = { menu=i18n.get( "uiR2Event0ScenarioSucceed" ):toUtf8(),
-- text=i18n.get( "uiR2Event1ScenarioSucceed" ):toUtf8()},
--["on scenario failed"] = { menu=i18n.get( "uiR2Event0ScenarioFailed" ):toUtf8(),
-- text=i18n.get( "uiR2Event1ScenarioFailed" ):toUtf8()},
--["On Scenario Started"] = { menu=i18n.get( "uiR2Event0ScenarioStart" ),
-- text=i18n.get( "uiR2Event1ScenarioStart" )},
--["on scenario succeeded"] = { menu=i18n.get( "uiR2Event0ScenarioSucceed" ),
-- text=i18n.get( "uiR2Event1ScenarioSucceed" )},
--["on scenario failed"] = { menu=i18n.get( "uiR2Event0ScenarioFailed" ),
-- text=i18n.get( "uiR2Event1ScenarioFailed" )},
},
["Conditions"] = {
}
@ -346,14 +345,14 @@ r2.registerHighLevel = function()
local lineNb = 0
for i=1, 100, 20 do
local lineStr = tostring(i).."/"..tostring(i+19)
subMenu:addLine(ucstring(lineStr), "", "", tostring(i))
subMenu:addLine(lineStr, "", "", tostring(i))
subMenu:addSubMenu(lineNb)
local subMenu2= subMenu:getSubMenu(lineNb)
for s=0, 19 do
lineStr = tostring(i+s)
local func = "r2.events:setEventValue('','" .. categoryEvent .."','".. lineStr.."')"
subMenu2:addLine(ucstring(lineStr), "lua", func, lineStr)
subMenu2:addLine(lineStr, "lua", func, lineStr)
end
lineNb = lineNb+1
end
@ -733,8 +732,8 @@ r2.registerHighLevel = function()
local name = this.Name
local actNb = r2.logicComponents:searchElementIndex(this)-1
local firstPart = i18n.get("uiR2EDDefaultActTitle"):toUtf8().. actNb
local firstPartSpace = i18n.get("uiR2EDDefaultActTitle"):toUtf8().. " " .. actNb
local firstPart = i18n.get("uiR2EDDefaultActTitle").. actNb
local firstPartSpace = i18n.get("uiR2EDDefaultActTitle").. " " .. actNb
if name=="" then
name = firstPartSpace
elseif string.lower(name)==string.lower(firstPart) or string.lower(name)==string.lower(firstPartSpace) then
@ -754,9 +753,7 @@ r2.registerHighLevel = function()
if this:isBaseAct() then
return i18n.get("uiR2EDBaseAct")
end
local result = ucstring()
result:fromUtf8(this:getName())
return result
return this:getName()
end,
-----------------------------------------------------------------------------
-- from baseClass
@ -819,9 +816,7 @@ r2.registerHighLevel = function()
for i=0, r2.Scenario.Acts.Size-1 do
local act = r2.Scenario.Acts[i]
if not act:isBaseAct() then
local uc_name = ucstring()
uc_name:fromUtf8(act.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. act.InstanceId .."')", act.InstanceId)
subMenu:addLine(act.Name, "lua", calledFunction.."('".. act.InstanceId .."')", act.InstanceId)
empty = false
end
end
@ -836,12 +831,12 @@ r2.registerHighLevel = function()
function classAct:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["Start Act"] = { menu=i18n.get( "uiR2AA0ActStart" ):toUtf8(),
text=i18n.get( "uiR2AA1ActStart" ):toUtf8()},
["Start Act"] = { menu=i18n.get( "uiR2AA0ActStart" ),
text=i18n.get( "uiR2AA1ActStart" )},
},
["Events"] = {
["On Act Started"] = { menu=i18n.get( "uiR2Event0ActStart" ):toUtf8(),
text=i18n.get( "uiR2Event1ActStart" ):toUtf8()},
["On Act Started"] = { menu=i18n.get( "uiR2Event0ActStart" ),
text=i18n.get( "uiR2Event1ActStart" )},
},
["Conditions"] = {
}
@ -1088,10 +1083,10 @@ end
-- -- register trad
-- local localLogicEntityAttributes = {
-- ["ApplicableActions"] = {
-- ["Start Act"] = i18n.get("uiR2EdStartAct"):toUtf8(),
-- ["Start Act"] = i18n.get("uiR2EdStartAct"),
-- },
-- ["Events"] = {
-- ["On Act Started"] = i18n.get("uiR2EdOnActStarted"):toUtf8(),
-- ["On Act Started"] = i18n.get("uiR2EdOnActStarted"),
-- },
-- ["Conditions"] = {
-- }

@ -465,7 +465,7 @@ local generatePreCode = function(fName)
.."local comp = r2.newComponent('UserComponentHolder')\n\t"
.."assert(comp)\n\n\t"
.."comp.Base = \"palette.entities.botobjects.user_event\"\n\t"
.."comp.Name = r2:genInstanceName(ucstring('"..featureName.."')):toUtf8()\n\t"
.."comp.Name = r2:genInstanceName('"..featureName.."')\n\t"
.."comp.Position.x = x\n\t"
.."comp.Position.y = y\n\t"
.."comp.Position.z = r2:snapZToGround(x, y)\n\n\t"

@ -17,17 +17,17 @@ eltTemplateParams = {
multiMaxLine="3"
},
elementEditorTemplate = "template_edit_chat",
elementInitialName=i18n.get("uiR2EdChat"):toUtf8(),
sequenceInitialName=i18n.get("uiR2EDDialog"):toUtf8(),
elementInitialName=i18n.get("uiR2EdChat"),
sequenceInitialName=i18n.get("uiR2EDDialog"),
keepOpenedEditor = false,
currentEltUIID = nil, -- initialisé quand l'editeur est ouvert ou fermé
whoToWhoTranslation = {
["_DM"] = i18n.get("uiR2EdDonjonMaster"):toUtf8(),
["_System"] = i18n.get("uiR2EdSystem"):toUtf8(),
["_Nobody"] = i18n.get("uiR2EdNobody"):toUtf8(),
["_DM"] = i18n.get("uiR2EdDonjonMaster"),
["_System"] = i18n.get("uiR2EdSystem"),
["_Nobody"] = i18n.get("uiR2EdNobody"),
},
maxVisibleLine = 10,
@ -154,7 +154,7 @@ function r2.dialogs:openEditor()
sequenceUI.active = false
local dialogName = dialogUI:find("dialogMenu"):find("menu"):find("text")
assert(dialogName)
dialogName.uc_hardtext = i18n.get("uiR2EdNoSelelection")
dialogName.text = i18n.get("uiR2EdNoSelelection")
end
-- active editor
@ -180,7 +180,7 @@ function r2.dialogs:newSequenceInst(x, y, z)
assert(dialog)
dialog.Base = r2.Translator.getDebugBase("palette.entities.botobjects.dialog")
dialog.Name = r2:genInstanceName(i18n.get("uiR2EDDialog")):toUtf8()
dialog.Name = r2:genInstanceName(i18n.get("uiR2EDDialog"))
dialog.Position.x = x
dialog.Position.y = y
dialog.Position.z = r2:snapZToGround(x, y)
@ -245,10 +245,8 @@ function r2.dialogs:initDialogsMenu()
local allDialogs = {}
r2:getCurrentAct():appendInstancesByType(allDialogs, "ChatSequence")
local uc_dialog = ucstring()
for k, dialog in pairs(allDialogs) do
uc_dialog:fromUtf8(dialog.Name)
dialogMenu:addLine(uc_dialog, "lua", "r2:setSelectedInstanceId('" .. dialog.InstanceId .."')", dialog.InstanceId)
dialogMenu:addLine(dialog.Name, "lua", "r2:setSelectedInstanceId('" .. dialog.InstanceId .."')", dialog.InstanceId)
end
dialogMenu:setMaxVisibleLine(self.maxVisibleLine)
@ -308,15 +306,12 @@ function r2.dialogs:selectSequence(dialogId)
repeatButton.pushed = (sequenceInst.Repeating == 0)
-- dialog editor title
local uc_dialog = ucstring()
uc_dialog:fromUtf8(i18n.get("uiR2EDChatSequenceEditor"):toUtf8() .. sequenceInst.Name)
ui.uc_title = uc_dialog
ui.title = i18n.get("uiR2EDChatSequenceEditor")..sequenceInst.Name
-- dialog name in menu box
local dialogName = ui:find("dialogMenu"):find("menu"):find("text")
assert(dialogName)
uc_dialog:fromUtf8(sequenceInst.Name)
dialogName.uc_hardtext = uc_dialog
dialogName.text = sequenceInst.Name
-- initialize maximize/minimize
local maxElts = sequenceUI:find("maximize_elements")
@ -386,49 +381,47 @@ function r2.dialogs:updateElementEditor()
if instanceChat then
local uc_chat = ucstring()
local chat = ""
local index = r2.logicComponents:searchElementIndex(instanceChat)
if index~= nil then
uc_chat:fromUtf8(self.elementInitialName.." "..index.." : ")
chat = self.elementInitialName.." "..index.." : "
else
uc_chat:fromUtf8(self.elementInitialName.." : ")
chat = self.elementInitialName.." : "
end
chatName.uc_hardtext = uc_chat
chatName.text = uc_chat
-- after value
local time = instanceChat.Time
assert(time)
local minNb, secNb = self:calculMinSec(time)
minutesText.uc_hardtext = tostring(minNb)
secondsText.uc_hardtext = tostring(secNb)
minutesText.text = tostring(minNb)
secondsText.text = tostring(secNb)
-- who
local whoInst = r2:getInstanceFromId(tostring(instanceChat.Actions[0].Who))
local hideToWhoAndEmote = false
if whoInst then
uc_chat:fromUtf8(whoInst.Name)
chat = whoInst.Name
elseif instanceChat.Actions[0].WhoNoEntity=="_System" then
uc_chat = i18n.get("uiR2EdSystem")
chat = i18n.get("uiR2EdSystem")
hideToWhoAndEmote = true
elseif instanceChat.Actions[0].WhoNoEntity=="_DM" then
uc_chat = i18n.get("uiR2EdDonjonMaster")
chat = i18n.get("uiR2EdDonjonMaster")
hideToWhoAndEmote = true
else
uc_chat = ucstring("")
chat = ""
end
whoMenuText.uc_hardtext = uc_chat
whoMenuText.text = chat
-- says what
editBox:cancelFocusOnText()
local textID = instanceChat.Actions[0].Says
if textID ~= "" and r2:getInstanceFromId(textID) then
local uc_says_what = ucstring()
uc_says_what:fromUtf8(r2:getInstanceFromId(textID).Text)
editBox.uc_input_string = uc_says_what
editBox.input_string = r2:getInstanceFromId(textID).Text
else
editBox.uc_input_string = ""
editBox.input_string = ""
end
local breakAtEnd = 0
@ -449,37 +442,33 @@ function r2.dialogs:updateElementEditor()
-- to who
local toWhoInst = r2:getInstanceFromId(tostring(instanceChat.Actions[0].Facing))
if toWhoInst then
uc_chat = ucstring()
uc_chat:fromUtf8(toWhoInst.Name)
chat = toWhoInst.Name
else
uc_chat = i18n.get("uiR2EdNobody")
chat = i18n.get("uiR2EdNobody")
end
toWhoMenuText.uc_hardtext = uc_chat
toWhoMenuText.text = chat
-- emote
local emoteName = self.fromEmoteIdToName[instanceChat.Actions[0].Emote]
if emoteName then
uc_chat = ucstring()
uc_chat:fromUtf8(emoteName)
chat = emoteName
else
uc_chat = i18n.get("uiR2EdNoElt")
chat = i18n.get("uiR2EdNoElt")
end
emoteButtonText.uc_hardtext = uc_chat
emoteButtonText.text = chat
else
local uc_chat = ucstring()
uc_chat:fromUtf8(self.elementInitialName.." : ")
chatName.uc_hardtext = uc_chat
chatName.text = self.elementInitialName.." : "
minutesText.uc_hardtext = "0"
secondsText.uc_hardtext = "0"
minutesText.text = "0"
secondsText.text = "0"
whoMenuText.uc_hardtext = ""
whoMenuText.text = ""
editBox.uc_input_string = ""
editBox.input_string = ""
toWhoMenuText.uc_hardtext = ""
emoteButtonText.uc_hardtext = i18n.get("uiR2EdNoElt")
toWhoMenuText.text = ""
emoteButtonText.text = i18n.get("uiR2EdNoElt")
end
end
@ -577,14 +566,12 @@ function r2.dialogs:updateSequenceUI(sequenceInst)
repeatButton.pushed = (sequenceInst.Repeating == 0)
-- dialog editor title
local uc_title = ucstring()
uc_title:fromUtf8(i18n.get("uiR2EDChatSequenceEditor"):toUtf8() .. sequenceInst.Name)
ui.uc_title = uc_title
ui.title = i18n.get("uiR2EDChatSequenceEditor")..sequenceInst.Name
-- dialog name in menu box
local dialogName = ui:find("dialogMenu"):find("menu"):find("text")
assert(dialogName)
dialogName.uc_hardtext = sequenceInst.Name
dialogName.text = sequenceInst.Name
end
------ UP ELEMENT INST -------------------------------------------
@ -646,7 +633,7 @@ function r2.dialogs:updateElementUI(elementUI)
-- Add a white line that indicate that the dialog pause at end (ChatStep) in reduced view
chatText:addColoredTextChild(text, 220, 140, 100, 255)
if chatStep.BreakAtEnd and chatStep.BreakAtEnd == 1 then
chatText:addColoredTextChild("\n"..i18n.get("uiR2EDThenPause"):toUtf8(), 255, 255, 255, 255)
chatText:addColoredTextChild("\n"..i18n.get("uiR2EDThenPause"), 255, 255, 255, 255)
end
local sep = elementUI:find("sep")
@ -674,17 +661,17 @@ function r2.dialogs:initTimeMenu(timeFunction, isHours)
timeMenu:reset()
for i=0,9 do
timeMenu:addLine(ucstring(tostring(i)), "lua", timeFunction .. "(" .. tostring(i) .. ")", tostring(i))
timeMenu:addLine(tostring(i), "lua", timeFunction .. "(" .. tostring(i) .. ")", tostring(i))
end
if isHours then
timeMenu:addLine(ucstring(tostring(10)), "lua", timeFunction .. "(" .. tostring(10) .. ")", tostring(10))
timeMenu:addLine(tostring(10), "lua", timeFunction .. "(" .. tostring(10) .. ")", tostring(10))
else
local lineNb = 9
for i=10, 50, 10 do
local lineStr = tostring(i).."/"..tostring(i+9)
timeMenu:addLine(ucstring(lineStr), "", "", tostring(i))
timeMenu:addLine(lineStr, "", "", tostring(i))
lineNb = lineNb+1
timeMenu:addSubMenu(lineNb)
@ -692,7 +679,7 @@ function r2.dialogs:initTimeMenu(timeFunction, isHours)
for s=0,9 do
lineStr = tostring(i+s)
subMenu:addLine(ucstring(lineStr), "lua", timeFunction .. "(" .. tostring(i+s) .. ")", lineStr)
subMenu:addLine(lineStr, "lua", timeFunction .. "(" .. tostring(i+s) .. ")", lineStr)
end
timeMenu:setMaxVisibleLine(self.maxVisibleLine)
@ -768,13 +755,12 @@ function r2.dialogs:initWhoMenu(whoFunction, towho)
local npcTable = r2.Scenario:getAllInstancesByType("Npc")
if towho == true then
whoMenu:addLine(i18n.get("uiR2EdNobody"), "lua", whoFunction.."('" ..i18n.get("uiR2EdNobody"):toUtf8().. "')", "Nobody")
whoMenu:addLine(i18n.get("uiR2EdNobody"), "lua", whoFunction.."('" ..i18n.get("uiR2EdNobody").. "')", "Nobody")
else
whoMenu:addLine(i18n.get("uiR2EdSystem"), "lua", whoFunction.."('_System')", "System")
whoMenu:addLine(i18n.get("uiR2EdDonjonMaster"), "lua", whoFunction.."('_DM')", "DonjonMaster")
end
local uc_who = ucstring()
for key, npc in pairs(npcTable) do
local addLine = true
@ -789,8 +775,7 @@ function r2.dialogs:initWhoMenu(whoFunction, towho)
end
end
if addLine then
uc_who:fromUtf8(npc.Name)
whoMenu:addLine(uc_who, "lua", whoFunction.."('" ..npc.InstanceId.. "')", npc.InstanceId)
whoMenu:addLine(npc.Name, "lua", whoFunction.."('" ..npc.InstanceId.. "')", npc.InstanceId)
end
end
end
@ -808,7 +793,7 @@ function r2.dialogs:updateSaysWhat()
if sequenceUI then
local chatEditor = sequenceUI:find("edit_element")
if chatEditor then
local saysWhat = chatEditor:find("says"):find("edit_box_group").uc_input_string:toUtf8()
local saysWhat = chatEditor:find("says"):find("edit_box_group").input_string
self:setSaysWhat(saysWhat)
end
end
@ -830,7 +815,7 @@ function r2.dialogs:setWho(who)
r2.requestSetNode(chatStep.Actions[0].InstanceId, "WhoNoEntity", "")
if who == chatStep.Actions[0].Facing then
self:setToWho(i18n.get("uiR2EdNobody"):toUtf8())
self:setToWho(i18n.get("uiR2EdNobody"))
end
else
r2.requestSetNode(chatStep.Actions[0].InstanceId, "Who", r2.RefId(""))
@ -851,7 +836,7 @@ function r2.dialogs:setToWho(toWho)
local chatStep = self:currentEltInst()
assert(chatStep)
if toWho == i18n.get("uiR2EdNobody"):toUtf8() then toWho="" end
if toWho == i18n.get("uiR2EdNobody") then toWho="" end
r2.requestSetNode(chatStep.Actions[0].InstanceId, "Facing", r2.RefId(toWho))
end
@ -859,7 +844,7 @@ end
function r2.dialogs:setSaysWhat(whatText)
if whatText == nil then
whatText = getUICaller().uc_input_string:toUtf8()
whatText = getUICaller().input_string
end
r2.requestNewAction(i18n.get("uiR2EDChatSetSayWhatAction"))

@ -35,13 +35,13 @@ function r2:getPropertyTranslationId(prop)
end
-------------------------------------------------------------------------------------
-- get translation id for a property, as an ucstring
-- get translation id for a property, as an utf-8 string
function r2:getPropertyTranslation(prop)
local translationId = r2:getPropertyTranslationId(prop)
local translationId = r2:getPropertyTranslationId(prop)
if (i18n.hasTranslation(translationId)) then
return i18n.get(translationId)
else
return ucstring(translationId)
return translationId
end
end
@ -149,12 +149,6 @@ if r2 == nil then
r2 = {} -- for vianney's tests (is initialized by the caller otherwise)
end
------------------
-- MISC GLOBALS --
------------------
r2.ScratchUCStr = ucstring() -- scratch ucstring, useful to do call from utf8 without to create a new object
---------------------
-- EDITION GLOBALS --
---------------------

@ -19,7 +19,7 @@ eltTemplateParams = {
},
elementEditorTemplate = "template_edit_events",
elementInitialName=i18n.get("uiR2EdAction"):toUtf8(),
elementInitialName=i18n.get("uiR2EdAction"),
currentEltUIID = nil, -- initialisé quand l'editeur est ouvert ou fermé
@ -158,10 +158,10 @@ end
------------------ TRANSLATION IN MENU ------------------------
function r2.events:getTranslationMenu(eventCategory, eventType)
if self.logicTranslations[eventCategory][eventType] then
return ucstring(self.logicTranslations[eventCategory][eventType].menu)
return self.logicTranslations[eventCategory][eventType].menu
else
debugInfo(eventType .. " is not translated")
return ucstring(eventType)
return eventType
end
end
@ -305,7 +305,7 @@ function r2.events:updateSequenceUI()
local logicEntity = r2:getInstanceFromId(self.filteredLogicEntityId)
assert(logicEntity)
filterMenuText.uc_hardtext = logicEntity:getDisplayName()
filterMenuText.text = logicEntity:getDisplayName()
local currentSequ = self:currentSequUI()
assert(currentSequ)
@ -365,7 +365,7 @@ function r2.events:filterEvents(logicEntityId)
-- update filter text
local filterMenuText = ui:find("filterMenu"):find("menu"):find("text")
assert(filterMenuText)
filterMenuText.uc_hardtext = logicEntity:getDisplayName()
filterMenuText.text = logicEntity:getDisplayName()
self.filteredLogicEntityId = logicEntityId
@ -561,10 +561,8 @@ function r2.events:updateElementEditor()
eventType = eventType .. " '" .. instanceEvent.Event.ValueString .. "'"
end
local uc_when_text = ucstring()
uc_when_text:fromUtf8(eventType)
whenMenuText.uc_hardtext_single_line_format = uc_when_text
editorTitleText.uc_hardtext = whenMenuText.hardtext .. " ..."
whenMenuText.text_single_line_format = eventType
editorTitleText.text = whenMenuText.hardtext .. " ..."
-- actions
local actionsList = eventEditor:find("actions_list")
@ -619,9 +617,7 @@ function r2.events:updateElementEditor()
end
end
local uc_action_text = ucstring()
uc_action_text:fromUtf8(actionType)
actionMenuText.uc_hardtext_single_line_format = uc_action_text
actionMenuText.text_single_line_format = actionType
end
end
else
@ -666,9 +662,7 @@ function r2.events:updateElementEditor()
conditionType = conditionType .. " '" .. instance:getShortName() .."'"
end
local uc_condition_text = ucstring()
uc_condition_text:fromUtf8(conditionType)
conditionMenuText.uc_hardtext_single_line_format = uc_condition_text
conditionMenuText.text_single_line_format = conditionType
end
end
@ -858,9 +852,7 @@ function r2.events:updateValiditySymbol(elementUI, eventInst)
invalidEvent.active = (logicAct==nil)
validEvent.active = (logicAct~=nil and logicAct~=r2:getCurrentAct())
if validEvent.active then
local uc_other_act = ucstring()
uc_other_act:fromUtf8(i18n.get("uiR2EDEventNotInCurrentAct"):toUtf8() .. "'" .. logicAct.Name .. "'")
validEvent.tooltip = uc_other_act
validEvent.tooltip = i18n.get("uiR2EDEventNotInCurrentAct").."'"..logicAct.Name.."'"
end
end
@ -970,9 +962,7 @@ function r2.events:initEventMenu(categoryEvent)
if logicEntity then
firstLine = 2
local uc_name = ucstring()
uc_name:fromUtf8(logicEntity.Name)
logicEntityMenu:addLine(uc_name, "lua", "r2.events:setLogicEntity('".. logicEntity.InstanceId .."')", logicEntity.InstanceId)
logicEntityMenu:addLine(logicEntity.Name, "lua", "r2.events:setLogicEntity('".. logicEntity.InstanceId .."')", logicEntity.InstanceId)
logicEntityMenu:addSeparator()
logicEntityMenu:addSubMenu(0)

@ -309,8 +309,8 @@ r2.initBaseScenario = function()
end
act.Name = i18n.get("uiR2EDAct1"):toUtf8()
act.Title = i18n.get("uiR2EDAct1"):toUtf8() -- obsolete
act.Name = i18n.get("uiR2EDAct1")
act.Title = i18n.get("uiR2EDAct1") -- obsolete
local features = act.Features
local tmpDefault = r2.newComponent("DefaultFeature")
@ -347,7 +347,7 @@ end
-- local features = act.Features
-- local tmpDefault = r2.newComponent("DefaultFeature")
-- r2.ActUIDisplayer.LastSelfCreatedActInstanceId = act.InstanceId
-- act.Title = i18n.get("uiR2EDAct1"):toUtf8()
-- act.Title = i18n.get("uiR2EDAct1")
-- table.insert(features, tmpDefault)
-- table.insert(acts, act)
-- -- table.insert(scenario.Acts, act)
@ -364,14 +364,11 @@ end
function r2.onScheduleStartAct(errorId, actId, nbSeconds)
if (r2.Mode == "DM" or r2.Mode == "AnimationModeDm") then
if errorId == 0 then
local ucStringMsg = ucstring()
local str = "Act " .. actId
if nbSeconds ~= 0 then
str = str .. " will start in " .. nbSeconds .. " seconds"
end
ucStringMsg:fromUtf8(str)
displaySystemInfo(ucStringMsg, "BC")
displaySystemInfo(str, "BC")
elseif errorId == 1 then
messageBox("Act ".. actId .." can not be started because another act is already starting.")
elseif errorId == 2 then
@ -382,26 +379,20 @@ end
function r2.onDisconnected()
local str = "You have been disconnected by the server."
local ucStringMsg = ucstring()
messageBox(str)
ucStringMsg:fromUtf8(str)
displaySystemInfo(ucStringMsg, "BC")
messageBox(str)
displaySystemInfo(str, "BC")
end
function r2.onKicked(timeBeforeDisconnection, kicked)
if kicked then
local str = "You have been kicked. You must come back to mainland or leave this session otherwise you will be disconnected in "
.. tostring(timeBeforeDisconnection) .. " secondes."
local ucStringMsg = ucstring()
messageBox(str)
ucStringMsg:fromUtf8(str)
displaySystemInfo(ucStringMsg, "BC")
messageBox(str)
displaySystemInfo(str, "BC")
else
local str = "You have been unkicked."
local ucStringMsg = ucstring()
messageBox(str)
ucStringMsg:fromUtf8(str)
displaySystemInfo(ucStringMsg, "BC")
local str = "You have been unkicked."
messageBox(str)
displaySystemInfo(str, "BC")
end
end
@ -437,12 +428,8 @@ function r2.onScenarioHeaderUpdated(scenario)
end
function r2.onSystemMessageReceived(msgType, msgWho, msg)
local ucStringMsg = ucstring()
ucStringMsg:fromUtf8(msg)
if string.len(msg) > 2 and string.sub(msg, 1, 2) == "ui" then
ucStringMsg = i18n.get(msg)
msg = ucStringMsg:toString()
msg = i18n.get(msg)
end
if msgType == "BC" or msgType == "BC_ML" then
printMsgML(msg)
@ -1056,10 +1043,10 @@ r2.displayFeatureHelp = function(className)
uiInfo:invalidateCoords()
uiInfo:updateCoords()
uiInfo.title = title
uiInfo.Env.uc_title = title
uiInfo.Env.title = title
local uiText = getUI("ui:interface:feature_help:content:enclosing:help_text_enclosed:help_text")
assert(uiText)
uiText.uc_hardtext_format = ucstring(i18n.get(help))
uiText.text_format = i18n.get(help)
uiInfo:invalidateCoords()
uiInfo:updateCoords()
@ -1088,7 +1075,7 @@ function r2.setFeatureDisplayHelp()
--debugInfo("checked: " ..tostring(showAgain))
local ui = getUI("ui:interface:feature_help")
local name = ui.Env.uc_title
local name = ui.Env.title
local len = string.len(name) - 10 - 6
local className = string.sub(name, -10-len, 6+len) --removing uiR2Ed and _HelpTitle
--formName = formName .."Form"

@ -397,13 +397,13 @@ component.createComponent = function(x, y)
assert(comp.Position)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdAmbush")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdAmbush"))
comp.Position.x = x
comp.Position.y = y
comp.Position.z = r2:snapZToGround(x, y)
local zoneTrigger = r2.Features["ZoneTrigger"].Components.ZoneTrigger.createComponent(x + 3, y + 3)
zoneTrigger.Name = comp.Name.." "..i18n.get("uiR2EDZoneTrigger"):toUtf8()--r2:genInstanceName(i18n.get("uiR2EdZoneTrigger")):toUtf8()
zoneTrigger.Name = comp.Name.." "..i18n.get("uiR2EDZoneTrigger")--r2:genInstanceName(i18n.get("uiR2EdZoneTrigger"))
zoneTrigger.InheritPos = 0
zoneTrigger.Deletable = false
table.insert(comp.Components, zoneTrigger)
@ -439,26 +439,26 @@ function component:getLogicTranslations()
-- register trad
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )}
}
}

@ -186,51 +186,51 @@ function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Spawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Spawn" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Despawn" ):toUtf8()},
["Wander"] = { menu=i18n.get( "uiR2AA0BanditWander" ):toUtf8(),
text=i18n.get( "uiR2AA1BanditWander" ):toUtf8()},
["Sit Down"] = { menu=i18n.get( "uiR2AA0BanditSitDown" ):toUtf8(),
text=i18n.get( "uiR2AA1BanditSitDown" ):toUtf8()},
["Kill"] = { menu=i18n.get( "uiR2AA0BanditKill" ):toUtf8(),
text=i18n.get( "uiR2AA1BanditKill" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Spawn" ),
text=i18n.get( "uiR2AA1Spawn" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ),
text=i18n.get( "uiR2AA1Despawn" )},
["Wander"] = { menu=i18n.get( "uiR2AA0BanditWander" ),
text=i18n.get( "uiR2AA1BanditWander" )},
["Sit Down"] = { menu=i18n.get( "uiR2AA0BanditSitDown" ),
text=i18n.get( "uiR2AA1BanditSitDown" )},
["Kill"] = { menu=i18n.get( "uiR2AA0BanditKill" ),
text=i18n.get( "uiR2AA1BanditKill" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Spawn" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Despawn" ):toUtf8()},
["member death"] = { menu=i18n.get( "uiR2Event0MemberDeath" ):toUtf8(),
text=i18n.get( "uiR2Event1MemberDeath" ):toUtf8()},
["group death"] = { menu=i18n.get( "uiR2Event0GroupDeath" ):toUtf8(),
text=i18n.get( "uiR2Event1GroupDeath" ):toUtf8()},
["head to wander zone"] = { menu=i18n.get( "uiR2Event0BanditHeadWander" ):toUtf8(),
text=i18n.get( "uiR2Event1BanditHeadWander" ):toUtf8()},
["arrive at wander zone"] = { menu=i18n.get( "uiR2Event0BanditArriveWander" ):toUtf8(),
text=i18n.get( "uiR2Event1BanditArriveWander" ):toUtf8()},
["head to camp"] = { menu=i18n.get( "uiR2Event0BanditHeadCamp" ):toUtf8(),
text=i18n.get( "uiR2Event1BanditHeadCamp" ):toUtf8()},
["arrive at camp"] = { menu=i18n.get( "uiR2Event0BanditArriveCamp" ):toUtf8(),
text=i18n.get( "uiR2Event1BanditArriveCamp" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ),
text=i18n.get( "uiR2Event1Spawn" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ),
text=i18n.get( "uiR2Event1Despawn" )},
["member death"] = { menu=i18n.get( "uiR2Event0MemberDeath" ),
text=i18n.get( "uiR2Event1MemberDeath" )},
["group death"] = { menu=i18n.get( "uiR2Event0GroupDeath" ),
text=i18n.get( "uiR2Event1GroupDeath" )},
["head to wander zone"] = { menu=i18n.get( "uiR2Event0BanditHeadWander" ),
text=i18n.get( "uiR2Event1BanditHeadWander" )},
["arrive at wander zone"] = { menu=i18n.get( "uiR2Event0BanditArriveWander" ),
text=i18n.get( "uiR2Event1BanditArriveWander" )},
["head to camp"] = { menu=i18n.get( "uiR2Event0BanditHeadCamp" ),
text=i18n.get( "uiR2Event1BanditHeadCamp" )},
["arrive at camp"] = { menu=i18n.get( "uiR2Event0BanditArriveCamp" ),
text=i18n.get( "uiR2Event1BanditArriveCamp" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Spawned" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Despawned" ):toUtf8()},
["is dead"] = { menu=i18n.get( "uiR2Test0BanditDead" ):toUtf8(),
text=i18n.get( "uiR2Test1BanditDead" ):toUtf8()},
["is wandering"] = { menu=i18n.get( "uiR2Test0BanditPatrolZone" ):toUtf8(),
text=i18n.get( "uiR2Test1BanditPatrolZone" ):toUtf8()},
["is sitting"] = { menu=i18n.get( "uiR2Test0BanditAtCamp" ):toUtf8(),
text=i18n.get( "uiR2Test1BanditAtCamp" ):toUtf8()},
["is heading to wander zone"]= {menu=i18n.get( "uiR2Test0BanditHeadPatrolZone" ):toUtf8(),
text=i18n.get( "uiR2Test1BanditHeadPatrolZone" ):toUtf8()},
["is heading to camp"] = { menu=i18n.get( "uiR2Test0BanditHeadCamp" ):toUtf8(),
text=i18n.get( "uiR2Test1BanditHeadCamp" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ),
text=i18n.get( "uiR2Test1Spawned" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ),
text=i18n.get( "uiR2Test1Despawned" )},
["is dead"] = { menu=i18n.get( "uiR2Test0BanditDead" ),
text=i18n.get( "uiR2Test1BanditDead" )},
["is wandering"] = { menu=i18n.get( "uiR2Test0BanditPatrolZone" ),
text=i18n.get( "uiR2Test1BanditPatrolZone" )},
["is sitting"] = { menu=i18n.get( "uiR2Test0BanditAtCamp" ),
text=i18n.get( "uiR2Test1BanditAtCamp" )},
["is heading to wander zone"]= {menu=i18n.get( "uiR2Test0BanditHeadPatrolZone" ),
text=i18n.get( "uiR2Test1BanditHeadPatrolZone" )},
["is heading to camp"] = { menu=i18n.get( "uiR2Test0BanditHeadCamp" ),
text=i18n.get( "uiR2Test1BanditHeadCamp" )},
}
}
return logicTranslations
@ -360,7 +360,7 @@ component.createComponent = function(x, y, banditsCount, race, banditsLevel, Zon
--feature.BanditCount = feature.BanditCount + 1
--comp.Name = "BanditCampFeature[".. feature.BanditCount .."]"
comp.Name = r2:genInstanceName(i18n.get("uiR2EDNameBanditCampFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDNameBanditCampFeature"))
local fire = comp.Fire
@ -394,7 +394,7 @@ component.createComponent = function(x, y, banditsCount, race, banditsLevel, Zon
zone.Position.y = comp.Position.y
zone.Position.z = comp.Position.z
zone.InheritPos = 0 -- don't inherit position of parents
zone.Name = r2:genInstanceName(i18n.get("uiR2EDNameWanderRegion")):toUtf8()
zone.Name = r2:genInstanceName(i18n.get("uiR2EDNameWanderRegion"))
comp._Zone = zone.InstanceId
table.insert(comp.Components, zone)
comp._Seed = os.time()
@ -435,7 +435,7 @@ function updateBanditCampEnum()
local paletteElt = r2.getPaletteElement(elementName)
if paletteElt and paletteElt.RingAccess and r2.RingAccess.testAccess(paletteElt.RingAccess) then
formLevel:addText(ucstring(tostring(level)))
formLevel:addText(tostring(level))
ok = true
-- local levelEnum = currentForm:find(creature.."Level")
@ -569,7 +569,7 @@ component.createGhostComponents = function(comp, act)
table.insert(npcGroup.Components, npc)
end
npcGroup.Name = r2:genInstanceName(i18n.get("uiR2EDNameBanditCamp")):toUtf8()
npcGroup.Name = r2:genInstanceName(i18n.get("uiR2EDNameBanditCamp"))
bandits = npcGroup
bandits.Position.x = x
bandits.Position.y = y

@ -466,7 +466,7 @@ component.createComponent = function(x, y)
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdBossSpawner")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdBossSpawner"))
comp.Position.x = x
comp.Position.y = y
@ -542,7 +542,7 @@ component.create = function()
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdBossSpawner")
logicEntityMenu:addLine(ucstring(name), "lua", "", "BossSpawner")
logicEntityMenu:addLine(name, "lua", "", "BossSpawner")
end

@ -204,7 +204,7 @@ component.createComponent = function(x, y, value, tvalue)
assert(comp)
comp.Base = "palette.entities.botobjects.milestone"
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_CounterFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_CounterFeature"))
comp.Position.x = x
comp.Position.y = y
@ -256,32 +256,32 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EDRollout_CounterFeature")
logicEntityMenu:addLine(ucstring(name), "lua", "", "CounterFeature")
logicEntityMenu:addLine(name, "lua", "", "CounterFeature")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["Activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["Desactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["Increment"] = { menu=i18n.get( "uiR2AA0CounterIncrement" ):toUtf8(),
text=i18n.get( "uiR2AA1CounterIncrement" ):toUtf8()},
["Decrement"] = { menu=i18n.get( "uiR2AA0CounterDecrement" ):toUtf8(),
text=i18n.get( "uiR2AA1CounterDecrement" ):toUtf8()},
["Activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["Desactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["Increment"] = { menu=i18n.get( "uiR2AA0CounterIncrement" ),
text=i18n.get( "uiR2AA1CounterIncrement" )},
["Decrement"] = { menu=i18n.get( "uiR2AA0CounterDecrement" ),
text=i18n.get( "uiR2AA1CounterDecrement" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["desactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["desactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )}
}
}
return logicTranslations

@ -181,7 +181,7 @@ local registerFeature = function ()
getUI(class.Menu .. ":activities").active = not isBO and not isPlant
if not isBO and not isPlant then
getUI(class.Menu .. ":activities").uc_hardtext = i18n.get("uimR2EDNewActivity")
getUI(class.Menu .. ":activities").text = i18n.get("uimR2EDNewActivity")
end
end,
--------------------------------------------------------------------------------------------
@ -247,10 +247,8 @@ local registerFeature = function ()
local subMenu = menu:getSubMenu(ev)
local func = ""
for i=0, 9 do
local uc_name = ucstring()
uc_name:fromUtf8( tostring(i) )
func = "r2.events:setEventValue('','" .. categoryEvent .."','".. tostring(i).."')"
subMenu:addLine(uc_name, "lua", func, tostring(i))
subMenu:addLine(tostring(i), "lua", func, tostring(i))
end
elseif r2.events.eventTypeWithValue[eventType]~=nil then
@ -264,9 +262,7 @@ local registerFeature = function ()
func = "r2.events:setEventValue('".. sequence.InstanceId .."','" .. categoryEvent .."')"
end
local uc_name = ucstring()
uc_name:fromUtf8(sequence:getName())
subMenu:addLine(uc_name, "lua", func, sequence.InstanceId)
subMenu:addLine(sequence:getName(), "lua", func, sequence.InstanceId)
end
if this:getBehavior().Activities.Size==0 then
@ -285,9 +281,7 @@ local registerFeature = function ()
for a=0, sequence.Components.Size-1 do
local activity = sequence.Components[a]
local uc_name = ucstring()
uc_name:fromUtf8(activity:getShortName())
activitiesMenu:addLine(uc_name, "lua",
activitiesMenu:addLine(activity:getShortName(), "lua",
"r2.events:setEventValue('".. activity.InstanceId .."','" .. categoryEvent .."')", activity.InstanceId)
end
@ -449,9 +443,9 @@ local registerFeature = function ()
-- get select bar type
SelectBarType = function(this)
if not this:isBotObject() then
return i18n.get("uiR2EDScene"):toUtf8()
return i18n.get("uiR2EDScene")
else
return i18n.get("uiR2EDbotObjects"):toUtf8()
return i18n.get("uiR2EDbotObjects")
end
end,
@ -1121,7 +1115,7 @@ local registerFeature = function ()
---------------------------------------------------------------------------------------------------------
-- get select bar type
SelectBarType = function(this)
return i18n.get("uiR2EDbotObjects"):toUtf8()
return i18n.get("uiR2EDbotObjects")
end,
--------------------------------------------------------------------------------------------
-- from 'BaseClass'
@ -1172,7 +1166,7 @@ local registerFeature = function ()
---------------------------------------------------------------------------------------------------------
-- get select bar type
SelectBarType = function(this)
return i18n.get("uiR2EDbotObjects"):toUtf8()
return i18n.get("uiR2EDbotObjects")
end,
--------------------------------------------------------------------------------------------
-- from 'BaseClass'
@ -1461,7 +1455,7 @@ local registerFeature = function ()
function userComponentHolder:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdUserComponent")
logicEntityMenu:addLine(ucstring(name), "lua", "", "uiR2EdUserComponent")
logicEntityMenu:addLine(name, "lua", "", "uiR2EdUserComponent")
end
@ -1503,7 +1497,7 @@ local registerFeature = function ()
end
local component = r2.newComponent("UserComponentHolder")
component.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
component.Name = r2:genInstanceName(i18n.get("uiR2EdUserComponent")):toUtf8()
component.Name = r2:genInstanceName(i18n.get("uiR2EdUserComponent"))
component.Position.x = x
component.Position.y = y
@ -1522,7 +1516,7 @@ local registerFeature = function ()
function userComponentHolder:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdUserComponent")
logicEntityMenu:addLine(ucstring(name), "lua", "", "uiR2EdUserComponent")
logicEntityMenu:addLine(name, "lua", "", "uiR2EdUserComponent")
end
function userComponentHolder.onPickAddEntity(this)
@ -1576,7 +1570,7 @@ local registerFeature = function ()
end
local component = r2.newComponent("UserComponentHolder")
component.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
component.Name = r2:genInstanceName(i18n.get("uiR2EdUserComponent")):toUtf8()
component.Name = r2:genInstanceName(i18n.get("uiR2EdUserComponent"))
component.Position.x = x
component.Position.y = y
@ -1693,9 +1687,7 @@ local registerFeature = function ()
addLine = not (entity:isKindOf("NpcCreature") or entity:isBotObject() or entity:isPlant() or entity:isGrouped()) --TEMP
end --TEMP
if addLine then
local uc_name = ucstring()
uc_name:fromUtf8(entity.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
empty = false
end
end
@ -1711,64 +1703,64 @@ local registerFeature = function ()
local logicTranslations = {
["ApplicableActions"] = {
["Activate"] = {menu=i18n.get("uiR2EdActivates"):toUtf8(),
["Activate"] = {menu=i18n.get("uiR2EdActivates"),
text=r2:lowerTranslate("uiR2EdActivates")},
["Deactivate"] = {menu=i18n.get("uiR2EdDeactivates"):toUtf8(),
["Deactivate"] = {menu=i18n.get("uiR2EdDeactivates"),
text=r2:lowerTranslate("uiR2EdDeactivates")},
["Sit Down"] = {menu=i18n.get("uiR2EdSitDown"):toUtf8(),
["Sit Down"] = {menu=i18n.get("uiR2EdSitDown"),
text=r2:lowerTranslate("uiR2EdSitsDown")},
["Stand Up"] = {menu=i18n.get("uiR2EdStandUp"):toUtf8(),
["Stand Up"] = {menu=i18n.get("uiR2EdStandUp"),
text=r2:lowerTranslate("uiR2EdStandsUp")},
["Kill"] = {menu=i18n.get("uiR2EdKill"):toUtf8(),
["Kill"] = {menu=i18n.get("uiR2EdKill"),
text=r2:lowerTranslate("uiR2EdKills")},
["begin activity sequence"] = {menu=i18n.get("uiR2EdBeginActivitySequ"):toUtf8(),
["begin activity sequence"] = {menu=i18n.get("uiR2EdBeginActivitySequ"),
text=r2:lowerTranslate("uiR2EdSequenceStarts")},
["Fight with player"] = {menu=i18n.get("uiR2EdFightWithPlayer"):toUtf8(),
["Fight with player"] = {menu=i18n.get("uiR2EdFightWithPlayer"),
text=r2:lowerTranslate("uiR2EdFightWithPlayer")},
["Fight with Npcs"] = {menu=i18n.get("uiR2EdFightWithNpcs"):toUtf8(),
["Fight with Npcs"] = {menu=i18n.get("uiR2EdFightWithNpcs"),
text=r2:lowerTranslate("uiR2EdFightWithNpcs")},
["Dont fight with player"] = {menu=i18n.get("uiR2EdDontFightWithPlayer"):toUtf8(),
["Dont fight with player"] = {menu=i18n.get("uiR2EdDontFightWithPlayer"),
text=r2:lowerTranslate("uiR2EdDontFightWithPlayer")},
["Dont fight with Npcs"] = {menu=i18n.get("uiR2EdDontFightWithNpcs"):toUtf8(),
["Dont fight with Npcs"] = {menu=i18n.get("uiR2EdDontFightWithNpcs"),
text=r2:lowerTranslate("uiR2EdDontFightWithNpcs")},
["Run"] = {menu=i18n.get("uiR2EdRun"):toUtf8(),
["Run"] = {menu=i18n.get("uiR2EdRun"),
text=r2:lowerTranslate("uiR2EdRun")},
["Dont run"] = {menu=i18n.get("uiR2EdDontRun"):toUtf8(),
["Dont run"] = {menu=i18n.get("uiR2EdDontRun"),
text=r2:lowerTranslate("uiR2EdDontRun")},
},
["Events"] = {
["activation"] = {menu=i18n.get("uiR2EdActivation"):toUtf8(),
["activation"] = {menu=i18n.get("uiR2EdActivation"),
text=r2:lowerTranslate("uiR2EdActivation")},
["desactivation"] = {menu=i18n.get("uiR2EdDeactivation"):toUtf8(),
["desactivation"] = {menu=i18n.get("uiR2EdDeactivation"),
text=r2:lowerTranslate("uiR2EdDeactivation")},
["death"] = {menu=i18n.get("uiR2EdDeath"):toUtf8(),
["death"] = {menu=i18n.get("uiR2EdDeath"),
text=r2:lowerTranslate("uiR2EdDeath")},
["end of activity step"] = {menu=i18n.get("uiR2EdEndActivityStep"):toUtf8(),
["end of activity step"] = {menu=i18n.get("uiR2EdEndActivityStep"),
text=r2:lowerTranslate("uiR2EdEndActivityStep")},
["end of activity sequence"] = {menu=i18n.get("uiR2EdEndActivitySequ"):toUtf8(),
["end of activity sequence"] = {menu=i18n.get("uiR2EdEndActivitySequ"),
text=r2:lowerTranslate("uiR2EdEndActivitySequ")},
["begin of activity step"] = {menu=i18n.get("uiR2EdBeginActivityStep"):toUtf8(),
["begin of activity step"] = {menu=i18n.get("uiR2EdBeginActivityStep"),
text=r2:lowerTranslate("uiR2EdBeginActivityStep")},
["begin of activity sequence"] = {menu=i18n.get("uiR2EdBeginOfActivitySequ"):toUtf8(),
["begin of activity sequence"] = {menu=i18n.get("uiR2EdBeginOfActivitySequ"),
text=r2:lowerTranslate("uiR2EdBeginOfActivitySequ")},
["targeted by player"] = {menu=i18n.get("uiR2EdTargetedByplayer"):toUtf8(),
["targeted by player"] = {menu=i18n.get("uiR2EdTargetedByplayer"),
text=r2:lowerTranslate("uiR2EdTargetedByplayer")}
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Spawned" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Despawned" ):toUtf8()},
["is dead"] = { menu=i18n.get( "uiR2Test0Dead" ):toUtf8(),
text=i18n.get( "uiR2Test1Dead" ):toUtf8()},
["is alive"] = { menu=i18n.get( "uiR2Test0Alive" ):toUtf8(),
text=i18n.get( "uiR2Test1Alive" ):toUtf8()},
["is in activity sequence"] = { menu=i18n.get( "uiR2Test0Seq" ):toUtf8(),
text=i18n.get( "uiR2Test1Seq" ):toUtf8()},
["is in activity step"] = { menu=i18n.get( "uiR2Test0Step" ):toUtf8(),
text=i18n.get( "uiR2Test1Step" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ),
text=i18n.get( "uiR2Test1Spawned" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ),
text=i18n.get( "uiR2Test1Despawned" )},
["is dead"] = { menu=i18n.get( "uiR2Test0Dead" ),
text=i18n.get( "uiR2Test1Dead" )},
["is alive"] = { menu=i18n.get( "uiR2Test0Alive" ),
text=i18n.get( "uiR2Test1Alive" )},
["is in activity sequence"] = { menu=i18n.get( "uiR2Test0Seq" ),
text=i18n.get( "uiR2Test1Seq" )},
["is in activity step"] = { menu=i18n.get( "uiR2Test0Step" ),
text=i18n.get( "uiR2Test1Step" )},
}
}
return logicTranslations
@ -1924,9 +1916,7 @@ local registerFeature = function ()
addLine = not (entity:isKindOf("NpcPlant") or entity:isGrouped())
end
if addLine then
local uc_name = ucstring()
uc_name:fromUtf8(entity.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
empty = false
end
end
@ -1957,32 +1947,32 @@ local registerFeature = function ()
function componentNpcPlant:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["Activate"] = {menu=i18n.get("uiR2EdActivates"):toUtf8(),
["Activate"] = {menu=i18n.get("uiR2EdActivates"),
text=r2:lowerTranslate("uiR2EdActivates")},
["Deactivate"] = {menu=i18n.get("uiR2EdDeactivates"):toUtf8(),
["Deactivate"] = {menu=i18n.get("uiR2EdDeactivates"),
text=r2:lowerTranslate("uiR2EdDeactivates")},
["Kill"] = {menu=i18n.get("uiR2EdKill"):toUtf8(),
["Kill"] = {menu=i18n.get("uiR2EdKill"),
text=r2:lowerTranslate("uiR2EdKills")},
},
["Events"] = {
["activation"] = {menu=i18n.get("uiR2EdActivation"):toUtf8(),
["activation"] = {menu=i18n.get("uiR2EdActivation"),
text=r2:lowerTranslate("uiR2EdActivation")},
["desactivation"] = {menu=i18n.get("uiR2EdDeactivation"):toUtf8(),
["desactivation"] = {menu=i18n.get("uiR2EdDeactivation"),
text=r2:lowerTranslate("uiR2EdDeactivation")},
["death"] = {menu=i18n.get("uiR2EdDeath"):toUtf8(),
["death"] = {menu=i18n.get("uiR2EdDeath"),
text=r2:lowerTranslate("uiR2EdDeath")},
["targeted by player"] = {menu=i18n.get("uiR2EdTargetedByplayer"):toUtf8(),
["targeted by player"] = {menu=i18n.get("uiR2EdTargetedByplayer"),
text=r2:lowerTranslate("uiR2EdTargetedByplayer")}
},
["Conditions"] = {
["is active"] = {menu=i18n.get("uiR2EdIsActive"):toUtf8(),
["is active"] = {menu=i18n.get("uiR2EdIsActive"),
text=r2:lowerTranslate("uiR2EdIsActive")},
["is dead"] = {menu=i18n.get("uiR2EdIsDead"):toUtf8(),
["is dead"] = {menu=i18n.get("uiR2EdIsDead"),
text=r2:lowerTranslate("uiR2EdIsDead")},
["is alive"] = {menu=i18n.get("uiR2EdIsAlive"):toUtf8(),
["is alive"] = {menu=i18n.get("uiR2EdIsAlive"),
text=r2:lowerTranslate("uiR2EdIsAlive")},
["is inactive"] = {menu=i18n.get("uiR2EdIsInactive"):toUtf8(),
["is inactive"] = {menu=i18n.get("uiR2EdIsInactive"),
text=r2:lowerTranslate("uiR2EdIsInactive")},
}
}
@ -2076,8 +2066,8 @@ function activeLogicEntityPropertySheetDisplayerTable:onAttrModified(instance, a
local dialogsUI = getUI(r2.dialogs.uiId)
assert(dialogsUI)
activitiesUI.uc_title = i18n.get("uiR2EDActivitySequenceEditor"):toUtf8() .. instance[attributeName]
dialogsUI.uc_title = i18n.get("uiR2EDChatSequenceEditor"):toUtf8() .. instance[attributeName]
activitiesUI.title = i18n.get("uiR2EDActivitySequenceEditor") .. instance[attributeName]
dialogsUI.title = i18n.get("uiR2EDChatSequenceEditor") .. instance[attributeName]
end
end

@ -533,14 +533,14 @@ component.createComponent = function(x, y)
local comp = r2.newComponent("DeliveryTask")
assert(comp)
local contextualText = i18n.get("uiR2EdDeliveryTask_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdDeliveryTask_MissionText"):toUtf8()
local missionSucceedText = i18n.get("uiR2EdDeliveryTask_MissionSucceededText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdDeliveryTask_WaitValidationText"):toUtf8()
local broadcastText = i18n.get("uiR2EdDeliveryTask_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdDeliveryTask_ContextualText")
local missionText = i18n.get("uiR2EdDeliveryTask_MissionText")
local missionSucceedText = i18n.get("uiR2EdDeliveryTask_MissionSucceededText")
local waitValidationText = i18n.get("uiR2EdDeliveryTask_WaitValidationText")
local broadcastText = i18n.get("uiR2EdDeliveryTask_BroadcastText")
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_request_item")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDDeliveryTask")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDDeliveryTask"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -581,39 +581,39 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdDeliveryTask")
logicEntityMenu:addLine(ucstring(name), "lua", "", "DeliveryTask")
logicEntityMenu:addLine(name, "lua", "", "DeliveryTask")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()}
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )}
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
-- ["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
-- text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["delivered"] = { menu=i18n.get( "uiR2Event0Delivered" ):toUtf8(),
text=i18n.get( "uiR2Event1Delivered" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
-- ["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
-- text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["delivered"] = { menu=i18n.get( "uiR2Event0Delivered" ),
text=i18n.get( "uiR2Event1Delivered" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}

@ -363,7 +363,7 @@ function component.createComponent(x, y)
assert(comp)
comp.Base = "palette.entities.botobjects.chest_wisdom_std_sel"
comp.Name = r2:genInstanceName(i18n.get("uiR2EdEasterEgg")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdEasterEgg"))
comp.Position.x = x
comp.Position.y = y
@ -459,25 +459,25 @@ function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Spawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Spawn" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Despawn" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Spawn" ),
text=i18n.get( "uiR2AA1Spawn" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ),
text=i18n.get( "uiR2AA1Despawn" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Spawn" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Despawn" ):toUtf8()},
["opened"] = { menu=i18n.get( "uiR2Event0ChestOpened" ):toUtf8(),
text=i18n.get( "uiR2Event1ChestOpened" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ),
text=i18n.get( "uiR2Event1Spawn" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ),
text=i18n.get( "uiR2Event1Despawn" )},
["opened"] = { menu=i18n.get( "uiR2Event0ChestOpened" ),
text=i18n.get( "uiR2Event1ChestOpened" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Spawned" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Despawned" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ),
text=i18n.get( "uiR2Test1Spawned" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ),
text=i18n.get( "uiR2Test1Despawned" )}
}
}
return logicTranslations

@ -172,7 +172,7 @@ component.createComponent = function(x, y)
assert(comp)
comp.Base = "palette.entities.botobjects.milestone"
comp.Name = r2:genInstanceName(i18n.get("uiR2EdEmptyFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdEmptyFeature"))
comp.Position.x = x
comp.Position.y = y
@ -252,7 +252,7 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdEmptyFeature")
logicEntityMenu:addLine(ucstring(name), "lua", "", "EmptyFeature")
logicEntityMenu:addLine(name, "lua", "", "EmptyFeature")
end
function component:getLogicTranslations()

@ -60,7 +60,7 @@ local function reinit(form, creature)
r2.RingAccess.testAccess(paletteElt.RingAccess) then
if paletteElt.Ecosystem == "Desert" and paletteElt.Level >= 1 and paletteElt.Level <= 50 then
creatureEnum:addText(ucstring(i18n.get(v.Translation)))
creatureEnum:addText(i18n.get(v.Translation))
end
end
end
@ -87,7 +87,7 @@ local function getBase(creature, form)
local k, v = next(creaturePalette, nil)
while k do
local name = i18n.get(v.Translation):toUtf8()
local name = i18n.get(v.Translation)
if name == race then
return v.Id, name
end
@ -138,7 +138,7 @@ end
if paletteElt and paletteElt.RingAccess and
r2.RingAccess.testAccess(paletteElt.RingAccess) then
if paletteElt.Ecosystem == currentEco and paletteElt.Level >= levelMin and paletteElt.Level <= levelMax then
creatureEnum:addText(ucstring(i18n.get(v.Translation)))
creatureEnum:addText(i18n.get(v.Translation))
end
end
end
@ -459,7 +459,7 @@ component.createGhostComponents= function(this, act)
if act then
comp.User._Herd = herd.InstanceId
--herd.Name = r2:genInstanceName(i18n.get("uiR2EdFaunaFeature")):toUtf8()
--herd.Name = r2:genInstanceName(i18n.get("uiR2EdFaunaFeature"))
herd.InheritPos = 0
herd.Position.x = comp.Position.x
herd.Position.y = comp.Position.y
@ -478,7 +478,7 @@ component.createComponent = function(x, y, nbcritters, raceBase, raceName,
--comp.Base = "palette.entities.botobjects.user_event"
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdCreatureComponent")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdCreatureComponent"))
comp.Position.x = x
comp.Position.y = y
@ -688,7 +688,7 @@ component.createComponent = function(x, y, carnCount, carnivoreBase, carnivoresN
--TODO: replace this milestone base by some default feature base
comp.Base = "palette.entities.botobjects.user_event"
comp.Name = r2:genInstanceName(i18n.get("uiR2EdFaunaFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdFaunaFeature"))
comp.Position.x = x
comp.Position.y = y
@ -715,7 +715,7 @@ component.createComponent = function(x, y, carnCount, carnivoreBase, carnivoresN
zoneSleep1.Position.y = comp.Position.y + FaunaRegionOffsets[1].y
zoneSleep1.Position.z = comp.Position.z
zoneSleep1.InheritPos = 0
zoneSleep1.Name = r2:genInstanceName(i18n.get("uiR2EDNameSleepRegion")):toUtf8()
zoneSleep1.Name = r2:genInstanceName(i18n.get("uiR2EDNameSleepRegion"))
table.insert(comp.Components, zoneSleep1)
-- Carnivore sleep zone
@ -726,7 +726,7 @@ component.createComponent = function(x, y, carnCount, carnivoreBase, carnivoresN
zoneSleep2.Position.y = comp.Position.y + FaunaRegionOffsets[2].y
zoneSleep2.Position.z = comp.Position.z
zoneSleep2.InheritPos = 0
zoneSleep2.Name = r2:genInstanceName(i18n.get("uiR2EDNameSleepRegion")):toUtf8()
zoneSleep2.Name = r2:genInstanceName(i18n.get("uiR2EDNameSleepRegion"))
table.insert(comp.Components, zoneSleep2)
--Herbivore sleep zone
@ -737,13 +737,13 @@ component.createComponent = function(x, y, carnCount, carnivoreBase, carnivoresN
zoneFood.Position.y = comp.Position.y + FaunaRegionOffsets[3].y
zoneFood.Position.z = comp.Position.z
zoneFood.InheritPos = 0
zoneFood.Name = r2:genInstanceName(i18n.get("uiR2EDNameFoodRegion")):toUtf8()
zoneFood.Name = r2:genInstanceName(i18n.get("uiR2EDNameFoodRegion"))
table.insert(comp.Components, zoneFood)
-- Herd of herbivores
local herbivores = feature.Components.Creature.createComponent(zoneSleep1.Position.x, zoneSleep1.Position.y, herbCount, herbivoreBase,
herbivoresName, zoneSleep1.InstanceId, zoneFood.InstanceId)
herbivores.Name = i18n.get("uiR2EdHerbivores"):toUtf8()
herbivores.Name = i18n.get("uiR2EdHerbivores")
--herbivores.Position.x = zoneSleep1.Position.x--comp.Position.x + 10
--herbivores.Position.y = zoneSleep1.Position.y--comp.Position.y + 10
herbivores.InheritPos = 0
@ -755,7 +755,7 @@ component.createComponent = function(x, y, carnCount, carnivoreBase, carnivoresN
-- Pack of carnivores
local carnivores = feature.Components.Creature.createComponent(zoneSleep2.Position.x, zoneSleep2.Position.y, carnCount, carnivoreBase,
carnivoresName, zoneSleep2.InstanceId, zoneSleep1.InstanceId)
carnivores.Name = i18n.get("uiR2EdCarnivores"):toUtf8()
carnivores.Name = i18n.get("uiR2EdCarnivores")
carnivores.InheritPos = 0
carnivores.ManagerId = comp.InstanceId
table.insert(comp.Components, carnivores)
@ -833,7 +833,7 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdFaunaFeature")
logicEntityMenu:addLine(ucstring(name), "lua", "", "FaunaFeature")
logicEntityMenu:addLine(name, "lua", "", "FaunaFeature")
end
r2.Features["FaunaFeature"] = feature

@ -375,10 +375,10 @@ component.createComponent = function(x, y)
local comp = r2.newComponent("GetItemFromSceneryObject")
assert(comp)
local contextualText = i18n.get("uiR2EdGetItemFromSceneryObject_ContextualText"):toUtf8()
local contextualText = i18n.get("uiR2EdGetItemFromSceneryObject_ContextualText")
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_request_item")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDGetItemFromSceneryObject")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDGetItemFromSceneryObject"))
comp.ItemNumber = 0
comp.ContextualText = contextualText
@ -444,35 +444,35 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdGetItemFromSceneryObject")
logicEntityMenu:addLine(ucstring(name), "lua", "", "GetItemFromSceneryObject")
logicEntityMenu:addLine(name, "lua", "", "GetItemFromSceneryObject")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["has triggered"] = { menu=i18n.get( "uiR2Test0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Test1Trigger" ):toUtf8()},
["has not triggered"] = { menu=i18n.get( "uiR2Test0NotTrigger" ):toUtf8(),
text=i18n.get( "uiR2Test1NotTrigger" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["has triggered"] = { menu=i18n.get( "uiR2Test0Trigger" ),
text=i18n.get( "uiR2Test1Trigger" )},
["has not triggered"] = { menu=i18n.get( "uiR2Test0NotTrigger" ),
text=i18n.get( "uiR2Test1NotTrigger" )},
}
}
return logicTranslations

@ -452,13 +452,13 @@ component.createComponent = function(x, y)
local comp = r2.newComponent("GetItemFromSceneryObjectTaskStep")
assert(comp)
local contextualText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_MissionText"):toUtf8()
local notValidatedText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_NotValidatedText"):toUtf8()
local broadcastText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_ContextualText")
local missionText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_MissionText")
local notValidatedText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_NotValidatedText")
local broadcastText = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep_BroadcastText")
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_request_item")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDGetItemFromSceneryObjectTaskStep")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDGetItemFromSceneryObjectTaskStep"))
comp.ItemNumber = 0
comp.ContextualText = contextualText
@ -500,35 +500,35 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdGetItemFromSceneryObjectTaskStep")
logicEntityMenu:addLine(ucstring(name), "lua", "", "GetItemFromSceneryObjectTaskStep")
logicEntityMenu:addLine(name, "lua", "", "GetItemFromSceneryObjectTaskStep")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["success"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["success"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["in progress"] = { menu=i18n.get( "uiR2Test0InProgress" ):toUtf8(),
text=i18n.get( "uiR2Test1InProgress" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
["in progress"] = { menu=i18n.get( "uiR2Test0InProgress" ),
text=i18n.get( "uiR2Test1InProgress" )},
}
}
return logicTranslations

@ -396,13 +396,13 @@ component.createComponent = function(x, y)
local comp = r2.newComponent("GiveItem")
assert(comp)
local contextualText = i18n.get("uiR2EdGiveItem_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdGiveItem_MissionText"):toUtf8()
local missionSucceedText = i18n.get("uiR2EdGiveItem_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdGiveItem_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdGiveItem_ContextualText")
local missionText = i18n.get("uiR2EdGiveItem_MissionText")
local missionSucceedText = i18n.get("uiR2EdGiveItem_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdGiveItem_BroadcastText")
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_request_item")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDGiveItem")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDGiveItem"))
comp.ItemNumber = 0
@ -471,36 +471,36 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdGiveItem")
logicEntityMenu:addLine(ucstring(name), "lua", "", "GiveItem")
logicEntityMenu:addLine(name, "lua", "", "GiveItem")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()}
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )}
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}

@ -198,7 +198,7 @@ component.createComponent = function(x, y)
assert(comp)
assert(comp.Position)
comp.Name = r2:genInstanceName(i18n.get("uiR2EdHiddenChest")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdHiddenChest"))
comp.Base = "palette.entities.botobjects.chest_wisdom_std_sel"
comp.Position.x = x
comp.Position.y = y
@ -209,7 +209,7 @@ component.createComponent = function(x, y)
comp.ItemNumber = 0
local zoneTrigger = r2.Features["ZoneTrigger"].Components.ZoneTrigger.createComponent(x + 3, y + 3)
zoneTrigger.Name = comp.Name.." "..i18n.get("uiR2EdZoneTrigger"):toUtf8()--r2:genInstanceName(i18n.get("uiR2EdZoneTrigger")):toUtf8()
zoneTrigger.Name = comp.Name.." "..i18n.get("uiR2EdZoneTrigger")--r2:genInstanceName(i18n.get("uiR2EdZoneTrigger"))
zoneTrigger.InheritPos = 0
zoneTrigger.Deletable = false
table.insert(comp.Components, zoneTrigger)
@ -243,9 +243,7 @@ component.initLogicEntitiesInstancesMenu = function(this, subMenu, calledFunctio
local entitiesTable = r2.Scenario:getAllInstancesByType(this.Name)
for key, entity in pairs(entitiesTable) do
local uc_name = ucstring()
uc_name:fromUtf8(entity.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
end
if table.getn(entitiesTable)==0 then
@ -259,26 +257,26 @@ function component:getLogicTranslations()
-- register trad
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )}
}
}

@ -581,18 +581,18 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdHuntTask_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdHuntTask_MissionText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdHuntTask_WaitValidationText"):toUtf8()
local missionSucceededText = i18n.get("uiR2EdHuntTask_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdHuntTask_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdHuntTask_ContextualText")
local missionText = i18n.get("uiR2EdHuntTask_MissionText")
local waitValidationText = i18n.get("uiR2EdHuntTask_WaitValidationText")
local missionSucceededText = i18n.get("uiR2EdHuntTask_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdHuntTask_BroadcastText")
local comp = r2.newComponent("HuntTask")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdHuntTask")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdHuntTask"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -660,40 +660,40 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdHuntTask")
logicEntityMenu:addLine(ucstring(name), "lua", "", "HuntTask")
logicEntityMenu:addLine(name, "lua", "", "HuntTask")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["succeed"] = { menu=i18n.get( "uiR2AA0SucceedTask" ):toUtf8(),
text=i18n.get( "uiR2AA1SucceedTask" ):toUtf8()},
["succeedStep"] = { menu=i18n.get( "uiR2AA0SucceedStep" ):toUtf8(),
text=i18n.get( "uiR2AA1SucceedStep" ):toUtf8()}
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["succeed"] = { menu=i18n.get( "uiR2AA0SucceedTask" ),
text=i18n.get( "uiR2AA1SucceedTask" )},
["succeedStep"] = { menu=i18n.get( "uiR2AA0SucceedStep" ),
text=i18n.get( "uiR2AA1SucceedStep" )}
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -357,17 +357,17 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdKillNpc_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdKillNpc_MissionText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdKillNpc_WaitValidationText"):toUtf8()
local missionSucceededText = i18n.get("uiR2EdKillNpc_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdKillNpc_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdKillNpc_ContextualText")
local missionText = i18n.get("uiR2EdKillNpc_MissionText")
local waitValidationText = i18n.get("uiR2EdKillNpc_WaitValidationText")
local missionSucceededText = i18n.get("uiR2EdKillNpc_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdKillNpc_BroadcastText")
local comp = r2.newComponent("KillNpc")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdKillNpc")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdKillNpc"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -435,36 +435,36 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdKillNpc")
logicEntityMenu:addLine(ucstring(name), "lua", "", "KillNpc")
logicEntityMenu:addLine(name, "lua", "", "KillNpc")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()}
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )}
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is completed"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is completed"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -405,7 +405,7 @@ component.createComponent = function(x, y, tvalue)
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_LootSpawner")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_LootSpawner"))
comp.Position.x = x
comp.Position.y = y
@ -485,7 +485,7 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EDRollout_RewardChest")
logicEntityMenu:addLine(ucstring(name), "lua", "", "RewardChest")
logicEntityMenu:addLine(name, "lua", "", "RewardChest")
end

@ -377,7 +377,7 @@ component.createComponent = function(x, y)
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdManHunt")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdManHunt"))
comp.Position.x = x
comp.Position.y = y
@ -427,7 +427,7 @@ component.create = function()
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdManHunt")
logicEntityMenu:addLine(ucstring(name), "lua", "", "ManHunt")
logicEntityMenu:addLine(name, "lua", "", "ManHunt")
end

@ -96,7 +96,7 @@ local registerFeature = function ()
---------------------------------------------------------------------------------------------------------
-- get select bar type
SelectBarType = function(this)
return i18n.get("uiR2EDScene"):toUtf8()
return i18n.get("uiR2EDScene")
end,
updateVersion = function(this, scenarioValue, currentValue )
@ -246,10 +246,8 @@ local registerFeature = function ()
local baseName = r2.PaletteIdToTranslation[this.Components[k-1].Base]
if counterNames[baseName]==nil then
local uc_name = ucstring()
uc_name:fromUtf8(baseName)
local name = r2:genInstanceName(uc_name):toUtf8()
counterName = string.gsub(name, tostring(uc_name), "")
local name = r2:genInstanceName(baseName)
counterName = string.gsub(name, tostring(baseName), "")
counterNames[baseName] = tonumber(counterName)
else
counterNames[baseName] = counterNames[baseName]+1
@ -431,66 +429,66 @@ local registerFeature = function ()
local logicTranslations = {
["ApplicableActions"] = {
["Activate"] = { menu=i18n.get( "uiR2AA0Spawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Spawn" ):toUtf8()},
["Deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Despawn" ):toUtf8()},
["Sit Down"] = { menu=i18n.get( "uiR2AA0NpcSit" ):toUtf8(),
text=i18n.get( "uiR2AA1NpcSit" ):toUtf8(),
["Activate"] = { menu=i18n.get( "uiR2AA0Spawn" ),
text=i18n.get( "uiR2AA1Spawn" )},
["Deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ),
text=i18n.get( "uiR2AA1Despawn" )},
["Sit Down"] = { menu=i18n.get( "uiR2AA0NpcSit" ),
text=i18n.get( "uiR2AA1NpcSit" ),
groupIndependant=true},
["Stand Up"] = { menu=i18n.get( "uiR2AA0NpcStand" ):toUtf8(),
text=i18n.get( "uiR2AA1NpcStand" ):toUtf8(),
["Stand Up"] = { menu=i18n.get( "uiR2AA0NpcStand" ),
text=i18n.get( "uiR2AA1NpcStand" ),
groupIndependant=true},
["Kill"] = { menu=i18n.get( "uiR2AA0Kill" ):toUtf8(),
text=i18n.get( "uiR2AA1Kill" ):toUtf8()},
["begin activity sequence"] = { menu=i18n.get( "uiR2AA0BeginSeq" ):toUtf8(),
text=i18n.get( "uiR2AA1BeginSeq" ):toUtf8()},
["Fight with player"] = { menu=i18n.get( "uiR2AA0FlagFightPlayersOn" ):toUtf8(),
text=i18n.get( "uiR2AA1FlagFightPlayersOn" ):toUtf8()},
["Dont fight with player"] = { menu=i18n.get( "uiR2AA0FlagFightPlayersOff" ):toUtf8(),
text=i18n.get( "uiR2AA1FlagFightPlayersOff" ):toUtf8()},
["Fight with Npcs"] = { menu=i18n.get( "uiR2AA0FlagFightNpcsOn" ):toUtf8(),
text=i18n.get( "uiR2AA1FlagFightNpcsOn" ):toUtf8()},
["Dont fight with Npcs"] = { menu=i18n.get( "uiR2AA0FlagFightNpcsOff" ):toUtf8(),
text=i18n.get( "uiR2AA1FlagFightNpcsOff" ):toUtf8()},
["Run"] = { menu=i18n.get( "uiR2AA0FlagRunOn" ):toUtf8(),
text=i18n.get( "uiR2AA1FlagRunOn" ):toUtf8()},
["Dont run"] = { menu=i18n.get( "uiR2AA0FlagRunOff" ):toUtf8(),
text=i18n.get( "uiR2AA1FlagRunOff" ):toUtf8()},
["Kill"] = { menu=i18n.get( "uiR2AA0Kill" ),
text=i18n.get( "uiR2AA1Kill" )},
["begin activity sequence"] = { menu=i18n.get( "uiR2AA0BeginSeq" ),
text=i18n.get( "uiR2AA1BeginSeq" )},
["Fight with player"] = { menu=i18n.get( "uiR2AA0FlagFightPlayersOn" ),
text=i18n.get( "uiR2AA1FlagFightPlayersOn" )},
["Dont fight with player"] = { menu=i18n.get( "uiR2AA0FlagFightPlayersOff" ),
text=i18n.get( "uiR2AA1FlagFightPlayersOff" )},
["Fight with Npcs"] = { menu=i18n.get( "uiR2AA0FlagFightNpcsOn" ),
text=i18n.get( "uiR2AA1FlagFightNpcsOn" )},
["Dont fight with Npcs"] = { menu=i18n.get( "uiR2AA0FlagFightNpcsOff" ),
text=i18n.get( "uiR2AA1FlagFightNpcsOff" )},
["Run"] = { menu=i18n.get( "uiR2AA0FlagRunOn" ),
text=i18n.get( "uiR2AA1FlagRunOn" )},
["Dont run"] = { menu=i18n.get( "uiR2AA0FlagRunOff" ),
text=i18n.get( "uiR2AA1FlagRunOff" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Spawn" ):toUtf8()},
["desactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Despawn" ):toUtf8()},
["member death"] = { menu=i18n.get( "uiR2Event0MemberDeath" ):toUtf8(),
text=i18n.get( "uiR2Event1MemberDeath" ):toUtf8()},
["group death"] = { menu=i18n.get( "uiR2Event0GroupDeath" ):toUtf8(),
text=i18n.get( "uiR2Event1GroupDeath" ):toUtf8()},
["end of activity step"] = { menu=i18n.get( "uiR2Event0EndActivityStep" ):toUtf8(),
text=i18n.get( "uiR2Event1EndActivityStep" ):toUtf8()},
["end of activity sequence"] = { menu=i18n.get( "uiR2Event0EndActivitySeq" ):toUtf8(),
text=i18n.get( "uiR2Event1EndActivitySeq" ):toUtf8()},
["begin of activity step"] = { menu=i18n.get( "uiR2Event0BeginActivityStep" ):toUtf8(),
text=i18n.get( "uiR2Event1BeginActivityStep" ):toUtf8()},
["begin of activity sequence"] = { menu=i18n.get( "uiR2Event0BeginOfActivitySeq" ):toUtf8(),
text=i18n.get( "uiR2Event1BeginOfActivitySeq" ):toUtf8()},
["targeted by player"] = { menu=i18n.get( "uiR2Event0TargetedByPlayer" ):toUtf8(),
text=i18n.get( "uiR2Event1TargetedByPlayer" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ),
text=i18n.get( "uiR2Event1Spawn" )},
["desactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ),
text=i18n.get( "uiR2Event1Despawn" )},
["member death"] = { menu=i18n.get( "uiR2Event0MemberDeath" ),
text=i18n.get( "uiR2Event1MemberDeath" )},
["group death"] = { menu=i18n.get( "uiR2Event0GroupDeath" ),
text=i18n.get( "uiR2Event1GroupDeath" )},
["end of activity step"] = { menu=i18n.get( "uiR2Event0EndActivityStep" ),
text=i18n.get( "uiR2Event1EndActivityStep" )},
["end of activity sequence"] = { menu=i18n.get( "uiR2Event0EndActivitySeq" ),
text=i18n.get( "uiR2Event1EndActivitySeq" )},
["begin of activity step"] = { menu=i18n.get( "uiR2Event0BeginActivityStep" ),
text=i18n.get( "uiR2Event1BeginActivityStep" )},
["begin of activity sequence"] = { menu=i18n.get( "uiR2Event0BeginOfActivitySeq" ),
text=i18n.get( "uiR2Event1BeginOfActivitySeq" )},
["targeted by player"] = { menu=i18n.get( "uiR2Event0TargetedByPlayer" ),
text=i18n.get( "uiR2Event1TargetedByPlayer" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Spawned" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Despawned" ):toUtf8()},
["is dead"] = { menu=i18n.get( "uiR2Test0Dead" ):toUtf8(),
text=i18n.get( "uiR2Test1Dead" ):toUtf8()},
["is alive"] = { menu=i18n.get( "uiR2Test0Alive" ):toUtf8(),
text=i18n.get( "uiR2Test1Alive" ):toUtf8()},
["is in activity sequence"] = { menu=i18n.get( "uiR2Test0Seq" ):toUtf8(),
text=i18n.get( "uiR2Test1Seq" ):toUtf8()},
["is in activity step"] = { menu=i18n.get( "uiR2Test0Step" ):toUtf8(),
text=i18n.get( "uiR2Test1Step" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ),
text=i18n.get( "uiR2Test1Spawned" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ),
text=i18n.get( "uiR2Test1Despawned" )},
["is dead"] = { menu=i18n.get( "uiR2Test0Dead" ),
text=i18n.get( "uiR2Test1Dead" )},
["is alive"] = { menu=i18n.get( "uiR2Test0Alive" ),
text=i18n.get( "uiR2Test1Alive" )},
["is in activity sequence"] = { menu=i18n.get( "uiR2Test0Seq" ),
text=i18n.get( "uiR2Test1Seq" )},
["is in activity step"] = { menu=i18n.get( "uiR2Test0Step" ),
text=i18n.get( "uiR2Test1Step" )},
}
}
return logicTranslations

@ -297,15 +297,15 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdNpcInteraction_ContextualText"):toUtf8()
local preInteractionText = i18n.get("uiR2EdNpcInteraction_PreInteractionText"):toUtf8()
local postInteractionText = i18n.get("uiR2EdNpcInteraction_PostInteractionText"):toUtf8()
local contextualText = i18n.get("uiR2EdNpcInteraction_ContextualText")
local preInteractionText = i18n.get("uiR2EdNpcInteraction_PreInteractionText")
local postInteractionText = i18n.get("uiR2EdNpcInteraction_PostInteractionText")
local comp = r2.newComponent("NpcInteraction")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdNpcInteraction")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdNpcInteraction"))
comp.ContextualText = contextualText
comp.PreInteractionText = preInteractionText
@ -370,33 +370,33 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdNpcInteraction")
logicEntityMenu:addLine(ucstring(name), "lua", "", "NpcInteraction")
logicEntityMenu:addLine(name, "lua", "", "NpcInteraction")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["has triggered"] = { menu=i18n.get( "uiR2Test0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Test1Trigger" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["has triggered"] = { menu=i18n.get( "uiR2Test0Trigger" ),
text=i18n.get( "uiR2Test1Trigger" )},
}
}
return logicTranslations

@ -158,7 +158,7 @@ function onComponentCreated(this)
local y = this.Position.y + 3
local zoneTrigger = r2.Features["ZoneTrigger"].Components.ZoneTrigger.createComponent(x, y)
assert(zoneTrigger)
zoneTrigger.Name = this.Name.." "..i18n.get("uiR2EdZoneTrigger"):toUtf8()
zoneTrigger.Name = this.Name.." "..i18n.get("uiR2EdZoneTrigger")
zoneTrigger.InheritPos = 0
zoneTrigger.Deletable = false
table.insert(this.SubComponents, zoneTrigger)
@ -175,7 +175,7 @@ component.create = function()
r2.requestNewAction(i18n.get("uiR2EDNewProximityDialogAction"))
local proxDialog = r2.newComponent("ProximityDialog")
assert(proxDialog)
proxDialog.Name = r2:genInstanceName(i18n.get("uiR2EDProximityDialog")):toUtf8()
proxDialog.Name = r2:genInstanceName(i18n.get("uiR2EDProximityDialog"))
proxDialog.Base = r2.Translator.getDebugBase("palette.entities.botobjects.dialog")
proxDialog.Position.x = x
proxDialog.Position.y = y
@ -249,9 +249,7 @@ end
function component.initLogicEntitiesInstancesMenu(this, subMenu, calledFunction)
local entitiesTable = r2.Scenario:getAllInstancesByType(this.Name)
for key, entity in pairs(entitiesTable) do
local uc_name = ucstring()
uc_name:fromUtf8(entity.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
end
if table.getn(entitiesTable)==0 then
@ -262,38 +260,38 @@ end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["starts dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStart" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatSeqStart" ):toUtf8()},
["stops dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStop" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatSeqStop" ):toUtf8()},
["starts chat"] = { menu=i18n.get( "uiR2AA0ChatStepStart" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatStepStart" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["starts dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStart" ),
text=i18n.get( "uiR2AA1ChatSeqStart" )},
["stops dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStop" ),
text=i18n.get( "uiR2AA1ChatSeqStop" )},
["starts chat"] = { menu=i18n.get( "uiR2AA0ChatStepStart" ),
text=i18n.get( "uiR2AA1ChatStepStart" )},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["start of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqStart" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatSeqStart" ):toUtf8()},
["end of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqEnd" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatSeqEnd" ):toUtf8()},
["start of chat"] = { menu=i18n.get( "uiR2Event0ChatStepStart" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatStepStart" ):toUtf8()},
["end of chat"] = { menu=i18n.get( "uiR2Event0ChatStepEnd" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatStepEnd" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["start of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqStart" ),
text=i18n.get( "uiR2Event1ChatSeqStart" )},
["end of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqEnd" ),
text=i18n.get( "uiR2Event1ChatSeqEnd" )},
["start of chat"] = { menu=i18n.get( "uiR2Event0ChatStepStart" ),
text=i18n.get( "uiR2Event1ChatStepStart" )},
["end of chat"] = { menu=i18n.get( "uiR2Event0ChatStepEnd" ),
text=i18n.get( "uiR2Event1ChatStepEnd" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is in dialog"] = { menu=i18n.get( "uiR2Test0ChatSeq" ):toUtf8(),
text=i18n.get( "uiR2Test1ChatSeq" ):toUtf8()},
["is not in dialog"] = { menu=i18n.get( "uiR2Test0ChatNotSeq" ):toUtf8(),
text=i18n.get( "uiR2Test1ChatNotSeq" ):toUtf8()},
["is in chat"] = { menu=i18n.get( "uiR2Test0ChatStep" ):toUtf8(),
text=i18n.get( "uiR2Test1ChatStep" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is in dialog"] = { menu=i18n.get( "uiR2Test0ChatSeq" ),
text=i18n.get( "uiR2Test1ChatSeq" )},
["is not in dialog"] = { menu=i18n.get( "uiR2Test0ChatNotSeq" ),
text=i18n.get( "uiR2Test1ChatNotSeq" )},
["is in chat"] = { menu=i18n.get( "uiR2Test0ChatStep" ),
text=i18n.get( "uiR2Test1ChatStep" )},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
}
}
return logicTranslations

@ -475,13 +475,13 @@ end
component.createComponent = function(x, y)
local questCompletedText = i18n.get("uiR2EdQuest_QuestCompletedText"):toUtf8()
local questCompletedText = i18n.get("uiR2EdQuest_QuestCompletedText")
local comp = r2.newComponent("Quest")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdQuest")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdQuest"))
comp.QuestCompletedText = questCompletedText
comp.TaskNumber = 0
@ -545,36 +545,36 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdQuest")
logicEntityMenu:addLine(ucstring(name), "lua", "", "Quest")
logicEntityMenu:addLine(name, "lua", "", "Quest")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["validate current task"] = { menu=i18n.get( "uiR2AA0ValidateCurrentTask" ):toUtf8(),
text=i18n.get( "uiR2AA1ValidateCurrentTask" ):toUtf8()},
["complete"] = { menu=i18n.get( "uiR2AA0CompleteQuest" ):toUtf8(),
text=i18n.get( "uiR2AA1CompleteQuest" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["validate current task"] = { menu=i18n.get( "uiR2AA0ValidateCurrentTask" ),
text=i18n.get( "uiR2AA1ValidateCurrentTask" )},
["complete"] = { menu=i18n.get( "uiR2AA0CompleteQuest" ),
text=i18n.get( "uiR2AA1CompleteQuest" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["success"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["success"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is finished"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is finished"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -348,7 +348,7 @@ function component.createComponent(x, y)
assert(comp)
comp.Base = "palette.entities.botobjects.chest_wisdom_std_sel"
comp.Name = r2:genInstanceName(i18n.get("uiR2EdRandomChest")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdRandomChest"))
comp.Position.x = x
comp.Position.y = y
@ -443,24 +443,24 @@ function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Spawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Spawn" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ):toUtf8(),
text=i18n.get( "uiR2AA1Despawn" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Spawn" ),
text=i18n.get( "uiR2AA1Spawn" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Despawn" ),
text=i18n.get( "uiR2AA1Despawn" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Spawn" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ):toUtf8(),
text=i18n.get( "uiR2Event1Despawn" ):toUtf8()},
["opened"] = { menu=i18n.get( "uiR2Event0ChestOpened" ):toUtf8(),
text=i18n.get( "uiR2Event1ChestOpened" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Spawn" ),
text=i18n.get( "uiR2Event1Spawn" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Despawn" ),
text=i18n.get( "uiR2Event1Despawn" )},
["opened"] = { menu=i18n.get( "uiR2Event0ChestOpened" ),
text=i18n.get( "uiR2Event1ChestOpened" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Spawned" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ):toUtf8(),
text=i18n.get( "uiR2Test1Despawned" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Spawned" ),
text=i18n.get( "uiR2Test1Spawned" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Despawned" ),
text=i18n.get( "uiR2Test1Despawned" )}
}
}
return logicTranslations

@ -439,14 +439,14 @@ component.createComponent = function(x, y)
local comp = r2.newComponent("RequestItem")
assert(comp)
local contextualText = i18n.get("uiR2EdRequestItem_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdRequestItem_MissionText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdRequestItem_WaitValidationText"):toUtf8()
local missionSucceededText = i18n.get("uiR2EdRequestItem_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdRequestItem_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdRequestItem_ContextualText")
local missionText = i18n.get("uiR2EdRequestItem_MissionText")
local waitValidationText = i18n.get("uiR2EdRequestItem_WaitValidationText")
local missionSucceededText = i18n.get("uiR2EdRequestItem_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdRequestItem_BroadcastText")
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_request_item")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRequestItem")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRequestItem"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -517,36 +517,36 @@ end
--function component:registerMenu(logicEntityMenu)
-- local name = i18n.get("uiR2EDRequestItem")
-- logicEntityMenu:addLine(ucstring(name), "lua", "", "RequestItem")
-- logicEntityMenu:addLine(name, "lua", "", "RequestItem")
--end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -306,18 +306,18 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdRewardProvider_ContextualText"):toUtf8()
local onTargetText = i18n.get("uiR2EdRewardProvider_OnTargetText"):toUtf8()
local rewardText = i18n.get("uiR2EdRewardProvider_RewardText"):toUtf8()
local rareRewardText = i18n.get("uiR2EdRewardProvider_RareRewardText"):toUtf8()
local inventoryFullText = i18n.get("uiR2EdRewardProvider_InventoryFullText"):toUtf8()
local notEnoughPointsText = i18n.get("uiR2EdRewardProvider_NotEnoughPointsText"):toUtf8()
local contextualText = i18n.get("uiR2EdRewardProvider_ContextualText")
local onTargetText = i18n.get("uiR2EdRewardProvider_OnTargetText")
local rewardText = i18n.get("uiR2EdRewardProvider_RewardText")
local rareRewardText = i18n.get("uiR2EdRewardProvider_RareRewardText")
local inventoryFullText = i18n.get("uiR2EdRewardProvider_InventoryFullText")
local notEnoughPointsText = i18n.get("uiR2EdRewardProvider_NotEnoughPointsText")
local comp = r2.newComponent("RewardProvider")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRewardProvider")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRewardProvider"))
comp.ContextualText = contextualText
comp.OnTargetText = onTargetText
@ -388,30 +388,30 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EDRollout_RewardProvider")
logicEntityMenu:addLine(ucstring(name), "lua", "", "RewardProvider")
logicEntityMenu:addLine(name, "lua", "", "RewardProvider")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["reward given"] = { menu=i18n.get( "uiR2Event0RewardGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1RewardGiven" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["reward given"] = { menu=i18n.get( "uiR2Event0RewardGiven" ),
text=i18n.get( "uiR2Event1RewardGiven" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
}
}
return logicTranslations

@ -325,13 +325,13 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdSceneryObjectInteraction_ContextualText"):toUtf8()
local contextualText = i18n.get("uiR2EdSceneryObjectInteraction_ContextualText")
local comp = r2.newComponent("SceneryObjectInteraction")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdSceneryObjectInteraction")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdSceneryObjectInteraction"))
comp.ContextualText = contextualText
@ -395,35 +395,35 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdSceneryObjectInteraction")
logicEntityMenu:addLine(ucstring(name), "lua", "", "SceneryObjectInteraction")
logicEntityMenu:addLine(name, "lua", "", "SceneryObjectInteraction")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["has triggered"] = { menu=i18n.get( "uiR2Test0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Test1Trigger" ):toUtf8()},
["has not triggered"] = { menu=i18n.get( "uiR2Test0NotTrigger" ):toUtf8(),
text=i18n.get( "uiR2Test1NotTrigger" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["has triggered"] = { menu=i18n.get( "uiR2Test0Trigger" ),
text=i18n.get( "uiR2Test1Trigger" )},
["has not triggered"] = { menu=i18n.get( "uiR2Test0NotTrigger" ),
text=i18n.get( "uiR2Test1NotTrigger" )},
}
}
return logicTranslations

@ -453,18 +453,18 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_MissionText"):toUtf8()
local notValidatedText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_NotValidatedText"):toUtf8()
local broadcastText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_BroadcastText"):toUtf8()
local missionSucceedText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_MissionSucceedTextText"):toUtf8()
local contextualText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_ContextualText")
local missionText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_MissionText")
local notValidatedText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_NotValidatedText")
local broadcastText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_BroadcastText")
local missionSucceedText = i18n.get("uiR2EdSceneryObjectInteractionTaskStep_MissionSucceedTextText")
local comp = r2.newComponent("SceneryObjectInteractionTaskStep")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdSceneryObjectInteractionTaskStep")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdSceneryObjectInteractionTaskStep"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -506,35 +506,35 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdSceneryObjectInteractionTaskStep")
logicEntityMenu:addLine(ucstring(name), "lua", "", "SceneryObjectInteractionTaskStep")
logicEntityMenu:addLine(name, "lua", "", "SceneryObjectInteractionTaskStep")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["in progress"] = { menu=i18n.get( "uiR2Test0InProgress" ):toUtf8(),
text=i18n.get( "uiR2Test1InProgress" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
["in progress"] = { menu=i18n.get( "uiR2Test0InProgress" ),
text=i18n.get( "uiR2Test1InProgress" )},
}
}
return logicTranslations

@ -344,7 +344,7 @@ component.createComponent = function(x, y, tvalue)
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_SceneryObjectRemover")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_SceneryObjectRemover"))
comp.Position.x = x
comp.Position.y = y
@ -412,33 +412,33 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EDRollout_SceneryObjectRemover")
logicEntityMenu:addLine(ucstring(name), "lua", "", "SceneryObject")
logicEntityMenu:addLine(name, "lua", "", "SceneryObject")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["remove objects"] = { menu=i18n.get( "uiR2AA0RemoveObject" ):toUtf8(),
text=i18n.get( "uiR2AA1RemoveObject" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["remove objects"] = { menu=i18n.get( "uiR2AA0RemoveObject" ),
text=i18n.get( "uiR2AA1RemoveObject" )},
},
["Events"] = {
["removed objects"] = { menu=i18n.get( "uiR2Event0RemovedObjects" ):toUtf8(),
text=i18n.get( "uiR2Event1RemovedObjects" ):toUtf8()},
["removed objects"] = { menu=i18n.get( "uiR2Event0RemovedObjects" ),
text=i18n.get( "uiR2Event1RemovedObjects" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["has removed objects"] = { menu=i18n.get( "uiR2Test0HasRemoved" ):toUtf8(),
text=i18n.get( "uiR2Test1HasRemoved" ):toUtf8()},
["has not removed objects"] = { menu=i18n.get( "uiR2Test0HasNotRemoved" ):toUtf8(),
text=i18n.get( "uiR2Test1HasNotRemoved" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["has removed objects"] = { menu=i18n.get( "uiR2Test0HasRemoved" ),
text=i18n.get( "uiR2Test1HasRemoved" )},
["has not removed objects"] = { menu=i18n.get( "uiR2Test0HasNotRemoved" ),
text=i18n.get( "uiR2Test1HasNotRemoved" )}
}
}
return logicTranslations

@ -407,17 +407,17 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdTalkTo_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdTalkTo_MissionText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdTalkTo_WaitValidationText"):toUtf8()
local missionSucceededText = i18n.get("uiR2EdTalkTo_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdTalkTo_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdTalkTo_ContextualText")
local missionText = i18n.get("uiR2EdTalkTo_MissionText")
local waitValidationText = i18n.get("uiR2EdTalkTo_WaitValidationText")
local missionSucceededText = i18n.get("uiR2EdTalkTo_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdTalkTo_BroadcastText")
local comp = r2.newComponent("TalkTo")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdTalkTo")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdTalkTo"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -485,36 +485,36 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdTalkTo")
logicEntityMenu:addLine(ucstring(name), "lua", "", "TalkTo")
logicEntityMenu:addLine(name, "lua", "", "TalkTo")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -314,17 +314,17 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdTargetMob_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdTargetMob_MissionText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdTargetMob_WaitValidationText"):toUtf8()
local missionSucceededText = i18n.get("uiR2EdTargetMob_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdTargetMob_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdTargetMob_ContextualText")
local missionText = i18n.get("uiR2EdTargetMob_MissionText")
local waitValidationText = i18n.get("uiR2EdTargetMob_WaitValidationText")
local missionSucceededText = i18n.get("uiR2EdTargetMob_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdTargetMob_BroadcastText")
local comp = r2.newComponent("TargetMob")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdTargetMob")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdTargetMob"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -392,36 +392,36 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdTargetMob")
logicEntityMenu:addLine(ucstring(name), "lua", "", "TargetMob")
logicEntityMenu:addLine(name, "lua", "", "TargetMob")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -249,7 +249,7 @@ feature.createComponent = function(x, y, hours, minutes, cyclic)
assert(comp)
comp.Base = "palette.entities.botobjects.time_trigger"
comp.Name = r2:genInstanceName(i18n.get("uiR2EdNameTimeTriggerFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdNameTimeTriggerFeature"))
comp.Position.x = x
comp.Position.y = y
@ -406,26 +406,26 @@ function component:getLogicTranslations()
-- register trad
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["On Activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["On Desactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["On Trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["On Activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["On Desactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["On Trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is finished"] = { menu=i18n.get( "uiR2Test0TimerFinished" ):toUtf8(),
text=i18n.get( "uiR2Test1TimerFinished" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is finished"] = { menu=i18n.get( "uiR2Test0TimerFinished" ),
text=i18n.get( "uiR2Test1TimerFinished" )},
}
}
return logicTranslations

@ -303,7 +303,7 @@ component.createGhostComponents= function(this, act)
local timer = r2.newComponent("Timer")
assert(timer)
timer.Name = r2:genInstanceName(i18n.get("uiR2EdTimer")):toUtf8()
timer.Name = r2:genInstanceName(i18n.get("uiR2EdTimer"))
timer.InheritPos = 0
timer.Position.x = comp.Position.x
timer.Position.y = comp.Position.y
@ -384,7 +384,7 @@ component.createComponent = function(x, y)
assert(comp.Position)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdTimedSpawner")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdTimedSpawner"))
comp.Position.x = x
comp.Position.y = y
comp.Position.z = r2:snapZToGround(x, y)
@ -422,26 +422,26 @@ function component:getLogicTranslations()
-- register trad
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()}
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )}
}
}

@ -365,7 +365,7 @@ component.createComponent = function(x, y, secondes, minutes, cyclic)
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.timer")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdNameTimerFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdNameTimerFeature"))
comp.Position.x = x
comp.Position.y = y
@ -455,52 +455,52 @@ function component:getLogicTranslations()
-- register trad
local logicTranslations = {
["ApplicableActions"] = {
["Activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["Deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["Trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["Pause"] = { menu=i18n.get( "uiR2AA0TimerPause" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerPause" ):toUtf8()},
["Resume"] = { menu=i18n.get( "uiR2AA0TimerResume" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerResume" ):toUtf8()},
["Add 10 Seconds"] = { menu=i18n.get( "uiR2AA0TimerAdd10s" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerAdds10s" ):toUtf8()},
["Add 1 minute"] = { menu=i18n.get( "uiR2AA0TimerAdd1m" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerAdds1m" ):toUtf8()},
["Sub 10 seconds"] = { menu=i18n.get( "uiR2AA0TimerSub10s" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerSubs10s" ):toUtf8()},
["Sub 1 minute"] = { menu=i18n.get( "uiR2AA0TimerSub1m" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerSubs1m" ):toUtf8()},
["add seconds"] = { menu=i18n.get( "uiR2AA0TimerAddNSeconds" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerAddNSeconds" ):toUtf8()},
["sub seconds"] = { menu=i18n.get( "uiR2AA0TimerSubNSeconds" ):toUtf8(),
text=i18n.get( "uiR2AA1TimerSubNSeconds" ):toUtf8()},
["Activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["Deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["Trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
["Pause"] = { menu=i18n.get( "uiR2AA0TimerPause" ),
text=i18n.get( "uiR2AA1TimerPause" )},
["Resume"] = { menu=i18n.get( "uiR2AA0TimerResume" ),
text=i18n.get( "uiR2AA1TimerResume" )},
["Add 10 Seconds"] = { menu=i18n.get( "uiR2AA0TimerAdd10s" ),
text=i18n.get( "uiR2AA1TimerAdds10s" )},
["Add 1 minute"] = { menu=i18n.get( "uiR2AA0TimerAdd1m" ),
text=i18n.get( "uiR2AA1TimerAdds1m" )},
["Sub 10 seconds"] = { menu=i18n.get( "uiR2AA0TimerSub10s" ),
text=i18n.get( "uiR2AA1TimerSubs10s" )},
["Sub 1 minute"] = { menu=i18n.get( "uiR2AA0TimerSub1m" ),
text=i18n.get( "uiR2AA1TimerSubs1m" )},
["add seconds"] = { menu=i18n.get( "uiR2AA0TimerAddNSeconds" ),
text=i18n.get( "uiR2AA1TimerAddNSeconds" )},
["sub seconds"] = { menu=i18n.get( "uiR2AA0TimerSubNSeconds" ),
text=i18n.get( "uiR2AA1TimerSubNSeconds" )},
},
["Events"] = {
["On Activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["On Desactivation"]= { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["On Trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["On Pause"] = { menu=i18n.get( "uiR2Event0TimerPause" ):toUtf8(),
text=i18n.get( "uiR2Event1TimerPause" ):toUtf8()},
["On Resume"] = { menu=i18n.get( "uiR2Event0TimerResume" ):toUtf8(),
text=i18n.get( "uiR2Event1TimerResume" ):toUtf8()},
["On Activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["On Desactivation"]= { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["On Trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
["On Pause"] = { menu=i18n.get( "uiR2Event0TimerPause" ),
text=i18n.get( "uiR2Event1TimerPause" )},
["On Resume"] = { menu=i18n.get( "uiR2Event0TimerResume" ),
text=i18n.get( "uiR2Event1TimerResume" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is paused"] = { menu=i18n.get( "uiR2Test0TimerPaused" ):toUtf8(),
text=i18n.get( "uiR2Test1TimerPaused" ):toUtf8()},
["is running"] = { menu=i18n.get( "uiR2Test0TimerRunning" ):toUtf8(),
text=i18n.get( "uiR2Test1TimerRunning" ):toUtf8()},
["is finished"] = { menu=i18n.get( "uiR2Test0TimerFinished" ):toUtf8(),
text=i18n.get( "uiR2Test1TimerFinished" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is paused"] = { menu=i18n.get( "uiR2Test0TimerPaused" ),
text=i18n.get( "uiR2Test1TimerPaused" )},
["is running"] = { menu=i18n.get( "uiR2Test0TimerRunning" ),
text=i18n.get( "uiR2Test1TimerRunning" )},
["is finished"] = { menu=i18n.get( "uiR2Test0TimerFinished" ),
text=i18n.get( "uiR2Test1TimerFinished" )},
}
}
return logicTranslations
@ -521,10 +521,8 @@ function component.initEventValuesMenu(this, menu, categoryEvent)
local subMenu = menu:getSubMenu(ev)
local func = ""
-- for i=0, 9 do
-- local uc_name = ucstring()
-- uc_name:fromUtf8( tostring(i) )
-- func = "r2.events:setEventValue('','" .. categoryEvent .."','".. tostring(i).."')"
-- subMenu:addLine(uc_name, "lua", func, tostring(i))
-- subMenu:addLine(tostring(i), "lua", func, tostring(i))
-- end
--endTime = nltime.getPreciseLocalTime()
@ -534,7 +532,7 @@ function component.initEventValuesMenu(this, menu, categoryEvent)
local lineNb = 0
for i=0, 50, 10 do
local lineStr = tostring(i).."/"..tostring(i+9)
subMenu:addLine(ucstring(lineStr), "", "", tostring(i))
subMenu:addLine(lineStr, "", "", tostring(i))
--endTime = nltime.getPreciseLocalTime()
--debugInfo(string.format("time for 12 is %f", endTime - startTime))
@ -545,7 +543,7 @@ function component.initEventValuesMenu(this, menu, categoryEvent)
for s=0,9 do
lineStr = tostring(i+s)
local func = "r2.events:setEventValue('','" .. categoryEvent .."','".. lineStr.."')"
subMenu2:addLine(ucstring(lineStr), "lua", func, lineStr)
subMenu2:addLine(lineStr, "lua", func, lineStr)
end
lineNb = lineNb+1
@ -556,7 +554,7 @@ function component.initEventValuesMenu(this, menu, categoryEvent)
for i=0, 50, 10 do
local lineStr = tostring(i).." m /"..tostring(i+9).." m"
subMenu:addLine(ucstring(lineStr), "", "", tostring(i))
subMenu:addLine(lineStr, "", "", tostring(i))
subMenu:addSubMenu(lineNb)
local subMenu2= subMenu:getSubMenu(lineNb)
@ -569,14 +567,14 @@ function component.initEventValuesMenu(this, menu, categoryEvent)
for m=0,9 do
lineStr = tostring( (i+m)*60)
-- local func = "r2.events:setEventValue('','" .. categoryEvent .."','".. lineStr.."')"
subMenu2:addLine(ucstring(tostring(i+m) .. "m"), "", "", lineStr)
subMenu2:addLine(tostring(i+m) .. "m", "", "", lineStr)
subMenu2:addSubMenu(index)
local subMenu3= subMenu2:getSubMenu(index)
index = index + 1
for s=0, 55, 5 do
lineStr = tostring( (i+m)*60 + s)
local func = "r2.events:setEventValue('','" .. categoryEvent .."','".. lineStr.."')"
subMenu3:addLine(ucstring(tostring(i+m) .. "m ".. s .. "s"), "lua", func, lineStr)
subMenu3:addLine(tostring(i+m) .. "m ".. s .. "s", "lua", func, lineStr)
end
end
lineNb = lineNb+1

@ -140,7 +140,7 @@ component.createComponent = function(x, y)
assert(comp)
comp.Base = "palette.entities.botobjects.milestone"
comp.Name = r2:genInstanceName(i18n.get("uiR2EdUserItemFeature")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdUserItemFeature"))
comp.Position.x = x
comp.Position.y = y
@ -191,7 +191,7 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdUserItemFeature")
logicEntityMenu:addLine(ucstring(name), "lua", "", "UserItemFeature")
logicEntityMenu:addLine(name, "lua", "", "UserItemFeature")
end
function component:getLogicEntityAttributes()

@ -222,7 +222,7 @@ function component.createComponent(x, y)
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.user_event")
comp.Name = r2:genInstanceName(i18n.get("uiR2ED" .. component.Name)):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2ED" .. component.Name))
comp.Position.x = x
comp.Position.y = y
@ -315,12 +315,12 @@ function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["triggered"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["triggered"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
}
}
return logicTranslations

@ -372,17 +372,17 @@ end
component.createComponent = function(x, y)
local contextualText = i18n.get("uiR2EdVisitZone_ContextualText"):toUtf8()
local missionText = i18n.get("uiR2EdVisitZone_MissionText"):toUtf8()
local waitValidationText = i18n.get("uiR2EdVisitZone_WaitValidationText"):toUtf8()
local missionSucceededText = i18n.get("uiR2EdVisitZone_MissionSucceededText"):toUtf8()
local broadcastText = i18n.get("uiR2EdVisitZone_BroadcastText"):toUtf8()
local contextualText = i18n.get("uiR2EdVisitZone_ContextualText")
local missionText = i18n.get("uiR2EdVisitZone_MissionText")
local waitValidationText = i18n.get("uiR2EdVisitZone_WaitValidationText")
local missionSucceededText = i18n.get("uiR2EdVisitZone_MissionSucceededText")
local broadcastText = i18n.get("uiR2EdVisitZone_BroadcastText")
local comp = r2.newComponent("VisitZone")
assert(comp)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.bot_chat")
comp.Name = r2:genInstanceName(i18n.get("uiR2EdVisitZone")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EdVisitZone"))
comp.ContextualText = contextualText
comp.MissionText = missionText
@ -395,7 +395,7 @@ component.createComponent = function(x, y)
comp.Position.z = r2:snapZToGround(x, y)
local zoneTrigger = r2.Features["ZoneTrigger"].Components.ZoneTrigger.createComponent(x + 3, y + 3)
zoneTrigger.Name = comp.Name.." "..i18n.get("uiR2EdZoneTrigger"):toUtf8() --r2:genInstanceName(i18n.get("uiR2EdZoneTrigger")):toUtf8()
zoneTrigger.Name = comp.Name.." "..i18n.get("uiR2EdZoneTrigger") --r2:genInstanceName(i18n.get("uiR2EdZoneTrigger"))
zoneTrigger.InheritPos = 0
zoneTrigger.Deletable = false
table.insert(comp.Components, zoneTrigger)
@ -456,38 +456,38 @@ end
function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdVisitZone")
logicEntityMenu:addLine(ucstring(name), "lua", "", "VisitZone")
logicEntityMenu:addLine(name, "lua", "", "VisitZone")
end
function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["succeed"] = { menu=i18n.get( "uiR2AA0SucceedTask" ):toUtf8(),
text=i18n.get( "uiR2AA1SucceedTask" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["succeed"] = { menu=i18n.get( "uiR2AA0SucceedTask" ),
text=i18n.get( "uiR2AA1SucceedTask" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ):toUtf8(),
text=i18n.get( "uiR2Event1MissionGiven" ):toUtf8()},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskWaitValidation" ):toUtf8()},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Event1TaskSuccess" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["mission asked"] = { menu=i18n.get( "uiR2Event0MissionGiven" ),
text=i18n.get( "uiR2Event1MissionGiven" )},
["wait validation"] = { menu=i18n.get( "uiR2Event0TaskWaitValidation" ),
text=i18n.get( "uiR2Event1TaskWaitValidation" )},
["succeeded"] = { menu=i18n.get( "uiR2Event0TaskSuccess" ),
text=i18n.get( "uiR2Event1TaskSuccess" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ):toUtf8(),
text=i18n.get( "uiR2Test1TaskSuccess" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is succeeded"] = { menu=i18n.get( "uiR2Test0TaskSuccess" ),
text=i18n.get( "uiR2Test1TaskSuccess" )},
}
}
return logicTranslations

@ -260,7 +260,7 @@ component.createComponent = function(x, y)
assert(comp.Position)
comp.Base = r2.Translator.getDebugBase("palette.entities.botobjects.trigger_zone")
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_ZoneTrigger")):toUtf8()
comp.Name = r2:genInstanceName(i18n.get("uiR2EDRollout_ZoneTrigger"))
comp.Position.x = x
comp.Position.y = y
@ -273,7 +273,7 @@ component.createComponent = function(x, y)
zone.Position.y = 0 -- comp.Position.y
zone.Position.z = 0 -- comp.Position.z
zone.InheritPos = 1 -- don't inherit position of parents
zone.Name = r2:genInstanceName(i18n.get("uiR2EDPlaces")):toUtf8()
zone.Name = r2:genInstanceName(i18n.get("uiR2EDPlaces"))
comp._Zone = zone.InstanceId
table.insert(comp.Components, zone)
@ -361,34 +361,34 @@ function component:getLogicTranslations()
-- register trad
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["simulate on enter"] = { menu=i18n.get( "uiR2AA0ZoneTriggerSimEnter" ):toUtf8(),
text=i18n.get( "uiR2AA1ZoneTriggerSimEnter" ):toUtf8()},
["simulate on leave"] = { menu=i18n.get( "uiR2AA0ZoneTriggerSimExit" ):toUtf8(),
text=i18n.get( "uiR2AA1ZoneTriggerSimExit" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["simulate on enter"] = { menu=i18n.get( "uiR2AA0ZoneTriggerSimEnter" ),
text=i18n.get( "uiR2AA1ZoneTriggerSimEnter" )},
["simulate on leave"] = { menu=i18n.get( "uiR2AA0ZoneTriggerSimExit" ),
text=i18n.get( "uiR2AA1ZoneTriggerSimExit" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["On Player Arrived"] = { menu=i18n.get( "uiR2Event0ZoneTriggerEntry" ):toUtf8(),
text=i18n.get( "uiR2Event1ZoneTriggerEntry" ):toUtf8()},
["On Player Left"] = { menu=i18n.get( "uiR2Event0ZoneTriggerExit" ):toUtf8(),
text=i18n.get( "uiR2Event1ZoneTriggerExit" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["On Player Arrived"] = { menu=i18n.get( "uiR2Event0ZoneTriggerEntry" ),
text=i18n.get( "uiR2Event1ZoneTriggerEntry" )},
["On Player Left"] = { menu=i18n.get( "uiR2Event0ZoneTriggerExit" ),
text=i18n.get( "uiR2Event1ZoneTriggerExit" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is empty"] = { menu=i18n.get( "uiR2Test0ZoneTriggerEmpty" ):toUtf8(),
text=i18n.get( "uiR2Test1ZoneTriggerEmpty" ):toUtf8()},
["is full"] = { menu=i18n.get( "uiR2Test0ZoneTriggerFull" ):toUtf8(),
text=i18n.get( "uiR2Test1ZoneTriggerFull" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
["is empty"] = { menu=i18n.get( "uiR2Test0ZoneTriggerEmpty" ),
text=i18n.get( "uiR2Test1ZoneTriggerEmpty" )},
["is full"] = { menu=i18n.get( "uiR2Test0ZoneTriggerFull" ),
text=i18n.get( "uiR2Test1ZoneTriggerFull" )},
}

@ -61,7 +61,7 @@ Logic.Components.LogicEntityAction =
local coloredName = (logicEntity.InstanceId == r2.events.filteredLogicEntityId)
local eventType = r2.events.keyWordsColor .. i18n.get("uiR2EdEventTxtPreEvent"):toUtf8() .. " "
local eventType = r2.events.keyWordsColor .. i18n.get("uiR2EdEventTxtPreEvent") .. " "
if coloredName then
eventType = eventType .. r2.events.filterWordColor
@ -106,7 +106,7 @@ Logic.Components.LogicEntityAction =
if conditionInst.Entity~="" and conditionInst.Condition.Type~="" then
conditionsList = conditionsList .. "\n" .. r2.events.keyWordsColor
..string.upper(i18n.get("uiR2EdEventTxtPreCondition"):toUtf8()).." "
..string.upper(i18n.get("uiR2EdEventTxtPreCondition")).." "
.. r2.events.communWordsColor
local conditionLogicEntity = r2:getInstanceFromId(tostring(conditionInst.Entity))
@ -141,7 +141,7 @@ Logic.Components.LogicEntityAction =
if actionInst.Entity~="" and actionInst.Action.Type~="" then
actionsList = actionsList .. "\n" .. r2.events.keyWordsColor
..string.upper(i18n.get("uiR2EdEventTxtPreActions"):toUtf8()).." "
..string.upper(i18n.get("uiR2EdEventTxtPreActions")).." "
.. r2.events.communWordsColor
local actionLogicEntity = r2:getInstanceFromId(tostring(actionInst.Entity))
@ -511,10 +511,10 @@ Logic.Components.ChatStep = {
local minNb, secNb = r2.dialogs:calculMinSec(this.Time)
local time = ""
if minNb ~= 0 then
time = tostring(minNb)..i18n.get("uiR2EdShortMinutes"):toUtf8()
time = tostring(minNb)..i18n.get("uiR2EdShortMinutes")
end
time = time.." " ..tostring(secNb)..i18n.get("uiR2EdShortSeconds"):toUtf8()
local afterTime = "(" ..i18n.get("uiR2EdAfter"):toUtf8().." ".. time..") "
time = time.." " ..tostring(secNb)..i18n.get("uiR2EdShortSeconds")
local afterTime = "(" ..i18n.get("uiR2EdAfter").." ".. time..") "
-- says
local whoToWho = ""
@ -533,7 +533,7 @@ Logic.Components.ChatStep = {
local facing = action.Facing
if facing~="" then
whoToWho = whoToWho ..i18n.get("uiR2EdSaysTo"):toUtf8().. " " .. r2:getInstanceFromId(facing).Name .. " "
whoToWho = whoToWho ..i18n.get("uiR2EdSaysTo").. " " .. r2:getInstanceFromId(facing).Name .. " "
end
local emote = action.Emote
@ -557,22 +557,22 @@ Logic.Components.ChatStep = {
if who then
saysWhat = who.Name
elseif action.WhoNoEntity=="_System" then
saysWhat = i18n.get("uiR2EdSystem"):toUtf8()
saysWhat = i18n.get("uiR2EdSystem")
elseif action.WhoNoEntity=="_DM" then
saysWhat = i18n.get("uiR2EdDonjonMaster"):toUtf8()
saysWhat = i18n.get("uiR2EdDonjonMaster")
end
saysWhat = saysWhat .. " " ..i18n.get("uiR2EdSays"):toUtf8().. " "
saysWhat = saysWhat .. " " ..i18n.get("uiR2EdSays").. " "
local says = action.Says
if says ~= "" then
local inst=r2:getInstanceFromId(says)
if inst then
says = inst.Text
local uc_says = ucstring()
uc_says:fromUtf8(says)
uc_says = uc_says:substr(0, 4)
says = uc_says:toUtf8()
--local uc_says = ucstring() ???
--uc_says:fromUtf8(says)
--uc_says = uc_says:substr(0, 4) ???
--says = uc_says
end
end
@ -688,7 +688,7 @@ Logic.Components.ChatSequence = {
local index = r2.logicComponents:searchElementIndex(this)
if index >= 0 then
name = i18n.get("uiR2EDDialog"):toUtf8() .. index
name = i18n.get("uiR2EDDialog") .. index
end
end
@ -723,10 +723,8 @@ Logic.Components.ChatSequence = {
local subMenu = menu:getSubMenu(ev)
local func = ""
for i=0, 9 do
local uc_name = ucstring()
uc_name:fromUtf8( tostring(i) )
func = "r2.events:setEventValue('','" .. categoryEvent .."','".. tostring(i).."')"
subMenu:addLine(uc_name, "lua", func, tostring(i))
subMenu:addLine(tostring(i), "lua", func, tostring(i))
end
elseif r2.events.eventTypeWithValue[eventType]=="ChatStep" then
@ -736,9 +734,7 @@ Logic.Components.ChatSequence = {
for c=0, this.Components.Size-1 do
local chat = this.Components[c]
local uc_name = ucstring()
uc_name:fromUtf8(chat:getShortName())
subMenu:addLine(uc_name, "lua",
subMenu:addLine(chat:getShortName(), "lua",
"r2.events:setEventValue('".. chat.InstanceId .."','" .. categoryEvent .. "')", chat.InstanceId)
end
@ -787,9 +783,7 @@ Logic.Components.ChatSequence = {
local entitiesTable = r2.Scenario:getAllInstancesByType(this.Name)
for key, entity in pairs(entitiesTable) do
local uc_name = ucstring()
uc_name:fromUtf8(entity.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
end
if table.getn(entitiesTable)==0 then
@ -870,7 +864,7 @@ Logic.Components.ActivityStep = {
local result = this:doLookupFromVerb(r2.activities.activityTypeTranslation)
if result then result = result.trans end
if result then return result end
return ucstring("Activity not registered : " .. lookupString)
return "Activity not registered : " .. lookupString
end,
-- element name
getName = function(this)
@ -888,10 +882,10 @@ Logic.Components.ActivityStep = {
local hourNb, minNb, secNb = r2.logicComponents:calculHourMinSec(tonumber(this.TimeLimitValue))
local timeLimitText = i18n.get("uiR2EdFor"):toUtf8() .. " "
if hourNb ~= 0 then timeLimitText = timeLimitText .. hourNb .. i18n.get("uiR2EdShortHours"):toUtf8() .. " " end
if minNb ~= 0 then timeLimitText = timeLimitText .. minNb .. i18n.get("uiR2EdShortMinutes"):toUtf8() .. " " end
timeLimitText = timeLimitText .. secNb .. i18n.get("uiR2EdShortSeconds"):toUtf8()
local timeLimitText = i18n.get("uiR2EdFor") .. " "
if hourNb ~= 0 then timeLimitText = timeLimitText .. hourNb .. i18n.get("uiR2EdShortHours") .. " " end
if minNb ~= 0 then timeLimitText = timeLimitText .. minNb .. i18n.get("uiR2EdShortMinutes") .. " " end
timeLimitText = timeLimitText .. secNb .. i18n.get("uiR2EdShortSeconds")
activityTime = timeLimitText
@ -966,7 +960,7 @@ Logic.Components.ActivitySequence = {
local index = r2.logicComponents:searchElementIndex(this)
if index >= 0 then
name = i18n.get("uiR2EdSeq"):toUtf8() .. index
name = i18n.get("uiR2EdSeq") .. index
end
end
@ -2601,32 +2595,32 @@ function component:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["starts dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStart" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatSeqStart" ):toUtf8()},
["stops dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStop" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatSeqStop" ):toUtf8()},
["starts chat"] = { menu=i18n.get( "uiR2AA0ChatStepStart" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatStepStart" ):toUtf8()},
["continues dialog"] = { menu=i18n.get( "uiR2AA0ChatStepContinue" ):toUtf8(),
text=i18n.get( "uiR2AA1ChatStepContinue" ):toUtf8()},
["starts dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStart" ),
text=i18n.get( "uiR2AA1ChatSeqStart" )},
["stops dialog"] = { menu=i18n.get( "uiR2AA0ChatSeqStop" ),
text=i18n.get( "uiR2AA1ChatSeqStop" )},
["starts chat"] = { menu=i18n.get( "uiR2AA0ChatStepStart" ),
text=i18n.get( "uiR2AA1ChatStepStart" )},
["continues dialog"] = { menu=i18n.get( "uiR2AA0ChatStepContinue" ),
text=i18n.get( "uiR2AA1ChatStepContinue" )},
},
["Events"] = {
["start of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqStart" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatSeqStart" ):toUtf8()},
["end of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqEnd" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatSeqEnd" ):toUtf8()},
["start of chat"] = { menu=i18n.get( "uiR2Event0ChatStepStart" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatStepStart" ):toUtf8()},
["end of chat"] = { menu=i18n.get( "uiR2Event0ChatStepEnd" ):toUtf8(),
text=i18n.get( "uiR2Event1ChatStepEnd" ):toUtf8()},
["start of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqStart" ),
text=i18n.get( "uiR2Event1ChatSeqStart" )},
["end of dialog"] = { menu=i18n.get( "uiR2Event0ChatSeqEnd" ),
text=i18n.get( "uiR2Event1ChatSeqEnd" )},
["start of chat"] = { menu=i18n.get( "uiR2Event0ChatStepStart" ),
text=i18n.get( "uiR2Event1ChatStepStart" )},
["end of chat"] = { menu=i18n.get( "uiR2Event0ChatStepEnd" ),
text=i18n.get( "uiR2Event1ChatStepEnd" )},
},
["Conditions"] = {
["is in dialog"] = { menu=i18n.get( "uiR2Test0ChatSeq" ):toUtf8(),
text=i18n.get( "uiR2Test1ChatSeq" ):toUtf8()},
["is not in dialog"] = { menu=i18n.get( "uiR2Test0ChatNotSeq" ):toUtf8(),
text=i18n.get( "uiR2Test1ChatNotSeq" ):toUtf8()},
["is in chat"] = { menu=i18n.get( "uiR2Test0ChatStep" ):toUtf8(),
text=i18n.get( "uiR2Test1ChatStep" ):toUtf8()},
["is in dialog"] = { menu=i18n.get( "uiR2Test0ChatSeq" ),
text=i18n.get( "uiR2Test1ChatSeq" )},
["is not in dialog"] = { menu=i18n.get( "uiR2Test0ChatNotSeq" ),
text=i18n.get( "uiR2Test1ChatNotSeq" )},
["is in chat"] = { menu=i18n.get( "uiR2Test0ChatStep" ),
text=i18n.get( "uiR2Test1ChatStep" )},
}
}
return logicTranslations

@ -204,9 +204,7 @@ function r2.logicComponents:updateElementTitle(classUI, eltUI, showPartIndex)
-- title
local title = eltUI:find("title")
assert(title)
local uc_title = ucstring()
uc_title:fromUtf8(partIndex..eltName)
title.uc_hardtext_format = uc_title
title.text_format = partIndex..eltName
end
------ REMOVE ELEMENT INST ----------------------------------------

@ -16,7 +16,7 @@ local logicEntity =
DisplayerPropertiesParams = "logicEntityPropertySheetDisplayer",
PermanentTreeIcon = "r2ed_icon_permanent_macro_components.tga",
TreeIcon = "r2ed_icon_macro_components.tga",
SelectBarType = i18n.get("uiR2EDMacroComponents"):toUtf8(),
SelectBarType = i18n.get("uiR2EDMacroComponents"),
Prop =
{
@ -229,7 +229,6 @@ local logicEntity =
assert(r2.getLogicAttribute(this.Class, eventCategory, eventType))
end
local uc_eventType = ucstring()
local menuTitle = r2.getLogicAttribute(this.Class, eventCategory, eventType)
local addLine = true
@ -238,8 +237,7 @@ local logicEntity =
end
if addLine then
uc_eventType:fromUtf8(menuTitle.menu)
subMenu:addLine(uc_eventType, "lua",
subMenu:addLine(menuTitle.menu, "lua",
"r2.events:setEventType('".. eventType .."','" .. tostring(endRequest) .. "','" .. eventCategory .. "')", eventType)
end
end
@ -254,26 +252,26 @@ local logicEntity =
function logicEntity:getLogicTranslations()
local logicTranslations = {
["ApplicableActions"] = {
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ):toUtf8(),
text=i18n.get( "uiR2AA1Activate" ):toUtf8()},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ):toUtf8(),
text=i18n.get( "uiR2AA1Deactivate" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ):toUtf8(),
text=i18n.get( "uiR2AA1Trigger" ):toUtf8()},
["activate"] = { menu=i18n.get( "uiR2AA0Activate" ),
text=i18n.get( "uiR2AA1Activate" )},
["deactivate"] = { menu=i18n.get( "uiR2AA0Deactivate" ),
text=i18n.get( "uiR2AA1Deactivate" )},
["trigger"] = { menu=i18n.get( "uiR2AA0Trigger" ),
text=i18n.get( "uiR2AA1Trigger" )},
},
["Events"] = {
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ):toUtf8(),
text=i18n.get( "uiR2Event1Activation" ):toUtf8()},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ):toUtf8(),
text=i18n.get( "uiR2Event1Deactivation" ):toUtf8()},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ):toUtf8(),
text=i18n.get( "uiR2Event1Trigger" ):toUtf8()},
["activation"] = { menu=i18n.get( "uiR2Event0Activation" ),
text=i18n.get( "uiR2Event1Activation" )},
["deactivation"] = { menu=i18n.get( "uiR2Event0Deactivation" ),
text=i18n.get( "uiR2Event1Deactivation" )},
["trigger"] = { menu=i18n.get( "uiR2Event0Trigger" ),
text=i18n.get( "uiR2Event1Trigger" )},
},
["Conditions"] = {
["is active"] = { menu=i18n.get( "uiR2Test0Active" ):toUtf8(),
text=i18n.get( "uiR2Test1Active" ):toUtf8()},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ):toUtf8(),
text=i18n.get( "uiR2Test1Inactive" ):toUtf8()},
["is active"] = { menu=i18n.get( "uiR2Test0Active" ),
text=i18n.get( "uiR2Test1Active" )},
["is inactive"] = { menu=i18n.get( "uiR2Test0Inactive" ),
text=i18n.get( "uiR2Test1Inactive" )},
}
}
return logicTranslations
@ -299,9 +297,7 @@ end
--
-- local entitiesTable = r2.Scenario:getAllInstancesByType(this.Name)
-- for key, entity in pairs(entitiesTable) do
-- local uc_name = ucstring()
-- uc_name:fromUtf8(entity.Name)
-- subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
-- subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
-- end
--
-- if table.getn(entitiesTable)==0 then
@ -338,9 +334,7 @@ function logicEntity.initLogicEntitiesInstancesMenu(this, subMenu, calledFunctio
local entity = enumerator:next()
if not entity then break end
found= true
local uc_name = ucstring()
uc_name:fromUtf8(entity.Name)
subMenu:addLine(uc_name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", calledFunction.."('".. entity.InstanceId .."')", entity.InstanceId)
end
if not found then
subMenu:addLine(i18n.get("uiR2EdNoSelelection"), "", "", "")

@ -66,13 +66,13 @@ function r2.miniActivities:updateSequenceButtonBar()
end
end
local uc_sequ = ucstring()
local sequ = ""
if sequenceInst and sequenceInst.User.Deleted~=true then
uc_sequ:fromUtf8(sequenceInst:getName())
sequ = sequenceInst:getName()
else
uc_sequ = i18n.get("uiR2EDSequences")
sequ = i18n.get("uiR2EDSequences")
end
sequencesButton.uc_hardtext = uc_sequ
sequencesButton.text = sequ
end
@ -145,9 +145,7 @@ function r2.miniActivities:updateMiniActivityView()
assert(place)
activityType = activityType .. " '" .. place.Name .."'"
end
local uc_type = ucstring()
uc_type:fromUtf8(activityType)
activityText.uc_hardtext = uc_type
activityText.text = activityType
else
decalErased = decalErased+1
end
@ -159,7 +157,7 @@ function r2.miniActivities:updateMiniActivityView()
if (sequenceInst.Components.Size==0) or (sequenceInst.Components.Size==1 and erasedInstId~=nil)
or (startCount == 0) then
noActivityLabel.active = true
noActivityLabel.uc_hardtext = i18n.get("uiR2EdNoActivity")
noActivityLabel.text = i18n.get("uiR2EdNoActivity")
else
noActivityLabel.active = false
end
@ -167,7 +165,7 @@ function r2.miniActivities:updateMiniActivityView()
else
noActivityLabel.active = true
noActivityLabel.uc_hardtext = i18n.get("uiR2EdNoSequence")
noActivityLabel.text = i18n.get("uiR2EdNoSequence")
end
-- hide remaining mini activity templates

@ -48,8 +48,7 @@ local plotItemNamePrefix = i18n.get("uiR2EDPlotItemNamePrefix")
function plotItem.getDisplayName(this)
r2.ScratchUCStr:fromUtf8(this.Name)
return concatUCString(plotItemNamePrefix, r2.ScratchUCStr)
return plotItemNamePrefix..this.Name
end
function plotItem.isNextSelectable(this)
@ -59,7 +58,7 @@ end
---------------------------------------------------------------------------------------------------------
-- get select bar type
function plotItem.SelectBarType(this)
return i18n.get("uiR2EDPlotItems"):toUtf8()
return i18n.get("uiR2EDPlotItems")
end
---------------------------------------------------------------------------------------------------------
@ -80,10 +79,6 @@ r2.registerComponent(plotItem)
-- // PRIVATE //
-- /////////////
local itemUCName = ucstring() -- keep a ucstring to avoid creation of string on the fly
local itemUCDesc = ucstring() -- keep a ucstring to avoid creation of string on the fly
local itemUCComment = ucstring() -- keep a ucstring to avoid creation of string on the fly
local plotItemSheetToDBPath = {}
local plotItemSheetNbRef = {} -- for each plot item sheet, store the number of references on it
@ -107,18 +102,15 @@ r2.PlotItemDisplayerCommon = {}
-- update name for tooltip display + availability
function r2.PlotItemDisplayerCommon:updateNameAndAvailability(instance, sheetId)
if plotItemSheetNbRef[sheetId] == 0 then
r2:setPlotItemInfos(sheetId, i18n.get("uiR2EDPlotItemDefaultName"), ucstring(), ucstring())
r2:setPlotItemInfos(sheetId, i18n.get("uiR2EDPlotItemDefaultName"), "", "")
setDbProp(plotItemSheetToDBPath[sheetId], sheetId) -- available again
elseif plotItemSheetNbRef[sheetId] > 1 then
-- duplicated slot, may happen during concurrent edition (bad luck)
r2:setPlotItemInfos(sheetId, i18n.get("uiR2EDDuplicatedPlotItemName"), ucstring(), ucstring())
r2:setPlotItemInfos(sheetId, i18n.get("uiR2EDDuplicatedPlotItemName"), "", "")
setDbProp(plotItemSheetToDBPath[sheetId], 0) -- available again
r2.PlotItemDisplayerCommon:touch() -- force to refresh the icon display
else
itemUCName:fromUtf8(instance.Name)
itemUCDesc:fromUtf8(instance.Desc)
itemUCComment:fromUtf8(instance.Comment)
r2:setPlotItemInfos(sheetId, itemUCName, itemUCDesc, itemUCComment)
r2:setPlotItemInfos(sheetId, instance.Name, instance.Desc, instance.Comment)
setDbProp(plotItemSheetToDBPath[sheetId], 0) -- available again
end
end
@ -260,9 +252,8 @@ function r2.PlotItemDisplayerCommon:updateAll()
setDbProp("LOCAL:R2:PLOT_ITEMS:" .. tostring(index) ..":SHEET", v.SheetId)
local slot = groupListSheet["item_" .. tostring(index)]
slot.but.pushed = (v == r2:getSelectedInstance()) -- update selection
itemUCName:fromUtf8(v.Name)
self:updateSheetColor(slot.sheet, v.SheetId)
slot.t.uc_hardtext = itemUCName
slot.t.text = v.Name
slot.t.global_color = true
slot.active=true
index = index + 1
@ -275,7 +266,7 @@ function r2.PlotItemDisplayerCommon:updateAll()
local slot = groupListSheet["item_" .. tostring(index)]
slot.but.pushed = false
slot.active=true
slot.t.uc_hardtext = i18n.get("uiR2EDCreateNewItem")
slot.t.text = i18n.get("uiR2EDCreateNewItem")
slot.t.global_color = false
slot.sheet.color = validItemColor
window:find("new_plot_item").frozen = false
@ -422,7 +413,7 @@ function r2.PlotItemsPanel:requestNewItem(sheetId)
r2.requestNewAction(i18n.get("uiR2EDCreateNewPlotItemAction"))
local newItem = r2.newComponent("PlotItem")
newItem.SheetId = sheetId
newItem.Name = i18n.get("uiR2EDPlotItemDefaultName"):toUtf8()
newItem.Name = i18n.get("uiR2EDPlotItemDefaultName")
newItem.Desc = ""
newItem.Comment = ""
r2.requestInsertNode(r2.Scenario.InstanceId, "PlotItems", -1, "", newItem)
@ -444,7 +435,7 @@ function r2.PlotItemsPanel:reinit()
if sheetId ~= 0 then
plotItemSheetToDBPath[sheetId] = availableDbPath
plotItemSheetNbRef[sheetId] = 0
r2:setPlotItemInfos(sheetId, defaultPlotItemName, ucstring(), ucstring())
r2:setPlotItemInfos(sheetId, defaultPlotItemName, "", "")
setDbProp(availableDbPath, getDbProp(refDbPath))
end
--local slot = groupListSheet["item_" .. tostring(k)]

@ -13,18 +13,14 @@ Translator.PredatorEnemyFaction = "Player|guard|bandit|herbivore|karavan";
function printMsg(str)
messageBox(str)
debugInfo(colorTag(255,255,0)..str)
local ucStringMsg = ucstring()
ucStringMsg:fromUtf8(str)
displaySystemInfo(ucStringMsg, "BC")
displaySystemInfo(str, "BC")
messageBox(str)
end
function printError( str)
local msg = "Translation WRN:"
debugInfo(colorTag(255,0,0)..msg..str)
-- local ucStringMsg = ucstring()
-- ucStringMsg:fromUtf8(str)
-- displaySystemInfo(ucStringMsg, "BC")
-- displaySystemInfo(str, "BC")
--messageBox(str)
assert(nil)
end
@ -34,10 +30,8 @@ r2.Translator.MultilineBc = {}
function Translator.updateEachSecond()
if table.getn( Translator.MultilineBc ) > 0 then
local msg=table.remove(Translator.MultilineBc, 1)
if msg then
local ucStringMsg = ucstring()
ucStringMsg:fromUtf8(msg)
displaySystemInfo(ucStringMsg, "BC")
if msg then
displaySystemInfo(msg, "BC")
end
end
end
@ -60,9 +54,8 @@ function printWarning( str)
-- Just report the last error
if (r2.LastTranslationErrorMsg == nil) then
r2.LastTranslationErrorMsg = str
local ucStringMsg = ucstring("Translation Error")
-- ucStringMsg:fromUtf8(r2.LastTranslationErrorMsg)
displaySystemInfo(ucStringMsg, "BC")
--displaySystemInfo(str, "BC")
displaySystemInfo("Translation Error", "BC")
messageBox(str)
end
if devMode then
@ -4384,18 +4377,18 @@ end
function Translator.addActivationToTranslations(logicTranslations)
if logicTranslations.ApplicableActions == nil then logicTranslations.ApplicableActions = {} end
--logicTranslations.ApplicableActions.activate = {menu=i18n.get("uiR2EdActivate"):toUtf8(), text="activates"}
--logicTranslations.ApplicableActions.deactivate = {menu=i18n.get("uiR2EdDesactivate"):toUtf8(), text="deactivates"}
--logicTranslations.ApplicableActions.trigger = {menu=i18n.get("uiR2EdTrigger"):toUtf8(), text="triggers"}
--logicTranslations.ApplicableActions.activate = {menu=i18n.get("uiR2EdActivate"), text="activates"}
--logicTranslations.ApplicableActions.deactivate = {menu=i18n.get("uiR2EdDesactivate"), text="deactivates"}
--logicTranslations.ApplicableActions.trigger = {menu=i18n.get("uiR2EdTrigger"), text="triggers"}
if logicTranslations.Events == nil then logicTranslations.Events = {} end
--logicTranslations.Events.activation = {menu=i18n.get("uiR2EdActivation"):toUtf8(), text=r2:lowerTranslate("uiR2EdActivation")}
--logicTranslations.Events.deactivation = {menu=i18n.get("uiR2EdDesactivation"):toUtf8(), text=r2:lowerTranslate("uiR2EdDesactivation")}
--logicTranslations.Events.trigger = {menu=i18n.get("uiR2EdTrigger"):toUtf8(), text=r2:lowerTranslate("uiR2EdTrigger")}
--logicTranslations.Events.activation = {menu=i18n.get("uiR2EdActivation"), text=r2:lowerTranslate("uiR2EdActivation")}
--logicTranslations.Events.deactivation = {menu=i18n.get("uiR2EdDesactivation"), text=r2:lowerTranslate("uiR2EdDesactivation")}
--logicTranslations.Events.trigger = {menu=i18n.get("uiR2EdTrigger"), text=r2:lowerTranslate("uiR2EdTrigger")}
if logicTranslations.Conditions == nil then logicTranslations.Conditions = {} end
--logicTranslations.Conditions["is active"] = {menu=i18n.get("uiR2EdIsActive"):toUtf8(), text=r2:lowerTranslate("uiR2EdIsActive")}
--logicTranslations.Conditions["is inactive"] = {menu=i18n.get("uiR2EdIsInactive"):toUtf8(), text=r2:lowerTranslate("uiR2EdIsInactive")}
--logicTranslations.Conditions["is active"] = {menu=i18n.get("uiR2EdIsActive"), text=r2:lowerTranslate("uiR2EdIsActive")}
--logicTranslations.Conditions["is inactive"] = {menu=i18n.get("uiR2EdIsInactive"), text=r2:lowerTranslate("uiR2EdIsInactive")}
return logicTranslations
end

@ -33,11 +33,11 @@ r2.acts = {
ecosystemNames =
{
["r2_desert"] = i18n.get("uiR2EDEcosystemDesert"):toUtf8(),
["r2_jungle"] = i18n.get("uiR2EDEcosystemJungle"):toUtf8(),
["r2_forest"] = i18n.get("uiR2EDEcosystemForest"):toUtf8(),
["r2_lakes"] = i18n.get("uiR2EDEcosystemLacustre"):toUtf8(),
["r2_roots"] = i18n.get("uiR2EDEcosystemPrimeRoots"):toUtf8(),
["r2_desert"] = i18n.get("uiR2EDEcosystemDesert"),
["r2_jungle"] = i18n.get("uiR2EDEcosystemJungle"),
["r2_forest"] = i18n.get("uiR2EDEcosystemForest"),
["r2_lakes"] = i18n.get("uiR2EDEcosystemLacustre"),
["r2_roots"] = i18n.get("uiR2EDEcosystemPrimeRoots"),
},
selectedIslandButtonId = nil,
@ -78,7 +78,7 @@ r2.acts = {
-------------------------- to sort islands in function of their translated name -----------
function r2.acts:getIslandNb(islandName)
local islandTrans = i18n.get(islandName):toUtf8()
local islandTrans = i18n.get(islandName)
local islandNb = string.sub(islandTrans, -5)
local endLen = 6
if string.sub(islandNb, 1, 1) ~= " " then
@ -155,9 +155,7 @@ function r2.acts:initActsEditor()
local ecoButton = ecoButtonsGr:find(ecoSysName):find("eco_button")
assert(ecoButton)
local uc_package = ucstring()
uc_package:fromUtf8(i18n.get("uiR2EDEcosystemPackage"):toUtf8().." : "..maxPackage)
ecoButton.tooltip = uc_package
ecoButton.tooltip = i18n.get("uiR2EDEcosystemPackage").." : "..maxPackage
for i=0, nbLines-1 do
local lineGr = createGroupInstance("template_line", ecoGr.id, {id="line"..i, h=buttonDim})
@ -319,14 +317,14 @@ function r2.acts:openScenarioActEditor(newScenario, noCancelOption, rebuildFirst
-- act and scenario names
if self.createNewScenario or rebuildFirstAct then
self.currentAct.name = i18n.get("uiR2EDDefaultActTitle"):toUtf8() .. " 1"
self.currentAct.name = i18n.get("uiR2EDDefaultActTitle") .. " 1"
else
local actNb = r2.Scenario.Acts.Size
self.currentAct.name = i18n.get("uiR2EDDefaultActTitle"):toUtf8() .. " " .. actNb
self.currentAct.name = i18n.get("uiR2EDDefaultActTitle") .. " " .. actNb
end
if self.createNewScenario == true then
self.currentScenario.name = i18n.get("uiR2EDNewScenario"):toUtf8()
self.currentScenario.name = i18n.get("uiR2EDNewScenario")
else
r2.ScenarioWindow:setActNotes()
@ -497,10 +495,8 @@ function r2.acts:openPreviousIslandsActs()
locationList:addChild(buttonIsland)
buttonIsland.Env.InstanceId = location.InstanceId
local uc_island = ucstring()
uc_island:fromUtf8(location.Name)
buttonIsland:find("button"):find("center_button").tooltip = uc_island
buttonIsland:find("selected_button"):find("center_button").tooltip = uc_island
buttonIsland:find("button"):find("center_button").tooltip = location.Name
buttonIsland:find("selected_button"):find("center_button").tooltip = location.Name
-- init text
local textList = buttonIsland:find("text_list")
@ -523,10 +519,7 @@ function r2.acts:openPreviousIslandsActs()
prevText:addColoredTextChild(act_text, 200, 120, 0, 255)
if act.ShortDescription~="" then
act_text = act.ShortDescription
local uc_act = ucstring()
uc_act:fromUtf8(act_text)
prevText:addTextChild(uc_act)
prevText:addTextChild(act_text)
end
end
@ -687,11 +680,9 @@ function r2.acts:openEcosystemIslands(ecoSystemName)
-- "choose island" title
local title = actsUI:find("choose_island"):find("choose_island_title")
assert(title)
-- doesn't work in all language local titleText = " " .. i18n.get("uiR2EDChooseIsland"):toUtf8() .." " .. self.ecosystemNames[self.ecoSystemName] .. " " .. i18n.get("uiR2EDEcosystem"):toUtf8() .. " "
local titleText = " " .. i18n.get("uiR2EDChooseIsland"):toUtf8() .. self.ecosystemNames[self.ecoSystemName] .. " "
local uc_title = ucstring()
uc_title:fromUtf8(titleText)
title.uc_hardtext = uc_title
-- doesn't work in all language local titleText = " " .. i18n.get("uiR2EDChooseIsland") .." " .. self.ecosystemNames[self.ecoSystemName] .. " " .. i18n.get("uiR2EDEcosystem") .. " "
local titleText = " " .. i18n.get("uiR2EDChooseIsland") .. self.ecosystemNames[self.ecoSystemName] .. " "
title.text = titleText
end
--------------------------------------------------------------------------------------
@ -752,11 +743,9 @@ function r2.acts:openIslandCard(islandName)
-- card title
local title = actsUI:find("island_images"):find("card_title")
assert(title)
-- doesn't work in all language local titleText = " " .. i18n.get("uiR2EDZoomOn"):toUtf8() .." '" .. i18n.get(islandName):toUtf8() .. "' " .. i18n.get("uiR2EDIsland"):toUtf8() .. " "
local titleText = " " .. i18n.get("uiR2EDZoomOn"):toUtf8() .. i18n.get(islandName):toUtf8() .. " "
local uc_title = ucstring()
uc_title:fromUtf8(titleText)
title.uc_hardtext = uc_title
-- doesn't work in all language local titleText = " " .. i18n.get("uiR2EDZoomOn") .." '" .. i18n.get(islandName) .. "' " .. i18n.get("uiR2EDIsland") .. " "
local titleText = " " .. i18n.get("uiR2EDZoomOn") .. i18n.get(islandName) .. " "
title.text = titleText
local islandTable = self.islands[self.ecoSystemName][self:getIslandNb(islandName)].table
local islandW, islandH = (islandTable.xmax - islandTable.xmin)*enlargingFactor, (islandTable.ymax - islandTable.ymin)*enlargingFactor
@ -866,7 +855,7 @@ function r2.acts:chooseLocationName()
local editText = chooseNamePopup:find("edit_box_group")
assert(editText)
local name = editText.uc_input_string:toUtf8()
local name = editText.input_string
-- check location name duplication
if not self.createNewScenario then
@ -914,7 +903,7 @@ function r2.acts:chooseScenarioActName()
assert(actGr)
local actEditText = actGr:find("edit_box_group")
assert(actEditText)
local actName = actEditText.uc_input_string:toUtf8()
local actName = actEditText.input_string
local scenarioName = ""
local scenarioEditText
@ -926,7 +915,7 @@ function r2.acts:chooseScenarioActName()
scenarioEditText = scenarioGr:find("edit_box_group")
assert(scenarioEditText)
scenarioName = scenarioEditText.uc_input_string:toUtf8()
scenarioName = scenarioEditText.input_string
end
if (self.createNewScenario and scenarioName~="" and actName~="") or (not self.createNewScenario and actName~="") then
@ -997,7 +986,7 @@ function r2.acts:createScenario()
local act =r2.newComponent("Act")
local features = act.Features
local tmpDefault = r2.newComponent("DefaultFeature")
act.Name = i18n.get("uiR2EDBaseAct"):toUtf8()
act.Name = i18n.get("uiR2EDBaseAct")
table.insert(features, tmpDefault)
table.insert(scenario.Acts, act)
@ -1006,7 +995,7 @@ function r2.acts:createScenario()
local features = act.Features
local tmpDefault = r2.newComponent("DefaultFeature")
r2.ActUIDisplayer.LastSelfCreatedActInstanceId = act.InstanceId
--act.Name = i18n.get("uiR2EDAct1"):toUtf8() .. ":" .. r2.currentAct.name
--act.Name = i18n.get("uiR2EDAct1") .. ":" .. r2.currentAct.name
act.Name = self.currentAct.name
act.WeatherValue = self.currentAct.weather
local manualWeather = 0
@ -1054,7 +1043,7 @@ function r2.acts:createAct()
end
r2.ActUIDisplayer.LastSelfCreatedActInstanceId = act.InstanceId
local actNb = r2.Scenario.Acts.Size
--act.Name = i18n.get("uiR2EDDefaultActTitle"):toUtf8() .. actNb .. ":" .. r2.currentAct.name
--act.Name = i18n.get("uiR2EDDefaultActTitle") .. actNb .. ":" .. r2.currentAct.name
act.Name = self.currentAct.name
act.WeatherValue = self.currentAct.weather
local manualWeather = 0
@ -1108,7 +1097,7 @@ function r2.acts:openLocationName()
local editText = chooseNamePopup:find("edit_box_group")
assert(editText)
editText.uc_input_string = i18n.get(self.currentLocation.islandName)
editText.input_string = i18n.get(self.currentLocation.islandName)
editText:setFocusOnText()
end

@ -25,12 +25,13 @@ function r2.ui.AnimActs:popMenu()
--
if not acts then return end
for k = 2, table.getn(acts) do
local str = ""
if acts[k].Name == "" then
r2.ScratchUCStr = i18n.get("uiR2EDUnamedAct")
str = i18n.get("uiR2EDUnamedAct")
else
r2.ScratchUCStr:fromUtf8(acts[k].Name)
str = acts[k].Name
end
rootMenu:addLine(r2.ScratchUCStr, "lua", "r2.ui.AnimActs:chooseAct(" .. tostring(k) .. ")", "")
rootMenu:addLine(str, "lua", "r2.ui.AnimActs:chooseAct(" .. tostring(k) .. ")", "")
end
launchContextMenuInGame(menuName)
local but = getUI("ui:interface:r2ed_testbar"):find("r2ed_anim_acts")

@ -22,8 +22,7 @@ function r2.ui.AnimUserTriggers:popMenu()
if not triggers then return end
for k = 1, table.getn(triggers) do
if triggers[k].Act == 0 or triggers[k].Act == r2.getCurrentActIndex() then
r2.ScratchUCStr:fromUtf8(triggers[k].Name)
rootMenu:addLine(r2.ScratchUCStr, "lua",
rootMenu:addLine(triggers[k].Name, "lua",
string.format("r2.ui.AnimUserTriggers:fireTrigger(%d, %d)", triggers[k].Act, triggers[k].Id), "")
end
end
@ -46,8 +45,7 @@ function r2.ui.AnimUserTriggers:fireTrigger(triggerAct, triggerId)
r2.triggerUserTrigger(triggerAct, triggerId)
local trig = self:findTrigger(triggerAct, triggerId)
if trig then
r2.ScratchUCStr:fromUtf8(trig.Name)
displaySystemInfo(concatUCString(i18n.get("uiR2EDTriggering"), r2.ScratchUCStr), "BC")
displaySystemInfo(concatString(i18n.get("uiR2EDTriggering"), trig.Name), "BC")
end
end

@ -113,21 +113,21 @@ end
--***********************************************************************
function CharTracking:initRaceTypes()
for k = 0, 3 do
self.RaceTypeToUtf8[k] = i18n.get("uiRAP_CharRace_" .. tostring(k)):toUtf8()
self.RaceTypeToUtf8[k] = i18n.get("uiRAP_CharRace_" .. tostring(k))
end
end
--***********************************************************************
function CharTracking:initReligionTypes()
for k = 0, 2 do
self.ReligionTypeToUtf8[k] = i18n.get("uiRAP_CharReligion_" .. tostring(k)):toUtf8()
self.ReligionTypeToUtf8[k] = i18n.get("uiRAP_CharReligion_" .. tostring(k))
end
end
--***********************************************************************
function CharTracking:initLevelTypes()
for k = 0, 5 do
self.LevelTypeToUtf8[k] = i18n.get("uiRAP_CharLevel_" .. tostring(k)):toUtf8()
self.LevelTypeToUtf8[k] = i18n.get("uiRAP_CharLevel_" .. tostring(k))
end
end
@ -147,15 +147,11 @@ function CharTracking:getColumn(name)
return getUI("ui:interface:ring_chars_tracking:content:main:enclosing:columns:getw:column_group:" .. name .. ":values")
end
--***********************************************************************
function CharTracking:getSelectList()
return getUI("ui:interface:ring_chars_tracking:content:main:enclosing:columns:getw:select")
end
local scratchUCStr = ucstring()
--***********************************************************************
function CharTracking:newTemplate(name, cache)
local group
@ -172,8 +168,7 @@ end
-- build a new text group from utf8 text
function CharTracking:newTextLabel(value)
local group = self:newTemplate("rap_text", self.TextCache)
scratchUCStr:fromUtf8(value)
group:find("t").uc_hardtext_single_line_format = scratchUCStr
group:find("t").text_single_line_format = value
return group
end
@ -181,15 +176,14 @@ end
-- build a new text group from utf8 text
function CharTracking:newCenteredTextLabel(value)
local group = self:newTemplate("rap_text_centered", self.CenteredTextCache)
scratchUCStr:fromUtf8(value)
group:find("t").uc_hardtext_single_line_format = scratchUCStr
group:find("t").text_single_line_format = value
return group
end
--***********************************************************************
function CharTracking:newNumberLabel(value)
local group = self:newTemplate("rap_number", self.NumberCache)
group:find("t").uc_hardtext_single_line_format = tostring(value)
group:find("t").text_single_line_format = tostring(value)
return group
end
@ -381,7 +375,7 @@ function CharTracking:setMessage(msg, color)
-- The version below set the msg in the middle of the window
--local errorTxt = self:getWindow():find("errorMsg")
errorTxt.uc_hardtext = msg
errorTxt.text = msg
errorTxt.color = color
errorTxt.active=true
--self:getWindow():invalidateCoords()
@ -493,10 +487,10 @@ function CharTracking:onLineRightClick()
self:onLineLeftClick()
local menu = getUI("ui:interface:ring_char_menu")
menu:find("tell").uc_hardtext = ucstring(i18n.get("uiRAP_MenuCharTell"):toUtf8() .. "'" .. self:getCharFromId(self.SelectedCharId).Char .."'")
menu:find("teleport").uc_hardtext = ucstring(i18n.get("uiRAP_MenuTeleportTo"):toUtf8() .. "'" .. self:getCharFromId(self.SelectedCharId).Char.."'")
menu:find("kick").uc_hardtext = ucstring(i18n.get("uiRAP_MenuKick"):toUtf8() .. "'" .. self:getCharFromId(self.SelectedCharId).Char.."'")
menu:find("unkick").uc_hardtext = ucstring(i18n.get("uiRAP_MenuUnkick"):toUtf8() .. "'" .. self:getCharFromId(self.SelectedCharId).Char.."'")
menu:find("tell").text = i18n.get("uiRAP_MenuCharTell") .. "'" .. self:getCharFromId(self.SelectedCharId).Char .."'"
menu:find("teleport").text = i18n.get("uiRAP_MenuTeleportTo") .. "'" .. self:getCharFromId(self.SelectedCharId).Char.."'"
menu:find("kick").text = i18n.get("uiRAP_MenuKick") .. "'" .. self:getCharFromId(self.SelectedCharId).Char.."'"
menu:find("unkick").text = i18n.get("uiRAP_MenuUnkick") .. "'" .. self:getCharFromId(self.SelectedCharId).Char.."'"
menu:find("unkick").grayed = not self:isKicked(self:getCharFromId(self.SelectedCharId).Flags)
menu:find("kick").grayed = not self:isConnected(self:getCharFromId(self.SelectedCharId).Flags)
@ -507,9 +501,7 @@ end
--***********************************************************************
function CharTracking:onTell()
debugInfo("tell to owner of session" .. self.SelectedCharId)
char = ucstring()
char:fromUtf8(self:getCharFromId(self.SelectedCharId).Char)
tell(char, i18n.get("uiRAP_AskForTall"))
tell(self:getCharFromId(self.SelectedCharId).Char, i18n.get("uiRAP_AskForTall"))
end
--***********************************************************************
@ -646,7 +638,7 @@ function CharTracking:onDraw()
-- refreshText.active = false
--else
-- refreshText.active = true
-- refreshText.uc_hardtext = waitText
-- refreshText.text = waitText
--end
end
else

@ -85,12 +85,12 @@ end
function r2:updateContextualCommandTooltip(index)
local command = r2.ContextualCommands.ToolbarCommands[index + 1]
assert(command)
local keyName = ucstring(runExpr(string.format("getKey('r2ed_context_command', 'commandId=%s')", command.Id)))
local keyName = runExpr(string.format("getKey('r2ed_context_command', 'commandId=%s')", command.Id))
if keyName == i18n.get("uiNotAssigned") then
-- no associated key
setContextHelpText(i18n.get(command.TextId))
else
setContextHelpText(concatUCString(i18n.get(command.TextId), " (", keyName, ")"))
setContextHelpText(concatString(i18n.get(command.TextId), " (", keyName, ")"))
end
end
@ -111,13 +111,13 @@ function r2.ContextualCommands:setupMenu(instance, menu)
-- end
-- debugInfo("Line with id 'dynamic_content_start' has index " .. tostring(rm:getLineFromId('dynamic_content_start')))
-- debugInfo("Line 6 is separator = " .. tostring(rm:isSeparator(6)))
-- rm:addLine(ucstring("toto"), "lua", "debugInfo('pouet')", "toto")
-- rm:addLine("toto", "lua", "debugInfo('pouet')", "toto")
-- rm:addSeparator()
-- rm:addLine(ucstring("tutu"), "lua", "debugInfo('pouet')", "tutu")
-- rm:addLine(ucstring("titi"), "lua", "debugInfo('pouet')", "titi")
-- rm:addLine("tutu", "lua", "debugInfo('pouet')", "tutu")
-- rm:addLine("titi", "lua", "debugInfo('pouet')", "titi")
-- local titiIndex = rm:getLineFromId('titi')
-- rm:addSeparatorAtIndex(titiIndex)
-- rm:addLine(ucstring("bidon"), "lua", "debugInfo('pouet')", "titi")
-- rm:addLine("bidon", "lua", "debugInfo('pouet')", "titi")
-- debugInfo("################################")
-- end
@ -181,12 +181,12 @@ function r2.ContextualCommands:setupMenu(instance, menu)
end
local keyNameGroup = createGroupInstance("r2_keyname", "", { id = command.Id })
if keyNameGroup then
local keyName = ucstring(runExpr(string.format("getKey('r2ed_context_command', 'commandId=%s')", command.Id)))
local keyName = runExpr(string.format("getKey('r2ed_context_command', 'commandId=%s')", command.Id))
if keyName == i18n.get("uiNotAssigned") then
-- no associated key
keyNameGroup:find("t").uc_hardtext = keyName
keyNameGroup:find("t").text = keyName
else
keyNameGroup:find("t").uc_hardtext = concatUCString(ucstring("(") , keyName, ucstring(")"))
keyNameGroup:find("t").text = "(" ..keyName..")"
end
destNode:setUserGroupRight(line, keyNameGroup)
end

@ -236,7 +236,7 @@ function npcCustomPropertySheetDisplayerTable:updateAllPrivate(instance)
local propWnd = r2:getPropertySheet(instance)
if propWnd.active then
local nameEBox = propWnd:find("Name"):find("eb")
local name = nameEBox.uc_input_string:toUtf8()
local name = nameEBox.input_string
r2:setNpcAttribute(instance.InstanceId, "Name", name)
end
@ -279,8 +279,8 @@ function npcCustomPropertySheetDisplayerTable:updateAllPrivate(instance)
-- update name
local editName = npcUI:find("name").edit_box_group
assert(editName)
editName.uc_input_string = instance:getDisplayName()
npcUI.uc_title = concatUCString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
editName.input_string = instance:getDisplayName()
npcUI.title = concatString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
-- update notes
local editNotes = npcUI:find("small_description")
@ -487,8 +487,8 @@ function npcCustomPropertySheetDisplayerTable:onAttrModified(instance, attribute
if attributeName == "Name" then
local editName = npcUI:find("name").edit_box_group
assert(editName)
editName.uc_input_string = instance:getDisplayName()
npcUI.uc_title = concatUCString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
editName.input_string = instance:getDisplayName()
npcUI.title = concatString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
editName:cancelFocusOnText()
return
end
@ -806,17 +806,17 @@ function r2:initNpcEditor()
local raceCB = npcUI:find("race").combo_box
assert(raceCB)
raceCB:resetTexts()
raceCB:addText(ucstring("Fyros"))
raceCB:addText(ucstring("Matis"))
raceCB:addText(ucstring("Tryker"))
raceCB:addText(ucstring("Zorai"))
raceCB:addText("Fyros")
raceCB:addText("Matis")
raceCB:addText("Tryker")
raceCB:addText("Zorai")
-- sex
local sexCB = npcUI:find("sex").combo_box
assert(sexCB)
sexCB:resetTexts()
sexCB:addText(ucstring(r2.female))
sexCB:addText(ucstring(r2.male))
sexCB:addText(r2.female)
sexCB:addText(r2.male)
-- Equipment
r2:initEquipmentEnv()
@ -832,8 +832,8 @@ function r2:initNpcEditor()
updateBodySetsCB:resetTexts()
for k, v in pairs(r2.tableBodySets) do
bodySetsCB:addText(ucstring(k))
updateBodySetsCB:addText(ucstring(k))
bodySetsCB:addText(k)
updateBodySetsCB:addText(k)
end
-- face sets
@ -845,8 +845,8 @@ function r2:initNpcEditor()
updateFaceSetsCB:resetTexts()
for k, v in pairs(r2.tableFaceSets) do
faceSetsCB:addText(ucstring(k))
updateFaceSetsCB:addText(ucstring(k))
faceSetsCB:addText(k)
updateFaceSetsCB:addText(k)
end
-- face morph
@ -858,8 +858,8 @@ function r2:initNpcEditor()
updateFaceMorphCB:resetTexts()
for k, v in pairs(r2.tableFaceMorph) do
faceMorphCB:addText(ucstring(k))
updateFaceMorphCB:addText(ucstring(k))
faceMorphCB:addText(k)
updateFaceMorphCB:addText(k)
end
bodySetsCB.view_text = r2.emptyComboLine
@ -1090,14 +1090,14 @@ function r2:updateName()
local editName = npcUI:find("name").edit_box_group
assert(editName)
local newString = editName.uc_input_string:toUtf8()
local newString = editName.input_string
local oldString = defaulting(selection.Name, "")
if newString ~= oldString then
r2.requestNewAction(i18n.get("uiR2EDUpdateNpcNameAction"))
r2:setNpcAttribute(selection.InstanceId, "Name", newString)
end
return editName.uc_input_string:toUtf8()
return editName.input_string
end
-- UPDATE NOTES --------------------------------------------------------------------------------
@ -1112,7 +1112,7 @@ function r2:updateNotes()
local editNotes = npcUI:find("small_description")
assert(editNotes)
local newString = editNotes.uc_input_string:toUtf8()
local newString = editNotes.input_string
local oldString = defaulting(selection.Notes, "")
if newString ~= oldString then
r2.requestNewAction(i18n.get("uiR2EDUpdateNpcNotesAction"))
@ -1344,10 +1344,10 @@ function r2:updateType(existingAction)
r2:setNpcAttribute(selection.InstanceId, "SheetClient", typeElement.SheetClient)
-- Name
local oldName = i18n.get(r2.sheetTypeCB[oldTypeNPC].Translation):toUtf8()
local oldName = i18n.get(r2.sheetTypeCB[oldTypeNPC].Translation)
if selection.Class == "Npc" and string.find(selection.Name, oldName) then
local ucNewName = getUICaller():getText(typeNPC)
local newName = r2:genInstanceName(ucNewName):toUtf8()
local newName = r2:genInstanceName(ucNewName)
r2:setNpcAttribute(selection.InstanceId, "Name", newName)
elseif selection.Name == oldName then
@ -1577,8 +1577,8 @@ function r2:addBodySets()
local bodySetsCombo = npcUI:find("body_sets").combo_box
assert(bodySetsCombo)
bodySetsCombo:addText(editText.uc_input_string)
updateBodySetsCombo:addText(editText.uc_input_string)
bodySetsCombo:addText(editText.input_string)
updateBodySetsCombo:addText(editText.input_string)
-- add new sets in table
local bodySets = npcUI:find("body_sets_scroll_target")
@ -1732,8 +1732,8 @@ function r2:addFaceSets()
local faceSetsCombo = npcUI:find("face_sets").combo_box
assert(faceSetsCombo)
faceSetsCombo:addText(editText.uc_input_string)
updateFaceSetsCombo:addText(editText.uc_input_string)
faceSetsCombo:addText(editText.input_string)
updateFaceSetsCombo:addText(editText.input_string)
-- add new sets in table
local faceSets = npcUI:find("face_sets_scroll_target")
@ -1886,8 +1886,8 @@ function r2:addFaceMorph()
local faceMorphCombo = npcUI:find("face_morph").combo_box
assert(faceMorphCombo)
faceMorphCombo:addText(editText.uc_input_string)
updateFaceMorphCombo:addText(editText.uc_input_string)
faceMorphCombo:addText(editText.input_string)
updateFaceMorphCombo:addText(editText.input_string)
-- add new sets in table
local faceMorph = npcUI:find("face_morph_scroll_target")
@ -2041,7 +2041,7 @@ end
r2.equipmentPalette = {}
r2.itemIndexEquipmentToSelectionText = {}
r2.equipmentEnv = {}
r2.noPiece = i18n.get("uiR2EdNoPiece"):toUtf8()
r2.noPiece = i18n.get("uiR2EdNoPiece")
r2.equipmentAttNb = 6
@ -2146,7 +2146,7 @@ function r2.addR2PlayerEquipment(paletteElt, equipmentTable)
tempTable[equType] = {}
for equName, equFile in pairs(v) do
local tradEquName = i18n.get(equName):toUtf8()
local tradEquName = i18n.get(equName)
if tostring(equType) ~= "hands" then
if equName == "uiR2EDequipment_none" then
table.insert(tempTable[equType], 1, {["trad"]=tradEquName, ["itemFile"]=equFile})
@ -2203,7 +2203,7 @@ function r2:updateEquipment(instance, init)
comboBox:resetTexts()
for k1, v1 in pairs(v) do
comboBox:addText(ucstring(v1.trad))
comboBox:addText(v1.trad)
end
end
@ -2222,8 +2222,8 @@ function r2:updateEquipment(instance, init)
if r2.equipmentSets[equipmentId] then
for k1, v1 in pairs(r2.equipmentSets[equipmentId]) do
comboBox:addText(ucstring(k1))
comboBoxPopup:addText(ucstring(k1))
comboBox:addText(k1)
comboBoxPopup:addText(k1)
end
end
comboBox.view_text = r2.emptyComboLine
@ -2433,8 +2433,8 @@ function r2:addEquipmentSet()
local equSetCombo = npcUI:find("equipment_sets").combo_box
assert(equSetCombo)
updateEquSetCombo:addText(editText.uc_input_string)
equSetCombo:addText(editText.uc_input_string)
updateEquSetCombo:addText(editText.input_string)
equSetCombo:addText(editText.input_string)
if r2.equipmentSets[selection.Equipment] == nil then
r2.equipmentSets[selection.Equipment] = {}

@ -601,11 +601,9 @@ r2.ActUIDisplayer.LastSelfCreatedActInstanceId = nil -- id of the last act creat
local actTitle = act:getName()
if act==r2.Scenario:getCurrentAct() then
actTitle = actTitle .. " [" .. i18n.get("uiR2EDCurrentActComboBox"):toUtf8() .."]"
actTitle = actTitle .. " [" .. i18n.get("uiR2EDCurrentActComboBox") .."]"
end
local text = ucstring()
text:fromUtf8(actTitle)
comboBox:setText(index - 1, text)
comboBox:setText(index - 1, actTitle)
return
end
end
@ -636,16 +634,13 @@ r2.ActUIDisplayer.LastSelfCreatedActInstanceId = nil -- id of the last act creat
local comboBox = self:getActComboBox()
local tree, macroTree
if not act:isBaseAct() then
local text = ucstring()
if not act:isBaseAct() then
local index = r2.logicComponents:searchElementIndex(act)-2
local actTitle = act:getName()
if type(actTitle) ~= "string" then
text:fromUtf8("bad type for title : " .. type(actTitle))
comboBox:insertText(index, text)
comboBox:insertText("index, bad type for title : " .. type(actTitle))
else
text:fromUtf8(actTitle)
comboBox:insertText(index, text)
comboBox:insertText(index, actTitle)
end
tree = self:findFreeTreeCtrl()

@ -133,9 +133,7 @@ function r2:group(src, target)
-- create a new group
-- debugInfo(colorTag(255, 255, 0) .. "Creating new group")
local newGroup = r2.newComponent("NpcGrpFeature")
local uc_groupName = ucstring()
uc_groupName:fromUtf8(r2.PaletteIdToGroupTranslation[src.Base].. " " .. i18n.get("uiR2EDNameGroup"):toUtf8())
local groupName = r2:genInstanceName(uc_groupName):toUtf8()
local groupName = r2:genInstanceName(r2.PaletteIdToGroupTranslation[src.Base].. " " .. i18n.get("uiR2EDNameGroup"))
newGroup.Name = groupName
--r2.requestSetNode(target.Behavior.InstanceId, "Type", "")
@ -546,20 +544,20 @@ function r2:copy()
r2.ClipBoard = selection:copy()
r2.ClipBoardSrcInstanceId = selection.InstanceId
r2.ClipBoardDisplayName = selection:getDisplayName()
displaySystemInfo(concatUCString(selection:getDisplayName(), i18n.get("uiR2EDSelectionCopied")), "BC")
displaySystemInfo(concatString(selection:getDisplayName(), i18n.get("uiR2EDSelectionCopied")), "BC")
end
------------------------------------------------------------------------------------
-- called by C++ when copy has been pressed (key or ui button)
function r2:paste()
r2.requestNewAction(concatUCString(i18n.get("uiR2EDPasteAction"), r2.ClipBoardDisplayName))
r2.requestNewAction(concatString(i18n.get("uiR2EDPasteAction"), r2.ClipBoardDisplayName))
if r2.ClipBoard == nil then
displaySystemInfo(i18n.get("uiR2EDEmptyClipBoard"), "BC")
return
end
-- call the paste function (not a method here)
local newCopy = r2.Classes[r2.ClipBoard.Class].newCopy(r2.ClipBoard)
r2.requestNewAction(concatUCString(i18n.get("uiR2EDPasteAction"), r2.ClipBoardDisplayName))
r2.requestNewAction(concatString(i18n.get("uiR2EDPasteAction"), r2.ClipBoardDisplayName))
r2.Classes[r2.ClipBoard.Class].paste(newCopy, true, r2.ClipBoardSrcInstanceId)
r2.requestEndAction()
end
@ -704,33 +702,32 @@ function r2:popMainMenu()
local menu = getUI(menuName)
assert(menu)
local function buildKeyName(action, params)
local keyName = ucstring(runExpr(string.format("getKey('%s', '%s')", action, params)))
assert(isUCString(keyName))
local keyName = runExpr(string.format("getKey('%s', '%s')", action, params))
if keyName == i18n.get("uiNotAssigned") then
-- no associated key...
return keyName
else
local result = concatUCString(ucstring("(") , keyName, ucstring(")"))
--debugInfo(result:toUtf8())
local result = "("..keyName..")"
--debugInfo(result)
return result
end
end
-- fill menu entries common to edition & test
menu:find("preferences_key").t.uc_hardtext = buildKeyName("show_hide", "game_config")
menu:find("keys_key").t.uc_hardtext = buildKeyName("show_hide", "keys")
--menu:find("debug_console_key").t.uc_hardtext = buildKeyName("show_hide", "debug_info")
menu:find("chat_window_key").t.uc_hardtext = buildKeyName("show_hide", "main_chat")
menu:find("quit_key").t.uc_hardtext = buildKeyName("quit_ryzom_now", "")
menu:find("mail_box_key").t.uc_hardtext = buildKeyName("show_hide", "mailbox")
menu:find("guild_forum_key").t.uc_hardtext = buildKeyName("show_hide", "guild_forum")
menu:find("preferences_key").t.text = buildKeyName("show_hide", "game_config")
menu:find("keys_key").t.text = buildKeyName("show_hide", "keys")
--menu:find("debug_console_key").t.text = buildKeyName("show_hide", "debug_info")
menu:find("chat_window_key").t.text = buildKeyName("show_hide", "main_chat")
menu:find("quit_key").t.text = buildKeyName("quit_ryzom_now", "")
menu:find("mail_box_key").t.text = buildKeyName("show_hide", "mailbox")
menu:find("guild_forum_key").t.text = buildKeyName("show_hide", "guild_forum")
-- fill name of key for each menu entry
if r2.Mode == "Edit" then
menu:find("go_test_key").t.uc_hardtext = buildKeyName("r2ed_try_go_test", "")
menu:find("palette_key").t.uc_hardtext = buildKeyName("show_hide", "r2ed_palette")
menu:find("scenario_key").t.uc_hardtext = buildKeyName("show_hide", "r2ed_scenario")
menu:find("go_test_key").t.text = buildKeyName("r2ed_try_go_test", "")
menu:find("palette_key").t.text = buildKeyName("show_hide", "r2ed_palette")
menu:find("scenario_key").t.text = buildKeyName("show_hide", "r2ed_scenario")
menu:find("cust_bbox").active = (config.R2EDExtendedDebug == 1)
else
menu:find("stop_test_key").t.uc_hardtext = buildKeyName("r2ed_stop_test", "")
menu:find("stop_test_key").t.text = buildKeyName("r2ed_stop_test", "")
menu:find("stop_test").active = (r2.AccessMode == "Editor")
end
@ -740,7 +737,7 @@ function r2:popMainMenu()
menu:find("player_admin").active = not (r2.AccessMode == "Editor")
end
menu:find("map_key").t.uc_hardtext = buildKeyName("show_hide", "map")
menu:find("map_key").t.text = buildKeyName("show_hide", "map")
menu:find("debug_console").active = (config.R2EDExtendedDebug == 1)
menu:find("fixed_lighting_bm").bm.texture = select(r2:getFixedLighting(), "r2_icon_light_on_small.tga", "r2_icon_light_off_small.tga")
@ -904,9 +901,8 @@ function r2:onModeChanged()
if r2.Mode == "Edit" and r2.LastTranslationErrorMsg ~= nil then
local str = r2.LastTranslationErrorMsg
assert(type(str) == "string")
local ucStringMsg = ucstring("Translation Error")
--ucStringMsg:fromUtf8(r2.LastTranslationErrorMsg)
displaySystemInfo(ucStringMsg, "BC")
--displaySystemInfo(str, "BC")
displaySystemInfo("Translation Error", "BC")
messageBox(str)
r2.LastTranslationErrorMsg = nil
end
@ -1006,7 +1002,7 @@ end
function r2:setToolContextHelp(ucHelp)
--debugInfo(tostring(ucHelp))
local helpGroup = getUI("ui:interface:r2ed_tool_context_help")
helpGroup.t.uc_hardtext = ucHelp
helpGroup.t.text = ucHelp
helpGroup.t:updateCoords()
helpGroup.w = helpGroup.t.w
helpGroup:invalidateCoords()
@ -1015,8 +1011,8 @@ end
-- call by C++ to display a message saying that the max number of points has been reached
-- while drawing a primitive
function r2:noMoreRoomLeftInPrimitveMsg()
local keyName = ucstring(runExpr("getKey('r2ed_context_command', 'commandId=delete')"))
local msg = concatUCString(i18n.get("uiR2EDNoMoreRoomInPrimStart"),
local keyName = runExpr("getKey('r2ed_context_command', 'commandId=delete')")
local msg = concatString(i18n.get("uiR2EDNoMoreRoomInPrimStart"),
keyName,
i18n.get("uiR2EDNoMoreRoomInPrimEnd"))
displaySystemInfo(msg, "TAGBC")
@ -1046,14 +1042,14 @@ end
-- called by C++ when an action has been undone
function r2:onUndo(actionUCName)
debugInfo("*undo*")
displaySystemInfo(concatUCString(i18n.get("uiR2EDUndoing"), actionUCName), "BC")
displaySystemInfo(concatString(i18n.get("uiR2EDUndoing"), actionUCName), "BC")
r2.ToolUI:updateUndoRedo()
end
-- called by C++ when an action has been redone
function r2:onRedo(actionUCName)
debugInfo("*redo*")
displaySystemInfo(concatUCString(i18n.get("uiR2EDRedoing"), actionUCName), "BC")
displaySystemInfo(concatString(i18n.get("uiR2EDRedoing"), actionUCName), "BC")
r2.ToolUI:updateUndoRedo()
end
@ -1252,7 +1248,7 @@ function r2:setDisplayMode(filter, displayMode, contextualVisibility)
v.DisplayerVisual.ContextualVisibilityActive = contextualVisibility
end
--if v.DisplayMode == srcDisplayMode or (srcDisplayMode == nil and v.DisplayMode ~= displayModeValue) then
--debugInfo("Changing display mode for " .. v:getDisplayName():toUtf8())
--debugInfo("Changing display mode for " .. v:getDisplayName())
--r2.requestSetNode(v.InstanceId, "DisplayMode", displayModeValue)
-- now a local property
--end
@ -1311,9 +1307,9 @@ function r2:onMessageSendingStart(messageName, nbPacket, size)
local msg = nil
if lastMessage.MessageName == "SSUA" then
msg = i18n.get("uiR2EDUploadScenario"):toUtf8()
msg = i18n.get("uiR2EDUploadScenario")
elseif lastMessage.MessageName == "RSS2" then
msg = i18n.get("uimR2EDGoToDMMode"):toUtf8()
msg = i18n.get("uimR2EDGoToDMMode")
else
return
@ -1340,10 +1336,10 @@ function r2:onMessageSendingUpdate(packetId, packetSize)
debugInfo("--- " .. tostring( math.floor( (100*lastMessage.Received) / lastMessage.Size) ) )
if lastMessage.MessageName == "SSUA" then
msg = i18n.get("uiR2EDUploadScenario"):toUtf8()
msg = i18n.get("uiR2EDUploadScenario")
elseif lastMessage.MessageName == "RSS2" then
msg = i18n.get("uimR2EDGoToDMMode"):toUtf8()
msg = i18n.get("uimR2EDGoToDMMode")
else
return

@ -208,15 +208,15 @@ function r2.setCurrSelectedFile(filename, path)
r2.CurrentForm.Env.FormInstance.LoadScenario_Level = ""
end
if header.Language then
r2.CurrentForm.Env.FormInstance.LoadScenario_Language = i18n.get("uiR2ED"..header.Language):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_Language = i18n.get("uiR2ED"..header.Language)
elseif r2.CurrentForm.Env.FormInstance.LoadScenario_Language then
r2.CurrentForm.Env.FormInstance.LoadScenario_Language = ""
end
if header.RingPointLevel then
if r2.checkRingAccess(header.RingPointLevel) == true then
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_Yes"):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_Yes")
else
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_No"):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_No")
end
elseif r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel then
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = ""
@ -243,7 +243,7 @@ function r2.setCurrSelectedFileToLoad(filename, path)
getUICaller().pushed = true
end
formInstance.LastFileButton = getUICaller()
r2.CurrentForm.Env.FormInstance.LoadScenario_Name = ucstring(filename):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_Name = filename
if path ~= nil and r2.CurrentForm.Env.FormInstance.Path then
r2.CurrentForm.Env.FormInstance.Path = path
@ -271,17 +271,17 @@ function r2.setCurrSelectedFileToLoad(filename, path)
r2.CurrentForm.Env.FormInstance.LoadScenario_Level = ""
end
if header.Language then
r2.CurrentForm.Env.FormInstance.LoadScenario_Language = i18n.get("uiR2ED"..header.Language):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_Language = i18n.get("uiR2ED"..header.Language)
elseif r2.CurrentForm.Env.FormInstance.LoadScenario_Language then
r2.CurrentForm.Env.FormInstance.LoadScenario_Language = ""
end
if header.RingPointLevel then
if r2.checkRingAccess(header.RingPointLevel) == true then
r2.CurrentForm.Env.FormInstance.RingAccess = 1
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_Yes"):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_Yes")
else
r2.CurrentForm.Env.FormInstance.RingAccess = 0
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_No"):toUtf8()
r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel = i18n.get("uiR2EDLoadScenario_No")
end
elseif r2.CurrentForm.Env.FormInstance.LoadScenario_RingPointsLevel then
r2.CurrentForm.Env.FormInstance.RingAccess = 0
@ -311,8 +311,8 @@ local function showFileList(formInstance)
local shortFilename = nlfile.getFilename(v)
local shortFileEscape=string.gsub(shortFilename, "'", "\\'")
local shortFilename2 = ucstring(shortFilename):toUtf8()
local shortFileEscape2 = ucstring(shortFileEscape):toUtf8()
local shortFilename2 = shortFilename
local shortFileEscape2 = shortFileEscape
local entry = createGroupInstance("r2ed_filelist_entry", "",

@ -14,52 +14,52 @@ r2.logicEntityAttributes = {
["ApplicableActions"] = {
-- ["Activate"] = tostring(i18n.get( "uiR2EdActivate" ):toUtf8()),
-- ["Deactivate"] = tostring(i18n.get( "uiR2EdDeactivate" ):toUtf8()),
-- ["Wander"] = tostring(i18n.get( "uiR2EdWander" ):toUtf8()),
-- ["Sit Down"] = tostring(i18n.get( "uiR2EdSitDown" ):toUtf8()),
-- ["Stand Up"] = tostring(i18n.get( "uiR2EdStandUp" ):toUtf8()),
-- ["Respawn"] = tostring(i18n.get( "uiR2EdRespawn" ):toUtf8()),
-- ["Kill"] = tostring(i18n.get( "uiR2EdKill" ):toUtf8()),
-- ["begin activity sequence"] = tostring(i18n.get( "uiR2EdBeginActivitySequ" ):toUtf8()),
-- ["Activate"] = tostring(i18n.get( "uiR2EdActivate" )),
-- ["Deactivate"] = tostring(i18n.get( "uiR2EdDeactivate" )),
-- ["Wander"] = tostring(i18n.get( "uiR2EdWander" )),
-- ["Sit Down"] = tostring(i18n.get( "uiR2EdSitDown" )),
-- ["Stand Up"] = tostring(i18n.get( "uiR2EdStandUp" )),
-- ["Respawn"] = tostring(i18n.get( "uiR2EdRespawn" )),
-- ["Kill"] = tostring(i18n.get( "uiR2EdKill" )),
-- ["begin activity sequence"] = tostring(i18n.get( "uiR2EdBeginActivitySequ" )),
-- ["begin chat sequence"] = tostring(i18n.get( "uiR2EdBeginChatSequ" ))
},
["Events"] = {
-- ["activation"] = tostring(i18n.get( "uiR2EdActivation" ):toUtf8()),
-- ["desactivation"] = tostring(i18n.get( "uiR2EdDesactivation" ):toUtf8()),
-- ["a member death"] = tostring(i18n.get( "uiR2EdAMemberDeath" ):toUtf8()),
-- ["member death"] = tostring(i18n.get( "uiR2EdMemberDeath" ):toUtf8()),
-- ["group death"] = tostring(i18n.get( "uiR2EdGroupDeath" ):toUtf8()),
-- ["head to wander zone"] = tostring(i18n.get( "uiR2EdHeadWanderZone" ):toUtf8()),
-- ["arrive at wander zone"] = tostring(i18n.get( "uiR2EdArriveWanderZone" ):toUtf8()),
-- ["head to camp"] = tostring(i18n.get( "uiR2EdHeadCamp" ):toUtf8()),
-- ["arrive at camp"] = tostring(i18n.get( "uiR2EdArriveCamp" ):toUtf8()),
-- ["death"] = tostring(i18n.get( "uiR2EdDeath" ):toUtf8()),
-- ["end of activity step"] = tostring(i18n.get( "uiR2EdEndActivityStep" ):toUtf8()),
-- ["begin of activity step"] = tostring(i18n.get( "uiR2EdBeginActivityStep" ):toUtf8()),
-- ["end of activity sequence"] = tostring(i18n.get( "uiR2EdEndActivitySequ" ):toUtf8()),
-- ["begin of activity sequence"] = tostring(i18n.get( "uiR2EdBeginOfActivitySequ" ):toUtf8()),
-- ["end of chat step"] = tostring(i18n.get( "uiR2EdEndChatStep" ):toUtf8()),
-- ["end of chat sequence"] = tostring(i18n.get( "uiR2EdEndChatSequ" ):toUtf8()),
-- ["group death"] = tostring(i18n.get( "uiR2EdGroupDeath" ):toUtf8()),
-- ["activation"] = tostring(i18n.get( "uiR2EdActivation" )),
-- ["desactivation"] = tostring(i18n.get( "uiR2EdDesactivation" )),
-- ["a member death"] = tostring(i18n.get( "uiR2EdAMemberDeath" )),
-- ["member death"] = tostring(i18n.get( "uiR2EdMemberDeath" )),
-- ["group death"] = tostring(i18n.get( "uiR2EdGroupDeath" )),
-- ["head to wander zone"] = tostring(i18n.get( "uiR2EdHeadWanderZone" )),
-- ["arrive at wander zone"] = tostring(i18n.get( "uiR2EdArriveWanderZone" )),
-- ["head to camp"] = tostring(i18n.get( "uiR2EdHeadCamp" )),
-- ["arrive at camp"] = tostring(i18n.get( "uiR2EdArriveCamp" )),
-- ["death"] = tostring(i18n.get( "uiR2EdDeath" )),
-- ["end of activity step"] = tostring(i18n.get( "uiR2EdEndActivityStep" )),
-- ["begin of activity step"] = tostring(i18n.get( "uiR2EdBeginActivityStep" )),
-- ["end of activity sequence"] = tostring(i18n.get( "uiR2EdEndActivitySequ" )),
-- ["begin of activity sequence"] = tostring(i18n.get( "uiR2EdBeginOfActivitySequ" )),
-- ["end of chat step"] = tostring(i18n.get( "uiR2EdEndChatStep" )),
-- ["end of chat sequence"] = tostring(i18n.get( "uiR2EdEndChatSequ" )),
-- ["group death"] = tostring(i18n.get( "uiR2EdGroupDeath" )),
},
["Conditions"] = {
-- ["is active"] = tostring(i18n.get( "uiR2EdIsActive" ):toUtf8()),
-- ["is inactive"] = tostring(i18n.get( "uiR2EdIsInactive" ):toUtf8()),
-- ["is dead"] = tostring(i18n.get( "uiR2EdIsDead" ):toUtf8()),
-- ["is alive"] = tostring(i18n.get( "uiR2EdIsAlive" ):toUtf8()),
-- ["is wandering"] = tostring(i18n.get( "uiR2EdIsWandering" ):toUtf8()),
-- ["is sitting"] = tostring(i18n.get( "uiR2EdIsSitting" ):toUtf8()),
-- ["is heading to wander zone"] = tostring(i18n.get( "uiR2EdIsHeadingWanderZone" ):toUtf8()),
-- ["is heading to camp"] = tostring(i18n.get( "uiR2EdIsHeadingCamp" ):toUtf8()),
-- ["is in activity sequence"] = tostring(i18n.get( "uiR2EdIsInActivitySequ" ):toUtf8()),
-- ["is in activity step"] = tostring(i18n.get( "uiR2EdIsInActivityStep" ):toUtf8()),
-- ["is in chat sequence"] = tostring(i18n.get( "uiR2EdIsInChatSequ" ):toUtf8()),
-- ["is in chat step"] = tostring(i18n.get( "uiR2EdIsInChatStep" ):toUtf8()),
-- ["is active"] = tostring(i18n.get( "uiR2EdIsActive" )),
-- ["is inactive"] = tostring(i18n.get( "uiR2EdIsInactive" )),
-- ["is dead"] = tostring(i18n.get( "uiR2EdIsDead" )),
-- ["is alive"] = tostring(i18n.get( "uiR2EdIsAlive" )),
-- ["is wandering"] = tostring(i18n.get( "uiR2EdIsWandering" )),
-- ["is sitting"] = tostring(i18n.get( "uiR2EdIsSitting" )),
-- ["is heading to wander zone"] = tostring(i18n.get( "uiR2EdIsHeadingWanderZone" )),
-- ["is heading to camp"] = tostring(i18n.get( "uiR2EdIsHeadingCamp" )),
-- ["is in activity sequence"] = tostring(i18n.get( "uiR2EdIsInActivitySequ" )),
-- ["is in activity step"] = tostring(i18n.get( "uiR2EdIsInActivityStep" )),
-- ["is in chat sequence"] = tostring(i18n.get( "uiR2EdIsInChatSequ" )),
-- ["is in chat step"] = tostring(i18n.get( "uiR2EdIsInChatStep" )),
},
}
@ -313,13 +313,13 @@ function r2:initWhichEntityMenu()
logicEntityMenu:reset()
local name = i18n.get("uiR2EdBanditCamps")
logicEntityMenu:addLine(ucstring(name), "lua", "", "BanditCampFeature")
logicEntityMenu:addLine(name, "lua", "", "BanditCampFeature")
name = i18n.get("uiR2EdGroups")
logicEntityMenu:addLine(ucstring(name), "lua", "", "NpcGrpFeature")
logicEntityMenu:addLine(name, "lua", "", "NpcGrpFeature")
name = i18n.get("uiR2EdNPCs")
logicEntityMenu:addLine(ucstring(name), "lua", "", "Npc")
logicEntityMenu:addLine(name, "lua", "", "Npc")
r2:registerFeaturesMenu(logicEntityMenu)
@ -345,7 +345,7 @@ function r2:initWhichEntityMenu()
addLine = false
end
if addLine then
subMenu:addLine(ucstring(entity.Name), "lua", "r2:selectWhichEntity(".. tostring(i) .. "," .. tostring(count) .. ")", entity.InstanceId)
subMenu:addLine(entity.Name, "lua", "r2:selectWhichEntity(".. tostring(i) .. "," .. tostring(count) .. ")", entity.InstanceId)
count=count+1
end
end
@ -500,7 +500,7 @@ function r2:updateActionText(actionUI)
totalText = totalText.."\n"
end
actionText:addTextChild(ucstring(totalText))
actionText:addTextChild(totalText)
sep.active = true
else
sep.active = false
@ -575,7 +575,7 @@ function r2:updateReactionText(reactionUI)
end
end
reactionText:addTextChild(ucstring(totalText))
reactionText:addTextChild(totalText)
sep.active = true
else
@ -986,7 +986,7 @@ function r2:openRightMenu(isEntityOfLeftMenu, loadTable, selectLineFunction)
local openSequencesMenu = r2.openSequencesMenu[action]
local actionName = r2.logicEntityAttributes[loadTable][action]
if actionName == nil then actionName = "?"..action.."?" end
local actionText = ucstring(actionName)
local actionText = actionName
if openSequencesMenu ~= nil then
-- first line
@ -1013,8 +1013,8 @@ function r2:openRightMenu(isEntityOfLeftMenu, loadTable, selectLineFunction)
if not openSequencesMenu.singleSubMenu then
--subMenu:addLine(ucstring(sequence.Name), "", "", sequence.InstanceId)
subMenu:addLine(ucstring(r2:getSequenceName(sequence)), "", "", sequence.InstanceId)
--subMenu:addLine(sequence.Name, "", "", sequence.InstanceId)
subMenu:addLine(r2:getSequenceName(sequence), "", "", sequence.InstanceId)
-- steps sub menu
subMenu:addSubMenu(s)
@ -1029,13 +1029,13 @@ function r2:openRightMenu(isEntityOfLeftMenu, loadTable, selectLineFunction)
for s = 0, steps.Size - 1 do
local step = steps[s]
local stepName = r2:getElementName(step)
stepsMenu:addLine(ucstring(stepName), "lua",
stepsMenu:addLine(stepName, "lua",
selectLineFunction.. "('".. action .. "','" .. step.InstanceId .."')", step.InstanceId)
count2=count2+1
end
else
--subMenu:addLine(ucstring(sequence.Name), "lua",
subMenu:addLine(ucstring(r2:getSequenceName(sequence)), "lua",
--subMenu:addLine(sequence.Name, "lua",
subMenu:addLine(r2:getSequenceName(sequence), "lua",
selectLineFunction.. "('".. action .. "','" .. sequence.InstanceId .. "')", sequence.InstanceId)
end
@ -1321,7 +1321,7 @@ function r2:buildActionTitle(actionUI, erase)
-- title
local title = actionUI:find("title")
assert(title)
title.uc_hardtext= part1..part2
title.text= part1..part2
end
function r2:getActionName(actionInst)
@ -1621,15 +1621,15 @@ function r2:updateActionEditor()
local whichEventNameText = whichEventLabel:find("name_text")
assert(whichEventNameText)
text = r2:getSelectedInstance().Name
whichEventNameText.uc_hardtext = text
whichEventNameText.text = text
if actionInst ~= nil then
local index = r2:searchElementIndex(actionInst)
if index~= nil then
actionName.uc_hardtext = tostring(i18n.get("uiR2EdAction")).." "..index.." : "
actionName.text = tostring(i18n.get("uiR2EdAction")).." "..index.." : "
else
actionName.uc_hardtext = tostring(i18n.get("uiR2EdAction")).." : "
actionName.text = tostring(i18n.get("uiR2EdAction")).." : "
end
-- which event text
@ -1641,7 +1641,7 @@ function r2:updateActionEditor()
assert(inst)
text = text .. " : " .. r2:getElementName(inst)
end
whichEventText.uc_hardtext = text
whichEventText.text = text
local previousButtonPair = actionsList:getChild(0)
-- ActionStep list
@ -1659,7 +1659,7 @@ function r2:updateActionEditor()
local whichEntityText = whichEntityMenu:find("text")
assert(whichEntityText)
text = r2:getInstanceFromId(tostring(actionStepInst.Entity)).Name
whichEntityText.uc_hardtext = text
whichEntityText.text = text
local whatActionMenu = previousButtonPair:find("right_menu")
@ -1674,7 +1674,7 @@ function r2:updateActionEditor()
assert(inst)
text = text .. " : " .. r2:getElementName(inst)
end
whatActionText.uc_hardtext = text
whatActionText.text = text
previousButtonPair.Env.entityId = tostring(actionStepInst.Entity)
previousButtonPair = newButtonPair
@ -1696,7 +1696,7 @@ function r2:updateActionEditor()
local whichEntityText = whichEntityMenu:find("text")
assert(whichEntityText)
text = r2:getInstanceFromId(tostring(conditionInst.Entity)).Name
whichEntityText.uc_hardtext = text
whichEntityText.text = text
local whatConditionMenu = previousButtonPair:find("right_menu")
assert(whatConditionMenu)
@ -1710,7 +1710,7 @@ function r2:updateActionEditor()
assert(inst)
text = text .. " : " .. r2:getElementName(inst)
end
whatConditionText.uc_hardtext = text
whatConditionText.text = text
previousButtonPair.Env.entityId = tostring(conditionInst.Entity)
previousButtonPair = newButtonPair
@ -1718,9 +1718,9 @@ function r2:updateActionEditor()
else
local name = tostring(i18n.get("uiR2EdAction")).." : "
actionName.uc_hardtext = name
actionName.text = name
whichEventText.uc_hardtext = ""
whichEventText.text = ""
end
end
@ -1834,12 +1834,12 @@ function r2:buildReactionTitle(reactionUI, erase)
local part3 = tostring(i18n.get("uiR2EdEventTxtPreEvent")).." '".. eventType .."' "..tostring(i18n.get("uiR2EdEventOf")).." ".. whichEntity.Name
-- title
title.uc_hardtext= part1..part2..part3
title.text= part1..part2..part3
elseif erase==true then
local eltsList = reactionUI.parent
local indexReactionUI = eltsList:getElementIndex(reactionUI) - 1
title.uc_hardtext = tostring(i18n.get("uiR2EdReaction")).." "..indexReactionUI.." : "
title.text = tostring(i18n.get("uiR2EdReaction")).." "..indexReactionUI.." : "
end
end
@ -2091,7 +2091,7 @@ function r2:updateReactionEditor()
local whatActionText = whatActionLabel:find("name_text")
assert(whatActionText)
local text = " " .. r2:getSelectedInstance().Name
whatActionText.uc_hardtext = text
whatActionText.text = text
local conditions = reactionEditor:find("conditions_list")
assert(conditions)
@ -2119,9 +2119,9 @@ function r2:updateReactionEditor()
actions.active = false
conditions.active = false
whatActionText.uc_hardtext = ""
whatTriggersText.uc_hardtext = ""
whichEventText.uc_hardtext = ""
whatActionText.text = ""
whatTriggersText.text = ""
whichEventText.text = ""
if reactionEditor.Env.minimize ~= true then
reactionEditor.h = reactionEditor.h - 320
@ -2162,7 +2162,7 @@ function r2:updateReactionEditor()
assert(inst)
text = text .. " : " .. r2:getElementName(inst)
end
whatActionText.uc_hardtext = text
whatActionText.text = text
-- "what triggers..." and "which event" buttons text
local entityName = actionInst.ParentInstance.Parent.Name
@ -2175,9 +2175,9 @@ function r2:updateReactionEditor()
text = text .. " : " .. r2:getElementName(inst)
end
whatTriggersText.uc_hardtext = entityName
whatTriggersText.text = entityName
whichEventText.uc_hardtext = text
whichEventText.text = text
menuPair.Env.entityId = actionInst.ParentInstance.Parent.InstanceId
@ -2200,7 +2200,7 @@ function r2:updateReactionEditor()
local whichEntityText = whichEntityMenu:find("text")
assert(whichEntityText)
text = r2:getInstanceFromId(tostring(actionStepInst.Entity)).Name
whichEntityText.uc_hardtext = text
whichEntityText.text = text
local whatActionMenu = previousButtonPair:find("right_menu")
assert(whatActionMenu)
@ -2215,7 +2215,7 @@ function r2:updateReactionEditor()
assert(inst)
text = text .. " : " .. r2:getElementName(inst)
end
whatActionText.uc_hardtext = text
whatActionText.text = text
previousButtonPair.Env.entityId = tostring(actionStepInst.Entity)
previousButtonPair = newButtonPair
@ -2239,7 +2239,7 @@ function r2:updateReactionEditor()
local whichEntityText = whichEntityMenu:find("text")
assert(whichEntityText)
text = r2:getInstanceFromId(tostring(conditionInst.Entity)).Name
whichEntityText.uc_hardtext = text
whichEntityText.text = text
local whatConditionMenu = previousButtonPair:find("right_menu")
assert(whatConditionMenu)
@ -2252,14 +2252,14 @@ function r2:updateReactionEditor()
assert(inst)
text = text .. " : " .. r2:getElementName(inst)
end
whatConditionText.uc_hardtext = text
whatConditionText.text = text
previousButtonPair.Env.entityId = tostring(conditionInst.Entity)
previousButtonPair = newButtonPair
end
end
reactionName.uc_hardtext = name
reactionName.text = name
end
---------------------------- new element --------------------------------------------------------------
@ -2408,7 +2408,7 @@ function r2:updateLogicEntityUI(instance)
r2:updateReactionEditor()
end
logicEntityUI.uc_title = tostring(i18n.get("uiR2EDEventsTriggersEditor")) .. r2:getSelectedInstance().Name
logicEntityUI.title = tostring(i18n.get("uiR2EDEventsTriggersEditor")) .. r2:getSelectedInstance().Name
end
----------------------------- CLOSE ACTION / REACTION EDITOR ------------------------------------
@ -2485,7 +2485,7 @@ r2.logicEntityUIUpdated = false
-- local logicEntityWnd = getUI("ui:interface:r2ed_logic_entities")
-- assert(logicEntityWnd)
-- logicEntityWnd.uc_title = tostring(i18n.get("uiR2EDEventsTriggersEditor")) .. instance[attributeName]
-- logicEntityWnd.title = tostring(i18n.get("uiR2EDEventsTriggersEditor")) .. instance[attributeName]
-- end
--end

@ -52,8 +52,8 @@ function r2:buildPaletteUI()
subNode.Text = i18n.get(instValue.Translation)
end
r2.PaletteIdToTranslation[instValue.Id] = subNode.Text:toUtf8()
r2.PaletteIdToGroupTranslation[instValue.Id] = newNode.Text:toUtf8()
r2.PaletteIdToTranslation[instValue.Id] = subNode.Text
r2.PaletteIdToGroupTranslation[instValue.Id] = newNode.Text
r2.PaletteIdToType[instValue.Id] = v
subNode.Id = tostring(shortElementId)

@ -112,28 +112,28 @@ end
--***********************************************************************
function PlayerTracking:initRaceTypes()
for k = 0, 3 do
self.RaceTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerRace_" .. tostring(k)):toUtf8()
self.RaceTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerRace_" .. tostring(k))
end
end
--***********************************************************************
function PlayerTracking:initReligionTypes()
for k = 0, 2 do
self.ReligionTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerReligion_" .. tostring(k)):toUtf8()
self.ReligionTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerReligion_" .. tostring(k))
end
end
--***********************************************************************
function PlayerTracking:initShardTypes()
for k = 0, 2 do
self.ShardTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerShard_" .. tostring(k)):toUtf8()
self.ShardTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerShard_" .. tostring(k))
end
end
--***********************************************************************
function PlayerTracking:initLevelTypes()
for k = 0, 5 do
self.LevelTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerLevel_" .. tostring(k)):toUtf8()
self.LevelTypeToUtf8[math.pow(2, k)] = i18n.get("uiRAP_PlayerLevel_" .. tostring(k))
end
end
@ -154,9 +154,6 @@ function PlayerTracking:getSelectList()
return getUI("ui:login:ring_players_tracking:content:main:enclosing:columns:getw:select")
end
local scratchUCStr = ucstring()
--***********************************************************************
function PlayerTracking:newTemplate(name, cache)
local group
@ -173,8 +170,7 @@ end
-- build a new text group from utf8 text
function PlayerTracking:newTextLabel(value)
local group = self:newTemplate("rap_text", self.TextCache)
scratchUCStr:fromUtf8(value)
group:find("t").uc_hardtext_single_line_format = scratchUCStr
group:find("t").text_single_line_format = value
return group
end
@ -182,15 +178,14 @@ end
-- build a new text group from utf8 text
function PlayerTracking:newCenteredTextLabel(value)
local group = self:newTemplate("rap_text_centered", self.CenteredTextCache)
scratchUCStr:fromUtf8(value)
group:find("t").uc_hardtext_single_line_format = scratchUCStr
group:find("t").text_single_line_format = value
return group
end
--***********************************************************************
function PlayerTracking:newNumberLabel(value)
local group = self:newTemplate("rap_number", self.NumberCache)
group:find("t").uc_hardtext_single_line_format = tostring(value)
group:find("t").text_single_line_format = tostring(value)
return group
end
@ -358,7 +353,7 @@ function PlayerTracking:fill(list)
self:setErrorMessage("uiRAP_NoSessionForLangFilter")
else
--self:setErrorMessage(i18n.get("uiRAP_NoSessionFound"))
self:setErrorMessage(ucstring())
self:setErrorMessage("")
self:enableButtons(false)
end
else
@ -372,7 +367,7 @@ end
--***********************************************************************
function PlayerTracking:setMessage(msg, color)
local errorTxt = self:getWindow():find("errorMsg")
errorTxt.uc_hardtext = msg
errorTxt.text = msg
errorTxt.color = color
errorTxt.active=true
end
@ -463,9 +458,9 @@ function PlayerTracking:onLineRightClick()
self:onLineLeftClick()
local menu = getUI("ui:login:ring_player_menu")
menu:find("tell").uc_hardtext = ucstring(i18n.get("uiRAP_MenuPlayerTell"):toUtf8() .. "'" .. self:getPlayerFromId(self.SelectedPlayerId).Player .."'")
menu:find("teleport").uc_hardtext = ucstring(i18n.get("uiRAP_MenuTeleportTo"):toUtf8() .. "'" .. self:getPlayerFromId(self.SelectedPlayerId).Player.."'")
menu:find("kick").uc_hardtext = ucstring(i18n.get("uiRAP_MenuKick"):toUtf8() .. "'" .. self:getPlayerFromId(self.SelectedPlayerId).Player.."'")
menu:find("tell").text = i18n.get("uiRAP_MenuPlayerTell") .. "'" .. self:getPlayerFromId(self.SelectedPlayerId).Player .."'"
menu:find("teleport").text = i18n.get("uiRAP_MenuTeleportTo") .. "'" .. self:getPlayerFromId(self.SelectedPlayerId).Player.."'"
menu:find("kick").text = i18n.get("uiRAP_MenuKick") .. "'" .. self:getPlayerFromId(self.SelectedPlayerId).Player.."'"
menu:find("kick").grayed = not self:isConnected(self:getPlayerFromId(self.SelectedPlayerId).Flags)
menu:find("teleport").grayed = not self:isConnected(self:getPlayerFromId(self.SelectedPlayerId).Flags)
@ -481,9 +476,7 @@ end
--***********************************************************************
function PlayerTracking:onTell()
debugInfo("tell to owner of session" .. self.SelectedPlayerId)
player = ucstring()
player:fromUtf8(self:getPlayerFromId(self.SelectedPlayerId).Player)
tell(player)
tell(self:getPlayerFromId(self.SelectedPlayerId).Player)
end
--***********************************************************************

@ -34,13 +34,13 @@ r2.DefaultPropertySheetTitleClampSize = -28
local eventArgs = {} -- static table here to avoid costly allocs with the ellipsis ...
local emptyArgs = {}
-- build an edit box for an arbitrary type
function r2:buildEditBox(prop, textRef, entryType, multiLine, maxNumChars, onChangeAction, onFocusLostAction)
function r2:buildEditBox(prop, textRef, entryType, multiLine, maxNumBytes, onChangeAction, onFocusLostAction)
local result =
[[<instance template="edit_box_widget" text_y="-1" posref="ML ML" sizeref="w" w="-8" fontsize="14" x="4" reset_focus_on_hide="true"
child_resize_hmargin="4"
max_historic="0"
y="-2"
negative_filter = '"{}[]'
negative_filter = ''
prompt="" enter_loose_focus="true"
color="255 255 255 255"
continuous_text_update="true"
@ -51,7 +51,8 @@ function r2:buildEditBox(prop, textRef, entryType, multiLine, maxNumChars, onCha
[[ text_ref = ]] .. strifyXml(textRef) ..
[[ entry_type = ]] .. strifyXml(entryType) ..
[[ multi_line = ]] .. strifyXml(multiLine) ..
[[ max_num_chars = ]] .. strifyXml(maxNumChars) ..
[[ max_num_bytes = ]] .. strifyXml(maxNumBytes) ..
[[ max_num_chars = ]] .. strifyXml(maxNumBytes) ..
[[ params = ]] .. strifyXml(onChangeAction) ..
[[ on_focus_lost_params = ]] .. strifyXml(onFocusLostAction) ..
"/>"
@ -148,22 +149,20 @@ r2.WidgetStyles.String =
ok = r2.assert(loadstring('return '.. prop.ValidationFun))()(value)
end
if ok then
local ucValue = ucstring()
--debugInfo("value = " .. tostring(value))
ucValue:fromUtf8(value)
widget.eb.uc_input_string = ucValue
widget.eb.Env.CurrString = ucValue
widget.eb.input_string = value
widget.eb.Env.CurrString = value
--debugInfo("setting" .. widget.eb.id .. " to " .. tostring(value))
else
widget.eb.uc_input_string = widget.eb.Env.CurrString
widget.eb.input_string = widget.eb.uc_input_string:toUtf8()
widget.eb.input_string = widget.eb.Env.CurrString
widget.eb.input_string = widget.eb.input_string
end
end
local validation = ""
if prop.ValidationFun then
validation = string.format([[ if not %s(utf8Value) then editBox.uc_input_string = editBox.Env.CurrString; return end]], prop.ValidationFun)
validation = string.format([[ if not %s(utf8Value) then editBox.input_string = editBox.Env.CurrString; return end]], prop.ValidationFun)
end
local onChangeAction =
@ -174,7 +173,7 @@ r2.WidgetStyles.String =
return
end
local utf8Value = editBox.uc_input_string:toUtf8()
local utf8Value = editBox.input_string
%s
editBox.Env.CurrString = editBox.input_string
r2:requestSetObjectProperty('%s', utf8Value)
@ -184,7 +183,7 @@ r2.WidgetStyles.String =
if prop.ValidateOnEnter then
onChangeAction = onChangeAction .. "r2:validateForm(r2.CurrentForm)"
end
return r2:buildEditBox(prop, "TL TL", defaulting(prop.EntryType, "text"), true, defaulting(prop.MaxNumChar, 256), onChangeAction, onFocusLostAction),
return r2:buildEditBox(prop, "TL TL", defaulting(prop.EntryType, "text"), true, defaulting(prop.MaxNumChar, 255), onChangeAction, onFocusLostAction),
setter,
nil
end,
@ -193,9 +192,7 @@ r2.WidgetStyles.String =
--debugInfo("Building static text")
local function setter(widget, prop, value)
--debugInfo("value = " .. tostring(value))
local ucValue = ucstring()
ucValue:fromUtf8(value)
widget.uc_hardtext = ucValue
widget.text = value
end
local widgetXml =
string.format([[ <view type="text" id="%s" color="192 192 192 255" posparent="parent" active="true" posref="ML ML" x="4" y="-2" global_color="true" fontsize="12" shadow="true" hardtext="toto" auto_clamp="true"/> ]], prop.Name)
@ -206,9 +203,7 @@ r2.WidgetStyles.String =
--debugInfo("Building static text")
local function setter(widget, prop, value)
--debugInfo("value = " .. tostring(value))
local ucValue = ucstring()
ucValue:fromUtf8(value)
widget.uc_hardtext = ucValue
widget.text = value
end
local widgetXml =
string.format([[ <view type="text" id="%s" color="192 192 192 255" posparent="parent" active="true" posref="ML ML" x="4" y="-2" global_color="true" fontsize="12" shadow="true" hardtext="toto" multi_line="true" auto_clamp="true"/> ]], prop.Name)
@ -281,12 +276,10 @@ end
--
function refIdDefaultEventHandler:update(widget, value, target)
local text = widget:find("name")
if target then
local newName = ucstring()
newName:fromUtf8(target.Name)
text.uc_hardtext = newName
if target then
text.text = target.Name
else
text.uc_hardtext = i18n.get("uiR2EDNone")
text.text = i18n.get("uiR2EDNone")
end
end
--
@ -623,8 +616,7 @@ function refIdPlotItemEventHandler:updateSheet(widget, targetPlotItem)
local dbPath = "LOCAL:R2:PLOT_ITEMS:" .. tostring(k)
if getDbProp(dbPath .. ":SHEET") == targetPlotItem.SheetId then
widget.sheet.sheet = dbPath
r2.ScratchUCStr:fromUtf8(targetPlotItem.Name)
widget.t.uc_hardtext = r2.ScratchUCStr
widget.t.text = targetPlotItem.Name
return true
end
end
@ -644,7 +636,7 @@ function refIdPlotItemEventHandler:update(widget, value, target)
end
widget.sheet.sheet = ""
widget.t.uc_hardtext = i18n.get("uiR2EDChooseItem")
widget.t.text = i18n.get("uiR2EDChooseItem")
end
-- ui handling for selection of plot items from the scenario
@ -787,7 +779,7 @@ function r2:requestSetObjectProperty(propName, value, isLocal)
return -- not really modified -> no op
end
local ucActionName = r2:getPropertyTranslation(prop)
r2.requestNewAction(concatUCString(i18n.get("uiR2EDChangePropertyAction"), ucActionName, i18n.get("uiR2EDChangePropertyOf"), target:getDisplayName()))
r2.requestNewAction(concatString(i18n.get("uiR2EDChangePropertyAction"), ucActionName, i18n.get("uiR2EDChangePropertyOf"), target:getDisplayName()))
-- this is a property sheet
@ -1915,7 +1907,7 @@ function r2:buildAllPropertySheetsAndForms()
--f:write(r2:encloseXmlScript(xmlScript))
--f:flush()
--f:close()
parseInterfaceFromString(ucstring(r2:encloseXmlScript(xmlScript)):toUtf8())
parseInterfaceFromString(r2:encloseXmlScript(xmlScript))
local endTime = nltime.getLocalTime()
debugInfo(string.format("Reparsing generated xml took %f second", (endTime - startTime) / 1000))
end
@ -2055,7 +2047,7 @@ function propertySheetDisplayerTable:onAttrModified(instance, attributeName, ind
local propertySheet = r2:getPropertySheet(instance)
if propertySheet then
if attributeName == "Name" and instance == r2:getSelectedInstance() then
propertySheet.uc_title = concatUCString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
propertySheet.title = concatString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
end
propertySheet.Env.updatePropVisibility()
end
@ -2164,7 +2156,7 @@ function r2:showProperties(instance)
end
end
if instance and instance:getClass().BuildPropertySheet then
newPropWindow.uc_title = concatUCString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
newPropWindow.title = concatString(i18n.get("uiRE2DPropertiesOf"), instance:getDisplayName())
end
end
r2.CurrentPropertyWindow = newPropWindow
@ -2225,9 +2217,9 @@ function r2:doForm(formName, initialTable, validateCallback, cancelCallback)
formUI:center()
formUI:updateCoords()
if form.Caption ~= nil then
formUI.uc_title = i18n.get(form.Caption)
formUI.title = i18n.get(form.Caption)
else
formUI.uc_title = i18n.get("uiR2EDForm")
formUI.title = i18n.get("uiR2EDForm")
end
r2.CurrentForm = formUI
if type(form.onShow) == "function" then

@ -385,7 +385,7 @@ function r2:onChangeDesktop(desktopIndex)
-- set new title for th "keys" window
local keys = getUI("ui:interface:keys")
if keys then
keys.uc_title = i18n.get("uiR2EDEditingKeys")
keys.title = i18n.get("uiR2EDEditingKeys")
end
if r2.UserComponentsManager then
@ -426,7 +426,7 @@ function r2:onChangeDesktop(desktopIndex)
local keys = getUI("ui:interface:keys")
if keys then
keys.uc_title = i18n.get("uiR2EDTestOrDMKeys")
keys.title = i18n.get("uiR2EDTestOrDMKeys")
end
----------------------------------------------------------------------------------------------------------
@ -473,7 +473,7 @@ function r2:onChangeDesktop(desktopIndex)
r2.ui.AnimBar:updateDMControlledEntitiesWindow()
local keys = getUI("ui:interface:keys")
if keys then
keys.uc_title = i18n.get("uiR2EDTestOrDMKeys")
keys.title = i18n.get("uiR2EDTestOrDMKeys")
end
end

@ -42,7 +42,7 @@ function r2.ScenarioWindow:initScenarioWindow()
local languages2 = {}
for k, lang in pairs(languages) do
self.Languages[i18n.get("uiR2ED"..lang):toUtf8()] = lang
self.Languages[i18n.get("uiR2ED"..lang)] = lang
table.insert(languages2, i18n.get("uiR2ED"..lang))
end
table.sort(languages2)
@ -53,7 +53,7 @@ function r2.ScenarioWindow:initScenarioWindow()
local types2 = {}
for k, type in pairs(types) do
self.Types[i18n.get("uiR2ED"..type):toUtf8()] = type
self.Types[i18n.get("uiR2ED"..type)] = type
table.insert(types2, i18n.get("uiR2ED"..type))
end
table.sort(types2)
@ -70,7 +70,7 @@ function r2.ScenarioWindow:initScenarioWindow()
table.insert(locked, "RoSOnly")
end
for k, type in pairs(locked) do
self.Locked[i18n.get("uiR2ED"..type):toUtf8()] = type
self.Locked[i18n.get("uiR2ED"..type)] = type
table.insert(tmp, i18n.get("uiR2ED"..type))
end
-- table.sort(tmp)
@ -183,17 +183,13 @@ function r2.ScenarioWindow:updateLeftQuota()
self.LeftQuota, self.LeftStaticQuota = act:getLeftQuota()
local uc_tooltip = ucstring()
quotaViewText.hardtext = string.format("(%d)", self.LeftQuota)
uc_tooltip:fromUtf8(i18n.get("uiR2EDScene"):toUtf8() .. " (" .. self.LeftQuota .. ")")
quotaTooltip.tooltip = uc_tooltip
quotaMacroViewText.hardtext = string.format("(%d)", self.LeftQuota)
uc_tooltip:fromUtf8(i18n.get("uiR2EDMacroComponents"):toUtf8() .. " (" .. self.LeftQuota .. ")")
quotaMacroTooltip.tooltip = uc_tooltip
quotaTooltip.tooltip = i18n.get("uiR2EDScene") .. " (" .. self.LeftQuota .. ")"
quotaMacroViewText.hardtext = string.format("(%d)", self.LeftQuota)
quotaMacroTooltip.tooltip = i18n.get("uiR2EDMacroComponents") .. " (" .. self.LeftQuota .. ")"
quotaViewTextMisc.hardtext = string.format("(%d)", self.LeftStaticQuota)
quotaViewTextMisc2.hardtext = string.format("(%d)", self.LeftStaticQuota)
uc_tooltip:fromUtf8(i18n.get("uiR2EDbotObjects"):toUtf8() .. " (" .. self.LeftStaticQuota .. ")")
quotaMiscTooltip.tooltip = uc_tooltip
quotaMiscTooltip.tooltip = i18n.get("uiR2EDbotObjects") .. " (" .. self.LeftStaticQuota .. ")"
quotaViewText.color_rgba = select(self.LeftQuota >= 0, CRGBA(255, 255, 255), CRGBA(255, 0, 0))
quotaViewTextMisc.color_rgba = select(self.LeftStaticQuota >= 0, CRGBA(255, 255, 255), CRGBA(255, 0, 0))
@ -218,7 +214,7 @@ function r2.ScenarioWindow:setAct(act)
r2:setCurrentActFromId(act.InstanceId) -- will also trigger ui update (called by C++)
if act.InstanceId~=self.setActId then
if not r2:isClearingContent() then
displaySystemInfo(concatUCString(i18n.get("uiR2EDCurrentActNotify"), act:getDisplayName()), "BC")
displaySystemInfo(concatString(i18n.get("uiR2EDCurrentActNotify"), act:getDisplayName()), "BC")
end
self.setActId = act.InstanceId
end
@ -230,20 +226,17 @@ end
function r2.ScenarioWindow:updateComboBoxCurrentAct(newAct)
local comboB = self:getActComboBox()
local text = ucstring()
local currentAct = r2:getCurrentAct()
if not (currentAct==nil or currentAct.isNil) then
local currentActIndex = r2.ScenarioWindow:findComboBoxLineFromAct(currentAct)
if currentActIndex then
text:fromUtf8(currentAct:getName())
comboB:setText(currentActIndex, text)
comboB:setText(currentActIndex, currentAct:getName())
end
end
local newActIndex = r2.ScenarioWindow:findComboBoxLineFromAct(newAct)
if newActIndex then
text:fromUtf8(newAct:getName() .. " [" .. i18n.get("uiR2EDCurrentActComboBox"):toUtf8() .."]")
comboB:setText(newActIndex, text)
comboB:setText(newActIndex, newAct:getName() .. " [" .. i18n.get("uiR2EDCurrentActComboBox") .."]")
end
end
@ -316,11 +309,11 @@ function r2.ScenarioWindow:confirmDeleteAct()
local name = act.Name
local firstPart = i18n.get("uiR2EDDefaultActTitle"):toUtf8() .. i
local firstPartSpace = i18n.get("uiR2EDDefaultActTitle"):toUtf8().. " " .. i
local firstPart = i18n.get("uiR2EDDefaultActTitle") .. i
local firstPartSpace = i18n.get("uiR2EDDefaultActTitle").. " " .. i
if name == firstPart or name == firstPartSpace then
name = i18n.get("uiR2EDDefaultActTitle"):toUtf8() .. " " .. (i-1)
name = i18n.get("uiR2EDDefaultActTitle") .. " " .. (i-1)
r2.requestSetNode(act.InstanceId, "Name", name)
end
@ -527,8 +520,8 @@ function r2.ScenarioWindow:setActNotes()
local actGr = scenarioUI:find("act_properties")
assert(actGr)
local preActNotes = actGr:find("pre_act_notes"):find("small_description").uc_input_string:toUtf8()
local actNotes = actGr:find("act_notes"):find("small_description").uc_input_string:toUtf8()
local preActNotes = actGr:find("pre_act_notes"):find("small_description").input_string
local actNotes = actGr:find("act_notes"):find("small_description").input_string
if act==nil then act = r2:getCurrentAct() end
if actNotes~=act.ShortDescription then
@ -585,9 +578,7 @@ function r2.ScenarioWindow:updateActProperties()
if location==nil then return end
local locationName = actGr:find("location_name")
assert(locationName)
local uc_location = ucstring()
uc_location:fromUtf8(location.Name)
locationName.uc_hardtext = uc_location
locationName.text = location.Name
-- season
local seasons = {
@ -600,7 +591,7 @@ function r2.ScenarioWindow:updateActProperties()
assert(season)
local seasonStr = seasons[location.Season]
local uc_season = i18n.get(seasonStr)
season.uc_hardtext = uc_season
season.text = uc_season
-- manual weather
local weatherGr = actGr:find("weather")
@ -624,9 +615,7 @@ function r2.ScenarioWindow:updateActProperties()
assert(notesGr)
local notesAct = notesGr:find("small_description")
assert(notesAct)
local uc_notes = ucstring()
uc_notes:fromUtf8(act.ShortDescription)
notesAct.uc_input_string = uc_notes
notesAct.input_string = act.ShortDescription
end
-- pre act notes
@ -635,9 +624,7 @@ function r2.ScenarioWindow:updateActProperties()
assert(notesGr)
local notesAct = notesGr:find("small_description")
assert(notesAct)
local uc_notes = ucstring()
uc_notes:fromUtf8(act.PreActDescription)
notesAct.uc_input_string = uc_notes
notesAct.input_string = act.PreActDescription
end
@ -645,11 +632,8 @@ function r2.ScenarioWindow:updateActProperties()
if act==r2:getCurrentAct() then
local entityBudgetText = scenarioUI:find("entity_budget_text")
local macroBudgetText = scenarioUI:find("macro_budget_text")
local ucBudget = ucstring()
ucBudget:fromUtf8(i18n.get("uiR2EDMacroComponentsInAct"):toUtf8() .. act:getName())
macroBudgetText.uc_hardtext = ucBudget
ucBudget:fromUtf8(i18n.get("uiR2EDEntitiesInAct"):toUtf8() .. act:getName())
entityBudgetText.uc_hardtext = ucBudget
macroBudgetText.text = i18n.get("uiR2EDMacroComponentsInAct") .. act:getName()
entityBudgetText.text = i18n.get("uiR2EDEntitiesInAct") .. act:getName()
end
end
@ -677,9 +661,9 @@ function r2.ScenarioWindow:updateScenarioProperties()
assert(cb)
if r2.Scenario.Description.OtherCharAccess then
local access = r2.Scenario.Description.OtherCharAccess
cb.selection_text = i18n.get("uiR2ED".. access):toUtf8()
cb.selection_text = i18n.get("uiR2ED".. access)
else
cb.selection_text = i18n.get("uiR2EDFull"):toUtf8()
cb.selection_text = i18n.get("uiR2EDFull")
end
end
@ -707,9 +691,7 @@ function r2.ScenarioWindow:updateScenarioProperties()
assert(ui)
local widget = ui:find("mission_tag")
assert(widget)
local uc = ucstring()
uc:fromUtf8(scenario.Description.MissionTag)
widget:find("mission_tag_eb").eb.uc_input_string = uc
widget:find("mission_tag_eb").eb.input_string = scenario.Description.MissionTag
end
-- scenario rules
@ -723,39 +705,33 @@ function r2.ScenarioWindow:updateScenarioProperties()
-- scenario language
local languageCB = scenarioGr:find("language_combo_box")
assert(languageCB)
languageCB.selection_text = i18n.get("uiR2ED"..r2.Scenario.Language):toUtf8()
languageCB.selection_text = i18n.get("uiR2ED"..r2.Scenario.Language)
-- scenario type
local typeCB = scenarioGr:find("type_combo_box")
assert(typeCB)
-- special case for old enums
if r2.Scenario.Type =="Combat" then
typeCB.selection_text = i18n.get("uiR2EDso_hack_slash"):toUtf8()
typeCB.selection_text = i18n.get("uiR2EDso_hack_slash")
elseif r2.Scenario.Type =="Roleplay" then
typeCB.selection_text = i18n.get("uiR2EDso_story_telling"):toUtf8()
typeCB.selection_text = i18n.get("uiR2EDso_story_telling")
else
typeCB.selection_text = i18n.get("uiR2ED"..r2.Scenario.Type):toUtf8()
typeCB.selection_text = i18n.get("uiR2ED"..r2.Scenario.Type)
end
-- scenario title
local ucTitle = ucstring()
ucTitle:fromUtf8(scenario.Description.Title)
getUI("ui:interface:r2ed_scenario"):find("title_eb").eb.uc_input_string = ucTitle
getUI("ui:interface:r2ed_scenario"):find("title_eb").eb.input_string = scenario.Description.Title
-- scenario notes
local notesGr = scenarioGr:find("scenario_notes")
assert(notesGr)
local notesScenario = notesGr:find("small_description")
assert(notesScenario)
local uc_notes = ucstring()
uc_notes:fromUtf8(scenario.Description.ShortDescription)
notesScenario.uc_input_string = uc_notes
notesScenario.input_string = scenario.Description.ShortDescription
-- scenario name
local scenarioName = scenarioUI:find("scenario_name_text")
local uc_name = ucstring()
uc_name:fromUtf8(i18n.get("uiR2EDScenarioFilename"):toUtf8() .. " " ..ucstring(scenario:getName()):toUtf8())
scenarioName.uc_hardtext = uc_name
scenarioName.text = i18n.get("uiR2EDScenarioFilename") .. " " ..scenario:getName()
self.lockComboBoxes = false
end
@ -769,7 +745,7 @@ function r2.ScenarioWindow:setScenarioNotes()
local scenarioGr = scenarioUI:find("scenario_properties")
assert(scenarioGr)
local scenarioNotes = scenarioGr:find("scenario_notes"):find("small_description").uc_input_string:toUtf8()
local scenarioNotes = scenarioGr:find("scenario_notes"):find("small_description").input_string
if r2.Scenario and scenarioNotes~= r2.Scenario.Description.ShortDescription then
r2.requestNewAction(i18n.get("uiR2EDChangeScenarioDescription"))
@ -865,7 +841,7 @@ end
-- the scenario title was changed by the user
function r2.ScenarioWindow:onTitleChanged()
if self.lockComboBoxes then return end
local newTitle = getUI("ui:interface:r2ed_scenario"):find("title_eb").eb.uc_input_string:toUtf8()
local newTitle = getUI("ui:interface:r2ed_scenario"):find("title_eb").eb.input_string
if newTitle ~= r2.Scenario.Description.Title then
r2.requestNewAction(i18n.get("uiR2EDChangeScenarioTitle"))
r2.requestSetNode(r2.Scenario.Description.InstanceId, "Title", newTitle)
@ -936,7 +912,7 @@ end
function r2.ScenarioWindow:onScenarioMissionTagChanged()
if self.lockComboBoxes then return end
if config.R2EDExtendedDebug ~= 1 then return end
local newTag = getUI("ui:interface:r2ed_palette"):find("mission_tag"):find("mission_tag_eb").eb.uc_input_string:toUtf8()
local newTag = getUI("ui:interface:r2ed_palette"):find("mission_tag"):find("mission_tag_eb").eb.input_string
self:setScenarioNotes()
self:onTitleChanged()

@ -97,9 +97,9 @@ function ScenarioScores:initScenarioScoresOLD()
-- windows title
if ratingsGr.active then
ui.uc_title = i18n.get("uiR2EDMyScenarioScores")
ui.title = i18n.get("uiR2EDMyScenarioScores")
else
ui.uc_title = i18n.get("uiR2EDScenarioScores")
ui.title = i18n.get("uiR2EDScenarioScores")
end
end

@ -112,7 +112,7 @@ function r2.SelectBar:update()
local function setupButton(butt, instance)
butt.active = true
butt.b.pushed = (instance == selection)
butt.b.uc_hardtext = instance:getDisplayName()
butt.b.text = instance:getDisplayName()
local icon = instance:getSelectBarIcon()
if icon ~= "" and icon ~= nil then
butt.icon.texture = icon
@ -323,7 +323,7 @@ function r2.SelectBar:browseSequences()
r2:clearMenu(rm)
for s = 0, activitySequences.Size - 1 do
local sequence = activitySequences[s]
rm:addLine(ucstring(r2:getSequenceName(sequence)), "lua", "r2:selectActivitiesSequence(".. tostring(s) .. ")", "s")
rm:addLine(r2:getSequenceName(sequence), "lua", "r2:selectActivitiesSequence(".. tostring(s) .. ")", "s")
end
rm:addSeparator()
r2:addMenuLine(rm, i18n.get("uiR2EDNewSequence"), "lua", "r2:newMiniActivitySequence()", "new_sequence", "r2_icon_create.tga", 14)

@ -10,10 +10,10 @@ r2.SelectBar =
LastMenuHideTrigger = nil, -- last element that triggered the disparition of the select bar menu
InstancesType = "",
InstancesTypes = {
{["type"]=i18n.get("uiR2EDScene"):toUtf8(), ["icon"]="r2_palette_entities.tga" },
{["type"]=i18n.get("uiR2EDMacroComponents"):toUtf8(), ["icon"]="r2_palette_components.tga" },
{["type"]=i18n.get("uiR2EDbotObjects"):toUtf8(), ["icon"]="r2_palette_objets.tga" },
{["type"]=i18n.get("uiR2EDPlotItems"):toUtf8(), ["icon"]="ICO_mission_purse.tga" }
{["type"]=i18n.get("uiR2EDScene"), ["icon"]="r2_palette_entities.tga" },
{["type"]=i18n.get("uiR2EDMacroComponents"), ["icon"]="r2_palette_components.tga" },
{["type"]=i18n.get("uiR2EDbotObjects"), ["icon"]="r2_palette_objets.tga" },
{["type"]=i18n.get("uiR2EDPlotItems"), ["icon"]="ICO_mission_purse.tga" }
},
}
@ -143,7 +143,7 @@ function r2.SelectBar:update()
local function setupButtonWithIconAndText(butt, text, icon, buttIndex)
butt.active = true
butt.b.uc_hardtext = text
butt.b.text = text
local icon = icon
if icon ~= "" and icon ~= nil then
butt.icon.texture = icon
@ -176,7 +176,7 @@ function r2.SelectBar:update()
break
end
end
setupButtonWithIconAndText(butt, ucstring(type), icon, buttIndex)
setupButtonWithIconAndText(butt, type, icon, buttIndex)
butt.Env.Types = true
end
@ -250,9 +250,7 @@ function r2.SelectBar:update()
if self.InstancesType~="" then
-- special button for different types
local ucname = ucstring()
ucname:fromUtf8(self.InstancesType)
setupButtonType(self:getButton(buttIndex), ucname, buttIndex)
setupButtonType(self:getButton(buttIndex), self.InstancesType, buttIndex)
self.Content[buttIndex] = currElem
buttIndex = buttIndex - 1
end
@ -305,7 +303,7 @@ function r2.SelectBar:update()
if buttIndex <= self:getMaxNumEntries() then
local butt = self:getButton(buttIndex)
butt.active = true
butt.b.uc_hardtext = i18n.get("uiR2EDSelectSubObject")
butt.b.text = i18n.get("uiR2EDSelectSubObject")
butt.icon.active = false
butt.b.text_x = 12
butt.b.wmargin = 12
@ -511,9 +509,7 @@ function r2.SelectBar:popMenu(index)
-- special case for act
if index==2 then
for k, v in pairs(self.InstancesTypes) do
local ucname = ucstring()
ucname:fromUtf8(v.type)
r2:addMenuLine(rm, ucname, "lua", "r2.SelectBar:openInstancesOfType('".. v.type .."','" .. v.icon .."')", v.type, v.icon, 14)
r2:addMenuLine(rm, v.type, "lua", "r2.SelectBar:openInstancesOfType('".. v.type .."','" .. v.icon .."')", v.type, v.icon, 14)
end
else
for k, v in pairs(sons) do
@ -528,7 +524,7 @@ function r2.SelectBar:popMenu(index)
if self.Content[index] and self.Content[index].InstanceId == r2:getSelectedInstance().InstanceId then
if r2:getSelectedInstance().BuildPropertySheet then
rm:addSeparator()
r2:addMenuLine(rm, concatUCString(i18n.get("uiRE2DPropertiesOf"), r2:getSelectedInstance():getDisplayName()), "lua", "r2:showProperties(r2:getSelectedInstance())", "prop", "r2_icon_properties.tga", 14)
r2:addMenuLine(rm, concatString(i18n.get("uiRE2DPropertiesOf"), r2:getSelectedInstance():getDisplayName()), "lua", "r2:showProperties(r2:getSelectedInstance())", "prop", "r2_icon_properties.tga", 14)
end
end
et = os.clock()
@ -562,9 +558,7 @@ function r2.SelectBar:browseSequences()
r2:clearMenu(rm)
for s = 0, activitySequences.Size - 1 do
local sequence = activitySequences[s]
local uc_sequ = ucstring()
uc_sequ:fromUtf8(sequence:getName())
rm:addLine(uc_sequ, "lua", "r2.activities:triggerSelectSequence('".. sequence.InstanceId .. "')", sequence.InstanceId)
rm:addLine(sequence:getName(), "lua", "r2.activities:triggerSelectSequence('".. sequence.InstanceId .. "')", sequence.InstanceId)
end
rm:addSeparator()
r2:addMenuLine(rm, i18n.get("uiR2EDNewSequence"), "lua", "r2.activities:newSequenceInst()", "new_sequence", "r2_icon_create.tga", 14)

@ -100,12 +100,12 @@ function r2.ToolUI:updateTooltip(onClickL, paramsL)
onClickL = defaulting(onClickL, getUICaller().onclick_l)
paramsL = defaulting(paramsL, getUICaller().params_l)
local expr = string.format("getKey('%s', '%s')", onClickL, paramsL)
local keyName = ucstring(runExpr(expr))
local keyName = runExpr(expr)
if keyName == i18n.get("uiNotAssigned") then
-- no associated key
setContextHelpText(getUICaller().tooltip)
else
setContextHelpText(concatUCString(getUICaller().tooltip, "@{6F6F} (", keyName, ")"))
setContextHelpText(concatString(getUICaller().tooltip, "@{6F6F} (", keyName, ")"))
end
end

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save