-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontrol.lua
More file actions
76 lines (76 loc) · 1.92 KB
/
control.lua
File metadata and controls
76 lines (76 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
--MOD_NAME = ""
--
--local function init_global()
-- global = {}
-- global.version = "0.0.1"
-- -- set up stuff
--end
--
--local function init_player(player)
-- --setup player specific stuff (gui settings etc.)
--end
--
--local function init_players()
-- for i,player in pairs(game.players) do
-- init_player(player)
-- end
--end
--
--local function init_force(force)
-- --force specific
--end
--
--local function init_forces()
-- for i, force in pairs(game.forces) do
-- init_force(force)
-- end
--end
--
--local function on_init()
-- init_global()
-- init_forces()
--end
--
--local function on_load()
-- -- set metatables, register conditional event handlers, local references to global
--end
--
---- run once
--local function on_configuration_changed(data)
-- if not data or not data.mod_changes then
-- return
-- end
-- if data.mod_changes[MOD_NAME] then
-- local newVersion = data.mod_changes[MOD_NAME].new_version
-- local oldVersion = data.mod_changes[MOD_NAME].old_version
-- -- mod was added to existing save
-- if not oldVersion then
-- init_global()
-- init_forces()
-- init_players()
-- else
-- --mod was updated
-- -- update/change gui for all players via game.players.gui ?
-- end
-- global.version = newVersion
-- end
-- --check for other mods
--end
--
--local function on_player_created(event)
-- init_player(game.players[event.player_index])
--end
--
--local function on_force_created(event)
-- init_force(event.force)
--end
--local function on_forces_merging(event)
--
--end
--
--script.on_init(on_init)
--script.on_load(on_load)
--script.on_configuration_changed(on_configuration_changed)
--script.on_event(defines.events.on_player_created, on_player_created)
--script.on_event(defines.events.on_force_created, on_force_created)
--script.on_event(defines.events.on_forces_merging, on_forces_merging)