Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to place monsters in the Editor #7852

Merged
merged 7 commits into from
Oct 5, 2023

Conversation

ihhub
Copy link
Owner

@ihhub ihhub commented Oct 1, 2023

relates to #6845

fheroes2.engine.version_.1.0.8.2023-10-01.20-33-07.mp4

There are 2 problems which should be addressed later:

  • while changing the terrain we should remove all main objects from a tile
  • while using the eraser we should remove all main objects from a tile

Both issues will be addressed in a separate pull request.

@ihhub ihhub added improvement New feature, request or improvement ui UI/GUI related stuff editor Map editor related stuff labels Oct 1, 2023
@ihhub ihhub added this to the 1.0.9 milestone Oct 1, 2023
@ihhub ihhub self-assigned this Oct 1, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

src/fheroes2/editor/editor_interface.h Show resolved Hide resolved
src/fheroes2/editor/editor_interface.h Show resolved Hide resolved
src/fheroes2/editor/editor_interface.h Show resolved Hide resolved
Copy link
Collaborator

@Districh-ru Districh-ru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @ihhub, I left a couple comments after a quick check. Could you please check them in your spare time.

Also there is a mouse cursor issue. We may address it in a new PR: if you open the quick info or any dialog (in example quit dialog) the cursor is set to the POINTER after the dialog is closed and returned back to the monster icon after you move it to the nearby tile. (In future we could show a POINTER cursor above the places were the monster can not be placed).

fheroes2.2023-10-01.16-43-14-435.mp4

And a question to discuss - maybe after choosing a monster we should open the Dialog::SelectCount() with the default monster count set by default?

src/fheroes2/editor/editor_interface.cpp Show resolved Hide resolved
src/fheroes2/editor/editor_interface.cpp Show resolved Hide resolved
@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2023

Hi @Districh-ru , it is better to set monster count separately while you click on the monster. Doing it right after choosing a monster will limit your ability to quickly set them. I know that 0 doesn't mean 0 monsters but we can find a solution later.

@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2023

@Districh-ru , I am aware of the cursor issue. This is due to cursor updater class. I am still thinking how to address it properly in a separate PR.

@ihhub ihhub requested a review from Districh-ru October 1, 2023 14:36
@ihhub ihhub requested a review from zenseii October 1, 2023 14:39
@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2023

Hi @zenseii , could you please review the new text dialogs here?

Copy link
Collaborator

@Districh-ru Districh-ru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!
изображение

In future we should also add random monster placing.

Copy link
Collaborator

@zenseii zenseii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one comment regarding text, @ihhub

src/fheroes2/editor/editor_interface.cpp Outdated Show resolved Hide resolved
@ihhub ihhub requested a review from zenseii October 1, 2023 23:56
@Branikolog
Copy link
Collaborator

Branikolog commented Oct 4, 2023

Hi, @ihhub
I've made a couple of tests. 👍
The only tiny thing I would like to see is turning monster cursor into pointer while hovering over edges of the adventure map.

2023-10-04.11-06-43.mp4

But I suppose it is related to the issue you've discussed above with @Districh-ru . It's not urgent for sure. Everything else works well.

@ihhub
Copy link
Owner Author

ihhub commented Oct 4, 2023

Hi @Branikolog , I addressed your concern regarding the cursor.

@Branikolog
Copy link
Collaborator

Thanks, @ihhub !
There's an issue with positioning of the cursor after right click now:

2023-10-04.16-45-59.mp4

@ihhub
Copy link
Owner Author

ihhub commented Oct 4, 2023

Hi @Branikolog , this is the same problem which @Districh-ru spotted. This will be addressed in the separate pull request.

@Branikolog
Copy link
Collaborator

Branikolog commented Oct 4, 2023

@ihhub
I mostly concern about the position of the cursor (creature sprite) and the highlighted cell of the map:
IMG20231004171251

Creature sometimes appears on the map really far from the cursor.

The issue spotted by @Districh-ru , relates to showing the pointer cursor instead of creature sprite. Correct me if I'm wrong.

But I want to apologize, the issue I'm talking about is valid for a previous implementation too.

Edit:
Fix for map edges works well.

@Districh-ru
Copy link
Collaborator

Creature sometimes appears on the map really far from the cursor.

I also observe this issue: it appears only with disabled software cursor - the upper left corner of the monster sprite is set as the cursor center.
With software cursor turned on this issue does not appear - the center of monster sprite is set as the cursor center.

@ihhub
Copy link
Owner Author

ihhub commented Oct 5, 2023

Hi @Branikolog , I fixed the issue with the cursor. Please take a look.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@Branikolog Branikolog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now cursor works fine for both rendering modes!

@ihhub ihhub merged commit 28a3ae3 into master Oct 5, 2023
@ihhub ihhub deleted the editor-monster-placing branch October 5, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Map editor related stuff improvement New feature, request or improvement ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants