[closed] How to create a message with custom background

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
ZombieKnight
Posts: 161
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

[closed] How to create a message with custom background

Post by ZombieKnight »

Hi,
I'd like to create a message which would like
WML [message] and Lua gui.show_narration,
except with custom(my own) background instead of that blue box with golden sides.
How to do so?
Last edited by ZombieKnight on April 20th, 2024, 6:01 am, edited 1 time in total.
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Celtic_Minstrel
Developer
Posts: 2235
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to create a message with custom background

Post by Celtic_Minstrel »

I could be wrong, but I don't think there's any way to do that without recreating the whole dialog. The closest idea that comes to mind would be changing the active definition, but there's no Lua API to change definitions, so I don't think it can be done in Lua.

There is the idea of creating a custom GUI2 theme that defines only that one dialog in a different way. If it even works, that would mean all message dialogs in your scenario have the custom background. However, I don't know if this is possible either. There definitely exists a system to use an alternate GUI2 theme, but I don't think there's any system for a specific scenario to request a different theme.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
ZombieKnight
Posts: 161
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to create a message with custom background

Post by ZombieKnight »

Can I recreate a whole dialog from add-on position?
That GUI2 sounds interesting... where can I find it?
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Celtic_Minstrel
Developer
Posts: 2235
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to create a message with custom background

Post by Celtic_Minstrel »

You can create pretty much any dialog you can imagine, yes. The show_narration dialog is fairly complex, however. You could probably copy it WML definition from core and make a new dialog using it, though.

By the way, show_narration is part of GUI2 – it's just one of the pre-built dialogs provided for you.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
ZombieKnight
Posts: 161
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to create a message with custom background

Post by ZombieKnight »

Oh, ok I've found some custom dialogues and maybe it's what I want...
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
ZombieKnight
Posts: 161
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to create a message with custom background

Post by ZombieKnight »

Celtic_Minstrel wrote: March 17th, 2024, 1:43 am You could probably copy it WML definition from core and make a new dialog using it, though.
Oh, [message] definition is in lua, but it contains gui.show_naration tag...
Is gui.show_naration defined in lua?
And if so, where can I find it's definition?
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Celtic_Minstrel
Developer
Posts: 2235
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to create a message with custom background

Post by Celtic_Minstrel »

No, gui.show_narration is defined in C++ and WML. The WML part of the definition can be found in the data/gui/windows/wml_message.cfg file. If you loaded that file and passed the [resolution] tag to gui.show_dialog, you'd have a dialog that looks exactly like a message dialog, but probably lacks some functionality.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
ZombieKnight
Posts: 161
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to create a message with custom background

Post by ZombieKnight »

Hmm
Okay leaving that path...
When you have [story] [part] without background specified, it's black(background) and theres no golden line...
How to get rid of that golden line even, when I want to put a background there?
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
ZombieKnight
Posts: 161
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to create a message with custom background

Post by ZombieKnight »

Using custom dialog;
I can make the default one invisible... that's enough.
Maybe I could put there image under the message, tho didn't try.
I had saurian in profile before, but I've merged my discord profile with forum one...
Post Reply