-
Notifications
You must be signed in to change notification settings - Fork 493
orders: add search overlay for manager orders #5677
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
Open
pajawojciech
wants to merge
33
commits into
DFHack:develop
Choose a base branch
from
pajawojciech:orders-search
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+366
−1
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
71a1a32
orders: add search overlay for manager orders
pajawojciech cfaa140
Fix trailing whitespace
pajawojciech 16ab556
Newline at the end
pajawojciech e368607
orders: load cache reaction map on init
pajawojciech b46eb7f
Add Enter/Shift+Enter navigation and refactor jump to match
pajawojciech cde1477
Hide search highlight when filter text changes
pajawojciech 7fa03fb
Use full_interface for OrderHighlightOverlay to prevent repositioning
pajawojciech c163d3c
Hide highlight when order list changes
pajawojciech f37e46a
Consolidate onRenderFrame into render method
pajawojciech 506ca40
Use utils.search_text instead of custom search
pajawojciech 7fabf2b
Force new version of overlay position
pajawojciech 2cbf2d7
Narrow search overlay and adjust button positions
pajawojciech 1f2705d
Reshape arrow and contrasting colors
pajawojciech 0650a74
Merge branch 'develop' into orders-search
pajawojciech 93f6b1c
Hide overlay when job_details is open. Add author
pajawojciech b184150
Merge branch 'orders-search' of github.com:pajawojciech/dfhack into o…
pajawojciech 6bd16ad
Remove trailing spaces
pajawojciech d8eb61e
Rebuild manager order search results on every navigation to fix stale…
pajawojciech 860a2a1
Consolidate search state variables in OrdersSearchOverlay section to …
pajawojciech ab257aa
Guard get_order_search_key against nil reaction map and return nil fo…
pajawojciech 3a727a0
Remove unused cached variables from OrderHighlightOverlay init
pajawojciech d3d7067
Convert OrderHighlightOverlay constants from instance fields to modu…
pajawojciech 2cd1c6e
Use early return guard for search cursor visibility in OrderHighlight…
pajawojciech d605165
Add unconditional super render call to OrderHighlightOverlay for futu…
pajawojciech 14f46c8
Inline build_reaction_map into get_cached_reaction_map with early ret…
pajawojciech 1bdd533
Free C++ manager_order objects allocated by collect_reactions to prev…
pajawojciech 7aa13f8
Merge branch 'develop' into orders-search
pajawojciech da543e9
Merge branch 'develop' into orders-search
pajawojciech c4e84d7
Refactor overlay helper functions to local scope in orders.lua
pajawojciech c474f75
Remove order name generation from Lua and use DF button trick to get …
pajawojciech 9c9b5fd
Merge branch 'DFHack:develop' into orders-search
pajawojciech 99d0126
Enable orders search overlay by default
pajawojciech b9c82f6
Move change in changelog to future
pajawojciech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ distribution. | |
| #include "df/job_list_link.h" | ||
| #include "df/job_postingst.h" | ||
| #include "df/job_restrictionst.h" | ||
| #include "df/manager_order.h" | ||
| #include "df/plotinfost.h" | ||
| #include "df/specific_ref.h" | ||
| #include "df/unit.h" | ||
|
|
@@ -686,3 +687,29 @@ std::string Job::getName(df::job *job) | |
|
|
||
| return desc; | ||
| } | ||
|
|
||
| std::string Job::getManagerOrderName(df::manager_order *order) | ||
| { | ||
| CHECK_NULL_POINTER(order); | ||
|
|
||
| std::string desc; | ||
| auto button = df::allocate<df::interface_button_building_new_jobst>(); | ||
| button->mstring = order->reaction_name; | ||
| button->specdata.hist_figure_id = order->specdata.hist_figure_id; | ||
| button->jobtype = order->job_type; | ||
| button->itemtype = order->item_type; | ||
| button->subtype = order->item_subtype; | ||
| button->material = order->mat_type; | ||
| button->matgloss = order->mat_index; | ||
| button->specflag = order->specflag; | ||
| button->job_item_flag = order->material_category; | ||
| button->specdata = order->specdata; | ||
| button->art_specifier = order->art_spec.type; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't in If so, maybe I didn't notice any orders that seemed to incorporate |
||
| button->art_specifier_id1 = order->art_spec.id; | ||
| button->art_specifier_id2 = order->art_spec.subid; | ||
|
|
||
| button->text(&desc); | ||
| delete button; | ||
|
|
||
| return desc; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For confirmation by someone that works more on the C++ side:
This may not be necessary since
specdatais copied as a whole later?It seemed to work for me when I leaving this one off (copying one of them was definitely needed for some orders (e.g. differently-sized clothes)).