The International Simutrans Forum

 

Author Topic: Toolbar switching with right clicking  (Read 315 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

  • Coder/patcher
  • Devotee
  • *
  • Posts: 367
  • Languages: JP,EN
Toolbar switching with right clicking
« on: May 03, 2020, 09:30:27 AM »
This patch enables players to switch toolbars with the right click button, not to open another toolbar.

In current simutrans, right clicking of tools only closes the selected tools and does no work when the selected tool is not opened. With this patch, right clicking closes all tools launched by the toolbar and opens the selected tools when the selected tool is not opened. Players can avoid the flood of toolbars with a single right clicking while they switch tools.

A sample video is available on this tweet.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9989
  • Languages: De,EN,JP
Re: Toolbar switching with right clicking
« Reply #1 on: May 03, 2020, 12:59:57 PM »
I would like to hear more feedback. At first it was very surprising to me, but I can understand the reasoning.

Offline Ranran

  • Devotee
  • *
  • Posts: 984
  • Languages: ja
Re: Toolbar switching with right clicking
« Reply #2 on: May 03, 2020, 01:31:44 PM »
This behavior may be a bit confusing because right-clicking is currently only used to "close" the toolbar you clicked.
Because it has the action of opening and Left-clicking on an already open toolbar does not close it. However, the behavior does not seem to conflict.


I have a question. What happens if I have twothree toolbars open and right-click on the third toolbar?


In my opinion, it would be useful if the player correctly recognized this behavior, but it is often overlooked.
(´・ω・`)ちょっと分かり辛くて左右クリックの開閉動作が矛盾してるように思うよ
(´・ω・`)らんらんは今まで左クリックで閉じることを知らなかったし?でも知ってると便利
(´・ω・`)らんらんは英語しゃべれないので日本語で
« Last Edit: May 03, 2020, 02:08:28 PM by Ranran »

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: Toolbar switching with right clicking
« Reply #3 on: May 03, 2020, 01:39:30 PM »
This behavior may be a bit confusing because right-clicking is currently used to "close" the toolbar you clicked.
I didn't even know that yet :D I'm always using the escape key.

Imho the new behavior is good as long as it leaves "pinned" windows untouched.

Offline THLeaderH

  • Coder/patcher
  • Devotee
  • *
  • Posts: 367
  • Languages: JP,EN
Re: Toolbar switching with right clicking
« Reply #4 on: May 03, 2020, 01:41:37 PM »
Quote
I have a question. What happens if I have two toolbars open and right-click on the third toolbar?

I need to know more detail about the situation you suggested, but let's assume that toolbar A and B were launched by the main (showed at the top of the game window) toolbar, and now a player right-clicks another icon of the main toolbar to launch toolbar C.

In this case, both toolbar A and B are closed and only toolbar C is displayed. Is this the answer for your question?

EDIT:
Quote
Imho the new behavior is good as long as it leaves "pinned" windows untouched.
I agree. Considering about this, I wonder if "pinning" of toolbar has any affect on behavior in the current simutrans.

Offline Ranran

  • Devotee
  • *
  • Posts: 984
  • Languages: ja
Re: Toolbar switching with right clicking
« Reply #5 on: May 03, 2020, 01:52:32 PM »
Sorry, the question description was incorrect.


It uses the current version, left click to open and right click to close.
Does this behavior change?

It uses a right click, but doesn't close it all. Some players may expect it. On the other hand, there is no conflict of functions when closing with a single left click. EDIT: The ability to focus is lost.

I think there is a little issue with IMO, such consistency of behavior (easy to understand for the player).
« Last Edit: May 03, 2020, 02:06:58 PM by Ranran »

Offline THLeaderH

  • Coder/patcher
  • Devotee
  • *
  • Posts: 367
  • Languages: JP,EN
Re: Toolbar switching with right clicking
« Reply #6 on: May 03, 2020, 02:00:25 PM »
The behavior you indicated is not changed. The only cases that is affected is when a player right-clicks the tool that is not launched.

The following code can explain the behavior better than the verbal explanations.
Code: [Select]
if (!IS_LEFTRELEASE(ev)  &&  tool  &&  tool->is_selected()  ) {
// right click, and the selected tool is already launcheda
if(  tool->exit(welt->get_active_player())  ) {
welt->set_tool( tool_t::general_tool[TOOL_QUERY], welt->get_active_player() );
toolbar->remove_child(tool);
}
return true;
}

if(!IS_LEFTRELEASE(ev)) {
// right click, and the selected tool is not launched.
// close all tools launched by this toolbar
toolbar->destroy_children(welt->get_active_player());
}
// open the selected tool
welt->set_tool( tool, welt->get_active_player() );
toolbar->append_child(tool);

Offline Ranran

  • Devotee
  • *
  • Posts: 984
  • Languages: ja
Re: Toolbar switching with right clicking
« Reply #7 on: May 03, 2020, 02:15:17 PM »
The behavior you indicated is not changed. The only cases that is affected is when a player right-clicks the tool that is not launched.
Thank you for the explanation

- Left-clicking on the third toolbar with three toolbars open does not close the other toolbars
- Left-clicking the fourth toolbar with three toolbars open closes the other toolbars

I find these two behaviors inconsistent and little weird.

(´・ω・`)説明ありがと。翻訳介すとおかしくなりがちなので
(´・ω・`)3個開いて3個目右クリックだと他ツールバーは閉じない
(´・ω・`)3個開いて4個目右クリックだと他ツールバーは閉じる
(´・ω・`)らんらん的には全体的にこういう動作に一貫性が無いように思いますまる

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9989
  • Languages: De,EN,JP
Re: Toolbar switching with right clicking
« Reply #8 on: June 12, 2020, 12:51:35 PM »
I finally tested it and found it very confusng that only some toolbars are affected (for instance the list toolbar stays). I think it would need to affect all toolbars equally, and then it must be confiurable. Otherwise it is too confusing for non-powerusers.