Commit Graph

2036 Commits

Author SHA1 Message Date
VariableVince 3894945adf Fix Leaderboard: convert NaN into 0% (#1190)
## Description:

In edge cases, where all land is fallout, Owned % could be NaN%. Have it
converted to 0% in such cases.

https://discord.com/channels/1359946986937258015/1383735051195514880

BEFORE:
<img width="1059" alt="Before"
src="https://github.com/user-attachments/assets/a84bffe4-4a96-4175-897f-68be33778653"
/>

AFTER:
It's a little hard to test (especially when currently you can't get in
the old build menu and the new radial menu doesn't let you nuke
yourself). But the code speaks for itself i hope.

## 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:

tryout33
2025-06-15 21:17:14 -04:00
Aotumuri 43c98e506d fixed giantworldmap key (#1188)
## Description:
Fixed an issue where key was being displayed in a place it shouldn’t
have been.

https://discord.com/channels/1284581928254701718/1284581928833388619/1383774883472740433

## 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-15 20:03:00 -04:00
Vivacious Box 7fa11ed035 Set a targetable status for nukes (#1174)
## Description:

Set a targetable status for units (specifically atom bomb and hydro)
A nuke is targetable near launch and target but is untargetable mid air.
An untargetable unit is half transparent to show that it cannot be
destroyed.


![targetable](https://github.com/user-attachments/assets/cc6769ff-95ab-4294-9a8e-10f909711f68)

## 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
2025-06-15 06:23:13 +00:00
VariableVince 4317285b17 Fix Nations building more than allowed (#1176)
## Description:

According to the code, Nations aren't meant to build more than 1 port, 2
cities, 1 missile silo. Of course they may acquire more if they conquer
territory.

However they are seen to be building more than for example 1 missile
silo in-game. While the code checks how many of a type of unit they
have, it doesn't include units currently in construction.

This PR fixes that by using an existing function that includes units in
construction.

Note: this nerves Nations ever so slightly, so may be noticable in the
meta. Although it's a bug that's already present on v23 and before, and
it could be hotfixed into v23, there's something to say to leave it for
v24 testing including meta changes.

BEFORE:
![Before two silos constructed at same
time](https://github.com/user-attachments/assets/b44830f9-0063-49d5-b530-bb44f65b5719)

AFTER:

https://github.com/user-attachments/assets/9b1cc5ac-89f8-48d4-a399-04535e944e79

## 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:

tryout33
2025-06-14 23:45:01 -04:00
Vivacious Box 52ecaea06c Redraw stacked buildings sprites (#1170)
## Description:

When buildings are stacked on each other, the buildings under are not
redrawn when the stacked building is destroyed.
A simple outer range + sprite radius check triggers a touch which
redraws the buildings.
Sprite radius is set to 16 (dont forget to change it if it ever changes)

### Before:

![image](https://github.com/user-attachments/assets/08acd6e2-a45f-4cc1-b263-89be1d994a12)

### After:

![nukeredraw](https://github.com/user-attachments/assets/c972cb26-03bd-4f74-a960-63f6145fb85d)

## 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
2025-06-14 05:48:15 +00:00
Scott Anderson 3e9b81cd3f Extend token lifetime to 3 days (#1172)
## Description:

Extend token lifetime from 6 hours to 3 days.

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

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-14 00:52:50 -04:00
DiesselOne 38b87b7217 Rework leaderboard and team stats (#1164)
## Description:
This PR update the leaderboard and team stats component to be more
responsive on mobile and desktop.
Include new component gameLeftISidebar that manages showing/hiding
elements.
Add icons as components for easy use

## 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:

Diessel

Closes #1163 

Images:
![Snímek obrazovky 2025-06-13 v 18 45
44](https://github.com/user-attachments/assets/8c80fbfc-ae7d-449d-88a6-5072ede8d0e4)
![Snímek obrazovky 2025-06-13 v 18 45
39](https://github.com/user-attachments/assets/e386e368-3cf5-4cf5-b85b-8380a5785d62)
![Snímek obrazovky 2025-06-13 v 18 45
32](https://github.com/user-attachments/assets/efc39a92-bcd8-4f3c-a281-6570a92e4633)
![Snímek obrazovky 2025-06-13 v 18 45
27](https://github.com/user-attachments/assets/6bcb8462-ee11-4de5-af4c-1763f95fa56a)
2025-06-13 18:32:50 +00:00
Aotumuri e68d48c3a8 Fixed quick chat text injection (#1144)
## Description:
https://github.com/openfrontio/OpenFrontIO/issues/1035
Fixes #1035 
## 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:

.w.

---------

Co-authored-by: Scott Anderson <scottanderson@users.noreply.github.com>
Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-06-13 09:21:22 -07:00
Doo 9717c95c34 Update building images and adjust border/territory radii for unit configuration (#1037)
## Description:

Implementing the new images for building with better quality:
https://github.com/openfrontio/OpenFrontIO/issues/778

**Before :**

![image](https://github.com/user-attachments/assets/7ad756c5-f22f-4058-9153-59f6a0363382)


**After :** 

![image](https://github.com/user-attachments/assets/c5773420-336e-49c4-b8a1-8686c0bfc35b)



## 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:

.doo

---------

Co-authored-by: rldtech <r.le-disez+oplab@groupeonepoint.com>
Co-authored-by: tnhnblgl <51187395+tnhnblgl@users.noreply.github.com>
Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-06-13 05:23:50 +00:00
evanpelle ef5ed59e08 dynamic radial menu build options (#1152)
## Description:
Show different build options depending on where player clicked. If they
clicked on their own territory show structures, if not show nukes &
warship.

## 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:

<DISCORD USERNAME>
2025-06-12 10:13:55 -07:00
evanpelle 22caa9c5d2 favor transport ships, no reload penalty (#1153)
## Description:

People were able to get transport ships across by distracting enemy
warships with their own warship. This change has warships prioritize
enemy transport ships over warships. It also allows warships to reload
instantly after shooting a transport ship. This prevent cheesing where
players send out many transport ships with little to no troops to
distract the warship.

## 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:

<DISCORD USERNAME>
2025-06-12 10:13:44 -07:00
Vivacious Box 814e4d9934 Fix regression cooldown bars (#1154)
## Description:

Changes in unit cooldown introduced a bug in the loading bars
This fixes it.

## 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
2025-06-11 14:24:58 -07:00
Mittanicz 98a188a3d1 * optimize leaderboard (#1151)
## Description:

## 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
- [ ] 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:

Discord: Diessel

Closes: #1150 1150

Images
![Snímek obrazovky 2025-06-11 v 17 52
36](https://github.com/user-attachments/assets/bf66217d-9bd8-4cd6-ad5c-08c74e8d43b2)
![Snímek obrazovky 2025-06-11 v 17 52
30](https://github.com/user-attachments/assets/f5762517-276e-4e4e-8884-ed4f796f9a4e)
![Snímek obrazovky 2025-06-11 v 17 52
26](https://github.com/user-attachments/assets/a4e76ed8-cf2e-43bb-be54-45556e07e883)
2025-06-11 14:07:32 -07:00
Mittanicz 7104d10c3f * fix timer overflow (#1148)
## Description:
Fix the time overflow when there is long game. Using css only

## 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:

Diessel

Closes #1147 

Images:
![Snímek obrazovky 2025-06-11 v 17 03
02](https://github.com/user-attachments/assets/a3334381-cee4-4500-a356-a64f8de74215)
![Snímek obrazovky 2025-06-11 v 17 02
48](https://github.com/user-attachments/assets/d0828974-39b0-4a71-9951-95af81700552)
2025-06-11 14:01:36 -07:00
its-sii 5c6cc1dc7b Fixed bad translation string bug for unit info modal. (#1143)
## Description:
Just cleaning up a small oops I let slip through. 

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


![image](https://github.com/user-attachments/assets/0ba4855c-5cdc-4a60-be7a-19d1651f573b)

![image](https://github.com/user-attachments/assets/8a1722b3-e44c-4927-bf90-107ecc0c155e)

![image](https://github.com/user-attachments/assets/bca33461-8913-40db-b641-d94b452999d6)

![image](https://github.com/user-attachments/assets/34e9d3f1-e886-4753-beb7-91a8e1ade65a)

![image](https://github.com/user-attachments/assets/4e3ca80a-dcdb-49ea-9742-2c0d93195ea8)

## Please put your Discord username so you can be contacted if a bug or
regression is found: sii
2025-06-11 20:50:39 +00:00
Scott Anderson bbf6329933 discriminatedUnion (#1130)
## Description:

Convert `z.union()` to `z.discriminatedUnion()` and remove the redundant
`type` enum from `BaseIntentSchema`.

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

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-11 13:46:59 -07:00
VariableVince 4cd3c2f984 Rename Replay speed to Game speed in Singleplayer (#1145)
## Description:

Change the title of the replay panel from "Replay speed" to "Game speed"
when in a Singleplayer game.

BEFORE

![afbeelding](https://github.com/user-attachments/assets/1ff17f05-ebae-4adf-a90d-618a87ca7432)

AFTER
![Game
speed](https://github.com/user-attachments/assets/5af78157-17e9-4e00-b4c3-d36c33b026f9)

## 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:

tryout33
2025-06-11 02:13:18 -04:00
Ethienne Graveline 9b2c6cc1f6 Simple Upgradable Structures (Cities, Ports, SAMs and Silos) (#1012)
## Description:

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

I've implemented upgradable structures for cities and ports.

As of right now this is just meant as a QOL change for structure
stacking that currently happens and no gameplay changes are intended.

Structure upgrades cost the same as making a new structure of that type
and function the same as making a new structure of that type.

I'm putting up a draft PR for this now since adding support for SAMs and
Silos will take more time to handle the cooldowns and I want to make
sure I'm on the right track for getting this merged.

I also still need to add bot behavior for this and re-enable min
distance for structures.

I didn't see translations for the UnitInfoModal so I've left that out
for now.

I've tested locally in a single player game so far but will document and
test more thoroughly before merging.


![image](https://github.com/user-attachments/assets/321a17cf-26a5-4152-aae1-6b6a691638bb)


![image](https://github.com/user-attachments/assets/8cfdabe6-f0a1-435a-a5a3-05b442427c2f)


## 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:

# Poutine

---------

Co-authored-by: Scott Anderson <scottanderson@users.noreply.github.com>
2025-06-10 23:04:17 -04:00
Ghis 9c3b828fc8 fix(client): use the right language-modal selector (#1136)
## Description:
Use the proper language-modal selector tag in initialize for the
language modal.
fixes https://github.com/openfrontio/OpenFrontIO/issues/865

## 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:

ghisloufou
2025-06-11 02:54:04 +00:00
falc 15a895c724 lazy loading and current data var (#988)
## Description:
Improved loading perfomance a little bit
## 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:
![Screenshot from 2025-06-01
01-58-58](https://github.com/user-attachments/assets/6d74edc8-4de3-4b1f-ab9e-a61afb449a08)

@qqkedsi
2025-06-11 02:26:40 +00:00
evanpelle f0c37ec9c5 bugfix: ColorAllocator not copying fallbackColors causing it to be empty, causing npes 2025-06-10 14:43:37 -07:00
Christopher Mesona cd799b514c feat: assign unique colors for players (#1063)
## Description:

  * adds 100+ colors for players
  * assigns a unique color for each player
  * bot and team colors assignment unchanged


![image](https://github.com/user-attachments/assets/75061a50-7166-4c0b-8f53-b35074a85706)

## 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:

George

---------

Co-authored-by: cmesona <christopher.mesona@ubisoft.com>
2025-06-10 13:55:53 -07:00
Vivacious Box 6a1e34b16a Add progress bars to show loading time and healthbars (#1107)
## Description:


Add progress bars to show construction time, loading time and health
bars in the UI layer

The progress bars always show at least one pixel of progression (better
visuals)


![buildcity](https://github.com/user-attachments/assets/7181642a-742d-4996-8ca9-748b55c04a58)

![launchNuke](https://github.com/user-attachments/assets/85fbed8f-3d91-4d7e-9c01-737ee5868992)

![ships2](https://github.com/user-attachments/assets/9fd53e6a-b2c7-4044-8b65-6f61231775b1)


## 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: evanpelle <evanpelle@gmail.com>
2025-06-10 20:50:31 +00:00
Ghis 22e0de9526 Add a Replay speed control feature (#1106)
## Description:
PR for https://github.com/openfrontio/OpenFrontIO/issues/1105
This pull request introduces a new replay-panel under options-menu to
control singleplayer and replay speed.

![image](https://github.com/user-attachments/assets/2f83b969-eff1-4a87-bdca-867f6a98e46b)

User can select 4 different speed multipliers based on the
turnIntervalMs config.

I locally tested the feature in singleplayer mode. I couldn't find a way
to test replay mode.
Tested with the pause button, working as you would expect.


Here is an example:

[replay-speed.webm](https://github.com/user-attachments/assets/7b3a7616-5f8f-4fbb-88ba-0b2414c6f2ea)


## 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
⚠️ I need help to test this feature in real conditions with a replayed
game in dev env.

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

ghisloufou

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-06-10 13:40:20 -07:00
Ghis bf26557dac Fix non valid SafeString flag codes (#1135)
## Description:
Removed unicode in the following flag file names to prevent error, which
lead to not be able to start a game with it.

- Ceará
- 1_Northern Uí Néill
- Pará
- São Paulo
- 1_Southern Uí Néill

related to https://github.com/openfrontio/OpenFrontIO/pull/1133

## 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:

ghisloufou
2025-06-10 13:39:41 -07:00
Scott Anderson 790b052ca2 Move version and changelog to files (#1109)
## Description:

Move these assets to files so that they can be replaced with generated
assets in the future.

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

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-10 10:07:26 -07:00
evanpelle a0d17ed85e counter attack doesn't cancel out attack (#1132)
## Description:
Instead of a counter attack cancelling out the initial attack, both
attacks run concurrently. This results in a more dynamic frontline.

## 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:

<DISCORD USERNAME>
2025-06-10 10:03:02 -07:00
evanpelle f508e0dd15 use newer attack, delete existing attack (#1134)
## Description:
Also when a new attack is sent when there's an existing attack, have the
new attack delete the existing attack. This causes attack to "reset" and
use the entire border when a new attack is sent.

## 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:

<DISCORD USERNAME>
2025-06-10 10:01:46 -07:00
VariableVince aee6c0e72f Fix Māori flag name (#1133)
## Description:

Removed unicode in Māori flag file name to prevent error, which lead to
not be able to start a game with it.

## 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:

tryout33
2025-06-10 09:34:03 -07:00
Scott Anderson cfbed15fad Avoid using as to cast values (#1115)
## Description:

- Use `<argument> is <type>` return type declarations in favor of `as`.
- Use `satisfies` instead of `as`.

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

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-09 21:59:31 -07:00
evanpelle a19bfec40a increase nuke speed from 4 to 6 (#1125)
## Description:
Since nukes take a curved/longer paths nukes take too long to reach
their target. This PR increases their speed by 50%.

## 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:

evan
2025-06-09 20:02:51 -07:00
its-sii 9401f20436 Adding unit info modal translation support. (#1122)
## Description:
Adding translation support for unit info modal. 
## 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

Regression test to make sure UI is still displaying as expected

![image](https://github.com/user-attachments/assets/bad18084-a4bb-479c-a3dd-74c9c541fdb0)

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

sii
2025-06-09 15:34:58 -07:00
evanpelle bf9b9a4b0d fix duplicate websocket handler (#1124)
## Description:
Turns out ws.on adds a new listener, it doesn't remove the existing
listener. so it turns out we had both worker & game server listening to
messages. this only got noticed because we close web socket connection
on parsing failure.

## 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:

evan
2025-06-09 14:53:34 -07:00
Christopher Mesona 063574c224 fix: correct mac modifier and emoji key detection in input handler (#1118)
## Description:

Fixes Command and Option Keys for Mac. Shows this modification in help


![image](https://github.com/user-attachments/assets/81f884c2-6929-48cf-a8e5-3fde6290df34)

## 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:

George

Co-authored-by: cmesona <christopher.mesona@ubisoft.com>
2025-06-09 14:41:47 -07:00
VariableVince 5e821bec06 Optimizations for botbehaviour (#1114)
## Description:

Some optimizations for bot & fakehuman execution. Better performance
measured using profiling, at the start of a game or in singple player,
but since the circumstances differ it is not a very reliable comparison.

--- In BotExecution:
Added getNeighborTraitorToAttack in Botbehavior to use in maybeAttack.
No caching for playerNeighbors array, because although it could be
re-used up to two times in selectRandomEnemy, maybeAttack runs every
tick and selectEnemy only every 10 seconds so the cache overhead would
not be worth it.

--- In Botbehavior:
Put repeated code in dedicated functions for readability, maintainance
ease, and reduce the chances of forgetting to update the timestamp for
enemyUpdated. Can be seen as a follow-up to PRs #434 and #946.

-- In both selectEnemy and selectRandomEnemy: 
Put the first if this.enemy === null statement parenthesis, around the
two checks below. Because if there's already an enemy (if forgetEnemies
hasn't nullified it, enemy === null is false at the first if statement),
then enemy === null will still be false for the two checks below the
first. No need to check it thrice then. Once inside the first if
statement (when enemy === null is true), then we need to check it two
times more in case the code inside already set an enemy.

-- In selectEnemy under 'Prefer neighboring bots': 
Removed unneccessary check for enemy === null.
Replaced sort with more performant for loop.

-- In selectRandomEnemy:
Under 'Select a traitor as an enemy', if a traitor is a friendly player,
they got less odds to be chosen as enemy over an unfriendly player, but
they weren't ruled out. While below in the Sanity Check, we specifically
rule out friendly players as enemy and set enemy=null. So excluded
friendly players under 'Select a traitor as an enemy' instead of only
giving them lower odds.

Use the new shared method getNeighborTraitorToAttack.

-- In checkIncomingAttacks, since we're only interested in the max
value, replaced sort with loop that makes a single pass through the
attacks to find the largest one.

-- For shouldAcceptAllianceRequest, #1049 added tests and improved
readability of Alliance requests.

It may have also deoptimized it a bit. Const notTooManyAlliances would,
in the past, not be computed if requestorIsMuchLarger was already found
to be true. Since the readability changes, tooManyAlliances was always
computed regardless of the value of requestorIsMuchLarger.

This PR attempts to address this too, while still keeping it as readable
hopefully.

Also choose for early returns to optimize a bit more. So if isTraitor is
true, don't compute any further and just return false immediately etc.

Switched the order of testing for noMalice and isTraitor. Traitor status
used to be throughout the game, now it's only 30 seconds or will be
maybe 45 seconds to 1 minute. So the chances of someone asking for
alliance and being a traitor at the same time have decreased. isMalice
chances could be bigger.

Removed the named constants and choose to put them in comments, so
readability should be about the same as #1049 intended. Kept the braces
for the if statements because otherwise Prettier would misalign the
comments.)

## 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:

tryout33
2025-06-09 14:28:51 -04:00
Doo cc5b83d357 Remove duplicate gold accumulation in team stats calculation (#1010)
## Description:

Gold was counted twice.

Fixing issue https://github.com/openfrontio/OpenFrontIO/issues/1009

## 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:

.doo

---------

Co-authored-by: rldtech <r.le-disez+oplab@groupeonepoint.com>
Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-06-08 20:05:46 -07:00
evanpelle 718eda9888 cloudflare fixed tunnel name (#1096)
## Description:
The binary created a new tunnel on startup, and if the container crashed
looped, then it would generate 100s of tunnels causing us to reach the
1000 tunnel limit.

Now the config is stored on a mounted volume, so if the container
restarts it sees the existing config and does not create a new tunnel.

## 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:

evan
2025-06-08 19:38:23 -07:00
VariableVince 359af90727 Fix: Hide username validation error in-game (#1110)
## Description:

Empty username results in error box "Username must be at least 8
characters long.".

You can't open single player or private lobby modals, but you can still
join a public lobby. Your player name will then be "xxx".

The error box isn't hidden in-game however. This fixes it.

BEFORE

![Before
1](https://github.com/user-attachments/assets/8233749f-e625-41d6-8aef-f42e033c7c63)

![Before
2](https://github.com/user-attachments/assets/26a21669-1a86-4d1d-9f2c-1b208a503c4c)

AFTER


![After](https://github.com/user-attachments/assets/14a05491-cf05-46eb-ab8e-9847cd7cf094)

## 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:

tryout33
2025-06-08 19:30:45 -07:00
Scott Anderson 40cd223d6b Fix bug in FakeHumanExecution (#1102)
## Description:

Fix a bug causing an exception to be thrown which crashes the game.

## 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
- [ ] 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-06-08 08:03:40 -07:00
Max Lundgren 4170aca548 Add filters tabs to EvensDisplay to let users filter events (#1080)
## Description:
Big update to the EventsDisplay

- Style update for EventsDisplay, look & feel similar to other windows
- Component now hidden during spawn phase
- Adds new functionality for filtering events by category. Allows the
player to remove specific event types
- Displays latest gold amount, decays after 5 seconds

<img width="1147" alt="Screenshot 2025-06-07 at 20 18 55"
src="https://github.com/user-attachments/assets/11c39818-55ad-4ba1-a998-360057e2856c"
/>

<img width="422" alt="Screenshot 2025-06-07 at 19 01 55"
src="https://github.com/user-attachments/assets/09c0b998-6046-49fb-9fba-33b4f57f337b"
/>

<img width="444" alt="Screenshot 2025-06-07 at 20 20 25"
src="https://github.com/user-attachments/assets/022deadc-3a49-442a-85f5-f1cd128a5805"
/>

![Screen Shot 2025-06-07 at 20 32
07](https://github.com/user-attachments/assets/d8575ea0-109d-4841-b661-b233201a304a)



## 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:

maxion_


Fixes #1025 
Fixes #1034
2025-06-08 12:16:23 +03:00
Scott Anderson 67c8e2799a Revert "Ci coverage" (#1101)
Reverts openfrontio/OpenFrontIO#1099

This approach is causing issues in forks.
2025-06-08 04:38:38 -04:00
Scott Anderson f8101a766f Ci coverage (#1099)
## Description:

Updated #935 with token.

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

---------

Co-authored-by: aqw42 <garsvog1@gmail.com>
Co-authored-by: Théodore Léon <corentin.noel56@gmail.com>
Co-authored-by: evanpelle <evanpelle@gmail.com>
Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-08 03:09:28 -04:00
Scott Anderson d40ec2f723 Nations can spawn cities without a port (#1072)
## Description:

Allow nations to spawn cities even if they do not have a port.

## 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
- [ ] 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 <evanpelle@gmail.com>
2025-06-07 20:46:43 -07:00
evanpelle 6f51fd566a Disable donations public ffa matches (#1097)
## Description:
Some players have created a script to auto donate to themselves. So we
should disable donation in public ffa matches.

## 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:

<DISCORD USERNAME>
2025-06-07 20:30:49 -07:00
evanpelle dda9e26596 refactor radial, fix boat on terra nullius not working fixes (#1095)
## Description:
refactor the MenuElements to be more decoupled by passing in MenuParams.

Fix boat not working on terra nullius.

fixes #1088

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] 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-06-07 15:34:10 -07:00
Max Lundgren 72bb78342e rename Event interface -> GameEvent (#1094)
## Description:
Rename the `Event` interface `GameEvent` as `Event` shadows the browser
API `Event`

## 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:

maxion_
2025-06-07 15:32:45 -07:00
Max Lundgren 13fd2743ed #1086 prevent clicking on other structures than your own (#1087)
## Description:
Prevent opening UnitInfoModal for other structures than your own

## 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:

maxion_
2025-06-07 12:09:30 -07:00
Max Lundgren 9cfbd80d12 Add back #646 - trade ship gold by travelled distance (#1085)
## Description:
Return #646 - gold from tradeships by travelled distance

https://github.com/openfrontio/OpenFrontIO/pull/646/

## 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:

maxion_
2025-06-07 12:05:12 -07:00
E-EE-E 7a9cc66c7f Update PlayerImpl.ts (#1079)
## Description:
The removeTroops function works with the given parameter value of 1.

## 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:

<DISCORD USERNAME>
_bjkim_
2025-06-06 23:57:41 -04:00
evanpelle e6071b6a56 kick existing client when duplicate persistent id is found (#1077)
## Description:
Kick the existing client instead of the new client because this was
causing issues with replays. Players were unable to replay a game if
they were a player.

## 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-06-06 23:43:55 -04:00