1
0
forked from 0ad/0ad
Commit Graph

24165 Commits

Author SHA1 Message Date
78f7962d69 Improve the encyclopedia introduction text 2024-09-24 23:16:21 +02:00
d1f88a0d89 Cleaning some messed up files 2024-09-24 23:16:21 +02:00
f1b945310a Removing the civilization introduction duplicates 2024-09-24 23:16:21 +02:00
9b027d7c52 Implement a basic encyclopedia page 2024-09-24 23:16:21 +02:00
c5eab43423 Disable cutoff distance option when cover whole map is ON
Gray out the "Cutoff distance" slider on the "Graphics (advanced)" tab
of the game settings screen when this distance is ignored because the
"Cover whole map" configuration option is ON.
2024-09-24 20:39:57 +02:00
288d5002f3 Add support for vendored spirv-reflect
This allows build-archives.sh to fall back to vendored spirv-reflect if
it can't be found in PATH.

Also update error messages to suggest additional alternatives.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
39f3fa7d5b Package spirv-reflect for building shaders
Usually not available in Linux Distributions as it isn't customary to
package the SDK but only the bits needed as separate packages.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
cf909a81db Add support for vendored spirv-reflect to compile.py
The script build-archive.sh sets a variable SPIRV_REFLECT, even respects
it if it's set in env but without support from the compile.py script for
it there isn't much point.

This commit adds support SPIRV_REFLECT in compile.py and and adds a
fallback to use vendored spirv-reflect for when the envvar is unset and
the tool can't be found in PATH

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
f0d99f8f54 Add output of build-archives to gitignore
build-archives.sh generates output in archives, add it as well as the
rules files for spirv shaders which might be fetched during build to
gitignore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
9770391bc4 Make failure messages visible for build-archives
Due to "set -e" the script terminates when the required tools aren't
found and the arguably helpful messages later on won't be printed.

Make the initial check for tools non fatal and allow for the later check
to take care of missing tools.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
eb328fc2df Allow building archives without translations
Currently you have to fetch translations first so they can be filtered
by build-archives.sh without the script failing.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
7e91f70e02 Add some more AI names
A total of 16 possible AI names are added to four civilizations.

Athenians: Callias, Chabrias, Conon, Ephialtes, Nicias, Phocion, and
Pisistratus

Britons: Cassivellaunus, Imanuentius, and Mandubracius

Iberians: Litennon

Spartans: Anaxandridas, Cleomenes, Eurybiades, Gylippus, and
Leotychidas

The lists are sorted alphabetically.
2024-09-24 17:30:56 +02:00
9c72741e69
Fix x86_64 cross-compilation on macOS 2024-09-22 16:16:40 +02:00
660dd63792
Delete existing SPIR-V shaders before regeneration
As compile.py only creates shaders for program combinations which don't
have already existing shaders on disk, this removes all SPIR-V shaders
prior to rebuilding them to ensure they actually do get recreated.
2024-09-22 10:49:46 +02:00
57308bb847
Avoid unnecessary computations
This refactors the script for cleaning the translations to get the
same result by doing less. This is achieved by the following changes:

- Use glob-patterns for finding the files to clean more efficiently,
  without the need to exclude collected files again.
- Only write files which are supposed to be modified (previously all
  portable object files did get rewritten by this script, no matter if
  it did change something or not).
- Stop searching for sections in files to clean up, once they are
  already passed.
2024-09-22 07:59:07 +02:00
c59030857d
Rebuild SPIR-V shaders when compile script changes 2024-09-22 06:28:58 +02:00
8d70ced693
Add myself as code owner for ruff.toml 2024-09-21 20:54:32 +02:00
0ea6d32fa5
Enable various ruff rules
This commit enables a bunch of unrelated ruff rules, which only require
minimal changes to the code base to enable them.

The rules enabled by this commit are:

- check the use of datetime objects without timezone (DTZ005)
- check the performance of try-except in loops (PERF203)
- check the number of function arguments (PLR0913)
- check for mutable class defaults (RUF012)
- check for the use of secure hashing algorithms (S324)
- check for raising base exceptions (TRY002)
- check for raising other exceptions where TypeErrors should be raised
  (TRY004)
2024-09-21 20:54:30 +02:00
c0232c6b5f
Specify the Python target version in ruff.toml
This ensures the same Python target version used for `ruff format`
is used for `ruff check` as well. It also allows ruff, even if it's not
run through pre-commit, to use the correct target Python version.
2024-09-21 20:54:24 +02:00
265ed76131
Simplify check for identical shaders
Previously when checking if two SPIR-V shaders are identical the
hashs of their file content would be compared and afterwards their
(unhashed) file contents as well. Comparing the file contents isn't
necessary, as the hash function used is a cryptographic one, which
guarantees the hash can be used as a representative of the hashed data.
2024-09-21 20:39:59 +02:00
668ae8a20e Increase height of middle panel to prevent icon overflow
The icon/portrait of the middle panel when a single entity was selected
was very subtly (4 px) overflowing its lane and invading that of the
entity's name. This change fixes that by:

 - Raising the top of the middle panel by 4 px to leave room for the
   portrait/icon. This avoids having to shrink it and lose quality.

 - Distributing the 4 px of difference in height in the statistics area
   by lowering 1 px the top bar, 1 px the middle bar (if any), and 3 px
   the bottom bar (if any). The rest of the elements are lowered 4 px,
   and therefore remain in the same place.

 - Increasing the height of the minimap panel by 4 px so that it remains
   aligned with the middle panel, vertically centering the minimap, and
   making the necessary adjustments to the position of its buttons.

Additionally, a couple of minor changes are applied:

 - The separators between the statistics area and the attack/resistance
   and resources area, and between the attack/resistance and resources
   area and the entity name area, which had different heights, are set
   to the same height/thickness.

 - The attack/resistance icon, which was very close to the entity
   icon/portrait, is moved 1 px to the right, and the
   resourceCarryingText (in the same area), which was very far from the
   resourceCarryingIcon, is also moved 3 px to the right.

Fixes #7029
2024-09-18 13:38:05 +02:00
b15eb6909e Remove unnecessary comments in selection_details.js
Related: #7012
2024-09-18 06:46:51 +02:00
798cff1f6f Left-click the portrait to follow the entity
- Left-clicking the portrait of a unit will make the camera follow that
   unit (before: no action). A tooltip informs the player of this
   possibility.

 - Left-clicking the portrait of a structure will make the camera focus on
   that structure (before: no action). A tooltip informs the player of
   this possibility.

 - Double-clicking a hero/treasure icon will make the camera follow that
   hero/treasure (before: just focus on that hero/treasure).

 - Some minor related changes.

Fixes #6879
2024-09-18 06:46:51 +02:00
230c7ca27d
Add EditorConfig options for Python
While the desired options for indent size and style are Python's
defaults, let's make it explicit by specifying it in the EditorConfig.

As part of this, this also removes unnecessary inline formatting options
for Python files.
2024-09-17 11:03:15 +02:00
e56ebb3f46
Enable ruff naming rules 2024-09-13 11:04:07 +02:00
cd8b4266a4
Fix class name in xmlvalidator 2024-09-13 11:04:06 +02:00
8c7cc7373d
Fix variable names in SPIRV compile.py 2024-09-13 11:04:06 +02:00
0d3e3fbc29
Rename simple-example.py 2024-09-13 11:04:05 +02:00
661328ab15
Fix variable naming for map compatibility file 2024-09-13 11:04:05 +02:00
616f2e134b
Fix variable names in checkrefs.py 2024-09-13 11:04:04 +02:00
ea4b580527
Simplify JSON parsing 2024-09-11 17:52:10 +02:00
0e84957979
Simplify XML parsing by iterating only once
This simplifies the XML parsing, by iterating over the DOM tree only
once. Curiously this doesn't result in significant performance gains.

As the keywords are now found in the order they appear in the
document instead of the order they are mentioned in messages.json, the
order of a few strings in the PO-templates changes caused by the changes
in this commit.
2024-09-11 17:52:10 +02:00
eeb502c115
Simplify code by making use of early returns 2024-09-11 17:52:10 +02:00
f4c40b740c
Remove unnecessary extractors package
This simplifies the code structure, by removing the extractors package,
which only contained a single module, the extractors module. This module
is now located in the i18n_helper package.
2024-09-11 17:52:09 +02:00
20ab96a0f4
Make some attribute names PEP 8 compatible 2024-09-11 17:52:09 +02:00
ac48b72550
Move imports to the top of the file 2024-09-11 17:52:09 +02:00
4d3be23bac
Remove broken and unused ini-file extractor
The ini-file extractor has been broken since the transition to Python 3
and nobody noticed, because it isn't used nowadays. Therefore, let's
remove it.
2024-09-11 17:52:09 +02:00
f856a7663f
Add a cache for mask patterns
This increases the performance of updating the PO-templates
significantly by adding a cache for the building of mask patterns. In
non-representative tests it increased the performance of updating the
PO-templates by >25%.
2024-09-11 17:52:09 +02:00
7575dfe3c8
Remove unnecessary use of codecs module 2024-09-11 17:52:08 +02:00
e86fd58524
Simplify and speed up finding of messages.json 2024-09-11 17:51:58 +02:00
04aa01a39b
Speed up fetching of translations from Transifex
This increases the number of workers to use when fetching translations
from Transifex from 5 (the default) to 12. While the Transifex CLI
allows up to 20 workers, using more workers results in frequent request
throttling, which hurts performance more than it improves it.
2024-09-10 07:34:48 +02:00
ccb1d747f0
Use PEP 8 naming conventions for templatesanalyzer 2024-09-10 07:29:33 +02:00
5bea0a0f97 Add the large address aware flag to the nightly build. 2024-09-09 11:46:31 +03:00
26994b156b Split source package downloads
Instead of fetching the whole svn repo containing all current
dependencies into source, fetch them individually into subdirectories of
source.

Adds a wrapper script to each package to place the build output where
it's currently expected.

This allows adding and removing dependencies as well as changing origin
of those packages on a case by case basis.

It's recommended to run "git clean -dxf libraries/source" to free up
extra space and remove untracked files no longer covered by changes in
.gitignore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 22:17:08 +02:00
2b5ecd02a7 build-source-libs.sh: drop Perl dependency
Instead of using Perl to get the absolute path due to readlink -f
implementations differing behaviour use realpath. Since the inclusion
into coreutils this should be a valid alternative.

Also check for [[:space:]] instead of only \s as if that one is an issue
the others are as well.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 17:51:16 +02:00
bf82871ca8 build-source-libs.sh: remove --source-libs-dir
During the migration it apparently looked possibly useful at some point,
in the end it remained unused.

Further the clean-source-libs.sh doesn't handle the case where
build-source-libs.sh was invoked with --source-libs-dir.

Finally, when switching to support individual package this becomes very
complex to support.

For all the above reason remove the option.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 17:51:16 +02:00
33134af6c3 Stop using the source-libs repository on Windows
All prebuilt files for Windows libraries are now stored in the
windows-libs SVN repository for the foreseeable future.
2024-09-08 17:51:15 +02:00
966d859050 Add yamllint to pre-commit
Adding a hook to pre-commit to enforce a consistent style and remove the
hook check-yaml which only checks if a document is parsable and so
become redundant.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 13:08:11 +02:00
87f667732c Format yaml files
The schema at https://json.schemastore.org/gitea-issue-forms.json
doesn't like empty titles, so just remove the key to the same effect as
a zero length string.

Add document start markers where they are missing.

Use a max line length of 100 as discussed with Dunedan.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 13:08:11 +02:00
10e7513bba
Revert changes in check_diff.py in batches
This is to avoid running into errors caused by the limited length of
command line input when reverting lots of files.
2024-09-08 11:39:08 +02:00