mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:50:32 +00:00
Sync factory effective distance and railroad max length and add railroad ghost for factories (#4079)
> **Before opening a PR:** discuss new features on [Discord](https://discord.gg/K9zernJB5z) first, and file bugs or small improvements as [issues](https://github.com/openfrontio/OpenFrontIO/issues/new/choose). You must be assigned to an `approved` issue — unsolicited PRs will be auto-closed. **Add approved & assigned issue number here:** Resolves #2668 ## Description: Makes radius that factories effect equal to the max distance that a railroad can be and enable factory ghosts <img width="1920" height="1080" alt="Screenshot from 2026-06-01 20-13-58" src="https://github.com/user-attachments/assets/1e2f4de8-79fc-4034-b6ad-3c71255c0410" /> ## 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 ## Please put your Discord username so you can be contacted if a bug or regression is found: tktk1234567
This commit is contained in:
@@ -70,6 +70,8 @@ export class RangeCirclePass {
|
||||
const gl = this.gl;
|
||||
gl.useProgram(this.program);
|
||||
gl.uniformMatrix3fv(this.uCamera, false, cameraMatrix);
|
||||
gl.bindVertexArray(this.vao);
|
||||
|
||||
gl.uniform2f(this.uCenter, this.centerX, this.centerY);
|
||||
gl.uniform1f(this.uRadius, this.radius);
|
||||
if (this.warning) {
|
||||
@@ -77,8 +79,6 @@ export class RangeCirclePass {
|
||||
} else {
|
||||
gl.uniform3f(this.uColor, 1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
gl.bindVertexArray(this.vao);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
||||
}
|
||||
|
||||
|
||||
@@ -246,10 +246,10 @@ export class Config {
|
||||
return 15;
|
||||
}
|
||||
trainStationMaxRange(): number {
|
||||
return 100;
|
||||
return 110;
|
||||
}
|
||||
railroadMaxSize(): number {
|
||||
return 120;
|
||||
return this.trainStationMaxRange();
|
||||
}
|
||||
|
||||
tradeShipGold(dist: number, player: Player | PlayerView): Gold {
|
||||
|
||||
@@ -238,9 +238,7 @@ export class RailNetworkImpl implements RailNetwork {
|
||||
}
|
||||
|
||||
computeGhostRailPaths(unitType: UnitType, tile: TileRef): TileRef[][] {
|
||||
// Factories already show their radius, so we'll exclude from ghost rails
|
||||
// in order not to clutter the interface too much.
|
||||
if (![UnitType.City, UnitType.Port].includes(unitType)) {
|
||||
if (![UnitType.City, UnitType.Port, UnitType.Factory].includes(unitType)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user