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

313 Commits

Author SHA1 Message Date
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
Alexander Shishkin
5c09f751b3 Gui cleanup3 - UI refactoring to use smart pointers (#440)
* Changed most gui classes to use shared pointers
* Store and use IImage as shared_ptr
* CSpellWindow redesign
* AdventureMapClasses cleanup
* CLabel: store background as smart pointer
* Store CObjectList items as smart pointers
* Removed destroy function of list item
* Store toggle buttons as smart pointers
* Use CComponent as smart pointer
* Attempt to fix artifact merchant drawing
2018-04-07 18:34:11 +07:00
Arseniy Shestakov
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
AlexVinS
43acfa160b [tweaks] IImage * -> auto 2018-03-30 14:02:04 +03:00
Raphnalor
0f00dbf8cf Fix highlighting of a selected bonus for campaign. (#432) 2018-03-17 12:23:22 +08:00
Arseniy Shestakov
434deffb54 CAdvMapInt: improve hero reminder by checking hero path
Dialog won't show up if movement points insufficient for first step on current path.
2018-02-24 21:49:42 +08:00
Arseniy Shestakov
8bbe747e8e Cleanup undef for min / max. NOMINMAX is already in Global.h 2018-02-11 05:42:49 +03:00
AlexVinS
0a2b04709f Fixed https://bugs.vcmi.eu/view.php?id=2873 2018-02-09 22:12:21 +03:00
AlexVinS
0b70baa95e Spells configuration version 2 (effect-based)
* Indirect spell effects loading
* Json serializer improvements
* spell->canBeCastAt do not allow useless cast for any spell
* Added proxy caster class for spell-created obstacles
* Handle damage from spell-created obstacles inside mechanics
* Experimental GameState integration/regression tests
* Ignore mod settings and load only "vcmi" mod when running tests
* fixed https://bugs.vcmi.eu/view.php?id=2765 (with tests)
* Huge improvements of BattleAI regarding spell casts
* AI can cast almost any combat spell except TELEPORT, SACRIFICE and obstacle placement spells.
* Possible fix for https://bugs.vcmi.eu/view.php?id=1811
* CStack factored out to several classes
* [Battle] Allowed RETURN_AFTER_STRIKE effect on server side to be optional
* [Battle] Allowed BattleAction have multiple destinations
* [Spells] Converted limit|immunity to target condition
* [Spells] Use partial configuration reload for backward compatibility handling
* [Tests] Started tests for CUnitState
* Partial fixes of fire shield effect
* [Battle] Do HP calculations in 64 bits
* [BattleAI] Use threading for spell cast evaluation
* [BattleAI] Made AI be able to evaluate modified turn order (on hypothetical battle state)
* Implemented https://bugs.vcmi.eu/view.php?id=2811
* plug rare freeze when hypnotized unit shots vertically
* Correctly apply ONLY_MELEE_FIGHT / ONLY_DISTANCE_FIGHT for unit damage, attack & defense
* [BattleAI] Try to not waste a cast if battle is actually won already
* Extended JsonSerializeFormat API
* fixed https://bugs.vcmi.eu/view.php?id=2847
* Any unit effect can be now chained (not only damage like Chain Lightning)
** only damage effect for now actually uses "chainFactor"
* Possible quick fix for https://bugs.vcmi.eu/view.php?id=2860
2018-02-08 11:37:21 +03:00
FeniksFire
b85bb6ec0a Fix positioning
Fix problem for costBacground in QuickRecruitmentWindow.
Position "y" there was scaled which lead to errors with different
resolutions.
2018-01-15 18:00:41 +01:00
Alexander Shishkin
e90fcea3d3
Merge pull request #396 from FeniksFire/update
Update graphics for QuickRecruitmentWindow
2018-01-14 10:42:23 +03:00
FeniksFire
1331c81a8b Update graphics for QuickRecruitmentWindow
Adding graphics maded by edeksumo
2018-01-13 09:49:29 +01:00
Arseniy Shestakov
f15cadc87b Implement configurable object sounds: ambient, visit and removal
* If there more than one sound for visit or removal random is played
* At moment only the first ambient sound will be used
2018-01-02 09:49:03 +01:00
DJWarmonger
f523ae5545 Fixed Magic resistance display. 2017-12-30 12:25:29 +01:00
FeniksFire
bf4024c3ac Adding bacground for QuickRecruitmentWindow
Adding bacground for CreaturePurchaseCard in QuickRecruitmentWindow
2017-12-23 13:15:05 +01:00
AlexVinS
368ba0e2bf fixes 2017-12-21 21:27:39 +03:00
FeniksFire
f82fd41a14 Quick Recruitment Window upgrade
Now is possible to switch by button between creatures upgrades.
Fixed small typo, rename from purhase to purchase.
2017-12-21 18:23:28 +01:00
AlexVinS
39194a0629 Merge branch 'SplittingShortcuts' into develop 2017-11-15 22:31:55 +03:00
FeniksFire
3c3aaa7bb5 Improvement quick recruitment window
-Position is now relative to castle interface
-The highest level of creature is now presented.
-Improve positioning of creature card, now it's look like in hd mod.
2017-11-15 19:44:54 +01:00
FeniksFire
f2b7c85811 Adding object construction macro with parameter
- Adding macro "OBJECT_CONSTRUCTION_CAPTURING" that take as parameter
action flag.
- Fixed minor errors
2017-11-14 08:52:33 +01:00
FeniksFire
a4f701014b Quick Army Purhase in Town Screen
Mouse click on castle icon (it is now clickable) - quick recruit of all
available creatures.
2017-11-12 17:37:08 +01:00
Alexander Shishkin
fd4ecbd40b
Merge pull request #385 from Chocimier/altar
Fixed "Altar of Sacrifice only sacrifices creatures one kind at a time"
* https://bugs.vcmi.eu/view.php?id=2607
2017-10-28 14:04:34 +03:00
Piotr Wójcik
7171fa7ad4 Formatting 2017-10-28 11:04:55 +02:00
AlexVinS
c39cd5f951 Town building build mode fixes
* CGameHandler::buildStructure was using wrong requirements for buildings in auto mode.
* Build mode loading was wrong in case of omitted value
* Show town hall slot for not built building only if it have normal build mode
2017-10-28 03:27:39 +03:00
Piotr Wójcik
78e5d39ea0 Change variables type 2017-10-18 21:02:23 +02:00
Piotr Wójcik
f9ed952869 Properly calculate experience on altar 2017-10-14 22:10:59 +02:00
Piotr Wójcik
f145b4be91 Correctly sacrifice many stacks or many atrifacts, fixes #2607 2017-10-14 21:30:56 +02:00
AlexVinS
9423555015 Declare ownership of CCursorHandler::dndObject
# Conflicts:
#	AI/FuzzyLite
#	client/gui/CGuiHandler.cpp
2017-09-05 15:25:31 +03:00
AlexVinS
a8d25ea7b2 CHeroWindow tweaks
# Conflicts:
#	AI/FuzzyLite
#	client/windows/CHeroWindow.cpp
2017-09-05 15:22:48 +03:00