forked from mirrors/0ad
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a56ffcfd25 | |||
| 72e0ace313 | |||
| 7033b81ce6 | |||
| 30b741f8ba | |||
| 2da2c3394f | |||
| f578a5b34d | |||
| 8fee4dbb76 | |||
| baa18fd57d | |||
| 231750edf1 | |||
| 0d1cdc0eaa | |||
| 63d4513ebf | |||
| a1cb3055d9 | |||
| 7fd034a2c0 | |||
| 0f21853bd8 | |||
| b7fe462045 | |||
| bf0034f694 | |||
| b228b611de | |||
| 72b56d9fe5 | |||
| fb12d00c70 | |||
| 1690efeb72 | |||
| 5c8cf9a470 | |||
| d9ae2f8503 | |||
| b71cd96d12 | |||
| d93722a023 | |||
| 7d2647d59a | |||
| 1dff943455 | |||
| ce7a180e73 | |||
| ca1ad508a4 | |||
| 6d531e0303 | |||
| e6e5d61b22 | |||
| 7386a5d514 | |||
| 4140858066 | |||
| cc56bafc66 | |||
| 10408b46c2 | |||
| e2764dcee1 | |||
| 5c333770ee | |||
| 3cba40b5c8 | |||
| 2b85f5abf6 |
@@ -216,7 +216,7 @@ togglefullscreen = "Alt+Return" ; Toggle fullscreen/windowed mode
|
||||
screenshot.watermark = "Alt+K" ; Toggle product/company watermark for official screenshots
|
||||
wireframe = "Alt+Shift+W" ; Toggle wireframe mode
|
||||
silhouettes = "Alt+Shift+S" ; Toggle unit silhouettes
|
||||
mousegrabtoggle = "Ctrl+Alt" ; Toggle mouse grabbing mode
|
||||
mousegrabtoggle = F3 ; Toggle mouse grabbing mode
|
||||
|
||||
; > DIALOG HOTKEYS
|
||||
summary = "Ctrl+Tab" ; Toggle in-game summary
|
||||
@@ -252,7 +252,7 @@ reset = "R" ; Reset camera rotation to default
|
||||
follow = "" ; Follow the first unit in the selection
|
||||
rallypointfocus = "" ; Focus the camera on the rally point of the selected building
|
||||
lastattackfocus = "Space" ; Focus the camera on the last notified attack
|
||||
togglebirdseyeview = "" ; Toggle bird's eye view
|
||||
togglebirdseyeview = "Shift+Tab" ; Toggle bird's eye view
|
||||
zoom.in = Plus, NumPlus ; Zoom camera in (continuous control)
|
||||
zoom.out = Minus, NumMinus ; Zoom camera out (continuous control)
|
||||
zoom.wheel.in = WheelUp ; Zoom camera in (stepped control)
|
||||
@@ -392,7 +392,7 @@ flareactivate = "" ; Modifier to activate the mode to send a flare to
|
||||
calltoarms = "" ; Modifier to call the selected units to the arms.
|
||||
focusfire = "F" ; Modifier to control exclusively a building's arrows if it can attack
|
||||
; Overlays
|
||||
showstatusbars = Tab ; Toggle display of status bars
|
||||
showstatusbars = "" ; Toggle display of status bars
|
||||
devcommands.toggle = "Alt+D" ; Toggle developer commands panel
|
||||
highlightguarding = PageDown ; Toggle highlight of guarding units
|
||||
highlightguarded = PageUp ; Toggle highlight of guarded units
|
||||
|
||||
@@ -66,11 +66,20 @@ function parseCmdLineArgs(settings, cmdLineArgs)
|
||||
{
|
||||
// eslint-disable-next-line dot-notation
|
||||
const mapType = cmdLineArgs['autostart'].substring(0, cmdLineArgs['autostart'].indexOf('/'));
|
||||
settings.map.setType({
|
||||
"scenarios": "scenario",
|
||||
"random": "random",
|
||||
"skirmishes": "skirmish",
|
||||
}[mapType]);
|
||||
switch (mapType)
|
||||
{
|
||||
case "random":
|
||||
settings.map.setType("random");
|
||||
break;
|
||||
case "scenarios":
|
||||
settings.map.setType("scenario");
|
||||
break;
|
||||
case "skirmishes":
|
||||
settings.map.setType("skirmish");
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown map type ${mapType}`);
|
||||
}
|
||||
// eslint-disable-next-line dot-notation
|
||||
settings.map.selectMap("maps/" + cmdLineArgs['autostart']);
|
||||
|
||||
|
||||
+1
-3
@@ -8,7 +8,5 @@
|
||||
|
||||
<translatableAttribute id="caption">Saved game</translatableAttribute>
|
||||
|
||||
<translatableAttribute id="tooltip">
|
||||
The controller loaded a saved game.
|
||||
</translatableAttribute>
|
||||
<translatableAttribute id="tooltip">The controller loaded a saved game.</translatableAttribute>
|
||||
</object>
|
||||
|
||||
@@ -42,4 +42,6 @@ async function cancelButton()
|
||||
await new Promise(resolve => { Engine.GetGUIObjectByName("cancel").onPress = resolve; });
|
||||
if (Engine.HasXmppClient())
|
||||
Engine.StopXmppClient();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ function loginButton()
|
||||
Engine.OpenChildPage("page_prelobby_login.xml");
|
||||
}
|
||||
|
||||
function registerButton()
|
||||
async function registerButton()
|
||||
{
|
||||
Engine.OpenChildPage("page_prelobby_register.xml");
|
||||
if (await Engine.OpenChildPage("page_prelobby_register.xml"))
|
||||
Engine.OpenChildPage("page_prelobby_login.xml");
|
||||
}
|
||||
|
||||
@@ -40,6 +40,5 @@ async function onRegistered()
|
||||
setFeedback(translate("Registered"));
|
||||
|
||||
Engine.StopXmppClient();
|
||||
|
||||
Engine.OpenChildPage("page_prelobby_login.xml");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* Override style so we can get a bigger primary name.
|
||||
*/
|
||||
g_TooltipTextFormats.namePrimaryBig.font = "sans-bold-20";
|
||||
// Temporarily overwritten in order to hide a baseline issue in the font engine.
|
||||
g_TooltipTextFormats.namePrimaryBig.font = /* "sans-bold-20" */ "sans-bold-16";
|
||||
g_TooltipTextFormats.namePrimarySmall.font = "sans-bold-16";
|
||||
g_TooltipTextFormats.nameSecondary.font = "sans-bold-16";
|
||||
|
||||
|
||||
@@ -23,25 +23,19 @@
|
||||
<object>
|
||||
<object name="icon1" type="image" sprite="stretched:pregame/icons/experimental.png"/>
|
||||
<object name="text1" type="text" textcolor="white" font="sans-16">
|
||||
<translatableAttribute id="caption">
|
||||
This game is still in development. You may encounter bugs, and some features are not as fleshed out as we would like.
|
||||
</translatableAttribute>
|
||||
<translatableAttribute id="caption">This game is still in development. You may encounter bugs, and some features are not as fleshed out as we would like.</translatableAttribute>
|
||||
</object>
|
||||
</object>
|
||||
<object>
|
||||
<object name="icon2" type="image" sprite="stretched:pregame/icons/lag.png"/>
|
||||
<object name="text2" type="text" textcolor="white" font="sans-16">
|
||||
<translatableAttribute id="caption">
|
||||
The game can have performance problems, especially with large maps and a great number of units.
|
||||
</translatableAttribute>
|
||||
<translatableAttribute id="caption">The game can have performance problems, especially with large maps and a great number of units.</translatableAttribute>
|
||||
</object>
|
||||
</object>
|
||||
<object>
|
||||
<object name="icon3" type="image" sprite="stretched:pregame/icons/map.png"/>
|
||||
<object name="text3" type="text" textcolor="white" font="sans-16">
|
||||
<translatableAttribute id="caption">
|
||||
0 A.D. is Free Software: you can participate in its development. If you want to help with art, sound, gameplay or programming, make sure to join our official forum.
|
||||
</translatableAttribute>
|
||||
<translatableAttribute id="caption">0 A.D. is Free Software: you can participate in its development. If you want to help with art, sound, gameplay or programming, make sure to join our official forum.</translatableAttribute>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
@@ -265,8 +265,8 @@ function initGUICharts()
|
||||
function resizeDropdown(dropdown)
|
||||
{
|
||||
dropdown.size.bottom = dropdown.size.top +
|
||||
(Engine.GetTextWidth(dropdown.font, dropdown.list[dropdown.selected]) >
|
||||
dropdown.size.right - dropdown.size.left - 28 &&
|
||||
(dropdown.getPreferredHeaderTextSize().width >
|
||||
dropdown.size.right - dropdown.size.left - dropdown.button_width &&
|
||||
dropdown.list[dropdown.selected].indexOf(" ") !== -1 ? 42 : 28);
|
||||
}
|
||||
|
||||
|
||||
@@ -756,6 +756,32 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"extractor": "json",
|
||||
"filemasks": [
|
||||
"simulation/data/settings/player_placements.json"
|
||||
],
|
||||
"options": {
|
||||
"keywords": {
|
||||
"Name": {},
|
||||
"Description": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"extractor": "json",
|
||||
"filemasks": [
|
||||
"simulation/data/settings/population_capacities.json"
|
||||
],
|
||||
"options": {
|
||||
"keywords": {
|
||||
"Title": {},
|
||||
"Tooltip": {},
|
||||
"CapTitle": {},
|
||||
"CapTooltip": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"extractor": "json",
|
||||
"filemasks": [
|
||||
|
||||
@@ -136,7 +136,7 @@ export function* generateMap(mapSettings)
|
||||
const playerIDs = randBool() ? sortAllPlayers() : primeSortAllPlayers();
|
||||
|
||||
g_Map.log("Ensuring player territory");
|
||||
const playerRadius = scaleByMapSize(12, 20);
|
||||
const playerRadius = scaleByMapSize(15, 20);
|
||||
for (let i = 0; i < numPlayers; ++i)
|
||||
createArea(
|
||||
new ChainPlacer(1, 6, 40, 1, playerPosition[i], 0, [Math.floor(playerRadius)]),
|
||||
|
||||
@@ -20456,98 +20456,98 @@
|
||||
<Actor seed="23588"/>
|
||||
</Entity>
|
||||
<Entity uid="3473">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="332.12186" z="451.66132"/>
|
||||
<Orientation y="-2.40531"/>
|
||||
<Actor seed="43656"/>
|
||||
</Entity>
|
||||
<Entity uid="3474">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="330.28055" z="448.46393"/>
|
||||
<Orientation y="-2.4396"/>
|
||||
<Actor seed="22449"/>
|
||||
</Entity>
|
||||
<Entity uid="3475">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="327.54374" z="452.57486"/>
|
||||
<Orientation y="2.35621"/>
|
||||
<Actor seed="58505"/>
|
||||
</Entity>
|
||||
<Entity uid="3476">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="326.51185" z="448.19327"/>
|
||||
<Orientation y="-2.08526"/>
|
||||
<Actor seed="21275"/>
|
||||
</Entity>
|
||||
<Entity uid="3477">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="325.30298" z="451.8647"/>
|
||||
<Orientation y="-2.21181"/>
|
||||
<Actor seed="35836"/>
|
||||
</Entity>
|
||||
<Entity uid="3478">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="328.28318" z="446.60975"/>
|
||||
<Orientation y="-2.25087"/>
|
||||
<Actor seed="62149"/>
|
||||
</Entity>
|
||||
<Entity uid="3479">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="323.6949" z="443.73194"/>
|
||||
<Orientation y="-2.2695"/>
|
||||
<Actor seed="52899"/>
|
||||
</Entity>
|
||||
<Entity uid="3480">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="318.79917" z="444.40821"/>
|
||||
<Orientation y="-2.38955"/>
|
||||
<Actor seed="31384"/>
|
||||
</Entity>
|
||||
<Entity uid="3481">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="317.27378" z="439.22846"/>
|
||||
<Orientation y="-2.40764"/>
|
||||
<Actor seed="46504"/>
|
||||
</Entity>
|
||||
<Entity uid="3482">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="338.14426" z="456.2815"/>
|
||||
<Orientation y="-2.43624"/>
|
||||
<Actor seed="46566"/>
|
||||
</Entity>
|
||||
<Entity uid="3483">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="334.72394" z="458.05823"/>
|
||||
<Orientation y="-2.39664"/>
|
||||
<Actor seed="48744"/>
|
||||
</Entity>
|
||||
<Entity uid="3484">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="314.81849" z="440.92362"/>
|
||||
<Orientation y="-2.31492"/>
|
||||
<Actor seed="37975"/>
|
||||
</Entity>
|
||||
<Entity uid="3485">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="322.47095" z="438.82441"/>
|
||||
<Orientation y="-2.41076"/>
|
||||
<Actor seed="15798"/>
|
||||
</Entity>
|
||||
<Entity uid="3486">
|
||||
<Template>units/germ/infantry_clubman</Template>
|
||||
<Template>units/germ/champion_infantry_maceman</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="334.34528" z="448.38428"/>
|
||||
<Orientation y="-2.42885"/>
|
||||
@@ -21558,4 +21558,4 @@
|
||||
</Entity>
|
||||
</Entities>
|
||||
<Paths/>
|
||||
</Scenario>
|
||||
</Scenario>
|
||||
|
||||
@@ -9,9 +9,9 @@ export function aiWarn(output)
|
||||
/**
|
||||
* Useful for simulating consecutive AI matches.
|
||||
*/
|
||||
export function exit()
|
||||
export function exit(exitStatus)
|
||||
{
|
||||
Engine.Exit();
|
||||
Engine.Exit(exitStatus);
|
||||
}
|
||||
|
||||
export function VectorDistance(a, b)
|
||||
|
||||
@@ -31,6 +31,7 @@ PetraBot.prototype.CustomInit = function(gameState)
|
||||
if (this.isDeserialized)
|
||||
{
|
||||
// WARNING: the deserializations should not modify the metadatas infos inside their init functions
|
||||
this.canPlay = this.data.canPlay;
|
||||
this.turn = this.data.turn;
|
||||
this.playedTurn = this.data.playedTurn;
|
||||
this.elapsedTime = this.data.elapsedTime;
|
||||
@@ -151,6 +152,7 @@ PetraBot.prototype.Serialize = function()
|
||||
}
|
||||
|
||||
return {
|
||||
"canPlay": this.canPlay,
|
||||
"uniqueIDs": this.uniqueIDs,
|
||||
"turn": this.turn,
|
||||
"playedTurn": this.playedTurn,
|
||||
|
||||
@@ -449,7 +449,7 @@ Attack.prototype.GetSplashData = function(type)
|
||||
|
||||
Attack.prototype.GetRange = function(type)
|
||||
{
|
||||
if (!type)
|
||||
if (!type || !this.template[type])
|
||||
return this.GetFullAttackRange();
|
||||
|
||||
let max = +this.template[type].MaxRange;
|
||||
|
||||
@@ -17,13 +17,11 @@ PopulationCapManager.prototype.Init = function()
|
||||
*/
|
||||
PopulationCapManager.prototype.SetPopulationCapType = function(type)
|
||||
{
|
||||
if ([this.CAPTYPE_PLAYER_POPULATION, this.CAPTYPE_TEAM_POPULATION, this.CAPTYPE_WORLD_POPULATION].includes(type))
|
||||
this.popCapType = type;
|
||||
else
|
||||
{
|
||||
warn(`Attempted to set an unknown population capacity type: '${type}'. Continuing with type 'Player Population'...`);
|
||||
this.popCapType = this.CAPTYPE_PLAYER_POPULATION;
|
||||
}
|
||||
if (![this.CAPTYPE_PLAYER_POPULATION, this.CAPTYPE_TEAM_POPULATION, this.CAPTYPE_WORLD_POPULATION].includes(type))
|
||||
error("Invalid population cap type specified: " + type);
|
||||
|
||||
this.popCapType = type;
|
||||
|
||||
if (this.popCap)
|
||||
this.InitializePopCaps();
|
||||
};
|
||||
@@ -48,6 +46,13 @@ PopulationCapManager.prototype.SetPopulationCap = function(cap)
|
||||
this.InitializePopCaps();
|
||||
};
|
||||
|
||||
PopulationCapManager.prototype.SetPerPlayerPopulationCaps = function(playerCaps)
|
||||
{
|
||||
this.perPlayerPopCaps = playerCaps;
|
||||
this.popCapType = this.CAPTYPE_PLAYER_POPULATION;
|
||||
this.InitializePopCaps();
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the current pop cap.
|
||||
* @returns {number}
|
||||
@@ -86,10 +91,10 @@ PopulationCapManager.prototype.InitializePopCaps = function()
|
||||
*/
|
||||
PopulationCapManager.prototype.InitializePlayerPopCaps = function()
|
||||
{
|
||||
const players = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetActivePlayers();
|
||||
for (const player of players)
|
||||
QueryPlayerIDInterface(player, IID_Player)
|
||||
.SetMaxPopulation(this.popCap);
|
||||
const players = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNonGaiaPlayers();
|
||||
for (const i in players)
|
||||
QueryPlayerIDInterface(players[i], IID_Player)
|
||||
.SetMaxPopulation(this.perPlayerPopCaps ? this.perPlayerPopCaps[i] : this.popCap);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -11,5 +11,5 @@
|
||||
],
|
||||
"auraName": "Terror Cimbricus",
|
||||
"auraDescription": "Enemy Soldiers, Ships, Siege, and Structures -20 meters vision range.",
|
||||
"overlayIcon": "art/textures/ui/session/auras/speed_bonus.png"
|
||||
}
|
||||
"overlayIcon": "art/textures/ui/session/auras/fear.png"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
{ "tech": "phase_town" },
|
||||
{ "notciv": "brit" },
|
||||
{ "notciv": "gaul" },
|
||||
{ "notciv": "germ" },
|
||||
{ "notciv": "iber" },
|
||||
{ "notciv": "rome" },
|
||||
{ "notciv": "spart" }
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@
|
||||
"description": "Hire servants to help quarry stone. Increases stone gathering rates.",
|
||||
"requirements": {
|
||||
"all": [
|
||||
{ "tech": "phase_village" }
|
||||
{ "tech": "phase_village" },
|
||||
{ "civ": "cart" }
|
||||
]
|
||||
},
|
||||
"icon": "mining_stone_01.png",
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@
|
||||
"description": "Hire servants to help quarry stone. Increases stone gathering rates.",
|
||||
"requirements": {
|
||||
"all": [
|
||||
{ "tech": "phase_town" }
|
||||
{ "tech": "phase_town" },
|
||||
{ "civ": "cart"}
|
||||
]
|
||||
},
|
||||
"icon": "mining_stone_02.png",
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@
|
||||
"description": "Hire servants to help quarry stone. Increases stone gathering rates.",
|
||||
"requirements": {
|
||||
"all": [
|
||||
{ "tech": "phase_city" }
|
||||
{ "tech": "phase_city" },
|
||||
{ "civ": "cart"}
|
||||
]
|
||||
},
|
||||
"icon": "mining_stone_03.png",
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
{ "value": "Cost/Resources/metal", "replace": 0 },
|
||||
{ "value": "Loot/metal", "replace": 0 }
|
||||
],
|
||||
"affects": ["Healer"],
|
||||
"affects": ["Healer !Champion !Hero"],
|
||||
"soundComplete": "interface/alarm/alarm_upgradearmory.xml"
|
||||
}
|
||||
|
||||
@@ -64,9 +64,22 @@ function InitGame(settings)
|
||||
Engine.QueryInterface(cmpPlayer.entity, IID_TechnologyManager)?.ResearchTechnology(Engine.QueryInterface(cmpPlayer.entity, IID_Diplomacy).template.SharedLosTech);
|
||||
}
|
||||
|
||||
const cmpPopulationCapManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PopulationCapManager);
|
||||
cmpPopulationCapManager.SetPopulationCapType(settings.PopulationCapType);
|
||||
cmpPopulationCapManager.SetPopulationCap(settings.PopulationCap);
|
||||
{
|
||||
const popCap = settings.PopulationCap || 300;
|
||||
const cmpPopulationCapManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PopulationCapManager);
|
||||
const nonGaiaPlayers = settings.PlayerData.slice(1);
|
||||
if (nonGaiaPlayers.some(player => player.PopulationLimit))
|
||||
cmpPopulationCapManager.SetPerPlayerPopulationCaps(nonGaiaPlayers.map(player => player.PopulationLimit || popCap));
|
||||
else
|
||||
{
|
||||
if ([cmpPopulationCapManager.CAPTYPE_PLAYER_POPULATION, cmpPopulationCapManager.CAPTYPE_TEAM_POPULATION,
|
||||
cmpPopulationCapManager.CAPTYPE_WORLD_POPULATION].includes(settings.PopulationCapType))
|
||||
cmpPopulationCapManager.SetPopulationCapType(settings.PopulationCapType);
|
||||
else
|
||||
cmpPopulationCapManager.SetPopulationCapType(cmpPopulationCapManager.CAPTYPE_PLAYER_POPULATION);
|
||||
cmpPopulationCapManager.SetPopulationCap(popCap);
|
||||
}
|
||||
}
|
||||
|
||||
// Update the grid with all entities created for the map init.
|
||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_Pathfinder).UpdateGrid();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Attack disable=""/>
|
||||
<BuildingAI disable=""/>
|
||||
<BuildRestrictions>
|
||||
<Territory>own neutral enemy</Territory>
|
||||
<Territory>own neutral</Territory>
|
||||
<Category>Encampment</Category>
|
||||
<Distance>
|
||||
<FromClass>CivilCentre</FromClass>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<SpecificName>Hūsą</SpecificName>
|
||||
</Identity>
|
||||
<Obstruction>
|
||||
<Static width="18.0" depth="18.0"/>
|
||||
<Static width="16.0" depth="16.0"/>
|
||||
</Obstruction>
|
||||
<VisualActor>
|
||||
<Actor>structures/germans/house.xml</Actor>
|
||||
|
||||
+7
-4
@@ -25,7 +25,7 @@
|
||||
</Health>
|
||||
<Identity>
|
||||
<GenericName>Champion Healer</GenericName>
|
||||
<VisibleClasses datatype="tokens">Healer</VisibleClasses>
|
||||
<VisibleClasses datatype="tokens">Healer -Soldier</VisibleClasses>
|
||||
<Requirements>
|
||||
<Techs datatype="tokens">phase_city</Techs>
|
||||
</Requirements>
|
||||
@@ -45,10 +45,13 @@
|
||||
<Resistance>
|
||||
<Entity>
|
||||
<Damage>
|
||||
<Hack>3</Hack>
|
||||
<Pierce>3</Pierce>
|
||||
<Hack>2</Hack>
|
||||
<Pierce>4</Pierce>
|
||||
<Crush>20</Crush>
|
||||
</Damage>
|
||||
</Entity>
|
||||
</Resistance>
|
||||
</Entity>
|
||||
<Vision>
|
||||
<Range>60</Range>
|
||||
</Vision>
|
||||
</Entity>
|
||||
|
||||
+5
-1
@@ -2,11 +2,15 @@
|
||||
<Entity parent="merc_inf|template_unit_infantry_ranged_slinger">
|
||||
<Attack>
|
||||
<Ranged>
|
||||
<Damage>
|
||||
<Damage>
|
||||
<Pierce op="mul">1.15</Pierce>
|
||||
<Crush op="mul">1.15</Crush>
|
||||
</Damage>
|
||||
<MaxRange>50</MaxRange>
|
||||
<RepeatTime>1750</RepeatTime>
|
||||
<Projectile>
|
||||
<Spread op="mul">0.85</Spread>
|
||||
</Projectile>
|
||||
</Ranged>
|
||||
</Attack>
|
||||
<Builder>
|
||||
|
||||
+10
-1
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Entity parent="template_unit_infantry_melee_maceman">
|
||||
<Builder disable=""/>
|
||||
<Cost>
|
||||
<Resources>
|
||||
<food>50</food>
|
||||
@@ -11,7 +12,7 @@
|
||||
<Civ>germ</Civ>
|
||||
<GenericName>Cimbrian Clubman</GenericName>
|
||||
<SpecificName>Kulbawigô</SpecificName>
|
||||
<VisibleClasses datatype="tokens">Club</VisibleClasses>
|
||||
<VisibleClasses datatype="tokens">Champion</VisibleClasses>
|
||||
<Requirements>
|
||||
<Techs datatype="tokens">phase_village</Techs>
|
||||
</Requirements>
|
||||
@@ -27,6 +28,14 @@
|
||||
</Entity>
|
||||
</Resistance>
|
||||
<ResourceGatherer disable=""/>
|
||||
<Selectable>
|
||||
<Overlay>
|
||||
<Texture>
|
||||
<MainTexture>256x256/arrow.png</MainTexture>
|
||||
<MainTextureMask>256x256/arrow_mask.png</MainTextureMask>
|
||||
</Texture>
|
||||
</Overlay>
|
||||
</Selectable>
|
||||
<UnitMotion>
|
||||
<WalkSpeed op="mul">1.2</WalkSpeed>
|
||||
</UnitMotion>
|
||||
@@ -14,18 +14,6 @@
|
||||
<Civ>germ</Civ>
|
||||
<Icon>units/germ/support_wagon_covered.png</Icon>
|
||||
</Identity>
|
||||
<ProductionQueue/>
|
||||
<Researcher>
|
||||
<Technologies datatype="tokens">
|
||||
health_females_01
|
||||
unlock_females_house
|
||||
</Technologies>
|
||||
</Researcher>
|
||||
<Trainer>
|
||||
<Entities datatype="tokens">
|
||||
units/{civ}/support_female_citizen_house
|
||||
</Entities>
|
||||
</Trainer>
|
||||
<VisualActor>
|
||||
<Actor>structures/germans/wagon_house.xml</Actor>
|
||||
</VisualActor>
|
||||
|
||||
@@ -203,11 +203,10 @@ pipeline {
|
||||
}
|
||||
}
|
||||
steps {
|
||||
checkout changelog: false, poll: false, scm: [
|
||||
$class: 'SubversionSCM',
|
||||
locations: [[local: '.', remote: "https://svn.wildfiregames.com/nightly-build/trunk@${NIGHTLY_REVISION}"]],
|
||||
quietOperation: false,
|
||||
workspaceUpdater: [$class: 'UpdateWithCleanUpdater']]
|
||||
bat "svn co https://svn.wildfiregames.com/nightly-build/trunk@${NIGHTLY_REVISION} ."
|
||||
bat 'svn revert -R .'
|
||||
bat 'svn cleanup --remove-unversioned'
|
||||
|
||||
copyArtifacts projectName: '0ad-patch-release', selector: upstream()
|
||||
bat "svn patch ${params.BUNDLE_VERSION}.patch"
|
||||
|
||||
@@ -225,8 +224,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
cleanup {
|
||||
bat 'svn revert -R .'
|
||||
bat 'svn cleanup --remove-unversioned'
|
||||
bat 'svn cleanup'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,11 +253,10 @@ pipeline {
|
||||
HOSTTYPE = 'amd64'
|
||||
}
|
||||
steps {
|
||||
checkout changelog: false, poll: false, scm: [
|
||||
$class: 'SubversionSCM',
|
||||
locations: [[local: '.', remote: "https://svn.wildfiregames.com/nightly-build/trunk@${NIGHTLY_REVISION}"]],
|
||||
quietOperation: false,
|
||||
workspaceUpdater: [$class: 'UpdateWithCleanUpdater']]
|
||||
bat "svn co https://svn.wildfiregames.com/nightly-build/trunk@${NIGHTLY_REVISION} ."
|
||||
bat 'svn revert -R .'
|
||||
bat 'svn cleanup --remove-unversioned'
|
||||
|
||||
script {
|
||||
if (params.PATCH_BUILD) {
|
||||
copyArtifacts projectName: '0ad-patch-release', selector: upstream()
|
||||
@@ -281,8 +278,7 @@ pipeline {
|
||||
}
|
||||
post {
|
||||
cleanup {
|
||||
bat 'svn revert -R .'
|
||||
bat 'svn cleanup --remove-unversioned'
|
||||
bat 'svn cleanup'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// This pipeline is used to generate the nightly builds.
|
||||
|
||||
def visualStudioPath = '"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe"'
|
||||
def buildOptions = '/p:PlatformToolset=v143 /t:pyrogenesis /t:AtlasUI %JOBS% /nologo -clp:Warningsonly -clp:ErrorsOnly'
|
||||
def buildOptions = '/p:PlatformToolset=v143 /t:pyrogenesis /t:AtlasUI /t:ActorEditor %JOBS% /nologo -clp:Warningsonly -clp:ErrorsOnly'
|
||||
|
||||
def gitHash = ''
|
||||
def buildSPIRV = false
|
||||
|
||||
@@ -40,14 +40,15 @@
|
||||
<url type="translate">https://gitea.wildfiregames.com/0ad/0ad/wiki/Localization</url>
|
||||
<url type="donation">https://play0ad.com/community/donate/</url>
|
||||
<releases>
|
||||
<release version="0.28.0" date="2025-12-03">
|
||||
<url type="details">https://wildfiregames.com/forum/topic/137892-release-28-branch/</url>
|
||||
<release version="0.28.0" date="2026-02-05">
|
||||
<url type="details">https://play0ad.com/new-release-0-a-d-release-28-boiorix/</url>
|
||||
<description>
|
||||
<p>Wildfire Games proudly announces the release of 0 A.D. 0.28.0: "Boiorix".</p>
|
||||
<ul>
|
||||
<li>A new faction: the German tribes.</li>
|
||||
<li>Gendered Civilians replace Female Citizens.</li>
|
||||
<li>In some places JavaScript-Modules can be used to write mods.</li>
|
||||
<li>Font Rendering: CJK languages are bundled with the game, not as separate mods.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
@@ -9,7 +9,7 @@ cd "$(dirname "$0")"
|
||||
PV=128.13.0
|
||||
FOLDER="mozjs-${PV}"
|
||||
# If same-version changes are needed, increment this.
|
||||
LIB_VERSION="${PV}+wfg3"
|
||||
LIB_VERSION="${PV}+wfg4"
|
||||
LIB_NAME="mozjs128"
|
||||
|
||||
build_archive()
|
||||
@@ -69,7 +69,13 @@ fi
|
||||
|
||||
# unpack
|
||||
rm -Rf "${FOLDER}"
|
||||
"${TAR}" xfJ "${FOLDER}.tar.xz"
|
||||
"${TAR}" xfJ "${FOLDER}.tar.xz" \
|
||||
--exclude=js/src/tests/non262 \
|
||||
--exclude=js/src/tests/test262 \
|
||||
--exclude=js/src/jit-test \
|
||||
--exclude=python/mozperftest \
|
||||
--exclude=testing/web-platform \
|
||||
--exclude=third_party/rust/mp4parse/link-u-avif-sample-images
|
||||
|
||||
# patch
|
||||
(
|
||||
|
||||
@@ -56,7 +56,7 @@ void CFontMetrics::CalculateStringSize(const wchar_t* string, float& w, float& h
|
||||
m_Font->CalculateStringSize(string, w, h);
|
||||
}
|
||||
|
||||
float CFontMetrics::GetCapHeight()
|
||||
float CFontMetrics::GetCapHeight() const
|
||||
{
|
||||
if (!m_Font)
|
||||
return 0.0f;
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
CFontMetrics(CStrIntern font, CStrIntern locale);
|
||||
|
||||
float GetHeight() const;
|
||||
float GetCapHeight();
|
||||
float GetCapHeight() const;
|
||||
float GetCharacterWidth(wchar_t c) const;
|
||||
void CalculateStringSize(const wchar_t* string, float& w, float& h) const;
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ CTerrainTextureManager::~CTerrainTextureManager()
|
||||
|
||||
void CTerrainTextureManager::UnloadTerrainTextures()
|
||||
{
|
||||
m_TerrainGroups.clear();
|
||||
m_TextureEntries.clear();
|
||||
m_TerrainGroups.clear();
|
||||
|
||||
m_LastGroupIndex = 0;
|
||||
}
|
||||
|
||||
@@ -256,11 +256,15 @@ void CGUIManager::SGUIPage::LoadPage(ScriptContext& scriptContext)
|
||||
if (hotloadData)
|
||||
Script::ReadStructuredClone(rq, hotloadData, &hotloadDataVal);
|
||||
|
||||
sendingPromise = std::make_shared<JS::PersistentRootedObject>(rq.cx);
|
||||
// Assigning to `sendingPromise` isn't possible after `init` has been called because `init` might
|
||||
// replace this page. So a local copy has to be made.
|
||||
const std::shared_ptr<JS::PersistentRootedObject> localPromise{sendingPromise};
|
||||
|
||||
JS::RootedObject returnObject{rq.cx, gui->CallPageInit(rq, initData, hotloadDataVal,
|
||||
utf8_from_wstring(m_Name))};
|
||||
|
||||
sendingPromise = std::make_shared<JS::PersistentRootedObject>(rq.cx,
|
||||
returnObject ? returnObject : JS::NewPromiseObject(rq.cx, nullptr));
|
||||
*localPromise = returnObject ? returnObject : JS::NewPromiseObject(rq.cx, nullptr);
|
||||
}
|
||||
|
||||
JS::Value CGUIManager::SGUIPage::ReplacePromise(ScriptInterface& scriptInterface)
|
||||
|
||||
@@ -49,6 +49,7 @@ void CGUI::AddObjectTypes()
|
||||
m_ProxyData.insert(JSI_GUIProxy<IGUIObject>::CreateData(*m_ScriptInterface));
|
||||
m_ProxyData.insert(JSI_GUIProxy<CText>::CreateData(*m_ScriptInterface));
|
||||
m_ProxyData.insert(JSI_GUIProxy<CList>::CreateData(*m_ScriptInterface));
|
||||
m_ProxyData.insert(JSI_GUIProxy<CDropDown>::CreateData(*m_ScriptInterface));
|
||||
m_ProxyData.insert(JSI_GUIProxy<CMiniMap>::CreateData(*m_ScriptInterface));
|
||||
m_ProxyData.insert(JSI_GUIProxy<CButton>::CreateData(*m_ScriptInterface));
|
||||
m_ProxyData.insert(JSI_GUIProxy<CScrollPanel>::CreateData(*m_ScriptInterface));
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "maths/Rect.h"
|
||||
#include "maths/Size2D.h"
|
||||
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
CButton::CButton(CGUI& pGUI)
|
||||
@@ -76,7 +77,7 @@ CSize2D CButton::GetTextSize()
|
||||
|
||||
CSize2D CButton::GetPreferredTextSize()
|
||||
{
|
||||
return CGUIText{m_pGUI, m_Caption, m_Font, m_pGUI.GetWindowSize().Width, m_BufferZone, m_TextAlign, this}.GetSize();
|
||||
return CGUIText{m_pGUI, m_Caption, m_Font, std::numeric_limits<float>::max(), m_BufferZone, m_TextAlign, this}.GetSize();
|
||||
}
|
||||
|
||||
void CButton::HandleMessage(SGUIMessage& Message)
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
CDropDown::CDropDown(CGUI& pGUI)
|
||||
@@ -501,3 +502,11 @@ float CDropDown::GetBufferedZ() const
|
||||
else
|
||||
return bz;
|
||||
}
|
||||
|
||||
CSize2D CDropDown::GetPreferredHeaderTextSize() const
|
||||
{
|
||||
if (m_Selected == -1)
|
||||
return CSize2D{0.0f, 0.0f};
|
||||
|
||||
return CGUIText{m_pGUI, m_List->m_Items[m_Selected], m_Font, std::numeric_limits<float>::max(), m_BufferZone, m_TextAlign, this}.GetSize();
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ public:
|
||||
*/
|
||||
virtual void Draw(CCanvas2D& canvas);
|
||||
|
||||
virtual void CreateJSObject();
|
||||
|
||||
// This is one of the few classes we actually need to redefine this function
|
||||
// this is because the size of the control changes whether it is open
|
||||
// or closed.
|
||||
@@ -81,6 +83,11 @@ public:
|
||||
|
||||
virtual float GetBufferedZ() const;
|
||||
|
||||
/**
|
||||
* Calculate the preferred text size of the currently selected item displayed in the header.
|
||||
*/
|
||||
virtual CSize2D GetPreferredHeaderTextSize() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* If the size changed, the texts have to be updated as
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "gui/ObjectBases/IGUIObject.h"
|
||||
#include "gui/ObjectTypes/CButton.h"
|
||||
#include "gui/ObjectTypes/CDropDown.h"
|
||||
#include "gui/ObjectTypes/CList.h"
|
||||
#include "gui/ObjectTypes/CMiniMap.h"
|
||||
#include "gui/ObjectTypes/CScrollPanel.h"
|
||||
@@ -69,6 +70,13 @@ template<> void JSI_GUIProxy<CList>::CreateFunctions(const ScriptRequest& rq, GU
|
||||
}
|
||||
DECLARE_GUIPROXY(CList);
|
||||
|
||||
// CDropDown
|
||||
template<> void JSI_GUIProxy<CDropDown>::CreateFunctions(const ScriptRequest& rq, GUIProxyProps* cache)
|
||||
{
|
||||
CreateFunction<&CDropDown::GetPreferredHeaderTextSize>(rq, cache, "getPreferredHeaderTextSize");
|
||||
}
|
||||
DECLARE_GUIPROXY(CDropDown);
|
||||
|
||||
// CMiniMap
|
||||
template<> void JSI_GUIProxy<CMiniMap>::CreateFunctions(const ScriptRequest& rq, GUIProxyProps* cache)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -149,6 +149,9 @@ void CGUIString::GenerateTextCall(const CGUI& pGUI, SFeedback& Feedback, CStrInt
|
||||
TextCall.m_Size = size;
|
||||
SpriteCall.m_Area = size;
|
||||
|
||||
// Temporary workaround for a fundamental misalignment issue.
|
||||
SpriteCall.m_Area += CSize2D{0.f, -3.f};
|
||||
|
||||
// Handle additional attributes
|
||||
for (const TextChunk::Tag::TagAttribute& tagAttrib : tag.m_TagAttributes)
|
||||
{
|
||||
|
||||
@@ -394,11 +394,21 @@ void XmppClient::SendIqGameReport(const ScriptRequest& rq, JS::HandleValue data)
|
||||
// Iterate through all the properties reported and add them to the stanza.
|
||||
std::vector<std::string> properties;
|
||||
Script::EnumeratePropertyNames(rq, data, true, properties);
|
||||
|
||||
// https://gitea.wildfiregames.com/0ad/0ad/issues/8687
|
||||
const std::map<std::string, std::string> mappings{
|
||||
{ "civilianUnitsLost", "femaleCitizenUnitsLost" },
|
||||
{ "civilianUnitsTrained", "femaleCitizenUnitsTrained" },
|
||||
{ "enemyCivilianUnitsKilled", "enemyFemaleCitizenUnitsKilled"}
|
||||
};
|
||||
for (const std::string& p : properties)
|
||||
{
|
||||
std::wstring value;
|
||||
Script::GetProperty(rq, data, p.c_str(), value);
|
||||
report->addAttribute(p, utf8_from_wstring(value));
|
||||
if (mappings.contains(p))
|
||||
report->addAttribute(mappings.at(p), utf8_from_wstring(value));
|
||||
else
|
||||
report->addAttribute(p, utf8_from_wstring(value));
|
||||
}
|
||||
|
||||
// Add stanza to IQ
|
||||
|
||||
+8
-7
@@ -166,6 +166,7 @@ enum ShutdownType
|
||||
};
|
||||
|
||||
static ShutdownType g_Shutdown = ShutdownType::None;
|
||||
static int g_ExitStatus{EXIT_SUCCESS};
|
||||
|
||||
// to avoid redundant and/or recursive resizing, we save the new
|
||||
// size after VIDEORESIZE messages and only update the video mode
|
||||
@@ -182,9 +183,10 @@ bool IsQuitRequested()
|
||||
return g_Shutdown == ShutdownType::Quit;
|
||||
}
|
||||
|
||||
void QuitEngine()
|
||||
void QuitEngine(int exitStatus)
|
||||
{
|
||||
g_Shutdown = ShutdownType::Quit;
|
||||
g_ExitStatus = exitStatus;
|
||||
}
|
||||
|
||||
void RestartEngine()
|
||||
@@ -210,7 +212,7 @@ static InReaction MainInputHandler(const SDL_Event_* ev)
|
||||
break;
|
||||
|
||||
case SDL_QUIT:
|
||||
QuitEngine();
|
||||
QuitEngine(EXIT_SUCCESS);
|
||||
break;
|
||||
|
||||
case SDL_DROPFILE:
|
||||
@@ -236,7 +238,7 @@ static InReaction MainInputHandler(const SDL_Event_* ev)
|
||||
std::string hotkey = static_cast<const char*>(ev->ev.user.data1);
|
||||
if (hotkey == "exit")
|
||||
{
|
||||
QuitEngine();
|
||||
QuitEngine(EXIT_SUCCESS);
|
||||
return IN_HANDLED;
|
||||
}
|
||||
else if (hotkey == "screenshot")
|
||||
@@ -506,7 +508,7 @@ static void NonVisualFrame()
|
||||
g_Profiler.Frame();
|
||||
|
||||
if (g_Game->IsGameFinished())
|
||||
QuitEngine();
|
||||
QuitEngine(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
static void MainControllerInit()
|
||||
@@ -826,7 +828,6 @@ int main(int argc, char* argv[])
|
||||
|
||||
EarlyInit(); // must come at beginning of main
|
||||
|
||||
int returnValue{EXIT_SUCCESS};
|
||||
try
|
||||
{
|
||||
// static_cast is ok, argc is never negative.
|
||||
@@ -834,7 +835,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
catch (const RL::SetupError&)
|
||||
{
|
||||
returnValue = EXIT_FAILURE;
|
||||
g_ExitStatus = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Shut down profiler initialised by EarlyInit
|
||||
@@ -848,5 +849,5 @@ int main(int argc, char* argv[])
|
||||
wutil_Shutdown();
|
||||
#endif
|
||||
|
||||
return returnValue;
|
||||
return g_ExitStatus;
|
||||
}
|
||||
|
||||
+12
-11
@@ -118,13 +118,14 @@ void CConsole::Init()
|
||||
|
||||
UpdateScreenSize(g_xres, g_yres);
|
||||
|
||||
// Calculate and store the line spacing
|
||||
// Calculate and store the line spacing.
|
||||
const CFontMetrics font{CStrIntern(m_consoleFont)};
|
||||
m_FontHeight = font.GetHeight();
|
||||
m_FontWidth = font.GetCharacterWidth(L'C');
|
||||
m_CharsPerPage = static_cast<size_t>(g_xres / m_FontWidth);
|
||||
// Offset by an arbitrary amount, to make it fit more nicely
|
||||
m_FontOffset = 7.0f;
|
||||
// Fonts constains two dimensions: the full height, and the cap height.
|
||||
// We are adding some offset to move the text up a bit, so it looks better in the console.
|
||||
m_FontOffset = font.GetCapHeight() / 2.f;
|
||||
|
||||
m_CursorBlinkRate = g_ConfigDB.Get("gui.cursorblinkrate", 0.5);
|
||||
}
|
||||
@@ -249,18 +250,18 @@ void CConsole::DrawWindow(CCanvas2D& canvas)
|
||||
for (CVector2D& point : points)
|
||||
point += CVector2D{m_X, m_Y - (1.0f - m_VisibleFrac) * m_Height};
|
||||
|
||||
canvas.DrawRect(CRect(points[1], points[3]), CColor(0.0f, 0.0f, 0.5f, 0.6f));
|
||||
canvas.DrawLine(points, 1.0f, CColor(0.5f, 0.5f, 0.0f, 0.6f));
|
||||
canvas.DrawRect(CRect(points[1], points[3]), CColor(0.05f, 0.05f, 0.2f, 0.85f));
|
||||
canvas.DrawLine(points, 1.0f, CColor(0.5f, 0.5f, 0.0f, 0.85f));
|
||||
|
||||
if (m_Height > m_FontHeight + 4)
|
||||
if (m_Height > m_FontHeight + 2.0f * m_FontOffset)
|
||||
{
|
||||
points = {
|
||||
CVector2D{0.0f, m_Height - m_FontHeight - 4.0f},
|
||||
CVector2D{m_Width, m_Height - m_FontHeight - 4.0f}
|
||||
CVector2D{0.0f, m_Height - m_FontHeight - 2.0f * m_FontOffset},
|
||||
CVector2D{m_Width, m_Height - m_FontHeight - 2.0f * m_FontOffset}
|
||||
};
|
||||
for (CVector2D& point : points)
|
||||
point += CVector2D{m_X, m_Y - (1.0f - m_VisibleFrac) * m_Height};
|
||||
canvas.DrawLine(points, 1.0f, CColor(0.5f, 0.5f, 0.0f, 0.6f));
|
||||
canvas.DrawLine(points, 1.0f, CColor(0.5f, 0.5f, 0.0f, 0.85f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +284,7 @@ void CConsole::DrawHistory(CTextRenderer& textRenderer)
|
||||
{
|
||||
textRenderer.Put(
|
||||
9.0f,
|
||||
m_Height - m_FontOffset - m_FontHeight * (i - m_MsgHistPos + 1),
|
||||
m_Height - 3.0f * m_FontOffset - m_FontHeight * (i - m_MsgHistPos + 1),
|
||||
it->c_str());
|
||||
}
|
||||
|
||||
@@ -299,7 +300,7 @@ void CConsole::DrawBuffer(CTextRenderer& textRenderer)
|
||||
|
||||
const CVector2D savedTranslate = textRenderer.GetTranslate();
|
||||
|
||||
textRenderer.Translate(2.0f, m_Height - m_FontOffset + 1.0f);
|
||||
textRenderer.Translate(2.0f, m_Height - m_FontOffset);
|
||||
|
||||
textRenderer.SetCurrentColor(CColor(1.0f, 1.0f, 0.0f, 1.0f));
|
||||
textRenderer.PutAdvance(L"]");
|
||||
|
||||
@@ -855,7 +855,8 @@ bool Autostart(const CmdLineArgs& args)
|
||||
while (!shouldQuit)
|
||||
{
|
||||
g_NetClient->Poll();
|
||||
ScriptFunction::Call(rq, global, "onTick", shouldQuit);
|
||||
if (!ScriptFunction::Call(rq, global, "onTick", shouldQuit))
|
||||
return false;
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(200));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,15 +240,17 @@ void CProfileViewer::RenderProfile(CCanvas2D& canvas)
|
||||
float rowColX = 0.0f;
|
||||
for (size_t col = 0; col < columns.size(); ++col)
|
||||
{
|
||||
CStrW text = table->GetCellText(row, col).FromUTF8();
|
||||
float w, h;
|
||||
font.CalculateStringSize(text.c_str(), w, h);
|
||||
|
||||
float x = rowColX;
|
||||
if (col > 0) // right-align all but the first column
|
||||
x += columns[col].width - w;
|
||||
textRenderer.Put(x, 0.0f, text.c_str());
|
||||
const CStrW text{table->GetCellText(row, col).FromUTF8()};
|
||||
if (!text.empty())
|
||||
{
|
||||
float w, h;
|
||||
font.CalculateStringSize(text.c_str(), w, h);
|
||||
|
||||
float x = rowColX;
|
||||
if (col > 0) // right-align all but the first column
|
||||
x += columns[col].width - w;
|
||||
textRenderer.Put(x, 0.0f, text.c_str());
|
||||
}
|
||||
rowColX += columns[col].width;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -47,6 +47,8 @@
|
||||
|
||||
class ScriptInterface;
|
||||
|
||||
extern void QuitEngine(int exitStatus);
|
||||
|
||||
namespace JSI_Main
|
||||
{
|
||||
bool AtlasIsAvailable()
|
||||
@@ -98,9 +100,8 @@ int GetFps()
|
||||
return g_frequencyFilter->StableFrequency();
|
||||
}
|
||||
|
||||
CSize2D GetTextSize(const std::string& fontName, const std::wstring& text)
|
||||
CSize2D CalculateTextSize(const std::string& fontName, const std::wstring& text)
|
||||
{
|
||||
ONCE(LOGWARNING("Engine.GetTextSize is deprecated and will be removed in a future version.Use guiObject.GetPreferedTextSize for accurate text sizing or guiObject.getTextSize for sizing within GUI objects."));
|
||||
float width = 0;
|
||||
float height = 0;
|
||||
CStrIntern _fontName(fontName);
|
||||
@@ -109,9 +110,17 @@ CSize2D GetTextSize(const std::string& fontName, const std::wstring& text)
|
||||
return CSize2D(width, height);
|
||||
}
|
||||
|
||||
|
||||
CSize2D GetTextSize(const std::string& fontName, const std::wstring& text)
|
||||
{
|
||||
ONCE(LOGWARNING("Engine.GetTextSize is deprecated and will be removed in a future version. Instead use guiObject.getPreferredTextSize and dropdown.getPreferredHeaderTextSize for more convenient text sizing or guiObject.getTextSize for sizing within an object."));
|
||||
return CalculateTextSize(fontName, text);
|
||||
}
|
||||
|
||||
int GetTextWidth(const std::string& fontName, const std::wstring& text)
|
||||
{
|
||||
return GetTextSize(fontName, text).Width;
|
||||
ONCE(LOGWARNING("Engine.GetTextWidth is deprecated and will be removed in a future version. Instead use guiObject.getPreferredTextSize and dropdown.getPreferredHeaderTextSize for more convenient text sizing or guiObject.getTextSize for sizing within an object."));
|
||||
return CalculateTextSize(fontName, text).Width;
|
||||
}
|
||||
|
||||
std::string CalculateMD5(const std::string& input)
|
||||
@@ -127,6 +136,7 @@ std::string CalculateMD5(const std::string& input)
|
||||
|
||||
void RegisterScriptFunctions(const ScriptRequest& rq)
|
||||
{
|
||||
ScriptFunction::Register<&QuitEngine>(rq, "Exit");
|
||||
ScriptFunction::Register<&AtlasIsAvailable>(rq, "AtlasIsAvailable");
|
||||
ScriptFunction::Register<&IsAtlasRunning>(rq, "IsAtlasRunning");
|
||||
ScriptFunction::Register<&OpenURL>(rq, "OpenURL");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -25,7 +25,7 @@ bool IsQuitRequested()
|
||||
return false;
|
||||
}
|
||||
|
||||
void QuitEngine()
|
||||
void QuitEngine(int)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,6 @@ void CRenderingOptions::ReadConfigAndSetupHooks()
|
||||
m_ConfigHooks->Setup("silhouettes", m_Silhouettes);
|
||||
|
||||
m_ConfigHooks->Setup("gpuskinning", [this]() {
|
||||
;
|
||||
const Renderer::Backend::IDevice::Capabilities& capabilities{
|
||||
g_VideoMode.GetBackendDevice()->GetCapabilities()};
|
||||
if (!g_ConfigDB.Get("gpuskinning", false))
|
||||
@@ -252,7 +251,10 @@ void CRenderingOptions::ReadConfigAndSetupHooks()
|
||||
if (capabilities.computeShaders && capabilities.storage)
|
||||
m_GPUSkinning = true;
|
||||
else
|
||||
{
|
||||
m_GPUSkinning = false;
|
||||
LOGMESSAGE("GPU skinning isn't supported on the current hardware.");
|
||||
}
|
||||
|
||||
if (CRenderer::IsInitialised())
|
||||
g_Renderer.MakeShadersDirty();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -87,7 +87,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
extern void QuitEngine();
|
||||
extern void QuitEngine(int exitStatus);
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
||||
Vendored
+1
-1
@@ -229,7 +229,7 @@ Function .onInit
|
||||
;Run the uninstaller
|
||||
uninst:
|
||||
ClearErrors
|
||||
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
|
||||
ExecWait '$R0'
|
||||
|
||||
done:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user