Search found 2233 matches

by Celtic_Minstrel
50 minutes ago
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: [solved] two [grid] tags

white_haired_uncle wrote: Today, 4:19 pm (though good luck finding it on the wiki unless you know exactly what to search for).
Why is that? Is there something that could be done to make it easier to find?
by Celtic_Minstrel
Today, 12:41 pm
Forum: Lua Labs
Topic: [closed] How to dialog:close() when >space< is typed into the text_box
Replies: 2
Views: 58

Re: How to dialog:close() when >space< is typed into the text_box

I'm pretty sure you posted the method you tried in the previous thread. Why is it not in this post?
by Celtic_Minstrel
Today, 12:41 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

Thanks! Oh dumb me, this works "dialog.test_text:focus()" Yes – either that or "gui.widget.focus(dialog.test_text)". I use dialog:set_canvas(1, { } ) To hide the label background...Any idea how to hide text_box background? Just to clarify, that doesn't hide it. It deletes it. Th...
by Celtic_Minstrel
Today, 1:23 am
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

Pretty much. Just be aware that that also includes deprecated things (which is mostly value_compat and callback).
by Celtic_Minstrel
Yesterday, 11:36 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

If you mean in documentation, that would be LuaAPI/types/widget. If you mean in the source code, the relevant file is lua_widget_attributes.cpp.
by Celtic_Minstrel
Yesterday, 6:00 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

I was hoping to find corresponding lua files that manipulate the widget so I could determine of its properties (select_layer(s), layer_selected, etc). Those don't exist. All core widgets are handled in C++. I don't know, but I did figure out that dialog.narration.selected_index=2 I'm not 100% sure ...
by Celtic_Minstrel
Yesterday, 1:59 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

I'm not aware of any examples of it being used outside of mainline. In mainline it's used in the following windows: addon_list mp_create_game addon_manager campaign_dialog campaign_difficulty game_stats game_version mp_create_game preferences server_info story_viewer title_screen It's also used in a...
by Celtic_Minstrel
Yesterday, 4:57 am
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

The default mode of a stacked widget is to stack its layers on top of one another. A lot of actual uses of it instead use it as a way to swap between different layers, showing only one layer at a time. I'm not sure if there's an example of its intended use in mainline. On the other hand, it's probab...
by Celtic_Minstrel
April 25th, 2024, 11:35 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 50
Views: 742

Re: two [grid] tags

That's what [stacked_widget] is for.
by Celtic_Minstrel
April 25th, 2024, 1:38 pm
Forum: WML Workshop
Topic: sound_source clarification
Replies: 2
Views: 114

Re: sound_source clarification

I think that's correct. You could try resetting the sound source whenever a unit moves. I would expect that to restart the sound from the beginning, but maybe if you're lucky it won't.
by Celtic_Minstrel
April 25th, 2024, 4:08 am
Forum: Lua Labs
Topic: [GUI] dynamic widget definition
Replies: 4
Views: 168

Re: [GUI] dynamic widget definition

Sounds like what you're doing is digging into the spinner's internals (it's a compound widget, which means it's composed of several smaller widges). That's definitely not the way it's supposed to work, but it's good to know that there's at least a workaround for the fact that it's not properly suppo...
by Celtic_Minstrel
April 25th, 2024, 2:14 am
Forum: Lua Labs
Topic: [GUI] dynamic widget definition
Replies: 4
Views: 168

Re: [GUI] dynamic widget definition

Now for the float, I'd like to use a slider, and that slider's minimum and maximum values and step size aren't known when I create the node definition, and it appears they cannot be modified on the fly. My guess is that they are fixed, and I have to define them when I define(/instantiate/initialize...
by Celtic_Minstrel
April 25th, 2024, 12:04 am
Forum: WML Workshop
Topic: negative ai aggression
Replies: 2
Views: 126

Re: negative ai aggression

The quantity (1 - aggression) is used to determine which of two attacks is better. The actual code that does the comparison is this ( harm_weight is the aforementioned aggression-based quantity): // Compare: P(we kill them) - P(they kill us). a = them_a.hp_dist[0] - us_a.hp_dist[0] * harm_weight; b ...
by Celtic_Minstrel
April 24th, 2024, 5:20 pm
Forum: WML Workshop
Topic: [solved] comma = or syntax
Replies: 4
Views: 168

Re: [solved] comma = or syntax

Apart from the case of commas on the left hand side of the =, it's based on the key whether or not a comma has any special meaning. So for example, it won't work with name in most cases.

The same goes for the range syntax – that's specific to certain places and doesn't generally work anywhere.
by Celtic_Minstrel
April 22nd, 2024, 12:59 pm
Forum: WML Workshop
Topic: [solved] where I can use [lua] and it's return value, what I can do in modify_unit
Replies: 12
Views: 424

Re: [solved] where I can use [lua] and it's return value, what I can do in modify_unit

So it looks like you can't do this either, which is unfortunate as I have multiple objects I'd like to insert. Why would you need to? You can dump multiple objects into [modify_unit anyway, so just put the [insert_tag] directly in there (like in your second example, but with name=object ). That mak...