Skip to content

Techtree international trade magic#59

Closed
El-Magico777 wants to merge 147 commits into
mainfrom
techtree-international-trade-magic
Closed

Techtree international trade magic#59
El-Magico777 wants to merge 147 commits into
mainfrom
techtree-international-trade-magic

Conversation

@El-Magico777
Copy link
Copy Markdown
Collaborator

Description:

Describe the PR.

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

1brucben and others added 30 commits October 17, 2025 17:46
Enforce minimum test coverage.

- [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 have read and accepted the CLA agreement (only required once).
Closes #1656

Change: Simplification of the function to display percentages with one
decimal place without limitation.
Result: Percentages are now displayed with one rounded decimal place
(e.g. 15.5%, 99.6%) without automatic replacement of extreme values.

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

kipstzz
Betray on MIRV launch, instead of on separate.

- [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
- [ ] I have read and accepted the CLA agreement (only required once).
…ects (#1631)

Fix the stale disconnected (Zzz) icon persisting when a client
reconnects

Refer to issue #1630

This change modifies the GameServer.addClient function to send the
mark_disconnected = false intent when a client that was previously
disconnected gets replaced by a newly joined client with the same
clientID. Under the old logic, this mark_disconnected = false intent is
not sent if the client was disconnected for longer than 60 seconds
before reconnecting.

https://github.com/user-attachments/assets/5e0ce1c3-9519-4f39-aa80-e46f1275649c

Left side browser (player with red tiles) is the disconnected client
that was disconnected at 00:14 game clock time. It reconnected around
03:56 game clock time.
Right side browser (player with green tiles) is the other client. Use
the game clock time from the right side for the live game clock time.

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

slyty

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
Determine which scroll event delta, x or y, has the non zero value.
Use it to determine troop ratio increase or decrease.
Shift + Scroll can change scroll diretion from Y to X axis. If that is
enabled this change will still allow troop ratio increase / decrease

- [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
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
regression is found:

richard012659

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
Tight code coverage requirements and low coverage are making it
difficult to merge code, because a small increase in lines of code can
decrease coverage enough to trigger a test failure.

- [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 have read and accepted the CLA agreement (only required once).
This PR introduces handling for the canvas `contextlost` and
`contextrestored` events to make the game's rendering more robust.

Previously, if the graphics context was lost (which can happen due to
browser memory management, GPU driver resets, etc.), the render loop
would continue to run, but most drawing operations would silently fail.
This resulted in a broken visual state where terrain, structures, and
other graphics would disappear, leading to what players have referred to
as the "black screen bug".

These changes implement the following:
1.  In `GameRenderer`, event listeners are added to the main canvas.
2. On `contextlost`, the `requestAnimationFrame` loop is cancelled,
pausing rendering.
3. On `contextrestored`, a full redraw of all layers is triggered, and
the render loop is restarted, allowing the game to gracefully recover.

Additionally, a related bug in the `StructureLayer` is fixed. During a
redraw/restoration, the layer could attempt to render unit icons to its
canvas before the images were fully (re)decoded. The `init` method now
explicitly waits for all icon images to be decoded before drawing them,
ensuring the layer is restored correctly.

**Important Note:** This PR represents a partial fix for the context
loss issue. Specifically, the `StructureIconsLayer` remains in a broken
state after context restoration. This layer is rendered using Pixi.js,
which has its own specific process for handling renderer recovery. Due
to my lack of experience with the Pixi.js API, I was unable to implement
the fix for this layer. This would be an excellent follow-up
contribution for someone familiar with Pixi.

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

aaa4xu
Added player management features so lobby hosts can kick players from
private games. This includes both UI changes and backend work.
- Hosts can now kick players from private lobbies with a simple button
- Added host badges and remove buttons to the UI
- Made sure only hosts can kick people, and hosts can't kick themselves
- When someone creates a private game, they automatically become the
host
- Kicking happens through WebSocket "kick-player" events
- Server checks that you're actually the host before letting you kick
anyone

<img width="1291" height="871" alt="Screenshot 2025-07-15 002114"
src="https://github.com/user-attachments/assets/ea575f83-a0f4-45d1-9cfe-7521d373f3d5"
/>
- Kicked player gets general message (same when kicked for multi tab)
- Host abandoment still existent (host clicks on x; or is closing tab)

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

[UN]nvm

---------

Co-authored-by: floriankilian <floriankilian@users.noreply.github.com>
Adjusted the CSS filter properties for the background image in dark mode
by reducing brightness, adding saturation control, and increasing
contrast.

Fixes #1238

Screenshots:
From:
<img width="3360" height="2100" alt="CleanShot Google Chrome 2025-07-31
at 11 00 58@2x"
src="https://github.com/user-attachments/assets/93472d02-3a3d-4431-bf43-9abc2d7ac873"
/>

To:
<img width="3360" height="2100" alt="CleanShot Google Chrome 2025-07-31
at 11 01 03@2x"
src="https://github.com/user-attachments/assets/eac464e1-d66f-4b74-a5f6-94441ff20b73"
/>

- [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:
[UN] nvm
There is a race condition causing clients to send intents before
joining:

1. User requests to join a Game
2. The Worker does authentication & authorization
3. User requests to send an intent before joining the game, so the
request is sent to the worker

So instead of kicking the client, just log a warning and drop the
message.

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

evan
Add support for merge groups

- [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 have read and accepted the CLA agreement (only required once).
…649)

Converted the WebSocket message handler from if-statement chain to
switch statements. The outer switch handles message types (`intent`,
`ping`, `hash`, `winner`) and the inner switch handles intent types
(`mark_disconnected`, `kick_player`).
- [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 have read and accepted the CLA agreement (only required once).
regression is found:
[UN] nvm

---

*Fixes #1639*
Fixes #1519
Currently if a player is killed via a nuke, they keep their gold despite
being eliminated and other players have no way to access that gold as
there is no territory to conquer. This PR fixes this by removing gold
from dead players.

This doesn't affect gameplay itself, because that gold was already
inaccessible. It'll just be clearer to the remaining players now.

<img width="1566" height="827" alt="Zrzut ekranu 2025-07-16 210908"
src="https://github.com/user-attachments/assets/438081e5-c145-4691-a36c-92ceb1049469"
/>
^ This is what this PR fixes

- [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 is found:
aceralex
Added prevention from accident reload of page

- [x] 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
- [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 is found:

@qqkedsi
<img width="526" height="896" alt="image"
src="https://github.com/user-attachments/assets/22b273a5-de50-4567-93f0-353cea36ea29"
/>
Improved dark mode styling for #1681

Old:

<img width="536" height="565" alt="image"
src="https://github.com/user-attachments/assets/8b7b5cc5-aa74-4e9b-a814-635c4373d5ab"
/>

New Look:
<img width="766" height="925" alt="image"
src="https://github.com/user-attachments/assets/acd00f2b-7248-4b63-b5c4-a345195d4414"
/>

- [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
totalfailure
This PR removes the unused `processName` utility function from `Util.ts`
and its dependency, the `twemoji` package.

The `processName` function has been commented out and non-operational
for approximately 9 months. This cleanup removes the dead code. As a
result, the `twemoji` npm package is no longer needed and has been
removed from the project's dependencies, which slightly reduces the
overall dependency footprint.

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

aaa4xu
Closes #555

Added random damage for warship shells and defence posts.
Damage mapping: roll 1-5 → 200, 225, 250, 275, 300 damage respectively.

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

kipstzz
Players received "traitor" debuff when alliances were formed after
attacks started, creating an unfair race condition.

the problem was mentioned here
https://discord.com/channels/1284581928254701718/1399115120486912100

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

Kipstzz

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
Add support for merge groups

- [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 have read and accepted the CLA agreement (only required once).
Attempt to support merge_group

- [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 have read and accepted the CLA agreement (only required once).
The first Google result contains a join code. Using the canonical should
tell Google to use openfront.io instead. Also add metadata for Open
Graph links. Set favicon in the index.html instead of Main.ts so google
can pick it up.

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

evan
Closes #1694

Currently when you paste the invitation (
[https://openfront.io#join=QwIr5aK4](https://openfront.io/#join=QwIr5aK4)
) it puts undefined in the input so I made this issue to make a PR and
fix the problem.

<img width="410" height="370" alt="image"
src="https://github.com/user-attachments/assets/d2cf4321-49e3-4e81-987e-66eff2e4d14c"
/>

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

kipstzz
Fixing all remaining type errors caused by strict mode and enable it.

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

azlod

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This PR updates the meta viewport tag in the HTML head to include
user-scalable=no. This change improves the user experience on tablets,
especially iPads, by disabling native browser zooming and enforcing
OpenFront’s zoom behavior.

This prevents inconsistencies caused by native scaling, such as icons or
text appearing misaligned or in incorrect positions.

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

seegurkenlp

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
PersistentIdSchema.safeParse(v).success returns a boolean not
undefined/null.

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

evan
The unload alert is triggered when purchasing items causing bad ux. We
already have unload alert in-game if you are still alive so this seems
unnecessary.

reverts:
openfrontio/OpenFrontIO@ac8a841

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

evan
…Maximized is set (#1710)

This PR fixes a visual bug where, when the `alwaysMaximized` property is
enabled on the modal component (`o-modal`), the background color does
not cover the entire content area, especially when the content is
scrollable or overflows.

before
It is noticeable that a black border appears between the first and
second lines from the bottom
<img width="929" height="722" alt="スクリーンショット 2025-08-05 17 03 16"
src="https://github.com/user-attachments/assets/c6ecdd90-2210-4f23-8737-68bd24a0957e"
/>

after
<img width="916" height="718" alt="スクリーンショット 2025-08-05 17 06 54"
src="https://github.com/user-attachments/assets/bcfb2a91-8b06-4185-84da-5430a789c46a"
/>

- [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:
aotumuri
1brucben and others added 28 commits October 27, 2025 19:01
… and implement a progress display for research items
…search tree modal by rendering at root to avoid transform clipping
* fix: adjust z-index for gameplay canvas and version display for proper layering

* style: update background colors for BuildMenu and ControlPanel2; brighten text colors for submarine panels

* fix: adjust z-index for player name rendering to ensure proper layering above gameplay canvas

* fix: adjust player info overlay layout for better alignment of flag images

* fix: enhance player info rendering by adding relation class for better visual distinction
* style(buildmenu): change button color for better contrast

* style(roads): change inner fill color to cool grey

* style(structure): change building fill color to very light blue
This commit makes the research tree modal listen to the CloseViewEvent and close itself when the event is fired. This allows the user to close the modal by pressing the Escape key.
… and adjust auto-peace logic in FakeHumanExecution
This commit integrates the `InternationalTrade` upgrade into the research tree.

The `InternationalTrade` upgrade was already defined as an `UpgradeType` and had a cost associated with it in the configuration, but it was not available to be researched in the tech tree.

This commit makes the following changes:

- In `src/core/tech/TechEffects.ts`:
  - Adds `INTERNATIONAL_TRADE: Economy-2` to the `RESEARCH_TECH_IDS` constant.
  - Adds a new `TechDefinition` for `INTERNATIONAL_TRADE` to the `TECHS` constant, which unlocks the `UpgradeType.InternationalTrade` upgrade upon completion.

This change makes the `InternationalTrade` upgrade available to be researched at the Economy-2 position in the tech tree.
@El-Magico777 El-Magico777 added this to the Cancelled milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants