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

Unselect initial town in the Town Portal spell list #4249

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

a1exsh
Copy link
Contributor

@a1exsh a1exsh commented Sep 23, 2021

Fix #843

@a1exsh
Copy link
Contributor Author

a1exsh commented Sep 23, 2021

I have this one-line change, but wondering now what's the fastest way to test it? 😅

There doesn't seem to be a way to select spells in the OG editor (for a hero, a town or a shrine). Does turning on some debug level gives all possible spells to the human player, for example?

@LeHerosInconnu
Copy link

Hello @a1exsh,

I have this one-line change, but wondering now what's the fastest way to test it?

There doesn't seem to be a way to select spells in the OG editor (for a hero, a town or a shrine). Does turning on some debug level gives all possible spells to the human player, for example?

It is not possible to do this in the scenario editor of the original game.
One way around it is to place a Spell Scroll with the desired spell on the adventure map, or to place many castles with a fully built Mage Guild.
I don't know if there is a debug level in fheroes2 for that.
In the meantime here is a test scenario file with a spell scroll:
0 9956d.zip

@vincent-grosbois
Copy link
Contributor

I have this one-line change, but wondering now what's the fastest way to test it? 😅

There doesn't seem to be a way to select spells in the OG editor (for a hero, a town or a shrine). Does turning on some debug level gives all possible spells to the human player, for example?

Usually I just run the game in debug mode, put a breakpoint somewhere and edit whatever data structure so it contains all spells
What you can do otherwise is just to add a few lines of codes when you compile such that whenever a spellbook object is created it adds the town portal spell, etc

@a1exsh
Copy link
Contributor Author

a1exsh commented Sep 24, 2021

Spell Scroll works the best — thank you, this way one can also test it in the OG.

I've tested the change and it works as I expected: the initial town is not selected, so clicking once doesn't immediately teleport the hero. The issue should be fixed by this.

@oleg-derevenetz oleg-derevenetz added bug Something doesn't work ui UI/GUI related stuff labels Sep 24, 2021
@oleg-derevenetz oleg-derevenetz added this to the 0.9.8 milestone Sep 24, 2021
@ihhub
Copy link
Owner

ihhub commented Sep 26, 2021

Hi @a1exsh , I think the original issue is based on a fact that we allow single mouse clicking and interpret 2 independent clicks as a double click (due to design). What we really need is to implementation of mouse double click support. I think the proposed change doesn't solve anything.
@Branikolog , please correct me if I'm wrong.

@a1exsh
Copy link
Contributor Author

a1exsh commented Sep 26, 2021

Hi @a1exsh , I think the original issue is based on a fact that we allow single mouse clicking and interpret 2 independent clicks as a double click (due to design).

It works the same way in OG and I think it's fine.

@ihhub Didn't you write this on the issue ticket? ;)

I think the correct way would be to do not highlight first town in a list at the beginning of the spell.
#843 (comment)

It does solve the issue and I think it's a reasonable approach to this problem..

@ihhub
Copy link
Owner

ihhub commented Sep 26, 2021

Oops, my bad🙂

@Branikolog
Copy link
Collaborator

Hi, @ihhub & @a1exsh.
In the OG we need to press OK button to initiate the spell. Currently in fheroes2 we simply need to click over selected (yellow) castle name. I've already talked about it in #843 (comment)
We can always misclick if it was previously selected. So no town selected on initiating the spell helps a bit (with the first town in a list) but not solves the problem.

@ihhub ihhub merged commit 598daad into ihhub:master Sep 28, 2021
@ihhub
Copy link
Owner

ihhub commented Sep 28, 2021

@a1exsh , thank you very much for this change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Click over selected castle causes immediate teleportation in "Town Portal" spell list
6 participants