[MIRROR] Merge Conflict Markers - The Explicit Pathing, Layering, Iconing, Warning. [MDB IGNORE] (#14735)

* Merge Conflict Markers - The Explicit Pathing, Layering, Iconing, Warning. (#68039)

* Merge Conflict Markers - The Explicit Pathing

Hey there,

This PR corrects an issue I've been having with mapmerge2 these last few months. Basically, what it does is create a base `/obj` that is given the name `---Merge Conflict Marker---`. This is fine and all, but the problem is that the base `/obj` is set to a certain plane. This does mean that sometimes, this VERY IMPORTANT marker is covered up by rocks or other objects. So, this seeks to get rid of that potential flaw, as well as do some other things.

Sometimes, when objects are rendered via GAGS or other code-means, they tend to have the same default Purple/White Sprite that any object without a valid icon_state has. This has caused me some confusion, so I have decided to create a new icon for conflict markers. This icon was designed to be as ugly as possible, while creating as much contrast as possible with the background by incorporating several colors into its design. I hope you find merge conflicts as unpleasant as I do.

I also updated mapmerge2 to have it so you can set the specified path of the object, as well as a small comment on the warnings if you do not heed it. I'm keeping the fact that mapmerge2 adds a name to the object just in case someone else really needs that. I also updated the linters to check for this path as well (even though the name and description should suffice for linting), and it should all be gravy from here.

* Adds further contrast to the DMI.

* Splits the merge conflict marker into a generic /obj

I also added a thing where if it didn't get caught by linters and it showed up on Initalize, it would error to mapping logs, spit out an error in world, and do all sorts of stuff to remind you.

* python new line

* forgot to add a tab

* Merge Conflict Markers - The Explicit Pathing, Layering, Iconing, Warning.

Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
SkyratBot
2022-07-05 08:50:36 +02:00
committed by GitHub
parent 89c0dd6a02
commit 2b4772a07e
6 changed files with 32 additions and 5 deletions

View File

@@ -97,7 +97,6 @@
..()
return late ? INITIALIZE_HINT_LATELOAD : INITIALIZE_HINT_QDEL
//airlock helpers
/obj/effect/mapping_helpers/airlock
layer = DOOR_HELPER_LAYER

View File

@@ -0,0 +1,18 @@
// Used by mapmerge2 to denote the existence of a merge conflict (or when it has to complete a "best intent" merge where it dumps the movable contents of an old key and a new key on the same tile).
// We define it explicitly here to ensure that it shows up on the highest possible plane (while giving off a verbose icon) to aide mappers in resolving these conflicts.
// DO NOT USE THIS IN NORMAL MAPPING!!! Linters WILL fail.
/obj/merge_conflict_marker
name = "Merge Conflict Marker - DO NOT USE"
icon = 'icons/effects/mapping_helpers.dmi'
icon_state = "merge_conflict_marker"
desc = "If you are seeing this in-game: someone REALLY, REALLY, REALLY fucked up. They physically mapped in a fucking Merge Conflict Marker. What the shit."
plane = POINT_PLANE
///We REALLY do not want un-addressed merge conflicts in maps for an inexhaustible list of reasons. This should help ensure that this will not be missed in case linters fail to catch it for any reason what-so-ever.
/obj/merge_conflict_marker/Initialize(mapload)
. = ..()
var/msg = "HEY, LISTEN!!! Merge Conflict Marker detected at [AREACOORD(src)]! Please manually address all potential merge conflicts!!!"
log_mapping(msg)
to_chat(world, span_boldannounce("[msg]"))
warning(msg)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -3339,6 +3339,7 @@
#include "code\modules\mapping\access_helpers.dm"
#include "code\modules\mapping\map_template.dm"
#include "code\modules\mapping\mapping_helpers.dm"
#include "code\modules\mapping\merge_conflicts.dm"
#include "code\modules\mapping\preloader.dm"
#include "code\modules\mapping\reader.dm"
#include "code\modules\mapping\ruins.dm"

View File

@@ -15,7 +15,12 @@ if grep -P '//' _maps/**/*.dmm | grep -v '//MAP CONVERTED BY dmm2tgm.py THIS HEA
echo "ERROR: Unexpected commented out line detected in this map file. Please remove it."
st=1
fi;
if grep -P 'Merge conflict marker' _maps/**/*.dmm; then
if grep -P 'Merge Conflict Marker' _maps/**/*.dmm; then
echo "ERROR: Merge conflict markers detected in map, please resolve all merge failures!"
st=1
fi;
# We check for this as well to ensure people aren't actually using this mapping effect in their maps.
if grep -P '/obj/merge_conflict_marker' _maps/**/*.dmm; then
echo "ERROR: Merge conflict markers detected in map, please resolve all merge failures!"
st=1
fi;

View File

@@ -75,9 +75,13 @@ def three_way_merge(base, left, right):
print(f" C: Both sides touch the tile at {coord}")
if merged_movables is None:
obj_name = "---Merge conflict marker---"
merged_movables = left_movables + [f'/obj{{name = "{obj_name}"}}'] + right_movables
print(f" Left and right movable groups are split by an `/obj` named \"{obj_name}\"")
# Note that if you do not have an object that matches this path in your DME, the invalid path may be discarded when the map is loaded into a map editor.
# To rectify this, either add an object with this same path, or create a new object/denote an existing object in the obj_path define.
obj_path = "/obj/merge_conflict_marker"
obj_name = "---Merge Conflict Marker---"
obj_desc = "A best-effort merge was performed. You must resolve this conflict yourself (manually) and remove this object once complete."
merged_movables = left_movables + [f'{obj_path}{{name = "{obj_name}",\n\tdesc = "{obj_desc}"}}'] + right_movables
print(f" Left and right movable groups are split by an `{obj_path}` named \"{obj_name}\"")
if merged_turfs is None:
merged_turfs = left_turfs
print(f" Saving turf: {', '.join(left_turfs)}")