1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-02 09:02:03 +02:00
Commit Graph

341 Commits

Author SHA1 Message Date
Andrey Filipenkov
72feb538ce add explicit null pointer checks 2022-09-25 10:05:16 +03:00
Andrii Danylchenko
2b0f02c832
Merge pull request #944 from AgostonSzepessy/dev/agos/937
Add right click to Quick Recruit Window
2022-09-23 14:01:52 +03:00
Andrii Danylchenko
43a1a8b76d
Merge pull request #928 from kambala-decapitator/quick-recruit-no-creatures
show message instead of the Quick Recruit dialog when there're no creatures in town
2022-09-22 18:21:45 +03:00
Andrey Filipenkov
2ce78ba8c9 fix operator precedence 2022-09-22 11:54:09 +03:00
Agoston Szepessy
411038195c Add clickeable area on top of creature picture
A class that wraps an instance of `CIntObject` creates an area
that users can right click to view information about the creature
they're buying.

The constants were based off the existing ones in the code and were
refined by guessing and checking where clicking falls inside/outside
the border of the rectangle.
2022-09-18 22:53:11 -07:00
Agoston Szepessy
dfdaf57803 Set position for CreaturePurchaseCard
This will make it pick up on right clicks. It was 0 before, so it wasn't
doing it.
2022-09-18 16:00:54 -07:00
Andrey Filipenkov
beeef8527f Apply suggestions from code review
Co-authored-by: Nordsoft91 <nordsoft@yahoo.com>
2022-09-18 17:43:40 +03:00
Andrey Filipenkov
81dec1405f fix typo: purhase -> purchase 2022-09-18 17:43:40 +03:00
Andrey Filipenkov
a320af837d fix includes in client subdirectories 2022-09-18 17:43:40 +03:00
Andrey Filipenkov
0163190ac5 move hardcoded strings to JSON file 2022-09-18 17:43:37 +03:00
DjWarmonger
7ba271edf1
Rotation rebase2 (#912)
* Instead of [x][y][z] coordinates, map will be stored as [z][x][y].
* Nullkiller AI can get it too.
* Use boost::multi_array instead of nested vectors
* In MapHandler too
* Rotate foreach algorithms, too
* VCAI gets rotated, too
2022-09-18 17:39:10 +03:00
Andrey Filipenkov
90d355dd05 check availability only of town creatures
QRD shows only town creatures ignoring Summoning Portal
2022-09-18 15:58:15 +03:00
Andrey Filipenkov
a0832c39f9 show message instead of the Quick Recruit dialog when there're no creatures in town 2022-09-18 15:50:06 +03:00
Andrey Filipenkov
d44780d2ac add standard hotkeys to the Quick Recruitment dialog 2022-09-11 11:31:28 +03:00
Nordsoft91
aaa07e4d2e New terrain support - part 1 (#755)
Initial support of new terrains
2022-09-11 11:31:26 +03:00
Andrii Danylchenko
23bbb69eb9 #793 U shortcut for creature stack stats window 2022-09-04 10:18:25 +03:00
Konstantin
c6b198ce14
Warning fix (I moved C++17 and CI to another branch) (#739)
* clang warning fixes
* use CMake 3.10 due to MXE CI does not have 3.13 yet

Co-authored-by: Konstantin <rilian@niisi.ras.ru>
2022-05-19 15:14:50 +03:00
Andrii Danylchenko
1e97859fbf Fix crash when clicking scenario info during campaign gameplay. 2022-05-10 09:48:05 +03:00
Andrii Danylchenko
84948820b2 exchange window move single stacks buttons 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
0fd13d2f3b Change HD mod assets 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
78efd09e2e Refactor HD mod army exchange 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
3c0935a5b9 Artifact exchange 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
8fa0b30985 Army exchange implementation 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
2ce73fd4e1 Army exchange implementation 2022-01-03 15:13:46 +02:00
Arseniy Lartsev
222a0e40c7 Added code to display some HD mod buttons in hero exchange window 2022-01-03 15:13:46 +02:00
Arseniy Lartsev
24d2d5b702 New layout for hero exchange dialog with HD mod features 2022-01-03 15:13:46 +02:00
AlexVinS
483a4689ce Fixes for code review issues 2021-02-20 04:57:50 +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
d6a4767865 Mod system improvement: Patch 2 2020-10-25 01:04:34 +03:00
Dmitry Orlov
934c4e511d Special buildings support : Patch 1 2020-10-15 15:03:01 +03:00
Dmitry Orlov
f4816b0824 Mod system improvement Part I : Special buildings should work in the modders towns 2020-10-07 12:35:11 +03:00
John Bolton
c61bae4060 Fixed RETURN_IF_BATTLE(). Undid disabled warnings. Fixed indentation. 2020-10-05 16:28:28 -07:00
John Bolton
1722d15276
Update client/windows/CCreatureWindow.h
Removed leftover debugging code.

Co-authored-by: Alexander Shishkin <alexvins@users.noreply.github.com>
2020-10-05 16:13:13 -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
John Bolton
6d8f1e4530 Fixed incorrect usage of const std::shared_ptr. Resolves 0003142.
Replaced const TBonusListPtr with TConstBonusListPtr where necessary
Replaced const std::shared_ptr<T> with std::shared_ptr<const T> where necessary.
Removed superfluous use of const.
Replaced const std::shared_ptr<T> with const std::shared_ptr<T> & in function parameters and ranged for-loops.
2020-09-30 22:56:28 -07:00
AlexVinS
55b54024a8 Cherry-picked essential fix from #631. This fixes https://bugs.vcmi.eu/view.php?id=3074. 2020-03-18 00:06:07 +03:00
JakubK
a8d5081895 More mouse scrolling fixes
Defect:
After my previous change that enabled map layer (`CAdvMapInt`) to listen to all mouse move events via `strongInterest` bool, I noticed that there are a few scenario that start scrolling the map unexpectedly. The two that were the easiest to reproduce were using keyboard arrows to move the hero or dimissing a popup dialog.

I traced this down to unexpected mouse move event (`SDL_MouseMotionEvent`) that SDL seems to dispatch in this situation. The windowID that comes with the event in this scenario is 0 (so no window with mouse focus). I don't know why SDL dispatches this mysterious (to me) mouse move event in that case (note that there is no actual mouse movement in either repro case).

Fix:
Don't handle the mouse move event if the windowID of the mouse motion event is 0.

Notes:
Impacts scrolling of the game map. Did some play testing and didn't notice the scrolling not working when expected. The two specific cases where the map would scroll unexpectedly (move a hero with keyboard arrows or dismiss a popup dialog) no longer move the map.
2020-01-04 22:45:33 -08:00
JakubK
09cd4c072a Defect:
In fullscreen mode, when the adventure window size does not fill the entire monitor (leaving black bars on each side), mouse movement is ignored in these areas. This results in difficulty scrolling the map in fullscreen mode, since you have to be exactly within [0,15] of the edge of the adventure window.

Fix:
Have the adventure map element, CAdvMapInt, subscribe to all mouse move events by setting the `strongInterest` bool to true. This will extend the scroll region to [min, 15], eliminating the dead mouse move space on the side of the window.

Notes:
Impacts adventure window mouse move event handling. Manually validated the scrolling the map now works without having to precisely aim for the edge of the window.
2019-12-26 10:10:39 -08:00
Dydzio
61ae6ce286 Remove useless and wrong recruit conditions 2019-06-01 20:29:49 +03:00
Dydzio
5470f9cafe Re-fix map hero movement speed, was too fast on land 2019-05-26 17:11:57 +02:00
Ewilhan
42114fa4fc Fixed wrongCursorOnFriendlyDwelling
Added else condition that covers cases "ObjectAtTile that is not enemy nor is Town nor is current Hero". This should cover all cases of friendly dwellings/mines not having the correct cursor.
2019-05-03 06:20:32 +01:00
Mikko
02c109f9cf
Update CAdvmapInterface.cpp 2019-01-24 15:34:58 +00:00
Mikko
f8ab2db0ea
Update CAdvmapInterface.cpp 2019-01-24 15:30:09 +00:00
Mikko
5b8ff278b9
Fix implicit cast from tribool to bool. 2019-01-24 14:45:40 +00:00
Alexander Shishkin
b00e935e4d
Warnings fixes (#538)
Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
2019-01-19 13:52:02 +03:00
AlexVinS
614cde4a55 Fixed two memory leaks 2018-11-14 20:58:37 +03:00
Dydzio
22ce535a2a Fix not responding statusbar 2018-10-29 14:12:07 +01:00
KasyanDiGris
fa5a14e2d8 Stabilize vcmi (#488)
* Shared statusbar
* Fixed server fails on client disconnected
2018-08-26 19:09:56 +03:00
yupinov
b56f862094 Yog is not able to buy a spellbook in his campaign anymore, as intended (#472)
* Yog is not able to buy a spellbook in his campaign anymore, as intended
2018-08-11 18:25:09 +03:00
Alexander Shishkin
75f8c8b29a Gui cleanup4 (#446)
* use smart pointers for almost all widget fields
* use SDL2 texture for cursor
* a lot af small tweaks and formatting
* removed CompImage class, it is actually useless as long as regular SDLImage support margins
* CGuiHandler: use smart pointers for [push|pop]Int
2018-07-25 01:36:48 +03:00