KeenSoftwareHouse / SpaceEngineers

2.93k stars 896 forks source link

Allow modAPI (script) access to OnGridChanged events. #519

Open fabricator77 opened 8 years ago

fabricator77 commented 8 years ago

OnGridChanged is used in the cargoship code to detect when a Player has taken over a ship so it doesn't despawn.

It's not possible to create the same functionality with other available events, which can be triggered by things like minor damage to ships, or unpowered ships drifting.

Jimmacle commented 8 years ago

I already spoke to you on Discord, but for the record I'll put it here too. Can't you use the event directly by casting your object to MyCubeGrid? The modding API still has a lot of work left but that method should work until the API gets some more love.

fabricator77 commented 8 years ago

I have to rely on several other PRs (that I'm working on) for my mod to work anyway. IMyGrid exists for a reason, I'm not going to rely on MyGrid being exposed as that can change (eg the current ISensor secuity hole).

Why are you abusing me for actually improving the API. For the record I don't believe in programming theory, long debates on best OO designs or endless refactoring.

Jimmacle commented 8 years ago

Calm down, dude. I'm just trying to help you get whatever you're working on going without having to rely on PRs as they aren't getting merged right now. Sorry for trying to help. Now you've put an unrelated change in your PR so it's even less likely to get merged.

fabricator77 commented 8 years ago

Huh, stupid GitHub client added that without my permission.

Jimmacle commented 8 years ago

When you make a PR it's possible to update it by committing to the same branch. Good practice is to make a separate branch for each PR so you can have multiple open at once without interference :) You can look at my fork if you need a visual.