Browse Source

Initial import

master
Chris Smith 6 years ago
commit
ac3f11fe79
4 changed files with 27 additions and 0 deletions
  1. 6
    0
      control.lua
  2. 9
    0
      data.lua
  3. 9
    0
      info.json
  4. 3
    0
      locale/en/en.cfg

+ 6
- 0
control.lua View File

@@ -0,0 +1,6 @@
1
+script.on_event("toggle-train-control", function(event)
2
+    local vehicle = game.players[event.player_index].vehicle
3
+    if vehicle and vehicle.train then
4
+        vehicle.train.manual_mode = not vehicle.train.manual_mode
5
+    end
6
+end)

+ 9
- 0
data.lua View File

@@ -0,0 +1,9 @@
1
+if not data.raw["custom-input"] or not data.raw["custom-input"]["toggle-train-control"] then
2
+    data:extend({
3
+        {
4
+            type = "custom-input",
5
+            name = "toggle-train-control",
6
+            key_sequence = "J"
7
+        }
8
+    })
9
+end

+ 9
- 0
info.json View File

@@ -0,0 +1,9 @@
1
+{
2
+  "name": "TrainModeToggle",
3
+  "version": "1.0.0",
4
+  "factorio_version": "0.15",
5
+  "title": "Train mode toggle",
6
+  "author": "csmith",
7
+  "homepage": "",
8
+  "description": "Adds a hotkey to toggle automatic mode on or off for the player's current train.",
9
+} 

+ 3
- 0
locale/en/en.cfg View File

@@ -0,0 +1,3 @@
1
+
2
+[controls]
3
+toggle-train-control=Toggle manual train control

Loading…
Cancel
Save