Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ruleset-defined custom actions in client #937

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

ec429
Copy link
Contributor

@ec429 ec429 commented Mar 6, 2022

User Action 1 through 3 may be defined by the ruleset, allow ordering
them through the action selection dialog.
Action Target Kind depends on the ruleset, so dispatch on it at
runtime to determine the semantics of qv2.

Closes #936.

Copy link
Contributor

@lmoureaux lmoureaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to game.ruleset in classic:

; Blank ruleset defined user actions.
; See the section "Ruleset defined actions" is doc/README.actions
; Example: set up "User Action 1"
ui_name_user_action_1                = _("%sDisrupt Supply Lines%s")
user_action_1_target_kind            = "tiles"
user_action_1_min_range              = 1
user_action_1_max_range              = 3
user_action_1_actor_consuming_always = FALSE

[actionenabler_user_1]
action = "User Action 1"

-> it works.

Some functions are crying for a docstring and I don't want them to feel lonely in the code. Since this is C++, user_action_N could have been a template but it's fine as it is.

client/gui-qt/dialogs.cpp Outdated Show resolved Hide resolved
User Action 1 through 3 may be defined by the ruleset, allow ordering
 them through the action selection dialog.
Action Target Kind depends on the ruleset, so dispatch on it at
 runtime to determine the semantics of qv2.

Closes longturn#936.
@lmoureaux lmoureaux enabled auto-merge (rebase) March 18, 2022 22:49
@lmoureaux lmoureaux merged commit a0c3dcc into longturn:master Mar 18, 2022
@ec429 ec429 deleted the useract branch March 18, 2022 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qt client does not support User Actions
2 participants