-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Use the new lua UserInterface in the missions #8273
Conversation
|
||
local percentage = 100 - VillageHousesLeft() * 10 | ||
local color = GetColor(percentage) | ||
UserInterface.SetMissionText(percentage .. "% of the village destroyed.", color) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could move this into an OnKilled
trigger set on every house in the village. Then this wouldn't need to run every tick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
d514c87
to
103a19e
Compare
@@ -345,6 +368,7 @@ InitMission = function() | |||
end) | |||
|
|||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end) | |||
TimerColor = HSLColor.New(115, 240, 130) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Player.Color
may be more convenient here. You just need to set it up with the Lua API in the PlayerProperties.cs
.
Updated.
|
By the way: The facing defaults are from our old lua API. |
Can you split off the facings into another pull request? They seem to be unused and unrelated here. |
Done: #8275 |
This is a well thought through enhancement of the Lua API. 👍 I could not find any regressions during testing. ✅ |
👍 Looks good to me |
Use the new lua UserInterface in the missions
No description provided.