|
1 | 1 | local license = [[ |
2 | | -Copyright (C) 2024 Niewiarowski, compujuckel |
| 2 | +Copyright (C) 2025 Niewiarowski, compujuckel |
3 | 3 |
|
4 | 4 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. |
5 | 5 |
|
|
81 | 81 |
|
82 | 82 | local collisionUpdateEvent = ac.OnlineEvent({ |
83 | 83 | ac.StructItem.key("AS_CollisionUpdate"), |
84 | | - enabled = ac.StructItem.boolean(), |
85 | | - target = ac.StructItem.byte() |
| 84 | + enabled = ac.StructItem.boolean() |
86 | 85 | }, function (sender, message) |
87 | 86 | ac.debug("collision_update_index", sender.index) |
88 | 87 | ac.debug("collision_update_enabled", message.enabled) |
89 | 88 |
|
90 | | - physics.disableCarCollisions(0, not message.enabled) |
91 | | - if sender.index == 0 then |
92 | | - for i, c in ac.iterateCars.ordered() do |
93 | | - physics.disableCarCollisions(i, not message.enabled) |
94 | | - end |
95 | | - else |
96 | | - physics.disableCarCollisions(sender.index, not message.enabled) |
| 89 | + physics.disableCarCollisions(sender.index, not message.enabled, true) |
| 90 | +end) |
| 91 | + |
| 92 | +local teleportToPitsEvent = ac.OnlineEvent({ |
| 93 | + ac.StructItem.key("AS_TeleportToPits"), |
| 94 | + dummy = ac.StructItem.byte() |
| 95 | +}, function (sender, message) |
| 96 | + if sender.index == 0 and ac.INIConfig.onlineExtras():get("EXTRA_RULES", "NO_BACK_TO_PITS", 0) == 0 then |
| 97 | + physics.teleportCarTo(0, ac.SpawnSet.Pits) |
97 | 98 | end |
98 | 99 | end) |
99 | 100 |
|
100 | | -apiKeyEvent({ key = "" }) |
| 101 | +local requestResetCarEvent = ac.OnlineEvent({ |
| 102 | + ac.StructItem.key("AS_RequestResetCar"), |
| 103 | + dummy = ac.StructItem.byte(), |
| 104 | +}, function (sender, message) |
| 105 | + if sender ~= nil then return end |
| 106 | + ac.debug("request_reset_car", message.dummy) |
| 107 | +end) |
| 108 | + |
| 109 | +local luaReadyEvent = ac.OnlineEvent({ |
| 110 | + ac.StructItem.key("AS_LuaReady"), |
| 111 | + dummy = ac.StructItem.byte() |
| 112 | +}, function () end) |
101 | 113 |
|
102 | 114 | local logoSize = vec2(68, 42) |
103 | 115 | local srpLogoSize = vec2(244, 64) |
|
267 | 279 |
|
268 | 280 | ui.registerOnlineExtra(ui.Icons.Info, "AssettoServer", function () return true end, window_AssettoServer, nil, ui.OnlineExtraFlags.Tool) |
269 | 281 |
|
270 | | -local teleportToPitsEvent = ac.OnlineEvent({ |
271 | | - ac.StructItem.key("AS_TeleportToPits"), |
272 | | - dummy = ac.StructItem.byte() |
273 | | -}, function (sender, message) |
274 | | - if sender.index == 0 and ac.INIConfig.onlineExtras():get("EXTRA_RULES", "NO_BACK_TO_PITS", 0) == 0 then |
275 | | - physics.teleportCarTo(0, ac.SpawnSet.Pits) |
276 | | - end |
277 | | -end) |
278 | | - |
279 | | -local requestResetCarEvent = ac.OnlineEvent({ |
280 | | - ac.StructItem.key("AS_RequestResetCar"), |
281 | | - dummy = ac.StructItem.byte(), |
282 | | -}, function (sender, message) |
283 | | - if sender ~= nil then return end |
284 | | - ac.debug("request_reset_car", message.dummy) |
285 | | -end) |
286 | | - |
287 | 282 | local resetCarControl = ac.ControlButton('__EXT_CMD_RESET', nil) |
288 | | -resetCarControl:onPressed(function() requestResetCarEvent({dummy=0}) end) |
| 283 | +resetCarControl:onPressed(function() requestResetCarEvent({}) end) |
| 284 | + |
| 285 | +luaReadyEvent({}) |
0 commit comments