@@ -251,32 +138,11 @@ function BuildingAddon(props: IBuildingAddonProps){
{addon.addonModifiers !== null &&
-
+
}
{addon.addonRequirement !== null &&
- Required:
- {addon.addonRequirement.requiredTotalPop !== undefined && addon.addonRequirement.requiredTotalPop !== null &&
- Population:

- {addon.addonRequirement.requiredTotalPop}
- }
- {addon.addonRequirement.requireAddon !== null &&
-
- }
- {addon.addonRequirement.requirementBuildings.map(b =>
- )
- }
- {addon.addonRequirement.requirementBuildingsEither.length !== 0 &&
- renderRequirementBuilding(addon.addonRequirement.requirementBuildingsEither, building)}
- {addon.addonRequirement.requirementsGlobalAddons.length !== 0 &&
- renderRequirementGlobalAddons(addon.addonRequirement.requirementsGlobalAddons, building)}
+
}
{addon.filename}
diff --git a/src/classes/building/Research.tsx b/src/classes/building/Research.tsx
new file mode 100644
index 0000000..981e490
--- /dev/null
+++ b/src/classes/building/Research.tsx
@@ -0,0 +1,124 @@
+import {IMod} from "../../types/Imod";
+import {IResearch} from "../../types/IResearch";
+import {
+ Accordion,
+ AccordionDetails,
+ AccordionSummary,
+ Grid2,
+ Paper,
+ Table,
+ TableBody,
+ TableCell,
+ TableContainer,
+ TableRow
+} from "@mui/material";
+import {ExpandMore} from "@mui/icons-material";
+import {getIcon, ModifiersProvidesResearchTable} from "../ModifiersProvideTable";
+import AvTimerOutlinedIcon from "@mui/icons-material/AvTimer";
+import Required from "../Required";
+import React from "react";
+import {IBuilding} from "../../types/IBuilding";
+import {IResearchShort} from "../../types/IResearchShort";
+
+
+interface IResearchProps {
+ research: IResearch,
+ building: IBuilding,
+ mod: IMod,
+}
+
+function ResearchFull(props: IResearchProps){
+
+ const research = props.research
+ const building = props.building
+
+ return
+
+}
+
+export function renderAffectedResearches(researches: IResearchShort[], modId: number, raceId: string) {
+
+ function researchLink(rs: IResearchShort) {
+ return
+
+ {rs.name}
+
+ }
+
+ return
{researches.map(rs =>
+ rs.buildingId == null ? :
+ Research affect: {researchLink(rs)}
+ )}
+}
+
+
+export default ResearchFull;
+
diff --git a/src/css/Building.css b/src/css/Building.css
index 050ffc0..9a2a40a 100644
--- a/src/css/Building.css
+++ b/src/css/Building.css
@@ -1,4 +1,4 @@
-.addon-accordion{
+.addon-research-accordion{
margin-top: 10px;
scroll-margin-top: 15px;
}
@@ -6,5 +6,5 @@
.selected-addon div {
- background-color: antiquewhite;
+ background-color: #fafaf2;
}
\ No newline at end of file
diff --git a/src/pages/BuildingPage.tsx b/src/pages/BuildingPage.tsx
index 533d9f9..aca4c4e 100644
--- a/src/pages/BuildingPage.tsx
+++ b/src/pages/BuildingPage.tsx
@@ -3,7 +3,18 @@ import React from "react";
import {withRouter} from "../core/withrouter";
import {IWeapon} from "../types/IUnit";
import '../css/Building.css'
-import {Button, Grid2, Paper, Table, TableBody, TableCell, TableContainer, TableRow} from "@mui/material";
+import {
+ Button,
+ Grid2,
+ Link,
+ ListItem,
+ Paper,
+ Table,
+ TableBody,
+ TableCell,
+ TableContainer,
+ TableRow
+} from "@mui/material";
import {ArrowBack} from "@mui/icons-material";
import ArmorType from "../classes/ArmorType";
import AvTimerOutlinedIcon from '@mui/icons-material/AvTimer';
@@ -13,12 +24,25 @@ import {IMod} from "../types/Imod";
import {IBuilding} from "../types/IBuilding";
import Vision from "../classes/Vision";
import BuildingAddon from "../classes/building/BuildingAddon";
+import {IUnitShort} from "../types/IUnitShort";
+import Research, {renderAffectedResearches} from "../classes/building/Research";
interface UintPageState {
building: IBuilding,
mod: IMod,
}
+function Unit (unit: IUnitShort, modId: number, raceId: String) {
+
+ return (
+ {unit.icon &&
}
+ {unit.name}
+ {unit.canDetect &&
}
+
+ )
+}
+
function Building(building: IBuilding, mod: IMod) {
@@ -36,13 +60,16 @@ function Building(building: IBuilding, mod: IMod) {
}
})
-
+ var buildingName = building.name;
+ if(building.name == null){
+ buildingName = building.filename.replaceAll('_', ' ').replace('.rgd', '');
+ }
return (
{mod.name} ({mod.version})
{building.icon &&
-
} {building.name}
+

} {buildingName}
@@ -103,7 +130,8 @@ function Building(building: IBuilding, mod: IMod) {
>
Armor type
-
+
+ {building.armorType2 &&
}
+ {building.units.length > 0 &&
+ Unit production
+ {building.units.map(unit =>
+ Unit(unit, mod.id, building.race.id)
+ )}
+ }
{building.addons.length > 0 &&
Addons
{building.addons.map(b =>
)}
}
+ {building.researches.length > 0 &&
+ Researches
+ {building.researches.map(r =>
+
+ )}
+ }
{[...mapBuildingWeapons.keys()].sort(function (a, b) {
return a - b;
- }).map(h => )}
+ }).map(h => )}
+
+
+ {renderAffectedResearches(building.affectedResearches, mod.id, building.race.id)}
{building.filename}
@@ -162,7 +205,6 @@ function Building(building: IBuilding, mod: IMod) {
function goToAddon(addonHash: string) {
let addonId = addonHash.replace("#", "");
- console.log(addonId);
[].forEach.call(document.querySelectorAll('div'), function (el: HTMLElement) {
el?.classList?.remove('selected-addon');
});
@@ -170,6 +212,15 @@ function goToAddon(addonHash: string) {
document?.getElementById(addonId)?.scrollIntoView()
}
+function goToResearch(researchHash: string) {
+ let researchId = researchHash.replace("#", "");
+ [].forEach.call(document.querySelectorAll('div'), function (el: HTMLElement) {
+ el?.classList?.remove('selected-research');
+ });
+ document?.getElementById(researchId)?.classList?.add("selected-research");
+ document?.getElementById(researchId)?.scrollIntoView()
+}
+
class BuildingPage extends React.Component
{
@@ -188,6 +239,7 @@ class BuildingPage extends React.Component {
mod: modData
});
goToAddon(window.location.hash);
+ goToResearch(window.location.hash);
}
render() {
@@ -207,4 +259,4 @@ class BuildingPage extends React.Component {
export default withRouter(BuildingPage);
-export { goToAddon };
\ No newline at end of file
+export { goToAddon, goToResearch };
\ No newline at end of file
diff --git a/src/pages/ModsPage.tsx b/src/pages/ModsPage.tsx
index 5f72d26..b1796fd 100644
--- a/src/pages/ModsPage.tsx
+++ b/src/pages/ModsPage.tsx
@@ -21,6 +21,8 @@ function Mods (mods: IMod[]) {
function Mod (modName: String) {
let sameMods = mapWithModVersions.get(modName) ?? []
+ let lastBeta = sameMods.filter((m) => m.isBeta).reverse()[0]
+
return(
{modName}
@@ -28,9 +30,9 @@ function Mods (mods: IMod[]) {
{sameMods.filter((m) => !m.isBeta).map(mod =>
)}
{sameMods.find((m) => m.isBeta) != null &&
Beta versions:
}
- {sameMods.find((m) => m.isBeta) != null &&
- sameMods.filter((m) => m.isBeta).map(mod =>
-
)}
+ {lastBeta != null &&
+
+ }
)
}
diff --git a/src/pages/RacePageFast.tsx b/src/pages/RacePageFast.tsx
index 19fb2e5..0741e4a 100644
--- a/src/pages/RacePageFast.tsx
+++ b/src/pages/RacePageFast.tsx
@@ -62,7 +62,7 @@ function UnitSmall (unit: IUnitShort, modId: number, raceId: String) {
return (
{unit.icon &&
}
{unitName}
- {unit.canDetect &&
}
)
}
@@ -140,21 +140,23 @@ class Units extends React.Component {
All units
-
- Infantry
- {this.state.units.infantry.map(unit => Unit(unit, this.props.modId, this.props.raceId))}
-
-
- Tech
-
- {this.state.units.tech.map(unit => Unit(unit, this.props.modId, this.props.raceId))}
-
-
-
- Support
-
- {this.state.units.support.map(unit => Unit(unit, this.props.modId, this.props.raceId))}
-
+
+
+ Infantry
+ {this.state.units.infantry.map(unit => Unit(unit, this.props.modId, this.props.raceId))}
+
+
+ Tech
+
+ {this.state.units.tech.map(unit => Unit(unit, this.props.modId, this.props.raceId))}
+
+
+
+ Support
+
+ {this.state.units.support.map(unit => Unit(unit, this.props.modId, this.props.raceId))}
+
+
diff --git a/src/pages/UnitPage.tsx b/src/pages/UnitPage.tsx
index a845c7c..71d386f 100644
--- a/src/pages/UnitPage.tsx
+++ b/src/pages/UnitPage.tsx
@@ -24,6 +24,10 @@ import WeaponSlot from "../classes/WeaponSlot";
import UnitsTable from "../classes/UnitsTable";
import {IMod} from "../types/Imod";
import Vision from "../classes/Vision";
+import {IResearchRequirements} from "../types/IResearchRequirements";
+import {getIcon} from "../classes/Required";
+import {IResearchShort} from "../types/IResearchShort";
+import {renderAffectedResearches} from "../classes/building/Research";
interface UintPageState {
unit: IUnit,
@@ -188,7 +192,9 @@ function Unit(unit: IUnit, mod: IMod) {
>
Armor type
-
+
+ {unit.armorType2 &&
after upgrade can become:
}
{unit.health} {unit.healthRegeneration > 0 &&
+{unit.healthRegeneration}/s}
- {unit.armour !== undefined && unit.armour > 0 &&
{unit.armour} }
+ {unit.armour !== undefined && unit.armour !== 0 &&
{unit.armour} }
}
- {unit.repairSpeed !== undefined && unit.repairSpeed !== null &&
+ {unit.repairSpeed !== undefined && unit.repairSpeed !== null && unit.repairCostPercent !== null &&
- Repair speed
+ Repair
- {unit.repairSpeed}
+ {unit.repairSpeed} hp/s; {unit.repairCostPercent}% cost
}
@@ -271,7 +277,7 @@ function Unit(unit: IUnit, mod: IMod) {
0}/>
-
+
@@ -280,7 +286,10 @@ function Unit(unit: IUnit, mod: IMod) {
{[...mapWithUnitWeapons.keys()].sort(function (a, b) {
return a - b;
- }).map(h => )}
+ }).map(h => )}
+
+
+ {renderAffectedResearches(unit.affectedResearches, mod.id, unit.race.id)}
{unit.filename}
@@ -290,6 +299,8 @@ function Unit(unit: IUnit, mod: IMod) {
}
+
+
class UnitPage extends React.Component {
diff --git a/src/types/ArmorTypeValues.ts b/src/types/ArmorTypeValues.ts
index 804ee75..70ebdb9 100644
--- a/src/types/ArmorTypeValues.ts
+++ b/src/types/ArmorTypeValues.ts
@@ -2,15 +2,15 @@ enum ArmorTypeValues {
InfantryLow = 'Infantry Low',
InfantryMedium = 'Infantry Medium',
InfantryHigh = 'Infantry High',
- InfantryHeavyMedium = 'Infantry Heavy Medium',
- InfantryHeavyHigh = 'Infantry Heavy High',
- Commander = 'Commander',
+ InfantryHeavyMedium = 'Infantry H.Med.',
+ InfantryHeavyHigh = 'Infantry H.High',
+ Commander = 'Infantry Com.',
VehicleLow = 'Vehicle Low',
VehicleMedium = 'Vehicle Medium',
VehicleHigh = 'Vehicle High',
LivingMetal = 'Living Metal',
Titan = 'Titan',
- Air = 'Air',
+ Air = 'Vehicle Air',
BuildingLow = 'Building Low',
BuildingMedium = 'Building Medium',
BuildingHigh = 'Building High',
diff --git a/src/types/IAffectedEntity.tsx b/src/types/IAffectedEntity.tsx
new file mode 100644
index 0000000..af88bdc
--- /dev/null
+++ b/src/types/IAffectedEntity.tsx
@@ -0,0 +1,23 @@
+export interface IAffectedEntity {
+ id: number
+ name: string
+ icon: string
+ filename: string
+}
+
+export interface ISergeantUnitShortDto {
+ id: number
+ name: string
+ icon: string
+ filename: string
+ unit: IAffectedEntity
+}
+
+export interface IWeaponUnitShortDto {
+ id: number
+ name: string
+ filename: string
+ units: IAffectedEntity[]
+ sergeants: ISergeantUnitShortDto[]
+ buildings: IAffectedEntity[]
+}
\ No newline at end of file
diff --git a/src/types/IBuilding.tsx b/src/types/IBuilding.tsx
index c31f930..c9d200e 100644
--- a/src/types/IBuilding.tsx
+++ b/src/types/IBuilding.tsx
@@ -1,7 +1,11 @@
import {Irace} from "./Irace";
import {IArmorType} from "./IArmorType";
import {WeaponHardpoint} from "./IUnit";
-import {IBuildingShort} from "./IBuildingShort";
+import {IUnitShort} from "./IUnitShort";
+import {IModifier} from "./IModifier";
+import {IRequirement} from "./IRequirement";
+import {IResearch} from "./IResearch";
+import {IResearchShort} from "./IResearchShort";
export interface IBuilding {
id: number
@@ -30,6 +34,9 @@ export interface IBuilding {
modId: number
weapons: WeaponHardpoint[]
addons: IBuildingAddon[]
+ researches: IResearch[]
+ units: IUnitShort[]
+ affectedResearches: IResearchShort[],
}
export interface IBuildingAddon {
@@ -43,8 +50,8 @@ export interface IBuildingAddon {
addonCostFaith: number;
addonCostSouls: number;
addonCostTime: number;
- addonModifiers: IAddonModifier[];
- addonRequirement: IAddonRequirement;
+ addonModifiers: IModifier[];
+ addonRequirement: IRequirement;
icon?: string;
}
@@ -54,19 +61,3 @@ export interface IBuildingAddonShort {
name: string;
icon: string;
}
-
-export interface IAddonRequirement {
- requirementBuildings: IBuildingShort[];
- requirementBuildingsEither: IBuildingShort[];
- requirementsGlobalAddons: IBuildingAddonShort[];
- replaceWhenDone: Boolean;
- requireAddon: IBuildingAddonShort;
- requiredTotalPop?: number;
-}
-
-export interface IAddonModifier {
- id: number;
- reference: string;
- usageType: string;
- value: number;
-}
\ No newline at end of file
diff --git a/src/types/IModifier.tsx b/src/types/IModifier.tsx
new file mode 100644
index 0000000..7104072
--- /dev/null
+++ b/src/types/IModifier.tsx
@@ -0,0 +1,8 @@
+
+export interface IModifier {
+ id: number;
+ reference: string;
+ usageType: string;
+ target: string;
+ value: number;
+}
\ No newline at end of file
diff --git a/src/types/IRequirement.tsx b/src/types/IRequirement.tsx
new file mode 100644
index 0000000..7b6a751
--- /dev/null
+++ b/src/types/IRequirement.tsx
@@ -0,0 +1,13 @@
+import {IBuildingShort} from "./IBuildingShort";
+import {IBuildingAddonShort} from "./IBuilding";
+import {IResearchRequirements} from "./IResearchRequirements";
+
+export interface IRequirement {
+ requirementBuildings: IBuildingShort[];
+ requirementBuildingsEither: IBuildingShort[];
+ requirementsGlobalAddons: IBuildingAddonShort[];
+ requirementResearches: IResearchRequirements[];
+ replaceWhenDone: Boolean;
+ requireAddon: IBuildingAddonShort;
+ requiredTotalPop?: number;
+}
\ No newline at end of file
diff --git a/src/types/IResearch.tsx b/src/types/IResearch.tsx
new file mode 100644
index 0000000..6c4be33
--- /dev/null
+++ b/src/types/IResearch.tsx
@@ -0,0 +1,24 @@
+import {IModifier} from "./IModifier";
+import {IRequirement} from "./IRequirement";
+import {IAffectedEntity, ISergeantUnitShortDto, IWeaponUnitShortDto} from "./IAffectedEntity";
+
+export interface IResearch {
+ id: number
+ name: string
+ filename: string
+ description: string
+ costRequisition: number
+ costPower: number
+ costPopulation: number
+ costFaith: number
+ costSouls: number
+ costTime: number
+ icon: string
+ modId: number
+ affectedUnits: IAffectedEntity[]
+ affectedSergeants: ISergeantUnitShortDto[]
+ affectedBuildings: IAffectedEntity[]
+ affectedWeapons: IWeaponUnitShortDto[]
+ requirements: IRequirement
+ modifiers: IModifier[]
+}
\ No newline at end of file
diff --git a/src/types/IResearchRequirements.tsx b/src/types/IResearchRequirements.tsx
new file mode 100644
index 0000000..4b9172b
--- /dev/null
+++ b/src/types/IResearchRequirements.tsx
@@ -0,0 +1,6 @@
+import {IResearchShort} from "./IResearchShort";
+
+export interface IResearchRequirements {
+ researchShortDto: IResearchShort,
+ researchMustNotBeComplete: Boolean,
+}
\ No newline at end of file
diff --git a/src/types/IResearchShort.tsx b/src/types/IResearchShort.tsx
new file mode 100644
index 0000000..e4833b3
--- /dev/null
+++ b/src/types/IResearchShort.tsx
@@ -0,0 +1,6 @@
+export interface IResearchShort {
+ id: string;
+ name: string;
+ icon: string;
+ buildingId: number;
+}
\ No newline at end of file
diff --git a/src/types/IUnit.tsx b/src/types/IUnit.tsx
index 2ee8326..213d792 100644
--- a/src/types/IUnit.tsx
+++ b/src/types/IUnit.tsx
@@ -1,5 +1,6 @@
import {Irace} from "./Irace";
import {IArmorType} from "./IArmorType";
+import {IResearchShort} from "./IResearchShort";
export interface IUnitResponse {
race: string
@@ -53,6 +54,7 @@ export interface IUnit {
modId: number
sergeants: ISergeant[]
weapons: WeaponHardpoint[]
+ affectedResearches: IResearchShort[],
}
export interface ISergeant {
@@ -81,6 +83,7 @@ export interface ISergeant {
detectRadius: number
icon: string
weapons: WeaponHardpoint[]
+ affectedResearches: IResearchShort[],
}
@@ -118,6 +121,7 @@ export interface IWeapon {
icon: string
modId: number
weaponArmorPiercing: IWeaponPiercing[]
+ affectedResearches: IResearchShort[],
}
export interface IWeaponPiercing {