Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new [screen_fade] WML action #6864

Merged
merged 3 commits into from Jul 15, 2022
Merged

Conversation

mesilliac
Copy link
Contributor

This is an implementation of FR #6745 . As mentioned there it is a new interface action WML tag [screen_fade], which can fade the game display to a given colour over a given duration.

It has the following format in WML:

[screen_fade]
	duration=(ms) #if 0 the effect is instantaneous
	red,green,blue=(0-255,0-255,0-255)
	alpha=(0-255)
[/screen_fade]

The fade is persistent, so after fading to a colour that colour is kept as an overlay on the game map until a fade to 0 alpha is performed.

I already implemented fading in #6855 so this is just the WML interface.

Unlike the [color_adjust] tag, this one also covers units and halos. And also unlike color_adjust, screen_fade is hardware accelerated.

I also added a flashy event to the test scenario to make sure that it works.

@github-actions github-actions bot added Lua API Issues with the Lua engine and API. Schema labels Jul 13, 2022
It takes (for now) the arguments:
 * red, green, blue = values between 0 and 255
 * alpha = value between 0 and 255
 * duration = time in ms over which to fade

The game display is faded to the given colour over the duration.
It will be left with an overlay of that colour and alpha until
a screen_fade to 0 alpha is performed.
Copy link
Member

@CelticMinstrel CelticMinstrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I just have two additional changes to propose, see below.

data/lua/wml-tags.lua Outdated Show resolved Hide resolved
src/scripting/game_lua_kernel.cpp Outdated Show resolved Hide resolved
Co-authored-by: Celtic Minstrel <CelticMinstrel@users.noreply.github.com>
@mesilliac
Copy link
Contributor Author

Hmm, i applied all the suggested changes but github still says changes are requested. Aside from github's strange hangups, i think this should be ready for squash and merge...

@CelticMinstrel
Copy link
Member

GitHub requires approval to be set manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lua API Issues with the Lua engine and API. Schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants