[solved] two [grid] tags
Moderator: Forum Moderators
-
- Posts: 1308
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [solved] two [grid] tags
Hmm. I can look at
and it's pretty clear what's going to happen.
After reading through that thread several times, I think I see what utils.handle_event_commands is supposed to do (though good luck finding it on the wiki unless you know exactly what to search for). And I have absolutely no idea how that example is going to cause the gui to close because the user hit the space bar.
Might be incredibly useful, once you figure it out, but I wouldn't call it simplified. And perhaps it is simple if you already know what it is and how to use it, but just to look at it for the first time, not so much.
Code: Select all
dialog.my_tb.on_modified = function()
if dialog.my_tb.text == " " then dialog:close() end
After reading through that thread several times, I think I see what utils.handle_event_commands is supposed to do (though good luck finding it on the wiki unless you know exactly what to search for). And I have absolutely no idea how that example is going to cause the gui to close because the user hit the space bar.
Might be incredibly useful, once you figure it out, but I wouldn't call it simplified. And perhaps it is simple if you already know what it is and how to use it, but just to look at it for the first time, not so much.
Speak softly, and carry Doombringer.
Re: [solved] two [grid] tags
wml-utils part is reference how to test this code, it has nothing to do with dialogs.
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [solved] two [grid] tags
Why is that? Is there something that could be done to make it easier to find?white_haired_uncle wrote: ↑April 27th, 2024, 4:19 pm (though good luck finding it on the wiki unless you know exactly what to search for).
- ZombieKnight
- Posts: 282
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: [solved] two [grid] tags
Ehm... I've been LONG looking for something like dialog.on_key.space = dialog:close()
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- ZombieKnight
- Posts: 282
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: [solved] two [grid] tags
Btw
Turned out that implementing speaker(non-narrator)
Isn't so simple...
How does message store unit and how to make it again in lua custom_dialog?
Turned out that implementing speaker(non-narrator)
Isn't so simple...
How does message store unit and how to make it again in lua custom_dialog?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1308
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [solved] two [grid] tags
Based on this:Celtic_Minstrel wrote: ↑April 27th, 2024, 5:36 pmWhy is that? Is there something that could be done to make it easier to find?white_haired_uncle wrote: ↑April 27th, 2024, 4:19 pm (though good luck finding it on the wiki unless you know exactly what to search for).
I did a wiki search for 'handle_event_commands' which came back with nothing. I then did a search on brave for 'handle_event_commands site:wesnoth.org'# lua wesnoth.require("wml-utils").handle_event_commands(wml.load("~add-ons/EventLoader/action.cfg"))
which got me to https://wiki.wesnoth.org/LuaAPI/wml-uti ... t_commands. Back to the wiki, I found that I could find that page only if I searched for 'utils.handle_event_commands'.
https://wiki.wesnoth.org/LuaAPI/wml-utils says
which I think is the problem. I would change the documentation to use just handle_event_commands, and then add the require and use utils.handle_event_commands in the examples.All examples on this page will assume it has been loaded by:
local utils = wesnoth.require "wml-utils"
Speak softly, and carry Doombringer.
Re: [solved] two [grid] tags
That is why I created https://wiki.wesnoth.org/Template:Lua_Functions for https://wiki.wesnoth.org/LuaAPI as documentation where you can actually use search.
I say again that handle_event_commands has nothing to do with current topic about grids and closing. It is way how to run wml such as [lua] midscenario with debug command.
I say again that handle_event_commands has nothing to do with current topic about grids and closing. It is way how to run wml such as [lua] midscenario with debug command.
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [solved] two [grid] tags
Or rather, it is the function to run arbitrary ActionWML for any reason whatsoever.
-
- Posts: 1308
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [solved] two [grid] tags
Arbitrary ActionWML which could be stored in a file and read (repeatedly) at runtime, allowing you to change WML without the whole F5-restart stuff? That was the impression I got from the linked thread.Celtic_Minstrel wrote: ↑April 27th, 2024, 8:27 pmOr rather, it is the function to run arbitrary ActionWML for any reason whatsoever.
Okay, that makes more sense. You removed the callback that dealt with hitting the space bar to close (click_dismiss doesn't do that, does it, just mouse click I thought?), and added the wml-utils, so I assumed that the wml-utils... somehow was a replacement for the callback which confused me to no end.
Speak softly, and carry Doombringer.