URL:
<http://gna.org/bugs/?12946>
Summary: [menu_item]/[command] losing function when called
again
Project: Battle for Wesnoth
Submitted by: ken_oh
Submitted on: Thursday 02/05/2009 at 16:39
Category: Bug
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: WML
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.5.9
Operating System: WinXP
_______________________________________________________
Details:
Insert this into a scenario in a campaign (either SP or MP). It will usually
work as long as the campaign lasts. But, put that same code in another
scenario after the first. It will work in that scenario, but will not work in
the scenario after that. For example, if it's called in scenario 1 and again
in scenario 2, it won't work in scenario 3.
[event]
name=start
[set_menu_item]
id=test_menu
image=help/closed_section.png
description=_"test menu"
[show_if]
[/show_if]
[command]
[message]
speaker=narrator
image="help/closed_section.png"
message="test"
[/message]
[/command]
[/set_menu_item]
[/event]
This is a problem because if you want to temporarily remove the menu item
(putting [not][/not] inside of show_if), that counts as the 2nd call.
Therefore, if you call set_menu_item in the 1st scenario, then clear it from
view with [not] in the 2nd scenario, and then want to make it available in
the 3rd scenario, it won't work in the 3rd scenario.
Here's what I know about what's going wrong. The right-click menu item still
shows up when it "doesn't work," but the command doesn't fire. Looking at
save files, here's what I see.
Normally you would find this:
[command]
first_time_only="no"
name="test menu"
[message]
Instead, when the problem arises, it looks like:
[command]
[message]
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?12946>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs