mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-04 21:26:06 +00:00
Private lobby toggle donation (#1752)
Resolve #1652 1. Add the ability to toggle **gold donations** and **troop donations** for private lobbies ~2. Add relevant translations.~ 3. Refactor `canDonate` to be specific to gold and troop donations 4. Add placeholders for singleplayer mode if this is to be extended to support that too. 5. Add Tests for Donate logic <img width="1643" height="1788" alt="image" src="https://github.com/user-attachments/assets/82b93400-a1f0-45f0-8b2b-a7f78dc0c3e9" /> _Private Lobby_  _Testing Troop Send In Private Lobby_  _Troop Send Complete In Private Lobby_  Confirming that public teams still works - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [X] I have read and accepted the CLA agreement (only required once). regression is found: DISCORD_USERNAME: cool_clarky --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com> Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
This commit is contained in:
@@ -39,6 +39,8 @@ export class GameManager {
|
||||
Date.now(),
|
||||
this.config,
|
||||
{
|
||||
donateGold: false,
|
||||
donateTroops: false,
|
||||
gameMap: GameMapType.World,
|
||||
gameType: GameType.Private,
|
||||
difficulty: Difficulty.Medium,
|
||||
|
||||
@@ -93,9 +93,15 @@ export class GameServer {
|
||||
if (gameConfig.infiniteGold !== undefined) {
|
||||
this.gameConfig.infiniteGold = gameConfig.infiniteGold;
|
||||
}
|
||||
if (gameConfig.donateGold !== undefined) {
|
||||
this.gameConfig.donateGold = gameConfig.donateGold;
|
||||
}
|
||||
if (gameConfig.infiniteTroops !== undefined) {
|
||||
this.gameConfig.infiniteTroops = gameConfig.infiniteTroops;
|
||||
}
|
||||
if (gameConfig.donateTroops !== undefined) {
|
||||
this.gameConfig.donateTroops = gameConfig.donateTroops;
|
||||
}
|
||||
if (gameConfig.instantBuild !== undefined) {
|
||||
this.gameConfig.instantBuild = gameConfig.instantBuild;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ export class MapPlaylist {
|
||||
|
||||
// Create the default public game config (from your GameManager)
|
||||
return {
|
||||
donateGold: true,
|
||||
donateTroops: true,
|
||||
gameMap: map,
|
||||
maxPlayers: config.lobbyMaxPlayers(map, mode, playerTeams),
|
||||
gameType: GameType.Public,
|
||||
|
||||
Reference in New Issue
Block a user