チケット #41990

Client : need a shortcut Key_E for connect_maglev

登録: 2021-04-12 15:04 最終更新: 2022-11-26 18:57

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
4

詳細

3.0.beta1 , client gtk3.22

Maybe i missed something, but it seems that maglev must be done one by one (each turn give the order to an ingeneer on a new tile) , which is very painful.

i expected shift-M to do maglev path (like shift-R for Roads, or shift-L for rails )

Edited:

Shift-M is reserved for something 3.1 key_E seems available.

チケットの履歴 (36 件中 3 件表示)

2021-04-12 15:04 更新者: alain_bkr
  • 新しいチケット "Client : need a shortcut Shift-M for Maglev" が作成されました
2021-04-12 20:59 更新者: chippo
コメント

Agreed. I also maybe missed something and find it painful.

2021-04-12 21:10 更新者: cazfi
コメント

Maglev is a ruleset defined Road type, and currently rulesets have no way to assign/reserve keys. That's a long standing issue.

In S3_1 & master Shift+M is taken for Plant activity (As 'm' is for Mine, and Plant is related).

2021-04-13 00:00 更新者: alain_bkr
コメント

I don't really care for the letter's choice, P M or Whatever , short cut could also be SHIFT+CTRL+...

For the fun, I m trying to write this patch , and duplicate connect_railways , but i understand mostly nothing as you may notice :-) Nothing happens (it compiles and run as before)

There are comment about compatibily ROad COmpat (ROCO_RAILROAD ...)

Any advice, hint or comment is welcome.

2021-04-13 00:03 更新者: alain_bkr
  • 添付ファイル broken_connect_maglev.patch (File ID: 6515) が付加されました
2021-04-13 00:32 更新者: cazfi
コメント

Reply To alain_bkr

Nothing happens (it compiles and run as before)

Have you also updated your ruleset so that some road type is marked as being compatibility version of Maglev special (that's what compat_special is supposed to mean; compatibility with older freeciv version where the road types were specials)?

2021-04-13 02:27 更新者: alain_bkr
コメント

1/ CTRL V is available , V for magleV

2/ Reply To cazfi

Reply To alain_bkr

Nothing happens (it compiles and run as before)

Have you also updated your ruleset so that some road type is marked as being compatibility version of Maglev special (that's what compat_special is supposed to mean; compatibility with older freeciv version where the road types were specials)? "

In ruleset.c i copy/pasted a bloc and substituted rail for maglev I did not touch any*.ruleset , only .c

3/ I found that the callback is not reached when the keys are pressed (but it is ok for for road or rail).

in menu.c

static void connect_rail_callback(GtkMenuItem *action, gpointer data)
   Rail is OK
static void connect_maglev_callback(GtkMenuItem *action, gpointer data)
   We never get here 

4/ I added an entry in the Work menu, and it shown disabled, in light-grey so i cannot test like this.

2021-04-13 02:46 更新者: alain_bkr
  • 添付ファイル broken_2_connect_maglev.patch (File ID: 6516) が付加されました
2021-04-13 02:49 更新者: cazfi
コメント

Reply To alain_bkr

I did not touch any*.ruleset , only .c

So you have no road type for which this would apply.

2021-04-13 02:52 更新者: alain_bkr
  • 添付ファイル broken_2_connect_maglev.patch (File ID: 6516) が削除されました
2021-04-13 05:41 更新者: alain_bkr
コメント

I don't understand what i should do to *.ruleset or anything else. maglev is already defined in civ2civ3/terrain.ruleset

I don't get how GUI_gkt3.22 works, and how KEY_E should call the callback i added.

2021-04-13 05:45 更新者: alain_bkr
  • 詳細が更新されました
  • 概要が更新されました
2021-04-13 05:48 更新者: cazfi
  • 詳細が更新されました
  • 概要が更新されました
コメント

Reply To alain_bkr

I don't understand what i should do to *.ruleset or anything else. maglev is already defined in civ2civ3/terrain.ruleset

But for that maglev there is no compat_special defined, so it uses default of "None". Your modification to ruleset.c is that you consider road types with the new compat_special value "Maglev" ones that should be handled by your new key.
2021-04-13 21:07 更新者: alain_bkr
  • 詳細が更新されました
  • 概要が更新されました
コメント

ok, thanks, i missed this.

A patch, for gtk_3.22 , with Key_E for connect_maglev , and an entry in the menu "Work"

It works for me, either on a fresh land or one with mixed nothing/road/rails.

It seems the save/load can handle this without problem , i used a previous game for the tests.

2021-04-14 16:40 更新者: alain_bkr
  • 添付ファイル broken_connect_maglev.patch (File ID: 6515) が削除されました
2021-04-17 07:29 更新者: cazfi
2021-05-01 01:56 更新者: chippo
コメント

Your patch applies, compiles and works sweetly. I see why you couldn't use shift-E (airbases). It even has a menu entry and control help (E). And maglev waypoints work too. Cool! One thing it's missing is two more lines of text in Help->Controls.

I'm definitely switching back to gtk client when I've got large maglev instructions to issue - which is now in this current game. Any plans to port your code to qt and sdl2 clients?

2021-05-01 02:38 更新者: cazfi
コメント

Word of warning: While the patch should be fine for anyone's private use, it's unlikely to make it to official freeciv distribution. It's extending backward compatibility hack we should be getting rid of instead, to something where it's not even about backward compatibility any more. It's specific to some rulesets with specific road type (it handles Maglev in some rulesets, but what about Canals and Highways seen in some of the existing rulesets, not to mention several alien ruleset road types, or any other road types in any potential rulesets?)

That said, we have a real issue to solve, and if we can't get come up with any proper solution (ruleset specific keys development has been on hold for years), we may need to compromise and adopt solution a bit like this.

2021-05-01 04:03 更新者: chippo
コメント

Reply To cazfi

it's unlikely to make it to official freeciv distribution.

Such a shame. Now it's painful building maglevs a tile-at-a-time, again. I shouldn't have tried that patch.

2022-05-07 01:00 更新者: alain_bkr
コメント

Just a word to refresh the ticket.

What is needed ?

  • for 3.0.x
  • for 3.1 and later (which changes some shortcuts a t least with gtk3.22 client)

Is it possible to have one solution for 3.0 (= the patch) and another solution for 3.1 and later ?

2022-05-07 01:11 更新者: cazfi
コメント

Reply To alain_bkr

What is needed ?

An idea how to do that properly would be a good start.

I should find some jtn's old draft patches about generic / customizable keybindings for an inspiration.

2022-05-07 01:59 更新者: cazfi
コメント

Well, making some decisions about this is really urgent at the moment. We've just entered S3_1 semi-d3f, and about any solution to this would require adding something to ruleset format.

--

- I dislike proposed patch in that it just adds bandaid for one road type and not overall solution for all of them, is extending a concept that we should be deprecating instead, and is likely to cause problems (how to migrate away from it) in the future
- However, that one road type is more important in current real-life rulesets (even in supplied ones) than any other one suffering from the same problem, so having special support for it would make sense
- We're certainly not getting any better solution in time to 3.1 (as we are in semi-d3f, one could say that deadline was last week), so it's either we take this solution or leave the problem in to freeciv-3.1
- Taking it in at this point would require reopening semi-d3f. Alpha3 is not yet out, so we have not yet published current formats as the d3f proposal. Some test runs towards alpha3 have been running already, and those may need to be rerun if we do the change

--

So, yeah, I'm at least preparing for the chance that we take it to S3_1 (will make a bit more in-depth review of the patch during this weekend)

2022-05-07 21:01 更新者: cazfi
コメント

Investigating it more, my dislike about adding something that's neither former special, nor has anything to do with comp)atibility with then, to "compat_special" list has only increased.

So I'm for making a bit bigger change after all, though I'm not sure if this new plan is future-proof either. Add new gui_type (base types already have similar concept) field for roads -> #44539

2022-05-07 21:34 更新者: cazfi
  • マイルストーン(未割り当て) から 3.1.0 (完了済み) に更新されました
  • コンポーネント(未割り当て) から Client common に更新されました
2022-05-12 02:00 更新者: cazfi
コメント

Reply To cazfi

Add new gui_type (base types already have similar concept) field for roads -> #44539

So now that ruleset change is in (so d3f is not blocked any more), but client functionality to handle the new "Maglev" gui_type (this ticket) has not been added. Parts of the existing patch are likely still usable for this implementation.

2022-05-26 04:39 更新者: cazfi
コメント

Reply To alain_bkr

A patch

Can you rework this to use the new road gui_type? The "Maglev" value for it already exist, so only the client part should be needed.

2022-06-18 15:55 更新者: cazfi
コメント

It would be nice to have this implemented and tested before S3_1-d3f, so that we see that the the ruleset format part used has no issues.

2022-10-08 16:41 更新者: cazfi
コメント

About the key selection: #45797

2022-10-08 17:25 更新者: cazfi
コメント

Key selection ticket that is direct dependency for this functionality: #45800

2022-11-21 13:56 更新者: cazfi
コメント

Reply To cazfi

Key selection ticket that is direct dependency for this functionality: #45800

Qt: #46084

2022-11-23 09:34 更新者: cazfi
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法なし から 受領 に更新されました
コメント

Attached patch implements this with <ctrl>m for gtk3.22-client, qt-client, and in case of S3_1 also for gtk3-client.

2022-11-26 18:57 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

添付ファイルリスト

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする