News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Toolbar switching with right clicking

Started by THLeaderH, May 03, 2020, 09:30:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

THLeaderH

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.

prissi

I would like to hear more feedback. At first it was very surprising to me, but I can understand the reasoning.

Ranran(retired)

#2
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.
(´・ω・`)ちょっと分かり辛くて左右クリックの開閉動作が矛盾してるように思うよ
(´・ω・`)らんらんは今まで左クリックで閉じることを知らなかったし?でも知ってると便利
(´・ω・`)らんらんは英語しゃべれないので日本語で
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Mariculous

Quote from: Ranran on May 03, 2020, 01:31:44 PMThis 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.

THLeaderH

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:
QuoteImho 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.

Ranran(retired)

#5
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).
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

THLeaderH

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.

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);

Ranran(retired)

Quote from: THLeaderH on May 03, 2020, 02:00:25 PMThe 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個目右クリックだと他ツールバーは閉じる
(´・ω・`)らんらん的には全体的にこういう動作に一貫性が無いように思いますまる
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

prissi

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.