Fix R2 feature info checkbox, kaetemi/ryzomclassic#158

ryzomclassic-develop
kaetemi 4 years ago
parent 7a9accde11
commit b61ad76ac2

@ -3064,13 +3064,13 @@ text_y="-2"
<!--<view type="text" id="help_text" posref="TL TL" posparent="parent" x="0" y="-14" color="255 255 255 255" fontsize="12" shadow="true" <!--<view type="text" id="help_text" posref="TL TL" posparent="parent" x="0" y="-14" color="255 255 255 255" fontsize="12" shadow="true"
global_color="true" hardtext="" multi_line="true" multi_line_space="0" /> global_color="true" hardtext="" multi_line="true" multi_line_space="0" />
--> -->
<ctrl type="button" id="custom_bbox_enabled" button_type="toggle_button" posref="BL BL" posparent="tb_enclosing" x="0" y="-14" <ctrl type="button" id="show_again" button_type="toggle_button" posref="BL BL" posparent="tb_enclosing" x="0" y="-14"
tx_normal="w_slot_on.tga" tx_pushed="w_opacity_on.tga" tx_over="w_slot_on.tga" pushed="true" tx_normal="w_slot_on.tga" tx_pushed="w_opacity_on.tga" tx_over="w_slot_on.tga" pushed="true"
color="255 255 255 255" col_pushed="255 255 255 255" col_over="255 255 255 0" color="255 255 255 255" col_pushed="255 255 255 255" col_over="255 255 255 0"
onclick_l="lua" onclick_l="lua"
params_l="r2.CustomBBox:updateFromUI()" params_l="r2.CustomBBox:updateFromUI()"
/> />
<view type="text" id="text_custom" posparent="custom_bbox_enabled" posref="MR ML" x="4" y="-3" global_color="true" fontsize="12" shadow="true" hardtext="uiR2showMessageAgain" auto_clamp="true"/> <view type="text" id="show_again_label" posparent="show_again" posref="MR ML" x="4" y="-3" global_color="true" fontsize="12" shadow="true" hardtext="uiR2showMessageAgain" auto_clamp="true"/>
<ctrl style="button_ok" x="0" y="6" posref="BM BM" text_y="0" <ctrl style="button_ok" x="0" y="6" posref="BM BM" text_y="0"
onclick_l="proc" params_l="help_close" hardtext="uittOK" /> onclick_l="proc" params_l="help_close" hardtext="uittOK" />

@ -1027,9 +1027,9 @@ r2.displayFeatureHelp = function(className)
assert(nil) assert(nil)
end end
local checkBox = getUI("ui:interface:feature_help:content:custom_bbox_enabled") local checkBox = getUI("ui:interface:feature_help:content:show_again")
assert(checkBox) assert(checkBox)
local chkBoxText = getUI("ui:interface:feature_help:content:text_custom") local chkBoxText = getUI("ui:interface:feature_help:content:show_again_label")
assert(chkBoxText) assert(chkBoxText)
if className == "Npc" then if className == "Npc" then
@ -1082,21 +1082,21 @@ end
function r2.setFeatureDisplayHelp() function r2.setFeatureDisplayHelp()
local checkBox = getUI("ui:interface:feature_help:content:custom_bbox_enabled") local checkBox = getUI("ui:interface:feature_help:content:show_again")
assert(checkBox) assert(checkBox)
local isChecked = checkBox.pushed local showAgain = checkBox.pushed
debugInfo("checked: " ..tostring(isChecked)) --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.uc_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"
assert(className) assert(className)
--debugInfo("Form name: " ..formName) --debugInfo("Form name: " ..formName)
if isChecked == false then if showAgain then
r2.setDisplayInfo(className, 1) r2.setDisplayInfo(className, 1)
else r2.setDisplayInfo(className, 0) end else r2.setDisplayInfo(className, 0) end

Loading…
Cancel
Save