Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
factorio.moon-logic: add wire renaming options
- Loading branch information
Showing
9 changed files
with
74 additions
and
23 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
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,25 @@ | ||
| local conf = {} | ||
|
|
||
| -- Configurable wire/network names for players that have these changed | ||
| -- in the game (e.g. via colorblind modes) or just don't like default names in lua env. | ||
| -- This changes descriptions in the guis as well. | ||
| conf.red_wire_name = 'red' | ||
| conf.green_wire_name = 'green' | ||
|
|
||
| -- Interval between raising global alerts on lua errors, in ticks | ||
| conf.logic_alert_interval = 10 * 60 | ||
|
|
||
| -- Function to use for debug=true logging and game.log() calls in lua env | ||
| conf.debug_print = print | ||
|
|
||
|
|
||
| function conf.update_from_settings() | ||
| local k_conf | ||
| for _, k in ipairs{'red-wire-name', 'green-wire-name'} do | ||
| k_conf = k:gsub('%-', '_') | ||
| if conf[k_conf] == nil then error(('BUG - config key typo: %s'):format(k)) end | ||
| conf[k_conf] = settings.startup[k].value | ||
| end | ||
| end | ||
|
|
||
| return conf |
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
Binary file not shown.
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
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
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
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
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,14 @@ | ||
| local conf = require('config') | ||
|
|
||
| data:extend{ | ||
| { order = '01', | ||
| setting_type = 'startup', | ||
| name = 'red-wire-name', | ||
| type = 'string-setting', | ||
| default_value = conf.red_wire_name }, | ||
| { order = '02', | ||
| setting_type = 'startup', | ||
| name = 'green-wire-name', | ||
| type = 'string-setting', | ||
| default_value = conf.green_wire_name }, | ||
| } |