Ticket #41990

Client : need a shortcut Key_E for connect_maglev

오픈 날짜: 2021-04-12 15:04 마지막 업데이트: 2022-11-26 18:57

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
4

Details

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.

Ticket History (3/36 Histories)

2021-04-12 15:04 Updated by: alain_bkr
  • New Ticket "Client : need a shortcut Shift-M for Maglev" created
2021-04-12 20:59 Updated by: chippo
댓글 올리기

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

2021-04-12 21:10 Updated by: 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 Updated by: 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 Updated by: alain_bkr
  • File broken_connect_maglev.patch (File ID: 6515) is attached
2021-04-13 00:32 Updated by: 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 Updated by: 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 Updated by: alain_bkr
  • File broken_2_connect_maglev.patch (File ID: 6516) is attached
2021-04-13 02:49 Updated by: 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 Updated by: alain_bkr
  • File broken_2_connect_maglev.patch (File ID: 6516) is deleted
2021-04-13 05:41 Updated by: 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 Updated by: alain_bkr
  • Details Updated
  • Summary Updated
2021-04-13 05:48 Updated by: cazfi
  • Details Updated
  • Summary Updated
댓글 올리기

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 Updated by: alain_bkr
  • Details Updated
  • Summary Updated
댓글 올리기

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 Updated by: alain_bkr
  • File broken_connect_maglev.patch (File ID: 6515) is deleted
2021-04-17 07:29 Updated by: cazfi
2021-05-01 01:56 Updated by: 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 Updated by: 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 Updated by: 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 Updated by: 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 Updated by: 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 Updated by: 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 Updated by: 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 Updated by: cazfi
  • Milestone Update from (None) to 3.1.0 (closed)
  • Component Update from (None) to Client common
2022-05-12 02:00 Updated by: 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 Updated by: 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 Updated by: 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 Updated by: cazfi
댓글 올리기

About the key selection: #45797

2022-10-08 17:25 Updated by: cazfi
댓글 올리기

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

2022-11-21 13:56 Updated by: cazfi
댓글 올리기

Reply To cazfi

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

Qt: #46084

2022-11-23 09:34 Updated by: cazfi
  • 소유자 Update from (None) to cazfi
  • Resolution Update from None to Accepted
댓글 올리기

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 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Attachment File List

Edit

Please login to add comment to this ticket » Login