@@ -27,6 +27,7 @@ namespace LevelEditor
27
27
EditorSector* sector = nullptr ;
28
28
s32 featureIndex = -1 ;
29
29
HitPart part = HP_FLOOR;
30
+ selection_get (hasFeature ? 0 : SEL_INDEX_HOVERED, sector, featureIndex, &part);
30
31
31
32
// Specific code for feature type.
32
33
switch (s_editMode)
@@ -35,39 +36,38 @@ namespace LevelEditor
35
36
{
36
37
// TODO: Currently, you can only delete one vertex at a time. It should be possible to delete multiple.
37
38
// Choose the selected feature over the hovered feature.
38
- selection_getVertex (hasFeature ? 0 : SEL_INDEX_HOVERED, sector, featureIndex);
39
39
if (sector)
40
40
{
41
41
edit_deleteVertex (sector->id , featureIndex, LName_DeleteVertex);
42
42
}
43
43
} break ;
44
44
case LEDIT_WALL:
45
45
{
46
- selection_getSurface (hasFeature ? 0 : SEL_INDEX_HOVERED, sector, featureIndex, &part);
47
- if (!sector) { return ; }
48
-
49
- if (part == HP_FLOOR || part == HP_CEIL)
50
- {
51
- edit_deleteSector (sector->id );
52
- }
53
- else if (part == HP_SIGN)
46
+ if (sector)
54
47
{
55
- if (sector && featureIndex >= 0 )
48
+ if (part == HP_FLOOR || part == HP_CEIL )
56
49
{
57
- // Clear the selections when deleting a sign -
58
- // otherwise the source wall will still be selected.
59
- edit_clearSelections ();
60
-
61
- FeatureId id = createFeatureId (sector, featureIndex, HP_SIGN);
62
- edit_clearTexture (1 , &id);
50
+ edit_deleteSector (sector->id );
51
+ }
52
+ else if (part == HP_SIGN)
53
+ {
54
+ if (featureIndex >= 0 )
55
+ {
56
+ // Clear the selections when deleting a sign -
57
+ // otherwise the source wall will still be selected.
58
+ edit_clearSelections ();
59
+
60
+ FeatureId id = createFeatureId (sector, featureIndex, HP_SIGN);
61
+ edit_clearTexture (1 , &id);
62
+ }
63
+ }
64
+ else
65
+ {
66
+ // Deleting a wall is the same as deleting vertex 0.
67
+ // So re-use the same command, but with the delete wall name.
68
+ const s32 vertexIndex = sector->walls [featureIndex].idx [0 ];
69
+ edit_deleteVertex (sector->id , vertexIndex, LName_DeleteWall);
63
70
}
64
- }
65
- else
66
- {
67
- // Deleting a wall is the same as deleting vertex 0.
68
- // So re-use the same command, but with the delete wall name.
69
- const s32 vertexIndex = sector->walls [featureIndex].idx [0 ];
70
- edit_deleteVertex (sector->id , vertexIndex, LName_DeleteWall);
71
71
}
72
72
} break ;
73
73
}
@@ -122,14 +122,14 @@ namespace LevelEditor
122
122
if (hasHovered && selection_get (SEL_INDEX_HOVERED, sector, featureIndex, &part))
123
123
{
124
124
s32 modeIndex = featureIndex;
125
- if (part == HP_FLOOR || part == HP_CEIL || s_editMode == LEDIT_VERTEX)
125
+ if (part == HP_FLOOR || part == HP_CEIL || s_editMode == LEDIT_VERTEX || s_editMode == LEDIT_SECTOR )
126
126
{
127
127
modeIndex = -1 ;
128
128
}
129
129
handleSelectMode (sector, modeIndex);
130
130
if (!selection_action (SA_CHECK_INCLUSION, sector, featureIndex, part))
131
131
{
132
- selection_surface (SA_SET, sector, featureIndex, part);
132
+ selection_action (SA_SET, sector, featureIndex, part);
133
133
edit_applyTransformChange ();
134
134
}
135
135
@@ -152,7 +152,7 @@ namespace LevelEditor
152
152
}
153
153
else if (s_doubleClick && s_editMode == LEDIT_WALL) // functionality for vertices, sectors, etc.?
154
154
{
155
- if (hasHovered && selection_getSurface (SEL_INDEX_HOVERED, sector, featureIndex, &part))
155
+ if (hasHovered && selection_get (SEL_INDEX_HOVERED, sector, featureIndex, &part))
156
156
{
157
157
if (!TFE_Input::keyModDown (KEYMOD_SHIFT))
158
158
{
0 commit comments