-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1db9f4c
Showing
9 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2016 avosirenfal | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# What does this mod do? | ||
|
||
This mod just adds a trashcan icon in the top left that deletes items dropped on it. Starting pistol? DELETED. Useless stack of base inserters? DELETED. | ||
|
||
**This is an updated version of "Just a trash bin" by Space. He seems to be inactive, if he returns I'll be happy to let him take over maintenance of this mod. [Original thread](https://forums.factorio.com/viewtopic.php?f=87&t=8392)** |
This file contains 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pcall(function() | ||
require "defines" | ||
end) | ||
|
||
script.on_event(defines.events.on_gui_click, function(event) | ||
local elem= event.element | ||
if elem.name == "trashbinguibutton" then | ||
local player = game.players[event.element.player_index] | ||
if (player) then | ||
--player.cursor_stack = nil | ||
if(player.cursor_stack ~= nil) then | ||
player.cursor_stack.clear() | ||
end | ||
end | ||
end | ||
end) | ||
|
||
script.on_event(defines.events.on_player_created, function(event) | ||
local player = game.players[event.player_index] | ||
if (player.gui.top.trashbingui ~= nil) then | ||
player.gui.top.trashbingui.destroy() | ||
end | ||
player.gui.top.add({ name="trashbingui", type="frame", direction="vertical", style = "trashbin-frame"}) | ||
player.gui.top.trashbingui.add({ name="trashbinguibutton", type="button", style = "trashbin-button"}) | ||
end) | ||
|
||
script.on_init(function() | ||
for k,v in pairs(game.players) do | ||
local player = game.players[v.name] | ||
if (player.gui.top.trashbingui == nil) then | ||
player.gui.top.add({ name="trashbingui", type="frame", direction="vertical", style = "trashbin-frame"}) | ||
player.gui.top.trashbingui.add({ name="trashbinguibutton", type="button", style = "trashbin-button"}) | ||
end | ||
end | ||
end) |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
require("prototypes.style") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "Trashcan", | ||
"version": "1.0.0", | ||
"title": "Trashcan", | ||
"author": "Sirenfal and Space", | ||
"description": "Adds a trash bin icon in the top left that deletes items dropped on it", | ||
"dependencies": ["base >= 0.14.0"], | ||
"factorio_version": "0.14.0" | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
data.raw["gui-style"]["default"]["trashbin-frame"] = | ||
{ | ||
type = "frame_style", | ||
font = "default-frame", | ||
font_color = {r=1, g=1, b=1}, | ||
bottom_padding = 3, | ||
right_padding = 2, | ||
graphical_set = | ||
{ | ||
type = "composition", | ||
filename = "__core__/graphics/gui.png", | ||
priority = "extra-high-no-scale", | ||
corner_size = {1, 1}, | ||
position = {3, 3} | ||
}, | ||
flow_style= | ||
{ | ||
horizontal_spacing = 0, | ||
vertical_spacing = 0 | ||
} | ||
} | ||
data.raw["gui-style"]["default"]["trashbin-button"] = | ||
{ | ||
type = "button_style", | ||
-- align = "center", | ||
bottom_padding = 3, | ||
right_padding = 2, | ||
width = 31, | ||
height = 32, | ||
font = "default-button", | ||
default_font_color={r=1, g=0, b=0}, | ||
default_graphical_set = | ||
{ | ||
type = "monolith", | ||
top_monolith_border = 0, | ||
right_monolith_border = 0, | ||
bottom_monolith_border = 0, | ||
left_monolith_border = 0, | ||
monolith_image = | ||
{ | ||
filename = "__Trashcan__/graphics/bin-closed-icon.png", | ||
width = 31, | ||
height = 32, | ||
x = 0, | ||
y = 0 | ||
} | ||
}, | ||
hovered_graphical_set = | ||
{ | ||
type = "monolith", | ||
top_monolith_border = 0, | ||
right_monolith_border = 0, | ||
bottom_monolith_border = 0, | ||
left_monolith_border = 0, | ||
monolith_image = | ||
{ | ||
filename = "__Trashcan__/graphics/bin-empty-icon.png", | ||
width = 31, | ||
height = 32, | ||
x = 0, | ||
y = 0 | ||
} | ||
}, | ||
clicked_graphical_set = | ||
{ | ||
type = "monolith", | ||
top_monolith_border = 0, | ||
right_monolith_border = 0, | ||
bottom_monolith_border = 0, | ||
left_monolith_border = 0, | ||
monolith_image = | ||
{ | ||
filename = "__Trashcan__/graphics/bin-icon.png", | ||
width = 31, | ||
height = 32, | ||
x = 0, | ||
y = 0 | ||
} | ||
}, | ||
} | ||
data.raw["gui-style"]["default"]["trashbin-label"] = | ||
{ | ||
type = "label_style", | ||
font = "default", | ||
font_color = {r=1, g=0, b=0}, | ||
} |