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

Use the new lua UserInterface in the missions #8273

Merged
merged 3 commits into from
May 27, 2015
Merged

Conversation

abcdefg30
Copy link
Member

No description provided.


local percentage = 100 - VillageHousesLeft() * 10
local color = GetColor(percentage)
UserInterface.SetMissionText(percentage .. "% of the village destroyed.", color)
end
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@abcdefg30 abcdefg30 force-pushed the luaUI branch 2 times, most recently from d514c87 to 103a19e Compare May 26, 2015 21:56
@@ -345,6 +368,7 @@ InitMission = function()
end)

Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
TimerColor = HSLColor.New(115, 240, 130)
Copy link
Member

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.

@abcdefg30
Copy link
Member Author

Updated.
This now also adds:

  • Default color values (e.g. HSLColor.White)
  • Default facings (e.g. Facing.NorthEast)
  • More player properties:
    • color
    • race
    • spawnpoint ID
    • team ID
    • a IsBot bool

@abcdefg30
Copy link
Member Author

By the way: The facing defaults are from our old lua API.

@Mailaender
Copy link
Member

Can you split off the facings into another pull request? They seem to be unused and unrelated here.

@abcdefg30
Copy link
Member Author

Done: #8275

@Mailaender
Copy link
Member

This is a well thought through enhancement of the Lua API. 👍 I could not find any regressions during testing. ✅

@obrakmann
Copy link
Contributor

👍 Looks good to me

obrakmann added a commit that referenced this pull request May 27, 2015
Use the new lua UserInterface in the missions
@obrakmann obrakmann merged commit e25a6ed into OpenRA:bleed May 27, 2015
@abcdefg30 abcdefg30 deleted the luaUI branch May 27, 2015 21:31
@obrakmann
Copy link
Contributor

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants