Commit Graph

76 Commits

Author SHA1 Message Date
Achim Marius 0793153f4e Standardize difficulty translation keys to easy/medium/hard/impossible (#2676)
Resolves #2673

## Description:

- This PR unifies difficulty naming by switching all difficulty
identifiers to a single lowercase set of keys (`easy`, `medium`, `hard`,
`impossible`) and aligning UI + translation keys (`en.json`) to match.
- The old UI labels (`"Relaxed"`, `"Balanced"`, `"Intense"`) have been
removed and replaced with the standardized difficulty terms (`Easy`,
`Medium`, `Hard`).

<img width="1312" height="306" alt="image"
src="https://github.com/user-attachments/assets/a59c5fae-f435-427d-b851-eef179a1e94f"
/>


## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

assessin.
2025-12-24 03:34:00 +00:00
FloPinguin 4d5bb7a835 Cleanup nations (Part 1) 🧹 (#2637)
## Description:

1. Using the wording `"Nation"`, `"FakeHuman"` and `"NPC"` at the same
time is confusing.
So I renamed every mention of `"FakeHuman"` and `"NPC"` in the entire
project to `"Nation"`. Just like they are called ingame.

2. `BotBehavior.ts` was originally intended for sharing the logic
between nations and bots.
But at the moment, the logic there isn't really shared and it's
basically just about attacking.
So I renamed `BotBehavior.ts` to `AiAttackBehavior.ts`. I use "Ai" to
indicate that this file is used by bots AND nations.

3. Moved `execuction/utils/AllianceBehavior.ts` to
`execuction/nation/NationAllianceBehavior.ts` to make sure everybody
understands that this file is not about alliances in general. It's just
about nations and how they handle alliances.

4. Removed `difficultyModifier` from `DefaultConfig`. It's unused and I
think we usually want to finetune the difficulty instead of using that
method.

5. Added `assertNever` in all `switch (difficulty)` default cases.

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2025-12-18 16:20:23 -08:00
VariableVince 765cd1b495 Fix: incorrect Duos Trios Quads texts + display teams in one box (#2632)
## Description:

- **Fix wrong Duos Trios Quads text in SP and Private Lobby modals:** PR
#2591 overwrote translations for public_lobby.teams_Duos , teams_Trios
and teams_Quads. But those translation keys are not only used in Public
Lobby, they are also used for the Single player and Private Lobby
modals. Where they are displayed in a slightly different context, making
the new translations appear off. Fix: add seperate translation keys and
restore old strings.

- **One box for team text in Public Lobby:** display number of teams and
team size in one block instead of two seperate blocks. It is agreed upon
also by evan that one block would look better:
https://discord.com/channels/1359946986937258015/1360078040222142564/1449498245817569502

--BEFORE:--
<img width="816" height="272" alt="Before in public lobby seperated
boxes"
src="https://github.com/user-attachments/assets/ddf7b425-4664-4f23-9d8c-7a859d6aea36"
/>

<img width="797" height="256" alt="Before in public lobby seperated
boxes and with change in translation of PR 2591 visible"
src="https://github.com/user-attachments/assets/f49c8fec-5de5-42d9-88fb-ed0ccb3951ea"
/>

<img width="1091" height="282" alt="Before naming of Duos Trios Quads
incorrect in SP and private lobby modal after changes in PR 2591"
src="https://github.com/user-attachments/assets/9c4d45b5-8db6-44b9-b2db-379a2c97e4d5"
/>

--AFTER:--
<img width="911" height="297" alt="After in public lobby now one box for
Team games"
src="https://github.com/user-attachments/assets/28a1c30b-3f0d-4484-bf12-4281435072c1"
/>

<img width="807" height="248" alt="After in public lobby now one box for
Team games Quads example"
src="https://github.com/user-attachments/assets/7cb54246-8d0a-410a-9e44-1f8cc15a2978"
/>

<img width="912" height="297" alt="After in public lobby still same for
other game modes"
src="https://github.com/user-attachments/assets/4dab6234-81fe-426d-82d1-c478d672673e"
/>

<img width="1115" height="622" alt="After naming of num teams for Duos
Trios Quads corrected Private lobby modal"
src="https://github.com/user-attachments/assets/c2622c4e-1cfd-40f9-b0ed-8ff1d437d72d"
/>

<img width="1163" height="582" alt="After naming of num teams for Duos
Trios Quads corrected"
src="https://github.com/user-attachments/assets/98fdfa22-70a8-4820-96fa-7b1df991e3ff"
/>


## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33
2025-12-17 11:30:12 -08:00
Ryan 34251c0673 lobby fill time added to stats (#2382)
## Description:

Finishes & closes #1969 and closes #1806.

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-10 19:53:25 -08:00
Mykola 25ea11114e Random spawn (#2375)
## Description:

https://github.com/openfrontio/OpenFrontIO/issues/2352

This is my first PR in this project, and I’ll continue refining it based
on feedback.

<img width="1088" height="859" alt="image"
src="https://github.com/user-attachments/assets/07f4f8b1-52fa-4136-add4-19b00aefd963"
/>

<img width="1157" height="783" alt="image"
src="https://github.com/user-attachments/assets/1c5be80d-72f8-4ead-8d4b-706a3a04fd73"
/>

<img width="1488" height="777" alt="image"
src="https://github.com/user-attachments/assets/4d743548-f0c3-4579-963b-43676f68fab1"
/>

<img width="1499" height="778" alt="image"
src="https://github.com/user-attachments/assets/f808e44f-ef97-467f-9e41-812e2857c36e"
/>


## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

nikolaj_mykola

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-06 15:49:37 -08:00
Adarsh Das 0789f0d7f8 Add Nations Vs Players Game Mode (#2233)
## Description:
Fixes: #676 
This PR adds Players Vs Nations as a game mode in the menu.

For this change I have added two mutually exclusive option for this
mode:
1. Match number of nations to number of players who have joined
2. Set the number of nations to a fixed value

### Screenshots:
#### Options in Single player mode
<img width="1025" height="790" alt="image"
src="https://github.com/user-attachments/assets/c0685ea5-94f5-43c7-a9e5-390835fc94e9"
/>
<img width="1005" height="795" alt="image"
src="https://github.com/user-attachments/assets/dddba015-a424-40dd-a0fe-2571fd7b0fba"
/>

#### Options in lobby mode
<img width="1015" height="888" alt="image"
src="https://github.com/user-attachments/assets/45bc865b-c6a8-4b6a-9062-4eb499c1ea36"
/>

#### Example gameplay (1 Human Vs 90 Nations)
<img width="1888" height="912" alt="image"
src="https://github.com/user-attachments/assets/38faec75-171f-4358-a3be-93630cca1587"
/>


## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

saphereye

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-10-28 16:40:30 -07:00
Vivacious Box f161c94ff4 Max timer (#1289)
## Description:

Adds a max timer setting
The timer starts at max timer and goes down, becoming red if reaching <
1 min
The player with the biggest territory wins at the end of the timer


![image](https://github.com/user-attachments/assets/888099fc-95ae-4303-8c80-c850e58d36e2)

## Please complete the following:

- [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 understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Vivacious Box

---------

Co-authored-by: Loymdayddaud <145969603+TheGiraffe3@users.noreply.github.com>
2025-10-17 17:09:10 -07:00
evanpelle e7497bfb76 Revert "Slider UI change (#2148)"
This reverts commit 972697a5ae.
2025-10-13 17:53:13 -07:00
Baeck Dong Jae 972697a5ae Slider UI change (#2148)
## Description:

1. adds feature so when making single player server, bots amount can be
determined by slider and manual
1-1.
[video](https://github.com/user-attachments/assets/23186592-2330-478b-8f73-313ca073803b)

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

jack_45183

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-10-13 11:37:17 -07:00
evanpelle 584fa9fb5d add support for custom colors (#2103)
## Description:

Added a colors tab in territory patterns modal so players can select
their color.

Refactored the PrivilegeChecker, removed custom flag checks since we no
longer support custom flags.

<img width="479" height="345" alt="Screenshot 2025-09-27 at 5 01 17 PM"
src="https://github.com/user-attachments/assets/ad96da65-f0eb-4731-a861-e6e5fcb4566a"
/>
## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-10-09 20:47:20 -07:00
evanpelle fdb05bf777 Merge branch 'v25' 2025-09-26 10:53:57 -07:00
evanpelle 5d9b62da4d add compact map option (#2095)
## Description:

Create mini map option
<img width="741" height="234" alt="Screenshot 2025-09-25 at 4 47 47 PM"
src="https://github.com/user-attachments/assets/6c442698-8e3b-44d5-b07e-c4f0a916c3bc"
/>

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-09-25 16:51:25 -07:00
evanpelle 8419cc7ccd fix donation not set on singleplayer (#2093)
## Description:
Bug: Donation to nations was not allowed in single player mode.

Always allow donation to Nations. Simplify the donation check logic.

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-09-24 14:35:58 -07:00
evanpelle a26585a47b Add support for colored patterns (#2062)
## Description:

Add support for colored territory patterns/skins

* Refactored & updated territory pattern rendering to render colored
skins
* rename public from pattern to skin (keep pattern name internally, too
difficult to rename)
* Moved all territory color logic to PlayerView
* Updated WinModal to show colored skins
* Refactored decode logic into a separate function: decodePatternData
* Refactored/updated how cosmetics are sent to server. Players now send
a PlayerCosmeticRefsSchema in the ClientJoinMessage.
PlayerCosmeticRefsSchema just contains names of the cosmetics, and the
server replaces the names/references with actual cosmetic data
* Refactored PastelThemeDark: have it extend Pastel theme so duplicate
logic can be removed.
* 

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-09-18 20:00:15 -07:00
Scott Anderson fc8e6637eb Difficulty translation key (#1959)
Move the key to name mapping for difficulties into the translation
system.

- [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
2025-09-03 19:00:38 -07:00
Cameron Clark 1ecd6c4ee1 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_

![donatetroopsprivatelobby](https://github.com/user-attachments/assets/c6690bbc-958e-48a1-9cf1-e2b361dfb1b2)
_Testing Troop Send In Private Lobby_

![donatetroopsprivatelobby2](https://github.com/user-attachments/assets/698c7603-6b4b-4da7-91ab-7bdc38bb49a5)

_Troop Send Complete In Private Lobby_

![testtradepublicteams](https://github.com/user-attachments/assets/1010332c-3f38-4644-9218-46aa7141f578)
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>
2025-09-03 16:19:13 -07:00
evanpelle 95b39daab9 Allow manually setting pattern for testing (#1910)
## Description:

This pr allows setting the pattern manually in using the dev console so
we can see how it looks before uploading.

To set it: set the b64 pattern in local storage with key: dev-pattern.

This will override set pattern. Only works in singleplayer mode.

## Please complete the following:

- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-08-23 20:25:26 -07:00
evanpelle b57a409b8a store & reference pattern by name (#1766)
## Description:

Store pattern by name instead of value. The worker replaces the pattern
name with it's base64 when joining. This ensures the client & server are
never out of sync after patterns are updated.

* removed resizeObserver on the territory modal, it was causing some
race conditions, and the modal is not resizable so it's unnecessary.

* Moved PatternSchema to CosmeticSchema
## Please complete the following:

- [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).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-08-16 18:08:16 -07:00
evanpelle fd2612ce19 enable factories by default (#1718)
## Description:

Enable factories by default in singplayer private & public games.

## Please complete the following:

- [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).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-08-06 15:21:39 -07:00
Tyler Hanavan 15d0fd5b64 Allow main menu modals to be closed by clicking escape (#1617)
## Description:



Allow the main menu modals to be closed by clicking the Escape key. The
manner by which this change achieves this is by adding a
connectedCallback to add a keydown EventListener, which closes the modal
on clicking Escape.

Relevant issue: #1586 

My earlier PR was only for the in-game modals, as they can access the
Event Bus and receive the CloseViewEvent.
https://github.com/openfrontio/OpenFrontIO/pull/1604

As mentioned, this PR differs in that it does not use the Event Bus
because these are not in-game modals. The main menu modals do not have
access to the event bus.

Affected modals for this PR.
- UserSettingModal.ts
- TerritoryPatternsModal.ts
- SingePlayerModal.ts
- NewsModal.ts
- LanguageModal.ts
- JoinPrivateLobbyModal.ts
- HostLobbyModal.ts
- HelpModal.ts
- FlatInput.ts








## Please complete the following:

- [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).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

slyty

---------

Co-authored-by: Antoine <antoine.gannat@gmail.com>
2025-08-02 04:36:03 -04:00
Antoine dc1f79d090 Fix all strict errors in /client (#1489)
## Description:

Second PR to fix issues in order to enable strict mode.

## Specifics

1. Most important change: Turned off errors for Class variables not
initialized in constructor. I've noticed that pretty much all Classes in
the project have at least one occurence of that issue. And fixing it
properly would require a large refactor across the whole project. So
disabling the rule seems like a good solution in this case.

#1075 

## Please complete the following:

- [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 aggreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

azlod
2025-07-29 16:24:52 -04:00
Scott Anderson 3a8ff6304a Quads (#1347)
## Description:

- Add trios and quads
- Add translations for duos, trios, quads
- Add duos, trios, quads to the public lobby rotation
- Increase the frequency of team games


![image](https://github.com/user-attachments/assets/a7bac4e7-9db2-486d-87bc-5779dd64da08)

![image](https://github.com/user-attachments/assets/c1b9225e-2193-4776-b97f-be01a1bdeeed)

## Please complete the following:

- [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 understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
2025-07-06 20:09:18 -04:00
DevelopingTom 6353a5d6f7 Automatic train stations (#1353)
## Description:

Train stations are now built automatically when a factory is
constructed.

Changes:
- When a factory is built, nearby structures are connected to the rail
network
- When a city is built near a factory, it is connected to the rail
network
    - All structures behave the same when a train stops: to be defined
    - Removed station badge
    - Gold income is now related to the structure's level

## Please complete the following:

- [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 understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom
2025-07-06 13:15:49 -07:00
DevelopingTom cfabdfebc7 Mark train stations and factories as experimental (#1309)
## Description:

Train stations and factories won't be ready for v24.
Disable them by default. They can be reactivated on private lobies and
solo games, allowing us to gather feedbacks.

Changes:
- added an "experimental" attribute for units. When set, they are hidden
entirely when disabled, rather than appearing grayed out.
 - disabled train stations and factories by default.

Default values:

![image](https://github.com/user-attachments/assets/ec91ef80-c0ef-45a7-8e6c-6628a836b593)

No factories:

![image](https://github.com/user-attachments/assets/a3e35607-aed5-401c-bc38-4ea742d057c6)


## Please complete the following:

- [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 understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom
2025-07-02 17:13:34 +00:00
Aotumuri b71acdc993 Patterned territory (#786)
## Description:
This is meant to give players more customization options.
Permission handling hasn’t really been implemented yet.
## Please complete the following:

- [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 understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aotumuri
2025-06-22 23:57:24 -04:00
falc 77f57207be Changed consolex to console logging (#1036)
## Description:
Changed from consolex to console
## Please complete the following:

- [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 understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

@qqkedsi
2025-06-04 09:22:17 -07:00
Shaan 9089de959b Synced the single player and host files together, and fix issue withc… (#991)
## Description:
This is a UI fix that addresses the issue where the nuke related options
were not able to be deselected in private lobby's, these are now able to
done.

## Please complete the following:
- [x] I have added screenshots for all UI updates
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Shaan160

Fixes #989 


![image](https://github.com/user-attachments/assets/78ae73ed-b73e-49f7-a2dd-bade3bcfa8bc)
2025-06-02 11:30:18 -07:00
evanpelle 2b1f2dca6e remove player id from Schemas, fix archive bug (#907)
## Description:

Remove all references to playerID in the archive schema, since we
reference players by client id.
Also fixed the game not archiving bug, due to invalid reference.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>
2025-05-27 16:34:32 -07:00
Scott Anderson b558bd722d Prevent multiple clients from using the same account (#706)
## Description:

This change blocks a persistent ID from being reused by more than one
client in the same game. This setting is only enabled in staging and
prod.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-17 21:03:05 -07:00
Scott Anderson 70745faac4 Enable strictNullChecks, eqeqeq (#436)
## Description:

Improve type safety and runtime correctness by:
1. Enabling TypeScript's
[strictNullChecks](https://www.typescriptlang.org/tsconfig/#strictNullChecks)
compiler option.
2. Replacing all loose equality operators (`==` and `!=`) with strict
equality operators (`===` and `!==`).
3. Cleaning up of type declarations, null handling logic, and equality
expressions throughout the project.

Currently, the code allows implicit assumptions that `null` and
`undefined` are interchangeable, and relies on type-coercing equality
checks that can introduce subtle bugs. These practices make it difficult
to reason about when values may be absent and hinder the effectiveness
of static analysis.

Migrating to strict null checks and enforcing strict equality
comparisons will clarify intent, reduce bugs, and make the codebase
safer and easier to maintain.

Fixes #466 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
Co-authored-by: evanpelle <openfrontio@gmail.com>
2025-05-15 16:39:40 -07:00
Aotumuri cddcc681dd Added custom disable settings (#593)
## Description:
I will write an issue later as I don't have time.

![スクリーンショット 2025-04-23 22 04
24](https://github.com/user-attachments/assets/77754140-eee9-46bd-a98f-a3abec35ca6a)
<img width="735" alt="スクリーンショット 2025-04-23 22 04 40"
src="https://github.com/user-attachments/assets/24bb3461-8e05-418c-8dbf-2ba1a624fe27"
/>
<img width="790" alt="スクリーンショット 2025-04-23 22 04 47"
src="https://github.com/user-attachments/assets/33387200-d0af-4394-9d60-af1f88a036e9"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
aotumuri
2025-05-07 06:14:54 -07:00
evanpelle d6a412aa50 implement duos (#630)
## Description:
Implement Duos team mode.
Also assign teams to nations at the start instead of assigning them
randomly on spawn. This gives more consistent team sizes

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-30 13:47:35 -07:00
michaelabilliot a4329d42ee Add category to singleplayer (#449)
## Description:
Just simply adds categories to the single player menu
![Screenshot 2025-04-11 at 05 40
49](https://github.com/user-attachments/assets/e6811b69-5abf-427f-9989-55f4538b034f)

Fixes #453 

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

lunhuiyan1718
2025-04-19 12:09:41 -07:00
Scott Anderson 5167f67b96 Allow up to seven teams for players (#445)
## Description:

- Allow up to seven teams for players, and one for bots.
- Add team count selection to the single player dialog.
- Select random number of teams in server rotation.

Fixes #456

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors


![image](https://github.com/user-attachments/assets/cbc1ba82-9d06-4763-896c-abdce067a161)


![image](https://github.com/user-attachments/assets/9f82a0a5-c0bb-49b6-a714-2b13286a64ca)

## Please put your Discord username so you can be contacted if a bug or
regression is found:

fake.neo

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-15 19:02:58 -07:00
Evan 08c2c01dae bugfix: flags not showing in game 2025-04-06 10:27:52 -07:00
Evan a3a05f9ed2 bugfix: start troops were set at zero, username was not set in singleplayer 2025-04-03 20:02:22 -07:00
Aotumuri 607e5b5ff0 MLS-PACK (#355)
## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

This is commit pack
This PR refactors and improves the language selection experience:
• Centralizes all language-related logic in LangSelector.ts &
LanguageModal.ts
	•	Redesigns the language selection UI for better UX across devices
	•	Adds new translations and supports more languages
Changes .w.
• Language selection is now handled entirely inside LangSelector.ts &
LanguageModal.ts
	•	Prevents background scrolling when open
	•	Highlights the current language at the top
	•	Always shows English second
	•	Shows browser language third (if different from current)
	•	All other languages are sorted alphabetically by English name
	•	Debug option is shown at the end when pressing D
	•	The language list is scrollable when it exceeds screen height
	
Supported Languages
["en", "ja", "fr", "bg", "nl", "ru", "ua", "de"]

Added Translation Keys
```
"lang": {
  "en": "English",
  "native": "English",
  "svg": "xx"
},
"map": {
  "map": "Map"
},
"game_starting_modal": {
  "title": "Game is Starting...",
  "desc": "Preparing for the lobby to start. Please wait."
},
"difficulty": {
  "difficulty": "Difficulty"
}
```

## Please put your Discord username so you can be contacted if a bug or
regression is found:
MLS Representative
- aotumuri 

Translation collaborator
- Nikola123 (He was a very big help from setting up the translation site
to adding the json. Thank you so much!)
I don't have permission from my collaborators to display their names
here, so I'll put the discord link here

https://discord.com/channels/1284581928254701718/1352553113612980224/1352553113612980224
- tryout33

Collaborators from other servers.
- CCC Group (This is not Culture Convenience Club. Think of it like a
server where developers of various games are playing.)
- People who fixed the UI and found bugs.
meow02952 (discord id) <- This person also gave me a code suggestion.
Thanks!
moon_spear (discord id)
ww_what_ww (discord id)
Azuna (he doesn't have discord account)
- People who corrected translations, etc.
_kyoyume_ (discord id)
_ultrasuper_ (discord id)
grueg (he doesn't have discord account)

# If I forgot to include your name, or if you’d like your name to be
added, please let me know via Gmail or Discord.

---------

Co-authored-by: Duwibi <86431918+Duwibi@users.noreply.github.com>
2025-04-02 20:37:36 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
evanpelle ab3f4fbac1 All players must join game before spawn (#380)
## Description:
The server stores all players that have joined, and once the game starts
it sends a list of players to all clients. Players cannot join after the
game has started. Server now generated the PlayerID instead of the
client.

The is necessary for team mode, we need to know how who is playing the
game before it starts so we can properly assign teams based on clans.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-03-30 17:04:29 -07:00
evanpelle d8fe41de7a teams (#349) 2025-03-27 20:43:56 -07:00
Mittanicz 6678d6e36e Image optimalization (#343)
I have minify images and convert them to webp format that reduce size
and keep quality.
Reduce size of bg image since its already blured by css so no need to
have it that big.

Reduce size of thumbs and helper images in helper modals should be fine
since they will not exceed the container size. Even that make them
larger than containter just to be safe
2025-03-26 10:05:45 -07:00
Aotumuri 9088adeb7a Translate all out-of-game UI (start screen, lobbies, etc.) (#316)
This PR adds full translation support for all out-of-game UI elements,
including the start screen, public/private lobby modals, and other
pre-game interfaces.

All static text has been externalized to en.json and ja.json for future
language support.
If you find any spots that are not yet translated (missing from the
JSON), please let me know.
Thanks a lot!

This is a follow-up to PR
[#305](https://github.com/openfrontio/OpenFrontIO/pull/305).

---------

Co-authored-by: Cldprv <dubois.cnm@tutanota.com>
Co-authored-by: jacks0n <rosty.west89@gmail.com>
2025-03-24 17:12:04 -07:00
Mittanicz 166ef92970 Create base components button, modal .. (#331)
Create base components with shared styles, as start of make ui better.
For now shoul look same but underhood new copoments are used.

This should be first PR that handle this and many more comes. I am in
rush due conflict with other ppl, but should work as i tested.

Testing again and look at structure

Main goal i have global css not scope in component die loading times and
size of elements. (Modal due nature of lit and shadow dom is exception,
maybe later find better way).

Documenting the components will happen later as base components
establish their usage.
2025-03-24 10:34:27 -07:00
Readixyee e02361c2f4 Disable nukes option (#237)
This makes it possible to disable all nukes as well as missile silos
from the game in privat lobbies and singleplayer games
2025-03-21 13:52:36 -07:00
evanpelle 33292aec5c feat: replay archived games, gamestate hash verification (#195)
create endpoint to load archived game. when joining game client first
checks if the game is active, if not it requests the game archive from
the server. the archive is sent to LocalServer to replay the game
locally. Every 10 ticks a hash is stored on the archive, and during
replay the LocalServer verifies this hash.
2025-03-09 14:24:39 -07:00
nwcubeok 5c9d266623 Close button sticky in every modal 2025-03-06 17:25:28 +01:00
Todd Groff c648da2277 Merge branch 'main' into randmap 2025-03-02 16:29:57 -05:00
NewHappyRabbit 9b85651ad8 Fixed dark mode class being added in different places (body and html elements).
Fixed flag "None" (xx.svg) being able to be set and used ingame.

All menu modals will now close if you click outside of them.

Fixed info icon in instructions.

Added an icon to show the number of new events that happened while the events panel is hidden.

Removed opacity from the svg icons files and added it to the player-icons div, making them have the same opacity and being more visible.
2025-03-02 09:39:36 -08:00
Evan a029b4277f use node cluster to shard server 2025-03-02 09:39:09 -08:00
Todd db9a75a3d9 consistency and fixed typo 2025-03-02 03:00:05 -05:00