1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-26 08:41:13 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
nordsoft
d7b0770b71 Remove excessive code 2022-12-17 20:50:33 +04:00
nordsoft
9b76a8000f Making team alignments widget customizable 2022-12-17 20:38:16 +04:00
nordsoft
b590e4a0e4 Fixes for multiplyer 2022-12-17 08:38:33 +04:00
nordsoft
b1f2c7aed4 Team alignments implemented 2022-12-17 08:19:16 +04:00
nordsoft
4f5fab702e Support roads selection in random map tab 2022-12-17 04:54:37 +04:00
nordsoft
42281f51e8 Revert "Remove uncompleted code"
This reverts commit 0c41787ca5.
2022-12-17 03:53:26 +04:00
nordsoft
8f089b3302 Rename folder 2022-12-16 02:19:23 +04:00
nordsoft
0c41787ca5 Remove uncompleted code 2022-12-16 02:17:10 +04:00
nordsoft
d3c3feb037 Configurable template selection 2022-12-16 02:15:53 +04:00
nordsoft
1d4209d97e Continue refactoring 2022-12-16 00:57:10 +04:00
nordsoft
2371e3e9a2 Interface builder refactored 2022-12-16 00:46:36 +04:00
nordsoft
2fe951f819 Merge remote-tracking branch 'upstream/develop' into interface-builder
# Conflicts:
#	client/lobby/RandomMapTab.cpp
2022-12-15 04:47:11 +04:00
nordsoft
4c3288dd61 Fix teams 2022-12-14 05:45:50 +04:00
nordsoft
fc7f1dbc5a Fix template selection 2022-12-14 05:23:21 +04:00
nordsoft
53b2f68560 Serialize template 2022-12-14 04:37:11 +04:00
nordsoft
1e2abae62b Template selections works 2022-12-13 04:38:18 +04:00
nordsoft
f90cb1be90 Template list prototype looks fine 2022-12-13 03:47:29 +04:00
nordsoft
cd58e8a860 Rename InterfaceBuilder 2022-12-12 11:48:39 +04:00
nordsoft
5e3504f578 Add improvements 2022-12-12 11:38:27 +04:00
nordsoft
8dbc5c1c1f Make each windows coniguration in separate file 2022-12-12 04:52:44 +04:00
nordsoft
b3d60ec418 Add new map sizes 2022-12-12 04:46:42 +04:00
nordsoft
3be9969154 Prevent crashes for custom config 2022-12-12 03:58:39 +04:00
nordsoft
0104c77d61 Interface builder for random map tab 2022-12-12 03:27:59 +04:00
Ivan Savenko
a512e0d58f Fixed ugly solid-white status bars in pregame, removed operator* from
CPicture
2022-11-29 17:07:21 +02:00
Ivan Savenko
a0157d6117 replaced C array with std::array 2022-11-28 21:20:46 +02:00
Ivan Savenko
3e58d1e3c5 Merge remote-tracking branch 'refs/remotes/vcmi/develop' into battleint_refactor 2022-11-28 16:10:13 +02:00
Ivan Savenko
0cae259f53 Most of rendering in BattleInt is done via canvas
- refactoring of CBattleStacksController.cpp
- moved EAlignment enum to Geometries.h from CIntObject
- renamed EAlignment to ETextAlignment, to avoid conflict with good/evil
alignemt
- ETextAlignment is now enum class
2022-11-26 23:12:20 +02:00
nordsoft
41e652dad2 Move buttons blocks at proper place 2022-11-25 14:36:17 +04:00
nordsoft
ebb65b5d0e Prevent multiple clicks 2022-11-25 14:26:59 +04:00
Ivan Savenko
abb553d975 Next step of code refactoring:
- refactoring of CBattleFieldController code (except for 2 arcane
methods)
- introduced class CCanvas for encapsulated rendering surface
- battleint rendering is now partially done with CCanvas
- removed unused includes of CBitmapHandler
2022-11-25 11:46:47 +02:00
Ivan Savenko
6b3beb05e5 BattleInt split is finished, start of refactoring:
- Refactoring of siege controller code
- Replaced some usages of C struct SDL_Surface with proper c++ class
IImage
- Refactoring of rendering of battlefield objects (WIP)
2022-11-25 00:26:14 +02:00
nordsoft
625c18a889 Fix #3234 2022-11-18 04:05:35 +04:00
Andrey Filipenkov
f0b909f772 code improvement 2022-09-27 11:56:12 +03:00
Andrey Filipenkov
9f46bf5bff Apply suggestions from code review
Co-authored-by: Nordsoft91 <nordsoft@yahoo.com>
2022-09-24 15:55:26 +03:00
Andrey Filipenkov
f56acf8a80 fix crash on exiting Custom Campaign
fix kambala-decapitator/vcmi#46
2022-09-24 15:55:25 +03:00
Andrey Filipenkov
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
Andrey Filipenkov
bca46d9560 fix focusing input on Save screen 2022-09-24 15:55:19 +03:00
Nordsoft91
4f1f9e3c5d
Fix start game button for rmg without templates (#781) 2022-08-30 08:30:21 +03:00
Evgeniy Meshcheryakov
e38b822303 Fix crash in scenario information window if campaign has no difficulty settings 2022-07-28 11:35:14 +03:00
Andrii Danylchenko
1e97859fbf Fix crash when clicking scenario info during campaign gameplay. 2022-05-10 09:48:05 +03:00
Andrii Danylchenko
2710d1df50 Android: make keyboard appear and disappear only on demand 2022-05-08 17:09:17 +03:00
Dmitry Orlov
a65feb29f5 Fixed: Advanced options window issues 2021-11-13 17:02:11 +02:00
Sergei Trofimovich
e407d4e547 client/lobby/CBonusSelection.cpp: fix difficulty overflow in bonus UI
Before the change campaign bonus selection screen had inconsistent
overflow behaviour for difficulty selection:

```
    0 1 2 3 4 | available buttons: '-' to decrease
      ^       |                    '+' to increase
```

Before the change:

1. If we click '+' 5 times we will end up on difficulty=4 (ok, saturated).
2. If we click '-' 5 times we will end up on difficulty=1 (unexpected, wrap around).

After the change:

1. If we click '+' 5 times we will end up on difficulty=4 (saturated).
2. If we click '-' 5 times we will end up on difficulty=0 (saturated).

The inconsistency happens because `difficulty` variable has `ui8` type
and server uses `difficulty = vstd::abetween(difficulty, 0, 4)` to
implement the saturation.

For large positive values saturation works as expected:
    vstd::abetween(difficulty=5, 0, 4) -> 4
For small values it does not:
    vstd::abetween(difficulty=-1, 0, 4) -> 4

The change makes client to avoid using negative values.
2021-07-25 21:01:17 +03:00
Sergei Trofimovich
e4dd2f6dd8 client/lobby/SelectionTab.cpp: initialize generalSortingBy before use
Noticed use of uninitialized value when built vcmi with -fsanitize=undefined:

```
  Established connection with
    VCMI 0.99 b310f2e61e (server).
    UUID: bab9a90d-7416-4566-8817-e367ffcac7c1
  ../vcmi-9999/client/lobby/SelectionTab.cpp:138:16:
    runtime error: load of value 32717, which is not a valid value for type 'ESortBy'
  /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include/g++-v12/tuple:190:4:
    runtime error: load of value 32717, which is not a valid value for type 'ESortBy'
  /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include/g++-v12/tuple:190:4:
    runtime error: load of value 32717, which is not a valid value for type 'ESortBy'
```

Here (before the change) `SelectionTab()` used `generalSortingBy` before
first use:

```
    SelectionTab::SelectionTab(ESelectionScreen Type) {
        ...
        if(tabType != ESelectionScreen::campaignList)
        {
            ...
                ESortBy criteria = (ESortBy)i;
                if(criteria == _name)
                    criteria = generalSortingBy;

                buttonsSortBy.push_back(... std::bind(&SelectionTab::sortBy, this, criteria)));
            ...
        }
        ...
        switch(tabType)
        {
        case ESelectionScreen::newGame:
                generalSortingBy = ESortBy::_name;
        ....
```

The change moves `generalSortingBy` initialization before first use.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2021-07-25 21:00:31 +03:00
AlexVinS
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
Dmitry Orlov
854a2e6c39 Feature: Mods system improvement, Part III. Bunusing buildings customization. 2021-01-14 01:02:13 +03:00
Dmitry Orlov
9cf953157a Fix: client crashes while browsing saves, if some factions are removed 2021-01-06 17:19:59 +03:00
John Bolton
c61bae4060 Fixed RETURN_IF_BATTLE(). Undid disabled warnings. Fixed indentation. 2020-10-05 16:28:28 -07:00
John Bolton
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
laikh
edc1d06f4e Random Map Generator Option: Allow having more computer only players than human/computer players
Remove unused variable humanPlayersCount and function getHumanOnlyPlayerCount()
2020-07-07 19:45:53 +08:00