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

Option polls #2431

Merged
merged 8 commits into from Feb 12, 2019
Merged

Option polls #2431

merged 8 commits into from Feb 12, 2019

Conversation

DeinFreund
Copy link
Member

Polls now have multiple options instead of just Yes and No.

@Licho1
Copy link
Member

Licho1 commented Oct 22, 2018

Note that this requires changes ingame/chobby

@DeinFreund
Copy link
Member Author

Yes, I'm waiting with this merge until @GoogleFrog is ready to use it in Chobby.

for (int i = 0; i < NumberOfMapChoices; i++)
{
Resource map;
if (i < NumberOfMapChoices / 2 && MinimalMapSupportLevel < MapSupportLevel.Featured)
Copy link
Member

Choose a reason for hiding this comment

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

could be simpler

Suggested change
if (i < NumberOfMapChoices / 2 && MinimalMapSupportLevel < MapSupportLevel.Featured)
if (i < NumberOfMapChoices / 2)

Copy link
Member Author

Choose a reason for hiding this comment

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

A server could be set to only allow Matchmaker maps. Imagine a 1v1 training server for example. In this case he should not show any featured maps.

Copy link
Member Author

@DeinFreund DeinFreund left a comment

Choose a reason for hiding this comment

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

reminder for in-game compat

{
Ended = true;
await battle.SayBattle($"Poll: {question} [END:FAILED]");
Outcome = new PollOutcome() { Success = false };
await battle.SayBattle($"Poll Ended: {Topic} [No option achieved absolute majority]");
Copy link
Member Author

Choose a reason for hiding this comment

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

These messages have to be backwards compatible for in-game.

if (winCount <= 0) winCount = 1;

if (!await Vote(e, true))
{
if (e == null) await battle.SayBattle($"Poll: {question} [!y=0/{winCount}, !n=0/{winCount}]");
Copy link
Member Author

Choose a reason for hiding this comment

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

Same here, this can't be removed because in-game needs it.

@DeinFreund DeinFreund merged commit 90d6e40 into ZeroK-RTS:master Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants