Skip to content

Commit

Permalink
Add a keyboard shortcut to get the YARM selector
Browse files Browse the repository at this point in the history
Defaults to Alt+R
  • Loading branch information
narc0tiq committed Mar 23, 2019
1 parent 7add0d2 commit 8360aec
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
5 changes: 3 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---------------------------------------------------------------------------------------------------
Version: 0.8.0
Date: 2019-03-22
Version: 0.8.1
Date: 2019-03-23
Features:
- Add a change log (you're looking at it!)
- Remove the resource monitor technology, recipe, and item
- Add a shortcut button with a blueprint-like selection tool -- this replaces the resource monitor item
- Add a shortcut key for the selection tool (default Alt+R)
- Remove remote viewer entities. If you're currently remote viewing, you should be returned to your real character during the migration
- Viewing a site now opens the map to the site's center (zoomed to world if radar available)
- Renaming can now be cancelled with Esc key
Expand Down
5 changes: 5 additions & 0 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ script.on_event(defines.events.on_gui_closed, function(event)
if err then msg_all({"YARM-err-specific", "on_gui_closed", err}) end
end)

script.on_event("get-yarm-selector", function(event)
local _, err = pcall(resmon.on_get_selection_tool, event)
if err then msg_all({"YARM-err-specific", "on_get_selection_tool", err}) end
end)

script.on_event(defines.events.on_player_selected_area, function(event)
local _, err = pcall(resmon.on_player_selected_area, event)
if err then msg_all{"YARM-err-specific", "on_player_selected_area", err} end
Expand Down
Binary file removed graphics/yarm-tech.png
Binary file not shown.
8 changes: 7 additions & 1 deletion locale/en/base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ YARM-site-rename-cancel=No, wait, nevermind
[entity-name]
rm_overlay=Resource Overlay
[item-name]
yarm-selector-tool=Resource monitor
[item-description]
yarm-selector-tool=Don't use this on your hotbar filter, it won't work. Instead, use it from the shortcut bar (or keyboard shortcut).
[shortcut-name]
yarm-selector=Resource monitor marker
yarm-selector=Resource monitor
[mod-setting-name]
YARM-ticks-between-checks=Ticks between resource updates
Expand Down
7 changes: 7 additions & 0 deletions prototypes/prototypes.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
data:extend(
{
{
type = 'custom-input',
name = 'get-yarm-selector',
key_sequence = 'ALT + R',
consuming = 'none'
},

{
type = "shortcut",
name = "yarm-selector",
Expand Down
5 changes: 5 additions & 0 deletions resmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,11 @@ function resmon.pull_YARM_item_to_cursor_if_possible(player_index)
end


function resmon.on_get_selection_tool(event)
resmon.pull_YARM_item_to_cursor_if_possible(event.player_index)
end


function resmon.start_recreate_overlay_existing_site(player_index)
local site = global.player_data[player_index].current_site
site.is_overlay_being_created = true
Expand Down

0 comments on commit 8360aec

Please sign in to comment.