8000 Add <gamemode> module by CoWinkKeyDinkInc · Pull Request #873 · PGMDev/PGM · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add <gamemode> module #873

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

Merged
merged 15 commits into from
Jul 17, 2021
Merged

Conversation

CoWinkKeyDinkInc
Copy link
Contributor
@CoWinkKeyDinkInc CoWinkKeyDinkInc commented May 19, 2021

This re-adds the <gamemode> module back to PGM (if it ever was there). It works similar to how it is already described in the docs, as I noticed that there is no code in PGM that uses the tags. You can't do that weird adding thing it talks about. This uses the translatable objective names so maps that are based around "Attack & Defend" like BoomBox or a "Scorebox" like Zap and Miner Sixty Niner, or maps with monument mode trickery no longer need to use the untranslatable <game> tag. <game> was known as gamemode in the code so this was changed to game. No new translatable components were added.

<!-- Sets Scorebox as game title -->
<gamemode>scorebox</gamemode>
<!-- Sets Attack/Defend as game title -->
<gamemode>ad</gamemode>

Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
@CoWinkKeyDinkInc
Copy link
Contributor Author
CoWinkKeyDinkInc commented May 19, 2021

We should expand on this and have more translatable gamemode titles, here are some others I have in mind:

kotf: King of the Flag
ffb: Flag Football
rfw: Race for Wool
br: Blitz: Rage
cp: Control Points
ctp: Control the Point
ctps: Control the Points

@Pablete1234
Copy link
Member

ctps: Control the points

Game names are all in singular, you still call it "Capture the wool" when there's 2 wools, Control the points makes no sense, it's Control the point

@Pablete1234 Pablete1234 added the feature New feature or request label May 22, 2021
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
@CoWinkKeyDinkInc
Copy link
Contributor Author

New translatable gamemode titles are added (I call dibs on Pirate English and lolcat translations :P)

@Electroid
Copy link
Member

Though, map tags were designed to replace game mode? Since it makes things more extensible?

@CoWinkKeyDinkInc
Copy link
Contributor Author
CoWinkKeyDinkInc commented May 22, 2021

@Electroid map tags are automated, so they are automatically generated by what tags a map uses. <gamemode> forces a gamemode title since PGM can't or doesn't evaluate certain game types like "Scorebox" or "King of the Flag".

Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
@Pugzy
Copy link
Contributor
Pugzy commented May 23, 2021

@Electroid map tags are automated, so they are automatically generated by what tags a map uses. <gamemode> forces a gamemode title since PGM can't or doesn't evaluate certain game types like "Scorebox" or "King of the Flag".

Can map tags not be defined in XML? This does seem like a duplicate of what map tags are for and support for translatable map tags already exist. Maybe they just need parsing and if exist override the auto-generated ones.

@CoWinkKeyDinkInc
Copy link
Contributor Author
CoWinkKeyDinkInc commented May 23, 2021

This PR will give them the tags and change the objective name on the scoreboard. It doesn't look like any tag is explicitly set in XML, so this would be the first.

Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
@CoWinkKeyDinkInc
Copy link
Contributor Author

The PR doesn't deal with the tags anymore. Thanks to some help with Pablete it's a bit better now. You can now use two gamemode types that will display on the scoreboard title. Now the documentation is just like how it is already described on the docs.

<!--- DTC & CTW -->
<gamemode>dtc</gamemode>
<gamemode>ctw</gamemode>
10000

/**
* Get a {@link Collection<Gamemode>} that represents this map's gamemodes.
*
* @return A component of gamemodes if defined or null.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return A component of gamemodes if defined or null.
* @return The list of defined gamemodes, empty list if none are defined.

Don't lie in the javadocs, makes the APIs hard to use

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't look resolved

CoWinkKeyDinkInc and others added 6 commits June 14, 2021 15:56
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
/**
* Get a {@link Collection<Gamemode>} that represents this map's gamemodes.
*
* @return A component of gamemodes if defined or null.
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't look resolved

@CoWinkKeyDinkInc
Copy link
Contributor Author
CoWinkKeyDinkInc commented Jul 4, 2021

Found what Pablo was talking about, it's TextFormatter.java I'll use this function soon.

Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
Copy link
Member
@Pablete1234 Pablete1234 left a comment

Choose a reason for hiding this comment

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

The comment on getGamemodes is still wrong. It says it returns a component when it returns a list of gamemodes

Pablete1234
Pablete1234 previously approved these changes Jul 8, 2021
Signed-off-by: Patrick <cowinkkeydinkinc@gmail.com>
@CoWinkKeyDinkInc
Copy link
Contributor Author

@Pablete1234 @Electroid Ready to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

Successfully merging this pull request may close these issues.

4 participants
0