A simple mod for the game "Factorio" that does what it's name implies.
リビジョン | 595ec2423a574229dd49c8d91f501a3ae113b208 (tree) |
---|---|
日時 | 2020-10-02 21:47:10 |
作者 | Eric Hopper <hopper@omni...> |
コミッター | Eric Hopper |
Backport changes from 0.2 branch to 0.1 branch.
@@ -1,3 +1,20 @@ | ||
1 | +--------------------------------------------------------------------------------------------------- | |
2 | +Version: 0.1.5 | |
3 | +Date: 02. 10. 2020 | |
4 | + Changes: | |
5 | + - Backport changes and bugfixes from 0.2 (aka Factorio 0.18/1.0) | |
6 | + branch to 0.1 (aka Factorio 0.17). | |
7 | + - Fix control prototype to no longer use long-deprecated 'script-only' | |
8 | + consume mode. This may result in some behavior change if you have the | |
9 | + control key used for RunSpeedToggle also bound to other actions. The | |
10 | + deprecated 'script-only' mode still works in 0.17, but the change is | |
11 | + being backported anyway. | |
12 | + - Change default binding for toggle key to F6 to avoid conflicting | |
13 | + with keys that are part of Factorio base and to be consistent with the | |
14 | + 0.18 version. | |
15 | + Bugfixes: | |
16 | + - Make negative speeds work correctly. This involved fixing a broken | |
17 | + floating point comparison function. | |
1 | 18 | --------------------------------------------------------------------------------------------------- |
2 | 19 | Version: 0.1.4 |
3 | 20 | Date: 26. 02. 2018 |
@@ -40,8 +40,8 @@ | ||
40 | 40 | end |
41 | 41 | |
42 | 42 | local function approx_eq(v1, v2, errscale) |
43 | - offset = v2 * errscale | |
44 | - return ((v1 >= (v2 - offset)) and (v1 <= (v2 + offset))) | |
43 | + offset = math.max(math.abs(v1 * errscale), math.abs(v2 * errscale)) | |
44 | + return math.abs(v1 - v2) <= offset | |
45 | 45 | end |
46 | 46 | |
47 | 47 | local function on_hotkey(event) |
@@ -3,8 +3,8 @@ | ||
3 | 3 | { |
4 | 4 | type = "custom-input", |
5 | 5 | name = "runspeedtoggle_hotkey", |
6 | - key_sequence = "F1", | |
7 | - consuming = "script-only" | |
6 | + key_sequence = "F6", | |
7 | + consuming = "none" | |
8 | 8 | }, |
9 | 9 | } |
10 | 10 | ) |
@@ -1,6 +1,6 @@ | ||
1 | 1 | { |
2 | 2 | "name": "RunSpeedToggle", |
3 | - "version": "0.1.4", | |
3 | + "version": "0.1.5", | |
4 | 4 | "title": "Run Speed Toggle", |
5 | 5 | "author": "Omnifarious", |
6 | 6 | "contact": "eric-factorio@omnifarious.org", |