1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-27 22:47:48 +02:00

56 Commits

Author SHA1 Message Date
Ivan Savenko
283adc37d7 Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods
- CStackInstance::experience renamed to totalExperience and now stores
total stack experience (multiplied by stack size) to reduce rounding
errors
- CStackInstance::totalExperience is now private with accessors methods
- stack experience is now automatically reallocated on stack management
- Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates
BulkRebalanceStacks
- Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop
unclear "smart" in name
- Reworked split-and-rebalance logic to correctly reallocate stack
experience
2025-05-01 18:18:30 +03:00
Ivan Savenko
f70ad2c15b Reorganized artifact-related classes
- files now generally contain only 1 class (except for tightly coupled
classes)
- files are now located in lib/entities/artifact directory
- removed excessive includes

No changes to functionality
2025-04-29 13:29:08 +03:00
Ivan Savenko
be554f4260
Merge pull request #5641 from kdmcser/chinese_encoding
fix Chinese encoding problem in GBK
2025-04-27 13:37:26 +03:00
kdmcser
84202ee64f fix compile error 2025-04-20 00:34:18 +08:00
kdmcser
c3c8b5048a extract functions of string <-> boost::filesystem::path to TextOperations.h 2025-04-20 00:23:41 +08:00
Ivan Savenko
204b13fc07
Merge pull request #5608 from Laserlicht/campaigneditor
campaign editor
2025-04-15 17:55:13 +03:00
Laserlicht
100f3606db code review 2025-04-12 13:39:08 +02:00
Ivan Savenko
dcb7a9e9f3 Fixes to locale/unicode handling
- Fixes crash on opening spellbook (recent regression)
- Fix crash if `haystack` string is shorter than `needle`
- Levenstein distance computation is now case-insensitive
- Text similarity computation now assumes utf-8 strings, not ascii
- Fix corruption of utf-8 string on life drain
2025-04-11 16:27:26 +03:00
Laserlicht
562b3f777d code review (second batch) 2025-04-10 21:41:22 +02:00
Laserlicht
28169b051e campaign editor 2025-04-05 22:30:31 +02:00
Michał Zaremba
f0ee3b8257 Fix setting up locale for Android and such 2025-04-02 05:14:51 +02:00
heroesiiifan
032d4bf112
Merge pull request #5574 from heroesiiifan/bela
add belarussian
2025-03-26 16:46:46 +02:00
Ivan Savenko
7a3e1409d0 Remove old boost includes and defines 2025-03-19 08:03:56 +00:00
Ivan Savenko
ca8dcf30ed Fix build 2025-03-18 11:56:22 +00:00
Ivan Savenko
eb3b51a6cf Remove save compatibility with 1.5.X 2025-03-18 11:35:15 +00:00
Ivan Savenko
860f65ea62
Merge branch 'develop' into fix_map_sorting 2025-03-16 19:19:27 +02:00
MichalZr6
749149a679 Fixes following reviews
Use std::optional and improve textSearchSimilarityScore()
2025-03-12 21:40:07 +01:00
MichalZr6
3f4616eb0f SonarCloud fixes 2025-03-12 17:44:13 +01:00
MichalZr6
9fbb2d7370 Fix: use LIBRARY instead of VLC 2025-03-11 23:45:59 +01:00
MichalZr6
5363424451 Small fixes to search mapobject feature:
- Trim overly long names to prevent incorrect item display
- Use getLocaleName() for proper locale-aware to_lower conversion
- Implement scoring-based sorting for better search match ranking
- Remove Boost dependency: replace with std::string::find() and rfind()
2025-03-11 23:22:04 +01:00
MichalZr6
e993c2aed0 Use locale based on language set in config 2025-03-11 23:21:12 +01:00
heroesiiifan
daacb73866
romanian plural 2025-03-09 20:38:30 +01:00
heroesiiifan
0424c8ad9c
fix 2025-03-08 20:15:10 +01:00
heroesiiifan
c49039a3f7
add romanian and bulgarian 2025-03-08 20:10:33 +01:00
Ivan Savenko
a8a6be7ac1 Fix potential compatibility with C++20 / C++23 mode
This fixes several issues with compatibility with C++20. C++23 was also
tested, but apparently it does not have any additional breaking changes
compared to C++20 (or we don't have those).

VCMI still uses C++17 as before - goal is only to make potential
transition easier.

There were 2 cases that are deprecated in C++20 that we use:
- Floating point operations on enums are deprecated
- `this` can no longer be captured when using default capture by value
`[=]`

Both of those should now be replaced with code that works fine in both C+
+17 and in C++20 mode
2025-03-02 14:11:48 +00:00
Ivan Savenko
b0de99fe89
Merge pull request #5478 from heroesiiifan/translation
develop - add greek, japanese, norwegian; harmonize
2025-03-01 23:14:28 +02:00
heroesiiifan
d6467f26d7
make new languages selectable only with config file 2025-02-26 17:14:06 +01:00
heroesiiifan
68b3421d5d
add greek, japanese, norwegian; harmonize 2025-02-25 22:54:19 +01:00
Ivan Savenko
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
Laserlicht
07b494632b optimize textSearchSimilar 2025-02-08 13:22:11 +01:00
Ivan Savenko
a95ab5a7ce Add better debugging for text conversion failure 2025-02-01 18:10:42 +00:00
Laserlicht
0035b2346a optimized search input 2025-01-23 23:50:04 +01:00
Ivan Savenko
101fd694b9 Remove MetaString method that can't be used with modded objects 2024-12-24 15:04:01 +00:00
Laserlicht
a8709731c4 unify time (without seconds) 2024-12-02 20:37:51 +01:00
Laserlicht
81328e2588 fixme & seconds in time (more usual) 2024-12-01 19:00:24 +01:00
MichalZr6
ab1f1d6d99 Fix crash on miniHillFort popup window 2024-11-19 10:53:16 +01:00
Joakim Thorén
db93f776c6 Fix MinGW date formatting error, see https://sourceforge.net/p/mingw-w64/bugs/793/. Workaround is to replace %F with %Y-%m-%d and %T with %H:%M:%S, should produce the same output as before per https://en.cppreference.com/w/cpp/io/manip/put_time 2024-11-17 00:02:13 +01:00
Ivan Savenko
e7bea6c3b8
Merge pull request #4852 from IvanSavenko/remove_vlc_entities_serialization
Remove remaining pointers to VLC entities from serializer
2024-11-06 22:01:11 +02:00
Ivan Savenko
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
Ivan Savenko
22f517686d Better handling of encoding detection for maps and campaigns
Now VCMI will use either preferred language or install language to load
maps and campaigns that are part of "core" mod, or, in other words -
placed in Maps directory of H3 data (like most of manually downloaded
maps and campaigns are)

If game data is in English, then game can safely use encoding of player-
selected language (such as Chinese) to load maps. After all, both GBK
and all Win-125X encoding are superset of ASCII, so English map will
always load up correctly.

Maps that are part of a mod still use mod language as before - it is up
to mod maker to correctly set up mod language.
2024-10-30 11:54:35 +00:00
Ivan Savenko
72b0062ae3 Better integration of wog commanders translation 2024-10-26 14:21:05 +00:00
Ivan Savenko
d1164ab9a9 Integrated exchange window translation into vcmi 2024-10-26 13:09:09 +00:00
Ivan Savenko
565c02d61c Added 'translate missing' command for convenience 2024-10-26 12:54:35 +00:00
Ivan Savenko
c43844706e Implemented translation support for random map descriptions 2024-10-25 20:41:19 +00:00
Laserlicht
6e65eaafbc workaround for assert 2024-10-14 21:01:01 +02:00
Ivan Savenko
604e3b5c67
Merge pull request #4763 from IvanSavenko/herohandler_split
Split CHeroHandler.cpp/.h into 1 file per class
2024-10-14 19:05:48 +03:00
Ivan Savenko
10ad0fc760 Split CHeroHandler.cpp/.h into 1 file per class
All parts of CHeroHandler.cpp are now in lib/entities/hero
Adjusted includes to use new paths
No functionality changes
2024-10-13 14:01:09 +00:00
Ivan Savenko
a8e84c55f6 Fix some of the new warnings from sonarcloud 2024-10-11 10:45:29 +00:00
Ivan Savenko
8e4152bc81 It is now possible to define objects directly in mod.json instead of
using path to file with object definition
2024-10-06 19:42:15 +00:00
Ivan Savenko
1488629628 Add simple support for translation of strings that were changed by
another mod
2024-10-06 19:42:15 +00:00