The International Simutrans Forum

 

Author Topic: Remove Way - No preview when dragging  (Read 1775 times)

0 Members and 1 Guest are viewing this topic.

Offline captain crunch

  • *
  • Posts: 116
Remove Way - No preview when dragging
« on: January 15, 2018, 12:48:01 AM »
When dragging the tool to remove ways it used to show you which way would get removed by displaying the remove icon (X) along the way. Now it is not shown, turning this action into a game of chance. This behaviour probably changed around svn commit r8336.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1269
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Remove Way - No preview when dragging
« Reply #1 on: January 15, 2018, 05:51:33 AM »
That "Remove Icon" is just a copy of the cursor. I don't see the cursor on your second screen - could it be that there simply is no cursor defined in the pakset, hence no graphic for the game to show?

EDIT: It's not pakset specific, the cursor is gone for other paksets as well.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4601
  • Languages: EN, DE, AT
Re: Remove Way - No preview when dragging
« Reply #2 on: January 15, 2018, 07:34:44 AM »
Which version works? Which does not? Cannot think of any change that caused this.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1269
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Remove Way - No preview when dragging
« Reply #3 on: January 15, 2018, 08:27:02 AM »
Since it affects the cursors of multiple tools (place label, plant tree etc.) perhaps it's an oversight in userfriendlys patch which operates in that area of the code?

Offline userfriendly

  • *
  • Posts: 21
    • GitHub Profile
  • Languages: EN
Re: Remove Way - No preview when dragging
« Reply #4 on: January 15, 2018, 09:29:26 PM »
Leartin is correct. The version after https://github.com/aburch/simutrans/commit/85deb996b3170453c511d1a834e1379c711a471d has the bug and the version right before my changes does not have the bug :(

I'll look into this, sometime this week, since it doesn't seem to be a game breaking bug.

Offline ROCAMBOLER529

  • *
  • Posts: 93
  • Languages: ES EN
Re: Remove Way - No preview when dragging
« Reply #5 on: January 16, 2018, 12:33:50 AM »
Maybe the road cannot be connnected in totally... In the irregulars terrains its very difficult to see if the road is connected or its has an end point!!

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4601
  • Languages: EN, DE, AT
Re: Remove Way - No preview when dragging
« Reply #6 on: January 16, 2018, 07:40:38 AM »
@userfriendly: Solution should be simple: first copy data the old way (before your patch), then call the method of your patch
Code: [Select]
*addtool = *(general_tool[toolnr]); // this line was removed by the commit, bringing it back could help?
set_defaults_general_tool(addtool, param_str);
Found no time to test whether this would work.

Offline userfriendly

  • *
  • Posts: 21
    • GitHub Profile
  • Languages: EN
Re: Remove Way - No preview when dragging
« Reply #7 on: January 16, 2018, 06:30:14 PM »
@Dwachs Thanks - I can confirm that fixes the issue! Reverted the line on master and the bug is gone.
I do want to know why that broke the remove ways icons. Any ideas?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4601
  • Languages: EN, DE, AT
Re: Remove Way - No preview when dragging
« Reply #8 on: January 17, 2018, 07:38:46 AM »
This missing line copies the data that is now missing: set_defaults_general_tools does only copy data for tools are related to some object, which is not the case for remove ways.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4601
  • Languages: EN, DE, AT
Re: Remove Way - No preview when dragging
« Reply #9 on: January 17, 2018, 09:00:09 PM »
This is now in r8371. Thanks for testing!

Offline captain crunch

  • *
  • Posts: 116
Re: Remove Way - No preview when dragging
« Reply #10 on: January 18, 2018, 12:34:58 PM »
Thank you, it works!