Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0bebedf09b | |||
| 4bf7bf8333 | |||
| d60715fdd7 | |||
| e7d44327e8 | |||
| fd7ab16354 | |||
| 18299fd3f5 | |||
| 9d8443c9b2 | |||
| be669f7b3e | |||
| e49a69058b | |||
| bf22a80ca9 | |||
| 14eec22025 | |||
| 6290cf9647 | |||
| 2aa09fba3d | |||
| ed398933ac | |||
| acbee5c1e7 | |||
| f33d7a6f1b | |||
| 8e126bee36 | |||
| 59d19f1dd1 | |||
| 68503cbf0e | |||
| 1a7717e03a | |||
| e619083b57 |
@@ -1 +1,2 @@
|
||||
*.zip
|
||||
.vscode/*
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ CREDITS
|
||||
|
||||
All code and graphics created by Deadlock989, with the following exceptions.
|
||||
|
||||
Code and graphics modifications after 2020-04-08 by Wyrrrd.
|
||||
Code and graphics modifications after 2020-04-08 by Wyrrrd, ickputzdirwech, Friendch, dwightkung and Deadlock989.
|
||||
For the latest unmodified version, see https://github.com/Wyrrrd/IndustrialDisplayPlates/tree/cd8778eb3b11f8bde5418088253123b1029dc461
|
||||
|
||||
Sounds by thomasevd and Raclure @ freesound.org.
|
||||
|
||||
Thanks to TheStaplergun for getting me started on GUIs and to others for scripting help.
|
||||
Thanks to TheStaplergun for getting me started on GUIs and to others for scripting help.
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
⚠ **This repository is archived.** ⚠
|
||||
|
||||
Though I have had great plans with this mod, I cannot find the time to maintain it properly. Luckily, the mod will not die, you can migrate to [Flydiverny's fork](https://github.com/Flydiverny/IndustrialDisplayPlates). I will try to merge the new features and fixes over to their fork in the meantime...
|
||||
|
||||
# Industrial Display Plates
|
||||
<img src="https://raw.githubusercontent.com/Wyrrrd/IndustrialDisplayPlates/master/thumbnail.png" width="128" height="128">
|
||||
<img src="https://raw.githubusercontent.com/Wyrrrd/IndustrialDisplayPlates/master/thumbnail.png" width="144" height="144">
|
||||
|
||||
### Features
|
||||
Big, medium and small signs to display item and fluid icons. Can be used to blueprint map markers.
|
||||
Big, medium and small signs to display item, fluid and signal icons. Can be used to blueprint map markers.
|
||||
|
||||
### Locale
|
||||
If you want to contribute by translating this mod, you can view the existing translations [here](https://github.com/Wyrrrd/IndustrialDisplayPlates/tree/master/locale). I'd be happy to add your language and credits to the next release.
|
||||
|
||||
### Credits
|
||||
Thanks to [Deadlock989](https://mods.factorio.com/user/Deadlock989) for the [original mod](https://mods.factorio.com/mod/IndustrialDisplays).
|
||||
Sounds by thomasevd and Raclure on freesound.org.
|
||||
Thanks to [Deadlock989](https://mods.factorio.com/user/Deadlock989) for the [original mod](https://mods.factorio.com/mod/IndustrialDisplays).
|
||||
Sounds by thomasevd and Raclure on freesound.org.
|
||||
Thanks to [Friendch](https://mods.factorio.com/user/Friendch) for the french translation.
|
||||
Thanks to [dwightkung](https://github.com/dwightkung) for the simplified chinese translation.
|
||||
|
||||
@@ -1,4 +1,42 @@
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.6
|
||||
Date: 2023-04-10
|
||||
Changes:
|
||||
- Add deprecation info
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.5
|
||||
Date: 2023-03-15
|
||||
Locale:
|
||||
- Added simplified Chinese translation (thanks to dwightkung)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.4
|
||||
Date: 2021-09-07
|
||||
Bugfixes:
|
||||
- fixed crash and unwanted behaviour introduced with last release
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.3
|
||||
Date: 2021-09-06
|
||||
Bugfixes:
|
||||
- Implemented controlled error message for blueprint update bug in factorio to avoid crash
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.2
|
||||
Date: 2021-08-21
|
||||
Changes:
|
||||
- Made virtual signals available (snouz)
|
||||
- Softer map ping sound
|
||||
Locale:
|
||||
- Adjusted French translation
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.1
|
||||
Date: 2021-08-08
|
||||
Locale:
|
||||
- Added French translation (thanks to Friendch)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.0
|
||||
Date: 2020-12-02
|
||||
Changes:
|
||||
- Version bump for base game 1.1
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.18.5
|
||||
Date: 2020-11-23
|
||||
Bugfixes:
|
||||
|
||||
+70
-19
@@ -37,16 +37,18 @@ end
|
||||
|
||||
local function add_map_marker(entity, icon_type, icon_name)
|
||||
if icon_type and icon_name then
|
||||
entity.force.add_chart_tag(entity.surface, { icon = { type = icon_type, name = icon_name}, position = entity.position })
|
||||
local map_type = (icon_type == "virtual-signal") and "virtual" or icon_type
|
||||
entity.force.add_chart_tag(entity.surface, { icon = { type = map_type, name = icon_name}, position = entity.position })
|
||||
entity.surface.play_sound{path = "map-marker-ping", position = entity.position, volume_modifier = 1}
|
||||
end
|
||||
end
|
||||
|
||||
local function change_map_markers(entity, icon_type, icon_name)
|
||||
local map_type = (icon_type == "virtual-signal") and "virtual" or icon_type
|
||||
local markers = get_map_markers(entity)
|
||||
if markers then
|
||||
for _,marker in pairs(markers) do
|
||||
marker.icon = { type = icon_type, name = icon_name}
|
||||
marker.icon = { type = map_type, name = icon_name}
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -63,7 +65,7 @@ local function remove_markers(entity)
|
||||
end
|
||||
end
|
||||
|
||||
local function find_entity_render(entity)
|
||||
local function find_entity_render(entity)
|
||||
for _,id in pairs(rendering.get_all_ids(DID.mod_name)) do
|
||||
if rendering.get_target(id).entity == entity then return id end
|
||||
end
|
||||
@@ -74,7 +76,7 @@ local function get_render_sprite_info(entity)
|
||||
local id = find_entity_render(entity)
|
||||
if id then
|
||||
local strings = splitstring(rendering.get_sprite(id), "/")
|
||||
if #strings == 2 then return strings[1], strings[2] end
|
||||
return strings[1], strings[2], strings[1] == 'virtual-signal' and 'virtual' or strings[1]
|
||||
end
|
||||
return nil, nil
|
||||
end
|
||||
@@ -152,10 +154,10 @@ local function display_filter_tabs(player,filter)
|
||||
local name = splitstring(tab.tab.name,":")
|
||||
end
|
||||
tabs.selected_tab_index = selected or 1 -- end of shenanigans
|
||||
if textfield.visible then textfield.focus() end -- fix textfield focus
|
||||
if textfield.visible then textfield.focus() end -- fix textfield focus
|
||||
end
|
||||
|
||||
local function toggle_search(player,element,override)
|
||||
local function toggle_search(player,element,override)
|
||||
local textfield = player.gui.screen[DID.custom_gui]["display-header"]["display-search-textfield"]
|
||||
if textfield then
|
||||
textfield.visible = override or not textfield.visible
|
||||
@@ -198,7 +200,7 @@ local display_gui_click = {
|
||||
end,
|
||||
["display-map-marker"] = function (event)
|
||||
local last_display = get_global_player_info(event.player_index,"last_display")
|
||||
if last_display then
|
||||
if last_display then
|
||||
if get_has_map_marker(last_display) then
|
||||
event.element.style = "display_small_button"
|
||||
remove_markers(last_display)
|
||||
@@ -251,7 +253,7 @@ local function gui_click(event)
|
||||
frame.destroy()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
-- is there a method for this element?
|
||||
local clicked = splitstring(event.element.name,":")
|
||||
if display_gui_click[clicked[1]] then
|
||||
@@ -266,16 +268,16 @@ local function create_display_gui(player, selected)
|
||||
|
||||
-- cache which entity this gui belongs to
|
||||
set_global_player_info(player.index,"last_display",selected)
|
||||
|
||||
|
||||
-- close any existing gui
|
||||
local frame = player.gui.screen[DID.custom_gui]
|
||||
if frame then frame.destroy() end
|
||||
player.opened = player.gui.screen
|
||||
|
||||
|
||||
-- get markers and currently rendered sprite
|
||||
local markers = next(get_map_markers(selected)) ~= nil
|
||||
local sname, stype = get_render_sprite_info(selected)
|
||||
local render_sprite = (sname and stype) and sname.."/"..stype or nil
|
||||
local render_sprite = (sname and stype) and sname.."/"..stype or nil
|
||||
|
||||
-- create frame
|
||||
frame = player.gui.screen.add {
|
||||
@@ -284,7 +286,7 @@ local function create_display_gui(player, selected)
|
||||
direction = "vertical",
|
||||
style = "display_frame",
|
||||
}
|
||||
|
||||
|
||||
-- update frame location if cached
|
||||
if get_global_player_info(player.index,"display_gui_location") then
|
||||
frame.location = get_global_player_info(player.index,"display_gui_location")
|
||||
@@ -300,7 +302,7 @@ local function create_display_gui(player, selected)
|
||||
}
|
||||
header.style.bottom_padding = -4
|
||||
header.style.horizontally_stretchable = true
|
||||
|
||||
|
||||
-- title
|
||||
header.add {
|
||||
type = "label",
|
||||
@@ -370,14 +372,21 @@ local function create_display_gui(player, selected)
|
||||
type = "tabbed-pane",
|
||||
style = "display_tabbed_pane",
|
||||
}
|
||||
|
||||
|
||||
-- build a table of info about existing items/fluids
|
||||
-- groups of subgroups of sprites -> localised_string
|
||||
local button_table = {}
|
||||
for prototype_type,prototypes in pairs(DID.elem_prototypes) do
|
||||
for _,prototype in pairs(game[prototypes]) do
|
||||
if not DID.displays[prototype.name] and not ((prototype_type == "item" and prototype.has_flag("hidden")) or (prototype_type == "fluid" and prototype.hidden)) then
|
||||
local group = (prototype.group.name == "fluids") and "intermediate-products" or prototype.group.name
|
||||
local group = ""
|
||||
if prototype_type == "virtual-signal" then
|
||||
group = prototype.subgroup.group.name
|
||||
elseif prototype_type == "fluids" then
|
||||
group = "intermediate-products"
|
||||
else
|
||||
group = prototype.group.name
|
||||
end
|
||||
if not DID.group_blacklist[group] then
|
||||
if button_table[group] == nil then button_table[group] = {} end
|
||||
if button_table[group][prototype.subgroup.name] == nil then button_table[group][prototype.subgroup.name] = {} end
|
||||
@@ -386,7 +395,7 @@ local function create_display_gui(player, selected)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- determine the biggest tab size
|
||||
local max_rows = 0
|
||||
for group,subgroups in pairs(button_table) do
|
||||
@@ -396,7 +405,7 @@ local function create_display_gui(player, selected)
|
||||
end
|
||||
max_rows = math.max(rows,max_rows)
|
||||
end
|
||||
|
||||
|
||||
-- set up tabs
|
||||
local tab_index = 1
|
||||
for group,subgroups in pairs(button_table) do
|
||||
@@ -448,7 +457,7 @@ local function create_display_gui(player, selected)
|
||||
end
|
||||
tab_index = tab_index + 1
|
||||
end
|
||||
|
||||
|
||||
-- make all tabs as big as biggest
|
||||
for _,tab in pairs(display_tabs.tabs) do
|
||||
tab.content.style.height = math.min(640, max_rows * 40)
|
||||
@@ -469,6 +478,33 @@ local function set_up_display_from_ghost(entity,tags)
|
||||
end
|
||||
end
|
||||
|
||||
remote.add_interface(
|
||||
"IndustrialDisplayPlates",
|
||||
{
|
||||
get_sprite = function(event)
|
||||
if event and event.entity and event.entity.valid then
|
||||
local spritetype, spritename = get_render_sprite_info(event.entity)
|
||||
return {spritetype=spritetype, spritename=spritename}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end,
|
||||
|
||||
set_sprite = function(event)
|
||||
if event and event.entity and event.entity.valid and event.sprite and game.is_valid_sprite_path(event.sprite) then
|
||||
destroy_render(event.entity)
|
||||
render_overlay_sprite(event.entity, event.sprite)
|
||||
if get_has_map_marker(event.entity) then
|
||||
local spritetype, spritename = get_render_sprite_info(event.entity)
|
||||
change_map_markers(event.entity, spritetype, spritename)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
-- local function reset_globals()
|
||||
-- global.translations = nil
|
||||
-- end
|
||||
@@ -506,7 +542,7 @@ script.on_event("deadlock-open-gui", function(event)
|
||||
local player = game.players[event.player_index]
|
||||
if player.cursor_stack and player.cursor_stack.valid_for_read then return end
|
||||
local selected = player and player.selected
|
||||
if selected and selected.valid and is_a_display(selected) then
|
||||
if selected and selected.valid and is_a_display(selected) then
|
||||
if player.can_reach_entity(selected) then
|
||||
create_display_gui(player, selected)
|
||||
else
|
||||
@@ -543,10 +579,18 @@ script.on_event(defines.events.on_player_setup_blueprint, function (event)
|
||||
local blueprint = nil
|
||||
if player and player.blueprint_to_setup and player.blueprint_to_setup.valid_for_read then blueprint = player.blueprint_to_setup
|
||||
elseif player and player.cursor_stack.valid_for_read and player.cursor_stack.name == "blueprint" then blueprint = player.cursor_stack end
|
||||
|
||||
if blueprint then
|
||||
for index,entity in pairs(event.mapping.get()) do
|
||||
local stype,sname = get_render_sprite_info(entity)
|
||||
if stype and sname then
|
||||
|
||||
-- Workaround for blueprint update bug
|
||||
if blueprint.get_blueprint_entity_count() == 0 then
|
||||
player.print({"display-plates.blueprint-wont-have-icons"})
|
||||
return
|
||||
end
|
||||
|
||||
blueprint.set_blueprint_entity_tag(index, "display-plate-sprite-type", stype)
|
||||
blueprint.set_blueprint_entity_tag(index, "display-plate-sprite-name", sname)
|
||||
blueprint.set_blueprint_entity_tag(index, "display-plate-sprite-map-marker", get_has_map_marker(entity))
|
||||
@@ -569,6 +613,13 @@ script.on_event(defines.events.on_player_changed_position, function (event)
|
||||
gui_close(event)
|
||||
end
|
||||
end
|
||||
|
||||
-- mod migration info
|
||||
local mod_migration_info = get_global_player_info(event.player_index, "mod_migration_info")
|
||||
if not mod_migration_info then
|
||||
player.print({"", "[img=entity.copper-display] ",{"display-plates.mod-migration-info"}})
|
||||
set_global_player_info(event.player_index, "mod_migration_info", true)
|
||||
end
|
||||
end)
|
||||
|
||||
script.on_event(defines.events.on_gui_text_changed, function(event)
|
||||
|
||||
@@ -60,7 +60,7 @@ for display,displaydata in pairs(DID.displays) do
|
||||
result = display,
|
||||
},
|
||||
max_health = 10 + size * 30,
|
||||
flags = {"placeable-player", "placeable-neutral", "player-creation"},
|
||||
flags = {"placeable-player", "placeable-neutral", "player-creation", "not-rotatable"},
|
||||
collision_box = { {-box_size+0.1, -box_size+0.1}, {box_size-0.1, box_size-0.1} },
|
||||
selection_box = { {-box_size, -box_size}, {box_size, box_size} },
|
||||
collision_mask = {
|
||||
|
||||
@@ -54,9 +54,11 @@ return {
|
||||
elem_prototypes = {
|
||||
item = "item_prototypes",
|
||||
fluid = "fluid_prototypes",
|
||||
["virtual-signal"] = "virtual_signal_prototypes",
|
||||
},
|
||||
group_blacklist = {
|
||||
["creative-mod_creative-tools"] = true,
|
||||
["other"] = true,
|
||||
},
|
||||
icon_size = 64,
|
||||
icon_mipmaps = 4,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "IndustrialDisplayPlates",
|
||||
"version": "0.18.5",
|
||||
"version": "1.1.6",
|
||||
"title": "Industrial Display Plates",
|
||||
"author": "Wyrrrd",
|
||||
"homepage": "https://github.com/Wyrrrd/IndustrialDisplayPlates",
|
||||
"dependencies": [
|
||||
"base >= 0.18.27",
|
||||
"base >= 1.1.0",
|
||||
"(?)IndustrialRevolution"
|
||||
],
|
||||
"description": "Big, medium and small signs which display item and fluid icons. Can be used to blueprint map markers.",
|
||||
"factorio_version": "0.18"
|
||||
"description": "Big, medium and small signs which display item, fluid and signal icons. Can be used to blueprint map markers.",
|
||||
"factorio_version": "1.1"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
[display-plates]
|
||||
blueprint-wont-have-icons=Dieser aktualisierte Blaupause wird keine Symbole oder Kartenmarkierungen der Anzeigeplatten enthalten. Um diese hinzuzufügen, erstelle eine neue Blaupause.
|
||||
mod-migration-info=Die Mod "IndustrialDisplayPlates" wird demnächst eingestellt. Bitte migrieren Sie auf "DisplayPlates" wie auf der Mod-Portal-Seite beschrieben.
|
||||
|
||||
[entity-name]
|
||||
copper-display=Kupferanzeigeplatte (groß)
|
||||
iron-display=Eisenanzeigeplatte (groß)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
[display-plates]
|
||||
blueprint-wont-have-icons=This updated blueprint will not contain any icons or map markers of the display plates. To include them, create a new blueprint.
|
||||
mod-migration-info=The mod "IndustrialDisplayPlates" will retire soon. Please migrate to "DisplayPlates" as described on the mod portal page.
|
||||
|
||||
[entity-name]
|
||||
copper-display=Copper display plate (large)
|
||||
iron-display=Iron display plate (large)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
[display-plates]
|
||||
blueprint-wont-have-icons=Ce plan mis à jour ne contiendra pas les icônes ni les marqueurs de carte des panneaux d'affichage. Pour les inclure, créez-en un nouveau.
|
||||
mod-migration-info=Le mod "IndustrialDisplayPlates" sera bientôt retiré. Veuillez migrer vers "DisplayPlates" comme décrit sur la page portail du mod.
|
||||
|
||||
[entity-name]
|
||||
copper-display=Panneau d'affichage en Cuivre (Grand)
|
||||
iron-display=Panneau d'affichage en Fer (Grand)
|
||||
steel-display=Panneau d'affichage en Acier (Grand)
|
||||
copper-display-medium=Panneau d'affichage en Cuivre (Moyen)
|
||||
iron-display-medium=Panneau d'affichage en Fer (Moyen)
|
||||
steel-display-medium=Panneau d'affichage en Acier (Moyen)
|
||||
copper-display-small=Panneau d'affichage en Cuivre (Petit)
|
||||
iron-display-small=Panneau d'affichage en Fer (Petit)
|
||||
steel-display-small=Panneau d'affichage en Acier (Petit)
|
||||
|
||||
[controls]
|
||||
display-map-marker=Marqueur de carte
|
||||
display-plate=Panneau d'affichage
|
||||
|
||||
[entity-description]
|
||||
display=Une icône qui peut être reliée à un marqueur sur la carte. Les paramètres sont préservés dans les plans.
|
||||
@@ -0,0 +1,25 @@
|
||||
[mod-name]
|
||||
IndustrialDisplayPlates=工业展示板
|
||||
[mod-description]
|
||||
IndustrialDisplayPlates=显示物品、流体和信号图标的大、中、小标志。可用于绘制包含地图标记的蓝图。
|
||||
[display-plates]
|
||||
blueprint-wont-have-icons=此更新的蓝图将不包含任何显示板的图标或地图标记。要包含它们,请创建一个新的蓝图。
|
||||
mod-migration-info="IndustrialDisplayPlates "修改即将退役。请迁移到 "DisplayPlates",如修改门户页面上所描述的。
|
||||
|
||||
[entity-name]
|
||||
copper-display=铜质显示板(大)
|
||||
iron-display=铁质展示板(大)
|
||||
steel-display=钢制展示板(大)
|
||||
copper-display-medium=铜质显示板(中)
|
||||
iron-display-medium=铁质展示板(中)
|
||||
steel-display-medium=钢制展示板(中)
|
||||
copper-display-small=铜质显示板(小)
|
||||
iron-display-small=铁质展示板(小)
|
||||
steel-display-small=钢显示板(小)
|
||||
|
||||
[controls]
|
||||
display-map-marker=地图标记
|
||||
display-plate=展示板
|
||||
|
||||
[entity-description]
|
||||
display=一个可以链接到地图标记的图标性标志。图标和地图标记设置可被保留在蓝图中。
|
||||
Binary file not shown.
Reference in New Issue
Block a user