Commit graph

257 commits

Author SHA1 Message Date
Edoardo Lolletti
b52ce46d17 add IsCardDeclarable to data_manager 2026-06-19 17:09:46 +02:00
Edoardo Lolletti
3029940c6e prevent softlock if no card can be declared 2026-06-19 17:00:58 +02:00
Edoardo Lolletti
e9696a53c1 Make ToUpperNoAccents take arbitrary string types 2025-09-26 10:28:32 +02:00
Edoardo Lolletti
f638489aa6 Use fallthrough attribute 2025-03-11 18:24:46 +01:00
Edoardo Lolletti
7b36b8484a Don't include fmt.h in text_types.h 2024-09-06 14:56:15 +02:00
Edoardo Lolletti
42e897aae6 Put the rest of the fmt formatting options in the epro namespace 2024-09-06 10:42:35 +02:00
Edoardo Lolletti
0709e238be Cleanup fmt includes 2024-05-18 12:04:56 +02:00
Edoardo Lolletti
6aa189df0f Add heuristics to skip card confirm panel when possible
If MSG_CONFIRM_CARDS is sent just to refresh the knowledge of that player to perform a selection immediately afterwards, (for example confirming 3 cards from the deck so that the opponent can konw what they're choosing), wait before showing it until the next message is parsed, if the first message (ignoring selection hint messages) is a selection message where the cards to be choosen from are the exact same as the ones previously confirmed, proceed directly to the selection, otherwise show the card confirm panel and then proceed with the message parsing.
2024-02-15 14:55:21 +01:00
Edoardo Lolletti
953862da26 Fix z index of cards in piles messing up in topdown
If a card left a pile while in topdown view, the other cards' z value was being updated regardless thus messing up the ordering
2023-06-24 11:09:09 +02:00
Edoardo Lolletti
31bfe954cb Fix chain icon displaying on piles in topdown
It was still calculating the z offset based off the pile size
2023-06-24 10:51:55 +02:00
Edoardo Lolletti
209fe5b11e Fix conti_selecting state not being cleared when restarting a duel
If a duel ended/restarted while choosing lingering effects to apply, such flag wouldn't have been reset until another lingering effect selection was performed, thus showing ``???`` instead of the location/sequence in each subsequent card selection
2023-06-12 00:09:44 +02:00
Edoardo Lolletti
933c0c49b9 Update handling of race selection
Make the race selection dialog no longer use an hardcoded max amount of checkboxes and update its drawing so that all the options are put one after the other rather than having big gaps between the available ones.
2023-04-20 23:19:48 +02:00
Edoardo Lolletti
cd00f787fe Fix more warnings and enable extra warning level 2023-02-08 20:13:06 +01:00
Edoardo Lolletti
b6af0562f8 Fix various integer casting to smaller size warnings 2023-02-07 15:41:03 +01:00
Edoardo Lolletti
1780568dbb Resolve remaining MSVC downcast warnings 2023-02-06 23:25:35 +01:00
Edoardo Lolletti
4db7dcce61 Set the refresh on stop flag to false when manually refreshing card coordinates 2023-01-15 16:29:46 +01:00
Edoardo Lolletti
8ca2a7414b Update client_field.cpp
[ci skip]
2022-10-18 23:12:41 +02:00
Edoardo Lolletti
78371eee89 Update usage of dInfo.duel_field and duel_params
Add DuelInfo::HasFieldFlag and DuelInfo::GetPzoneIndex to simplify code flow, no longer use DuelInfo::duel_field where it could be replaced with a check of a specific duel flag, update some variable names to give them more meaning
2022-10-18 22:20:06 +02:00
Edoardo Lolletti
05a49ba70b Use epro::mutex, thread and condition_variable
No longer use the types defined in the std namespace
2022-10-07 21:40:46 +02:00
Edoardo Lolletti
ad81d4d9e2 Move needed format and sprintf into `epro namespace instead of using them from the fmt` namespace
In b6d8cbde94, specialized ``format`` functions to work for fmt 9.x.x were put in the fmt namespace, avoid possible undefined behaviour and instead redefine those functions to the epro namespace
2022-10-07 20:27:52 +02:00
Edoardo Lolletti
6cfc6f0175 Clear sort_list vector when not showing wCardSelect because of a SORT message
Fixes https://github.com/edo9300/edopro/issues/250
2022-09-24 00:02:16 +02:00
Edoardo Lolletti
d15ca07f93
Update client to support 64 bit card race (#247)
Apply the required message changes needed to properly handle higher race values, to match with https://github.com/edo9300/ygopro-core/pull/127
2022-09-03 22:52:23 +02:00
Edoardo Lolletti
64d9888b1b Update handling of field vertices for different field types
Reorder the elements of the multi dimensional arrays so that the last  2 elements are the player and the sequence (when present), so that the values are more contiguous in memory and allow simplifying some code. Also keep track of the current field status and store the right values coresponding to the "field" and "speed" values and retrieve them via getters
2022-08-18 19:48:03 +02:00
Edoardo Lolletti
0fe83bf3e6 Update some font->getdimension to font->getdimensionustring 2022-07-28 23:19:05 +02:00
Edoardo Lolletti
6321f4050d
Implement topdown duel view and option to keep the field's aspect ratio (#242)
Implement a 2d topdown duel view, at the moment the only way to toggle that is by using the f9 key or directly edit the config file. Toggling it with the f9 key will also automatically enable the option to retain the field's aspect ratio (as a stretched topdown view isn't very pleasing). Like for the topdown option the aspect ratio toggle for now can only be properly set by manually editing the config file if the keyboard function keys are not available.
2022-07-12 14:31:30 +02:00
Edoardo Lolletti
1737c4de51 Update CardDataM::GetStrings to return a const reference 2022-04-08 15:11:13 +02:00
Edoardo Lolletti
b22809326c Minor update to ClientField::UpdateDeclarableList 2022-04-08 15:01:14 +02:00
Edoardo Lolletti
2c5a75fe91 Use uint8_t as the type for all the buffer manipulation functions 2022-02-27 01:07:44 +01:00
Edoardo Lolletti
248bdffbe2 Unify CoreUtils::Packet and ReplayPacket
Remove ReplayPacket and only use CoreUtils::Packet that will now have the same behaviour as ReplayPacket , that being storing the message as an uint_8 in its structure, and storing the data **without** the packet in its vector.
2022-02-12 22:45:54 +01:00
Edoardo Lolletti
0c618390cc Set Card::aniFrame to 0 on ClientField::RefreshAllCards 2022-01-02 12:54:53 +01:00
Edoardo Lolletti
21f188ae23 Make DataManager::unknown_string stringview 2021-12-28 23:32:50 +01:00
Edoardo Lolletti
401198290d Cleanup query parsing code 2021-12-05 23:04:18 +01:00
Edoardo Lolletti
d06aab36ff Update query handling 2021-08-21 13:35:25 +02:00
Edoardo Lolletti
1195f20f67 Swap player hints when swapping fields 2021-07-04 18:19:43 +02:00
Edoardo Lolletti
97396c829c Refresh hand hitboxes in main thread
Depending on the timing they were refreshed, they might have been refreshed while other drawing operations were performed that affected the view projection matrix.
2021-05-24 13:24:53 +02:00
Edoardo Lolletti
34b02b5ec2 Missing change for 5e98831673 2021-05-14 12:42:44 +02:00
Edoardo Lolletti
4f2fea00ea Replace some vector::erase(end()-1) with pop_back 2021-03-26 14:22:28 +01:00
Edoardo Lolletti
c3997db686 Minor formatting in client_field.cpp 2021-03-26 00:01:42 +01:00
Edoardo Lolletti
8a1795c28d Update ClientField::UpdateDeclarableList
Some cleanups
2021-02-01 19:56:00 +01:00
Edoardo Lolletti
463a58c84d Use upper case text when checking declarable card name 2021-02-01 19:26:22 +01:00
Edoardo Lolletti
21587fb5e8 Fix in hand cards not being hoverable while facedown 2021-02-01 19:23:42 +01:00
Edoardo Lolletti
e39bcaa73f Update collision detection 2021-01-22 15:53:11 +01:00
edo9300
045975a143 Add support for OPCODE_ALLOW_ALIASES and OPCODE_ALLOW_TOKENS 2020-11-23 13:13:04 +01:00
edo9300
b7fe232525 Still update usage of mutexes/signals
Add an unique lock parameter to WaitFrameSignal, to allow the function being called with an already locked mutex that will then be handled by the condition variable.
Replaces most of the instances of manual lock/unlock with unique_lock(s) and lock_guard(s)
2020-10-06 19:35:35 +02:00
edo9300
b63977f5f8 Directly call irr::core::vector3df::set in some instances instead of making a new assign 2020-09-29 23:08:07 +02:00
edo9300
f9689e0e24 More string view updates 2020-09-26 16:59:14 +02:00
edo9300
482b32a06a Use string view object to pass strings in most of the places 2020-09-18 21:47:50 +02:00
edo9300
063d9675e9 Cleanup some headers, use directly _t types defined from cstdint instead of the ones defined for the core 2020-08-25 23:48:07 +02:00
edo9300
fedc319210 Remove ClientCard constructor, set card sequence when created in limbo to keep consistent posistioning
Since all the values but 1 were set to "0", removed the constructor and using the {} initializer behaviour to set everything to 0
2020-08-21 22:16:15 +02:00
edo9300
25d05017ac Draw activation circle in the proper pile for the opponent 2020-07-31 12:14:30 +02:00