Menu bar icons are no longer filtering with rules
I made a mini test for this, but it's a bit tricky to automate this.
I tried this on r11400 and it passes the tests: test-tool_menu.zip
This is not working as expected.:
/* PAK64 MENUS:
SLOPETOOLS 0x8002
RAILTOOLS 0x8003
ROADTOOLS 0x8006
SHIPTOOLS 0x8007
SPECIALTOOLS 0x8009
AIRTOOLS 0x8008
*/
tool_list <- [0x8002,0x8003,0x8006,0x8007,0x8008,0x8009,0x1008]
function forbid_tools_menu()
{
for(local j=0; j<tool_list.len(); j++) {
rules.forbid_tool(player_all, tool_list[j])
}
}
Since these tools have a default paramter, on could use this one
tool_list <- [0x8002,0x8003,0x8006,0x8007,0x8008,0x8009,0x800A]
parameter_list <- ["SLOPETOOLS","RAILTOOLS","ROADTOOLS","SHIPTOOLS","AIRTOOLS","SPECIALTOOLS","EDITTOOLS"]
...
function forbid_tools_menu()
{
for(local j=0; j<tool_list.len(); j++) {
rules.forbid_way_tool(player_all, tool_list[j], -1, parameter_list[j])
}
}
But that means the empty default parameter does not longer catches all. r11454 should fix this.
Quote from: prissi on December 08, 2024, 01:55:19 PMSince these tools have a default paramter, on could use this one
tool_list <- [0x8002,0x8003,0x8006,0x8007,0x8008,0x8009,0x800A]
parameter_list <- ["SLOPETOOLS","RAILTOOLS","ROADTOOLS","SHIPTOOLS","AIRTOOLS","SPECIALTOOLS","EDITTOOLS"]
...
function forbid_tools_menu()
{
for(local j=0; j<tool_list.len(); j++) {
rules.forbid_way_tool(player_all, tool_list[j], -1, parameter_list[j])
}
}
But that means the empty default parameter does not longer catches all. r11454 should fix this.
This is excellent, I will do some tests later, I also need to update the scenarios.
The old script works too in r11454
Quote from: prissi on December 08, 2024, 02:19:10 PMThe old script works too in r11454
This ir working now ;D