Feature Request: inject STRONGDMM define
ZeWaka opened this issue · 3 comments
Problem to be solved
This would make life infinitely easier.
Sugest a solution
No response
As I understand it, the define is needed to set up the environment specifically for the editor's operation? I'm a bit out of the loop, so for general understanding, it would be great if you could show an example of how such a define might be used. Actually, for similar purposes, the editor relies on the fork of SpacemanDMM - you can make a PR there, and at the same time, check that everything works as it should. I'll merge it and release the editor version on it: SpacemanDMM builtins.rs.
One way Goonstation uses defines like those is to display different icons for map editors vs ingame.
Currently, we do the following:
#if (defined(SPACEMAN_DMM) || defined(FASTDMM))
#define IN_MAP_EDITOR
#endif
/turf/simulated/wall
#ifndef IN_MAP_EDITOR // display disposal pipes etc. above walls in map editors
plane = PLANE_WALL
#else
plane = PLANE_FLOOR
#endif
The issue is that then DreamChecker and such will skip over the code that runs in the actual game, which could present a vector for errors. For example, some of our objects don't have any icon_state at all, but have an icon_state in-editor. It would be ideal to eventually enforce this programmatically via DreamChecker, but we can't currently outside of some weird regexes.
Okay. I think I got it, but I still recommend making a PR to the fork of the parser.