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 text = self:getProgressGroup():find("text")
local ellipsisTxt = self:getProgressGroup():find("ellipsis") local ellipsisTxt = self:getProgressGroup():find("ellipsis")
text.color = color text.color = color
text.uc_hardtext = ucstr text.text = ucstr
if ellipsis then if ellipsis then
ellipsisTxt.hardtext = ellipsis ellipsisTxt.hardtext = ellipsis
else else
@ -60,7 +60,7 @@ function bgdownloader:setProgressText(ucstr, color, progress, ellipsis)
-- any current download to finish, otherwise connection may be lost) -- any current download to finish, otherwise connection may be lost)
self:setIcon("bgd_pause.tga") self:setIcon("bgd_pause.tga")
ellipsisTxt.hardtext = "" ellipsisTxt.hardtext = ""
text.uc_hardtext = pausedText text.text = pausedText
else else
self:setIcon("") self:setIcon("")
local progressCtrl = self:getProgressBar() local progressCtrl = self:getProgressBar()
@ -88,7 +88,7 @@ function bgdownloader:setPatchProgress(progress)
local progressDate = nltime.getLocalTime() / 500 local progressDate = nltime.getLocalTime() / 500
local colValue = math.floor(230 + 24 * math.sin(progressDate)) local colValue = math.floor(230 + 24 * math.sin(progressDate))
local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255) 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 end
------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------
@ -110,7 +110,7 @@ function bgdownloader:setPatchError()
self:getProgressGroup().active = true self:getProgressGroup().active = true
end end
local errMsg = getPatchLastErrorMessage() local errMsg = getPatchLastErrorMessage()
if errMsg == ucstring() then if errMsg == "" then
self:setProgressText(i18n.get("uiBGD_PatchError"), "255 0 0 255", 0) self:setProgressText(i18n.get("uiBGD_PatchError"), "255 0 0 255", 0)
else else
self:setProgressText(errMsg, "255 0 0 255", 0) 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" /> <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" /> <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" /> <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" /> <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> </group>
</template> </template>
@ -376,7 +376,7 @@
<view type="bitmap" id="icone" posref="TL TL" texture="money_seve.tga" global_color="false" /> <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" /> <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" /> <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> </group>
</template> </template>
<!-- the modal --> <!-- the modal -->

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

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

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

@ -796,7 +796,7 @@
<action handler="remove_link" params="id=mission_timer_link" /> <action handler="remove_link" params="id=mission_timer_link" />
<action handler="remove_link" params="id=mission_time2_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" /> <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" /> <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_timer_link" />
<action handler="remove_link" params="id=mission_time2_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" /> <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" /> <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 if (key ~= nil and key ~= '') then
key = ' @{T25}@{2F2F}(' .. key .. ')'; key = ' @{T25}@{2F2F}(' .. key .. ')';
text = concatUCString(text, key); text = concatString(text, key);
end end
-- if we don't do the full getUI, it doesn't work (don't understand why) -- 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); local uiQC= getUI("ui:interface:user_chat_emote_menu:quick_chat:" .. "qc" .. i);
uiQC.uc_hardtext_format= text; uiQC.text_format= text;
end end
end end
@ -358,7 +358,7 @@ function game:updateTargetConsiderUI()
end end
if impossible then if impossible then
wgToolTip.tooltip = concatUCString(wgToolTip.tooltip, ucstring("\n"), i18n.get("uittConsiderUnknownLevel")) wgToolTip.tooltip = concatString(wgToolTip.tooltip, "\n", i18n.get("uittConsiderUnknownLevel"))
end end
end end

@ -28,7 +28,7 @@
<define id="force_level_8" value="consider_7.tga" /> <define id="force_level_8" value="consider_7.tga" />
<proc id="proc_target_changed"> <proc id="proc_target_changed">
<!-- Name --> <!-- 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 --> <!-- Region force & Force level of the creature/player -->
<!-- old consider system --> <!-- 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"> <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" /> <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="" /> <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> </group>
<!-- ***************** --> <!-- ***************** -->
@ -469,7 +469,7 @@
<!-- link to display the group when the team member is present --> <!-- link to display the group when the team member is present -->
<link expr="ne(@SERVER:GROUP:#team_mate_index:NAME, 0)" target="active" /> <link expr="ne(@SERVER:GROUP:#team_mate_index:NAME, 0)" target="active" />
<!-- links to display the name of the team mate --> <!-- 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 --> <!-- 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), <link expr="ifthenelse(eq(@SERVER:GROUP:#team_mate_index:UID,@UI:VARIABLES:TARGET:UID),
'255 0 0 255', '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"> <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="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" /> <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="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="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="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> </group>
<ctrl style="skin_scroll" id="scroll_bar_theme" align="T" target="scroll_text" posparent="crop" posref="TL TR" x="-8" y="0" /> <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" /> <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="" 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_loose_focus="true" prompt="&gt;"
enter_recover_focus="true" enter_recover_focus="true"
max_num_chars="256" max_num_chars="255"
menu_r="" menu_r=""
onchange="" onchange=""
onchange_params="" onchange_params=""
@ -404,7 +404,7 @@
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;" enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true" enter_recover_focus="true"
max_num_chars="256" max_num_chars="255"
menu_r="" menu_r=""
onchange="" onchange=""
onchange_params="" onchange_params=""
@ -447,7 +447,7 @@
sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true" sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;" enter_loose_focus="true" prompt="&gt;"
enter_recover_focus="true" enter_recover_focus="true"
max_num_chars="256" max_num_chars="255"
menu_r="" menu_r=""
onchange="" onchange=""
onchange_params="" onchange_params=""

@ -456,8 +456,8 @@
<proc id="respawn_map_activated"> <proc id="respawn_map_activated">
<action handler="exit_free_look" /> <action handler="exit_free_look" />
<action handler="set" params="dblink=UI:VARIABLES:RESPAWN:MSG_SENT|value=0" /> <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(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: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: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_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" /> <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> </proc>

@ -353,7 +353,7 @@ end
-- local text = self:getProgressGroup():find("text") -- local text = self:getProgressGroup():find("text")
-- local ellipsisTxt = self:getProgressGroup():find("ellipsis") -- local ellipsisTxt = self:getProgressGroup():find("ellipsis")
-- text.color = color -- text.color = color
-- text.uc_hardtext = ucstr -- text.text = ucstr
-- if ellipsis then -- if ellipsis then
-- ellipsisTxt.hardtext = ellipsis -- ellipsisTxt.hardtext = ellipsis
-- else -- else
@ -378,7 +378,7 @@ end
-- local progressDate = nltime.getLocalTime() / 500 -- local progressDate = nltime.getLocalTime() / 500
-- local colValue = math.floor(230 + 24 * math.sin(progressDate)) -- local colValue = math.floor(230 + 24 * math.sin(progressDate))
-- local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255) -- 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 --end
-- --
--function outgame:setPatchSuccess() --function outgame:setPatchSuccess()

@ -1560,7 +1560,7 @@
<proc id="proc_appear_name_enter"> <proc id="proc_appear_name_enter">
<action handler="reset_keyboard_focus" /> <action handler="reset_keyboard_focus" />
<action handler="play_sound" params="name=summary_enter_name" /> <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>
<proc id="proc_appear_name_cancel"> <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: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="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>
<proc id="proc_charsel_initslot_empty"> <proc id="proc_charsel_initslot_empty">

@ -109,11 +109,11 @@
</proc> </proc>
<proc id="proc_select_init_right_screen" > <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=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:uc_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:uc_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=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="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="set_db_from_slot" params="dblink=UI:TEMP:CHAR3D|slot=@UI:NEW_SELECTED_SLOT" />
<action handler="proc" params="proc_charsel_init3d" /> <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 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"> <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=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: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: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=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=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="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="set_db_from_slot" params="dblink=UI:TEMP:CHAR3D|slot=@UI:SELECTED_SLOT" />
<action handler="proc" params="proc_charsel_init3d" /> <action handler="proc" params="proc_charsel_init3d" />

@ -184,12 +184,12 @@
<proc id="proc_sum_enter_name"> <proc id="proc_sum_enter_name">
<action handler="reset_keyboard_focus" /> <action handler="reset_keyboard_focus" />
<action handler="play_sound" params="name=summary_enter_name" /> <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>
<!-- proc_sum_enter_name2 is called after the server reception of VALID look at SERVER_RECEIVED_VALID --> <!-- proc_sum_enter_name2 is called after the server reception of VALID look at SERVER_RECEIVED_VALID -->
<proc id="proc_sum_enter_name2"> <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='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)" /> <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" <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" sizeref="" id="eb" posparent="parent" onenter="chat_box_entry" params="" reset_focus_on_hide="true"
enter_loose_focus="true" prompt="&gt;" enter_loose_focus="true" prompt="&gt;"
max_num_chars="256" max_num_chars="255"
max_num_bytes="0"
menu_r="" menu_r=""
onchange="" onchange=""
onchange_params="" onchange_params=""
@ -100,7 +101,7 @@
fontsize="12" 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 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 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"/> <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> </group>

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

@ -145,7 +145,7 @@
<link expr="and(ne(@SERVER:GUILD:OUTPOST:O#index:SHEET,0), <link expr="and(ne(@SERVER:GUILD:OUTPOST:O#index:SHEET,0),
eq(@SERVER:GUILD:OUTPOST:O#index:OWNED,#owned))" target="#id:active" /> eq(@SERVER:GUILD:OUTPOST:O#index:OWNED,#owned))" target="#id:active" />
<!-- name of the outpost --> <!-- 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 --> <!-- 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 --> <!-- 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" > <group id="global_state" sizeref="w" w="0" child_resize_h="true" posparent="sep_gs" posref="BL TL" x="0" y="-10" >
<!-- NAME --> <!-- NAME -->
<view type="text" id="outpost_name" posref="TM TM" x="0" y="0" global_color="false" fontsize="12" shadow="true" /> <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 --> <!-- LEVEL -->
<view style="outpost_title" id="title_level" posparent="parent" posref="TL TL" x="0" y="-20" hardtext="uiOutpostLevel" /> <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" /> <instance template="text_tt" posparent="title_level" tooltip="uittOutpostLevel" />
<view style="outpost_value_R" id="outpost_level" posparent="title_level" /> <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 --> <!-- OWNER: GUILD/TRIBE -->
<view style="outpost_title" id="title_owner" posparent="title_level" hardtext="uiOutpostOwner" /> <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" /> <instance template="text_tt" posparent="title_att_period" tooltip="uittOutpostAttPeriod" />
<view style="outpost_value_RC2" id="outpost_att_period" posparent="title_att_period" /> <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)" <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 --> <!-- ACTUAL DEFENDER PERIOD -->
<view style="outpost_title" id="title_def_period" posparent="title_att_period" hardtext="uiOutpostDefPeriod" case_mode="%case_normal" /> <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" /> <instance template="text_tt" posparent="title_def_period" tooltip="uittOutpostDefPeriod" />
<view style="outpost_value_RC2" id="outpost_def_period" posparent="title_def_period" /> <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)" <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 --> <!-- TIME ZONE SELECTION -->
<instance template="t_outpost_time_zone_selector" id="time_zone_selector" posparent="title_def_period" /> <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 --> <!-- active the line if the squad slot is here -->
<link expr="ne(@%outpost_selected:SQUADS:SP#index:SHEET, 0)" target="#id:active" /> <link expr="ne(@%outpost_selected:SQUADS:SP#index:SHEET, 0)" target="#id:active" />
<!-- name of the squad --> <!-- 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 --> <!-- 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> </template>
@ -530,14 +530,14 @@
<!-- active the line if the squad slot is here --> <!-- active the line if the squad slot is here -->
<link expr="ne(@%outpost_selected:SQUADS:T#index:SHEET, 0)" target="#id:active" /> <link expr="ne(@%outpost_selected:SQUADS:T#index:SHEET, 0)" target="#id:active" />
<!-- name of the squad --> <!-- 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 --> <!-- 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 --> <!-- clickable only if allowed rights -->
<link expr="ne(@SERVER:USER:OUTPOST_ADMIN,0)" target="#id:select:active" /> <link expr="ne(@SERVER:USER:OUTPOST_ADMIN,0)" target="#id:select:active" />
<link expr="eq(@SERVER:USER:OUTPOST_ADMIN,0)" target="#id:spawn:frozen" /> <link expr="eq(@SERVER:USER:OUTPOST_ADMIN,0)" target="#id:spawn:frozen" />
<!-- spawn pos button --> <!-- 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> </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_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" /> <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="getOutpostBuildingName(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_name:hardtext" />
<link expr="getOutpostBuildingDesc(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_desc:uc_hardtext" /> <link expr="getOutpostBuildingDesc(@%outpost_selected:BUILDINGS:#index:SHEET)" target="building_desc:hardtext" />
<link expr="@UI:TEMP:OUTPOST:SELECTION" action="lua:game:outpostUpdateBuildingSheet(#index)" /> <link expr="@UI:TEMP:OUTPOST:SELECTION" action="lua:game:outpostUpdateBuildingSheet(#index)" />
</group> </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" /> <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 --> <!-- Different Doc wether attacking or defending -->
<link expr="localize(ifthenelse(@%outpost_selected:OWNED, 'uiOutpostSquadEditDef', 'uiOutpostSquadEditAtt'))" <link expr="localize(ifthenelse(@%outpost_selected:OWNED, 'uiOutpostSquadEditDef', 'uiOutpostSquadEditAtt'))"
target="explain_edit:uc_hardtext_format" /> target="explain_edit:hardtext_format" />
<!-- Current Round --> <!-- 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" /> <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" <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()" 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" /> 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="eq(@SERVER:USER:OUTPOST_ADMIN,0)" target="cap_but:frozen" />
<link expr="ifthenelse(eq(@SERVER:USER:OUTPOST_ADMIN,0), <link expr="ifthenelse(eq(@SERVER:USER:OUTPOST_ADMIN,0),
localize('uiOutpostCapitalEditKO'), 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="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" /> <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" /> <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" /> <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"/> <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'))" <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="building1:active" />
<link expr="ifthenelse(eq(@%outpost_selected:OWNED,0), 0, 1)" target="building2: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" > <group id="content" x="0" y="0" w="0" h="0" child_resize_h="true" child_resize_hmargin="8" posref="TL TL" >
<!-- NAME --> <!-- NAME -->
<view type="text" id="outpost_name" posref="TM TM" x="0" y="-8" global_color="false" fontsize="12" shadow="true" /> <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 --> <!-- WAR COST -->
<view style="outpost_title" id="title_war_cost" posparent="parent" posref="TL TL" x="0" y="-30" hardtext="uiOutpostWarCost" /> <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" /> <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" /> <view style="outpost_value_B" id="outpost_war_cost_desc" posparent="title_war_cost" hardtext="uiOutpostWarCostDesc" fontsize="10" />
<!-- TIME SETUP --> <!-- TIME SETUP -->
@ -804,7 +804,7 @@
<view style="outpost_value_B" id="outpost_att_period" posparent="title_att_period" /> <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) --> <!-- 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)" <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 --> <!-- Relevant only if ACK received -->
<link expr="@UI:TEMP:OUTPOST:DECLARE_WAR_ACK_RECEIVED" target="outpost_att_period:active" /> <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 --> <!-- 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" /> <link expr="ne(@%outpost_selected:SQUAD_SHOP:#index:SHEET, 0)" target="#id:active,#id_select:active" />
<!-- squad name --> <!-- 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 --> <!-- 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> </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" /> <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), <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 --> <!-- SET / CANCEL -->
<instance template="button_ok_cancel" posref="BR BR" x="-8" y="4" <instance template="button_ok_cancel" posref="BR BR" x="-8" y="4"

@ -730,7 +730,7 @@
<!-- NAME. Get the Name spell --> <!-- NAME. Get the Name spell -->
<view type="text" id="spell_name" posref="TL TL" y="-1" w="120" h="10" shadow="true" fontsize="10" <view type="text" id="spell_name" posref="TL TL" y="-1" w="120" h="10" shadow="true" fontsize="10"
global_color="false" /> 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) --> <!-- COSTS (HP, SAP, STA) -->
<!-- <!--

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

@ -1227,7 +1227,7 @@
</group> </group>
<instance template="edit_box_widget" id="mission_tag_eb" posref="MR ML" x="0" posparent="mission_tag_label" w="200" <instance template="edit_box_widget" id="mission_tag_eb" posref="MR ML" x="0" posparent="mission_tag_label" w="200"
onenter="lua" onenter="lua"
negative_filter = '"{}[]' negative_filter = ''
fontsize="12" fontsize="12"
params="r2.ScenarioWindow:onScenarioMissionTagChanged()" params="r2.ScenarioWindow:onScenarioMissionTagChanged()"
on_focus_lost="lua" 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="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"> <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" <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" child_resize_hmargin="4"
max_historic="0" max_historic="0"
y="-2" 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" <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" onenter="#onenter" params="#params" onchange="#onchange" onchange_params="#onchange_params"
on_focus_lost="#on_focus_lost" on_focus_lost_params="#on_focus_lost_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="" > 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" /> <instance template="box_widget" id="back_edit_box" posref="TL TL" sizeref="w" h="20" />
@ -3019,7 +3019,7 @@ text_y="-2"
</proc> </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" <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" 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" > lockable="true" openable="false" opened="true" movable="true" active="false" savable="true" >

@ -667,7 +667,7 @@
</group> </group>
<instance template="edit_box_widget" id="title_eb" posref="MR ML" x="0" posparent="title_label" w="200" <instance template="edit_box_widget" id="title_eb" posref="MR ML" x="0" posparent="title_label" w="200"
onenter="lua" onenter="lua"
negative_filter = '"{}[]' negative_filter = ''
fontsize="12" fontsize="12"
params="r2.ScenarioWindow:onTitleChanged()" params="r2.ScenarioWindow:onTitleChanged()"
on_focus_lost="lua" 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 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" <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" child_resize_h="true" w="-15" child_resize_hmargin="10" max_sizeparent="crop_desc" max_sizeref="h"
max_h="-4" want_return="true" max_h="-4" want_return="true"
on_focus_lost="lua" on_focus_lost="lua"
on_focus_lost_params="r2.ScenarioWindow:setScenarioNotes() r2.ScenarioWindow:cancelFocusOnText()" 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" <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" <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" 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()" > 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" <view type="text" id="edit_text" x="4" y="-1" posref="TL TL" multi_line="true"
@ -1000,7 +1000,7 @@
</group> </group>
<!-- title update --> <!-- 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 node="r2ed_dm_gift">
</tree> </tree>

@ -446,7 +446,7 @@
<!-- ************ --> <!-- ************ -->
<!-- MISC --> <!-- 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"/> <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 --> <!-- reenable missions, possibly hidden after a ring session -->
<action handler="lua:game:updateMissionJournalMode()"/> <action handler="lua:game:updateMissionJournalMode()"/>

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

@ -45,24 +45,24 @@ function game.RingAccessPointFilter:init()
local levelCB = filterScenarioWnd:find("level"):find("combo_box") local levelCB = filterScenarioWnd:find("level"):find("combo_box")
assert(levelCB) assert(levelCB)
levelCB:resetTexts() levelCB:resetTexts()
levelCB:addText(ucstring(i18n.get("uiScenarioLevel_Any"))) levelCB:addText(i18n.get("uiScenarioLevel_Any"))
levelCB:addText(ucstring("1-50")) levelCB:addText("1-50")
levelCB:addText(ucstring("51-100")) levelCB:addText("51-100")
levelCB:addText(ucstring("101-150")) levelCB:addText("101-150")
levelCB:addText(ucstring("151-200")) levelCB:addText("151-200")
levelCB:addText(ucstring("201-250")) levelCB:addText("201-250")
levelCB.selection = 0 levelCB.selection = 0
local genreCB = filterScenarioWnd:find("genre"):find("combo_box") local genreCB = filterScenarioWnd:find("genre"):find("combo_box")
assert(genreCB) assert(genreCB)
genreCB:resetTexts() genreCB:resetTexts()
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_Any"))) genreCB:addText(i18n.get("uiScenarioOrient_Any"))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_NewbieTraining"))) genreCB:addText(i18n.get("uiScenarioOrient_NewbieTraining"))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_StoryTelling"))) genreCB:addText(i18n.get("uiScenarioOrient_StoryTelling"))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_Mistery"))) genreCB:addText(i18n.get("uiScenarioOrient_Mistery"))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_HackSlash"))) genreCB:addText(i18n.get("uiScenarioOrient_HackSlash"))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_GuildTraining"))) genreCB:addText(i18n.get("uiScenarioOrient_GuildTraining"))
genreCB:addText(ucstring(i18n.get("uiScenarioOrient_Other"))) genreCB:addText(i18n.get("uiScenarioOrient_Other"))
genreCB.selection = 0 genreCB.selection = 0
local name = filterScenarioWnd:find("name"):find("edit_box_group") local name = filterScenarioWnd:find("name"):find("edit_box_group")
@ -85,10 +85,10 @@ function game.RingAccessPointFilter:getURLParameters()
local filterScenarioWnd = self:getWnd() local filterScenarioWnd = self:getWnd()
assert(filterScenarioWnd) 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 level = self.LevelToURLParam[filterScenarioWnd:find("level"):find("combo_box").selection]
local orientation = self.OrientationToURLParam[filterScenarioWnd:find("genre"):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 charSlot = getCharSlot()
local result = string.format("&owner=%s&level=%s&orientation=%s&name=%s&charSlot=%u", encodeURLUnicodeParam(owner), level, orientation, encodeURLUnicodeParam(name), charSlot) 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 end
local ucUrl local ucUrl
if config.Local == 1 then if config.Local == 1 then
ucUrl = ucstring(NicoMagicURL) -- for test in local mode ucUrl = NicoMagicURL -- for test in local mode
else else
ucUrl = getDynString(game.NpcWebPage.UrlTextId) ucUrl = getDynString(game.NpcWebPage.UrlTextId)
end end
debugInfo(tostring(ucUrl)) debugInfo(tostring(ucUrl))
local utf8Url = ucUrl:toUtf8() local utf8Url = ucUrl
local browser = getUI("ui:interface:npc_web_browser"):find("html") 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.... -- when in ring mode, add the parameters ourselves. 60 second is the timout for zope....
browseNpcWebPage(getUIId(browser), utf8Url .. self:getURLParameters(), false, 60) 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" /> <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" <instance template="button_ok_cancel" posparent="add_contact_eb" posref="BR TR" x="0" y="-4"
onclick_ok="r2ed_invite_character" onclick_ok="r2ed_invite_character"
@ -832,7 +832,7 @@
onenter="" params="" onenter="" params=""
on_focus_lost="" on_focus_lost_params="" on_focus_lost="" on_focus_lost_params=""
reset_focus_on_hide="true" 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" <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 if (key ~= nil and key ~= '') then
key = ' @{2F2F}(' .. key .. ')' key = ' @{2F2F}(' .. key .. ')'
text = concatUCString(text, key) text = concatString(text, key)
end end
setContextHelpText(text) setContextHelpText(text)

@ -579,9 +579,9 @@
<!-- ********************* --> <!-- ********************* -->
<!-- * EDIT BOX WIDGET * --> <!-- * 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 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 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" /> <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> </group>

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

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

@ -465,7 +465,7 @@ local generatePreCode = function(fName)
.."local comp = r2.newComponent('UserComponentHolder')\n\t" .."local comp = r2.newComponent('UserComponentHolder')\n\t"
.."assert(comp)\n\n\t" .."assert(comp)\n\n\t"
.."comp.Base = \"palette.entities.botobjects.user_event\"\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.x = x\n\t"
.."comp.Position.y = y\n\t" .."comp.Position.y = y\n\t"
.."comp.Position.z = r2:snapZToGround(x, y)\n\n\t" .."comp.Position.z = r2:snapZToGround(x, y)\n\n\t"

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

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

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

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

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

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

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

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

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

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

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

@ -172,7 +172,7 @@ component.createComponent = function(x, y)
assert(comp) assert(comp)
comp.Base = "palette.entities.botobjects.milestone" 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.x = x
comp.Position.y = y comp.Position.y = y
@ -252,7 +252,7 @@ end
function component:registerMenu(logicEntityMenu) function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdEmptyFeature") local name = i18n.get("uiR2EdEmptyFeature")
logicEntityMenu:addLine(ucstring(name), "lua", "", "EmptyFeature") logicEntityMenu:addLine(name, "lua", "", "EmptyFeature")
end end
function component:getLogicTranslations() function component:getLogicTranslations()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -140,7 +140,7 @@ component.createComponent = function(x, y)
assert(comp) assert(comp)
comp.Base = "palette.entities.botobjects.milestone" 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.x = x
comp.Position.y = y comp.Position.y = y
@ -191,7 +191,7 @@ end
function component:registerMenu(logicEntityMenu) function component:registerMenu(logicEntityMenu)
local name = i18n.get("uiR2EdUserItemFeature") local name = i18n.get("uiR2EdUserItemFeature")
logicEntityMenu:addLine(ucstring(name), "lua", "", "UserItemFeature") logicEntityMenu:addLine(name, "lua", "", "UserItemFeature")
end end
function component:getLogicEntityAttributes() function component:getLogicEntityAttributes()

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

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

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

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

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

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

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

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

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

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

@ -25,12 +25,13 @@ function r2.ui.AnimActs:popMenu()
-- --
if not acts then return end if not acts then return end
for k = 2, table.getn(acts) do for k = 2, table.getn(acts) do
local str = ""
if acts[k].Name == "" then if acts[k].Name == "" then
r2.ScratchUCStr = i18n.get("uiR2EDUnamedAct") str = i18n.get("uiR2EDUnamedAct")
else else
r2.ScratchUCStr:fromUtf8(acts[k].Name) str = acts[k].Name
end end
rootMenu:addLine(r2.ScratchUCStr, "lua", "r2.ui.AnimActs:chooseAct(" .. tostring(k) .. ")", "") rootMenu:addLine(str, "lua", "r2.ui.AnimActs:chooseAct(" .. tostring(k) .. ")", "")
end end
launchContextMenuInGame(menuName) launchContextMenuInGame(menuName)
local but = getUI("ui:interface:r2ed_testbar"):find("r2ed_anim_acts") 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 if not triggers then return end
for k = 1, table.getn(triggers) do for k = 1, table.getn(triggers) do
if triggers[k].Act == 0 or triggers[k].Act == r2.getCurrentActIndex() then if triggers[k].Act == 0 or triggers[k].Act == r2.getCurrentActIndex() then
r2.ScratchUCStr:fromUtf8(triggers[k].Name) rootMenu:addLine(triggers[k].Name, "lua",
rootMenu:addLine(r2.ScratchUCStr, "lua",
string.format("r2.ui.AnimUserTriggers:fireTrigger(%d, %d)", triggers[k].Act, triggers[k].Id), "") string.format("r2.ui.AnimUserTriggers:fireTrigger(%d, %d)", triggers[k].Act, triggers[k].Id), "")
end end
end end
@ -46,8 +45,7 @@ function r2.ui.AnimUserTriggers:fireTrigger(triggerAct, triggerId)
r2.triggerUserTrigger(triggerAct, triggerId) r2.triggerUserTrigger(triggerAct, triggerId)
local trig = self:findTrigger(triggerAct, triggerId) local trig = self:findTrigger(triggerAct, triggerId)
if trig then if trig then
r2.ScratchUCStr:fromUtf8(trig.Name) displaySystemInfo(concatString(i18n.get("uiR2EDTriggering"), trig.Name), "BC")
displaySystemInfo(concatUCString(i18n.get("uiR2EDTriggering"), r2.ScratchUCStr), "BC")
end end
end end

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -112,7 +112,7 @@ function r2.SelectBar:update()
local function setupButton(butt, instance) local function setupButton(butt, instance)
butt.active = true butt.active = true
butt.b.pushed = (instance == selection) butt.b.pushed = (instance == selection)
butt.b.uc_hardtext = instance:getDisplayName() butt.b.text = instance:getDisplayName()
local icon = instance:getSelectBarIcon() local icon = instance:getSelectBarIcon()
if icon ~= "" and icon ~= nil then if icon ~= "" and icon ~= nil then
butt.icon.texture = icon butt.icon.texture = icon
@ -323,7 +323,7 @@ function r2.SelectBar:browseSequences()
r2:clearMenu(rm) r2:clearMenu(rm)
for s = 0, activitySequences.Size - 1 do for s = 0, activitySequences.Size - 1 do
local sequence = activitySequences[s] 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 end
rm:addSeparator() rm:addSeparator()
r2:addMenuLine(rm, i18n.get("uiR2EDNewSequence"), "lua", "r2:newMiniActivitySequence()", "new_sequence", "r2_icon_create.tga", 14) 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 LastMenuHideTrigger = nil, -- last element that triggered the disparition of the select bar menu
InstancesType = "", InstancesType = "",
InstancesTypes = { InstancesTypes = {
{["type"]=i18n.get("uiR2EDScene"):toUtf8(), ["icon"]="r2_palette_entities.tga" }, {["type"]=i18n.get("uiR2EDScene"), ["icon"]="r2_palette_entities.tga" },
{["type"]=i18n.get("uiR2EDMacroComponents"):toUtf8(), ["icon"]="r2_palette_components.tga" }, {["type"]=i18n.get("uiR2EDMacroComponents"), ["icon"]="r2_palette_components.tga" },
{["type"]=i18n.get("uiR2EDbotObjects"):toUtf8(), ["icon"]="r2_palette_objets.tga" }, {["type"]=i18n.get("uiR2EDbotObjects"), ["icon"]="r2_palette_objets.tga" },
{["type"]=i18n.get("uiR2EDPlotItems"):toUtf8(), ["icon"]="ICO_mission_purse.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) local function setupButtonWithIconAndText(butt, text, icon, buttIndex)
butt.active = true butt.active = true
butt.b.uc_hardtext = text butt.b.text = text
local icon = icon local icon = icon
if icon ~= "" and icon ~= nil then if icon ~= "" and icon ~= nil then
butt.icon.texture = icon butt.icon.texture = icon
@ -176,7 +176,7 @@ function r2.SelectBar:update()
break break
end end
end end
setupButtonWithIconAndText(butt, ucstring(type), icon, buttIndex) setupButtonWithIconAndText(butt, type, icon, buttIndex)
butt.Env.Types = true butt.Env.Types = true
end end
@ -250,9 +250,7 @@ function r2.SelectBar:update()
if self.InstancesType~="" then if self.InstancesType~="" then
-- special button for different types -- special button for different types
local ucname = ucstring() setupButtonType(self:getButton(buttIndex), self.InstancesType, buttIndex)
ucname:fromUtf8(self.InstancesType)
setupButtonType(self:getButton(buttIndex), ucname, buttIndex)
self.Content[buttIndex] = currElem self.Content[buttIndex] = currElem
buttIndex = buttIndex - 1 buttIndex = buttIndex - 1
end end
@ -305,7 +303,7 @@ function r2.SelectBar:update()
if buttIndex <= self:getMaxNumEntries() then if buttIndex <= self:getMaxNumEntries() then
local butt = self:getButton(buttIndex) local butt = self:getButton(buttIndex)
butt.active = true butt.active = true
butt.b.uc_hardtext = i18n.get("uiR2EDSelectSubObject") butt.b.text = i18n.get("uiR2EDSelectSubObject")
butt.icon.active = false butt.icon.active = false
butt.b.text_x = 12 butt.b.text_x = 12
butt.b.wmargin = 12 butt.b.wmargin = 12
@ -511,9 +509,7 @@ function r2.SelectBar:popMenu(index)
-- special case for act -- special case for act
if index==2 then if index==2 then
for k, v in pairs(self.InstancesTypes) do for k, v in pairs(self.InstancesTypes) do
local ucname = ucstring() r2:addMenuLine(rm, v.type, "lua", "r2.SelectBar:openInstancesOfType('".. v.type .."','" .. v.icon .."')", v.type, v.icon, 14)
ucname:fromUtf8(v.type)
r2:addMenuLine(rm, ucname, "lua", "r2.SelectBar:openInstancesOfType('".. v.type .."','" .. v.icon .."')", v.type, v.icon, 14)
end end
else else
for k, v in pairs(sons) do 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 self.Content[index] and self.Content[index].InstanceId == r2:getSelectedInstance().InstanceId then
if r2:getSelectedInstance().BuildPropertySheet then if r2:getSelectedInstance().BuildPropertySheet then
rm:addSeparator() 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
end end
et = os.clock() et = os.clock()
@ -562,9 +558,7 @@ function r2.SelectBar:browseSequences()
r2:clearMenu(rm) r2:clearMenu(rm)
for s = 0, activitySequences.Size - 1 do for s = 0, activitySequences.Size - 1 do
local sequence = activitySequences[s] local sequence = activitySequences[s]
local uc_sequ = ucstring() rm:addLine(sequence:getName(), "lua", "r2.activities:triggerSelectSequence('".. sequence.InstanceId .. "')", sequence.InstanceId)
uc_sequ:fromUtf8(sequence:getName())
rm:addLine(uc_sequ, "lua", "r2.activities:triggerSelectSequence('".. sequence.InstanceId .. "')", sequence.InstanceId)
end end
rm:addSeparator() rm:addSeparator()
r2:addMenuLine(rm, i18n.get("uiR2EDNewSequence"), "lua", "r2.activities:newSequenceInst()", "new_sequence", "r2_icon_create.tga", 14) 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) onClickL = defaulting(onClickL, getUICaller().onclick_l)
paramsL = defaulting(paramsL, getUICaller().params_l) paramsL = defaulting(paramsL, getUICaller().params_l)
local expr = string.format("getKey('%s', '%s')", onClickL, paramsL) local expr = string.format("getKey('%s', '%s')", onClickL, paramsL)
local keyName = ucstring(runExpr(expr)) local keyName = runExpr(expr)
if keyName == i18n.get("uiNotAssigned") then if keyName == i18n.get("uiNotAssigned") then
-- no associated key -- no associated key
setContextHelpText(getUICaller().tooltip) setContextHelpText(getUICaller().tooltip)
else else
setContextHelpText(concatUCString(getUICaller().tooltip, "@{6F6F} (", keyName, ")")) setContextHelpText(concatString(getUICaller().tooltip, "@{6F6F} (", keyName, ")"))
end end
end end

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

Loading…
Cancel
Save