celestian
February 28th, 2020, 19:55
I've noticed a difference in the way windowlists work in FGC and FGU.
Left side is FGC, right side is FGU. Note the differences indicated.
https://i.imgur.com/RF7Woj4.png
Here is a snippet of the windowlist code for the "Sounds" (above "Random Sounds") in the New Trigger.
<!-- linked sounds -->
<windowlist name="sounds_list">
<frame>reference-section</frame>
<script>
function onDrop(x, y, draginfo)
if not WindowManager.getReadOnlyState(getDatabaseNode().g etParent()) then
if draginfo.isType("shortcut") then
local sClass, sRecord = draginfo.getShortcutData();
if sClass == 'audio' then
local node = getDatabaseNode().getParent();
if DB.getChildCount(node,"soundlist") < 2 then
local nodeSounds = node.createChild("soundlist");
local nodeSound = nodeSounds.createChild();
if nodeSound then
local nodeSource = DB.findNode(sRecord);
local sName = DB.getValue(nodeSource,"name","");
DB.setValue(nodeSound,"sound","string",sRecord);
DB.setValue(nodeSound,"name","string",sName);
end
end
end
end
return true;
end
end
</script>
<anchored>
<top parent="sounds_label" anchor="bottom" offset="20" relation="relative" />
<left parent="" anchor="left" offset="5" />
<right parent="" anchor="right" relation="relative" offset="5" />
</anchored>
<child></child>
<child><backcolor>4040301E</backcolor></child>
<noscroll />
<empty textres="audiotriggers_label_dropsounds" />
<footer>footer_blank</footer>
<datasource>.soundlist</datasource>
<class>window_sound</class>
</windowlist>
Specifically the empty textres is not showing.
I also noticed that the "Matches" entry windowlist is not the same either. It should be creating a "blank" Match record when empty like the FGC version does.
Here is the xml snippet for that.
<windowlist name="matches_list">
<frame>reference-section</frame>
<anchored>
<top parent="match_label" anchor="bottom" offset="10" relation="relative" />
<left parent="" anchor="left" offset="5" />
<right parent="" anchor="right" relation="relative" offset="5" />
</anchored>
<child></child>
<child><backcolor>4040301E</backcolor></child>
<noscroll />
<empty textres="audiotriggers_label_addmatch" />
<createonempty />
<datasource>.matchlist</datasource>
<class>window_match</class>
</windowlist>
Left side is FGC, right side is FGU. Note the differences indicated.
https://i.imgur.com/RF7Woj4.png
Here is a snippet of the windowlist code for the "Sounds" (above "Random Sounds") in the New Trigger.
<!-- linked sounds -->
<windowlist name="sounds_list">
<frame>reference-section</frame>
<script>
function onDrop(x, y, draginfo)
if not WindowManager.getReadOnlyState(getDatabaseNode().g etParent()) then
if draginfo.isType("shortcut") then
local sClass, sRecord = draginfo.getShortcutData();
if sClass == 'audio' then
local node = getDatabaseNode().getParent();
if DB.getChildCount(node,"soundlist") < 2 then
local nodeSounds = node.createChild("soundlist");
local nodeSound = nodeSounds.createChild();
if nodeSound then
local nodeSource = DB.findNode(sRecord);
local sName = DB.getValue(nodeSource,"name","");
DB.setValue(nodeSound,"sound","string",sRecord);
DB.setValue(nodeSound,"name","string",sName);
end
end
end
end
return true;
end
end
</script>
<anchored>
<top parent="sounds_label" anchor="bottom" offset="20" relation="relative" />
<left parent="" anchor="left" offset="5" />
<right parent="" anchor="right" relation="relative" offset="5" />
</anchored>
<child></child>
<child><backcolor>4040301E</backcolor></child>
<noscroll />
<empty textres="audiotriggers_label_dropsounds" />
<footer>footer_blank</footer>
<datasource>.soundlist</datasource>
<class>window_sound</class>
</windowlist>
Specifically the empty textres is not showing.
I also noticed that the "Matches" entry windowlist is not the same either. It should be creating a "blank" Match record when empty like the FGC version does.
Here is the xml snippet for that.
<windowlist name="matches_list">
<frame>reference-section</frame>
<anchored>
<top parent="match_label" anchor="bottom" offset="10" relation="relative" />
<left parent="" anchor="left" offset="5" />
<right parent="" anchor="right" relation="relative" offset="5" />
</anchored>
<child></child>
<child><backcolor>4040301E</backcolor></child>
<noscroll />
<empty textres="audiotriggers_label_addmatch" />
<createonempty />
<datasource>.matchlist</datasource>
<class>window_match</class>
</windowlist>