Skip to content

Commit

Permalink
Added buttons to add, remove, and move mesh groups in FoxModelEditor.
Browse files Browse the repository at this point in the history
BobDoleOwndU committed Jun 9, 2021

Verified

This commit was signed with the committer’s verified signature.
1 parent 5fc51d3 commit c4131c0
Showing 3 changed files with 890 additions and 731 deletions.
Original file line number Diff line number Diff line change
@@ -52,7 +52,77 @@ public override void OnInspectorGUI()

foxModel.meshGroups[i].name = EditorGUILayout.TextField("Name", foxModel.meshGroups[i].name);
foxModel.meshGroups[i].parent = (short)(EditorGUILayout.Popup("Parent", foxModel.meshGroups[i].parent + 1, meshGroupStrings) - 1);

GUILayout.BeginHorizontal();
foxModel.meshGroups[i].visible = EditorGUILayout.Toggle("Is Visible", foxModel.meshGroups[i].visible);

if (GUILayout.Button("+", GUILayout.Width(25)))
{
meshGroupsLength++;
foxModel.meshGroups = SetArraySize(foxModel.meshGroups, meshGroupsLength);

for(int j = meshGroupsLength - 1; j > i; j--)
{
foxModel.meshGroups[j] = foxModel.meshGroups[j - 1];

if (foxModel.meshGroups[j].parent > i)
foxModel.meshGroups[j].parent++;
} //for

foxModel.meshGroups[i + 1] = new FoxMeshGroup();

serializedObject.Update();
} //if

if (GUILayout.Button("-", GUILayout.Width(25)))
{
for (int j = i; j < meshGroupsLength - 1; j++)
{
foxModel.meshGroups[j] = foxModel.meshGroups[j + 1];

if (foxModel.meshGroups[j].parent > i)
foxModel.meshGroups[j].parent--;
} //for

meshGroupsLength--;
foxModel.meshGroups = SetArraySize(foxModel.meshGroups, meshGroupsLength);
serializedObject.Update();
} //if

if (i != 0)
{
if (GUILayout.Button("▲", GUILayout.Width(25)))
{
FoxMeshGroup temp = foxModel.meshGroups[i];
foxModel.meshGroups[i] = foxModel.meshGroups[i - 1];
foxModel.meshGroups[i - 1] = temp;

for (int j = 0; j < meshGroupsLength; j++)
if (foxModel.meshGroups[j].parent == i)
foxModel.meshGroups[j].parent--;
else if(foxModel.meshGroups[j].parent == i - 1)
foxModel.meshGroups[j].parent++;

} //if
} //if

if (i != foxModel.meshGroups.Length - 1)
{
if (GUILayout.Button("▼", GUILayout.Width(25)))
{
FoxMeshGroup temp = foxModel.meshGroups[i];
foxModel.meshGroups[i] = foxModel.meshGroups[i + 1];
foxModel.meshGroups[i + 1] = temp;

for (int j = 0; j < meshGroupsLength; j++)
if (foxModel.meshGroups[j].parent == i)
foxModel.meshGroups[j].parent++;
else if (foxModel.meshGroups[j].parent == i + 1)
foxModel.meshGroups[j].parent--;
} //if
} //if
GUILayout.EndHorizontal();

} //if
} //for
} //if
3 changes: 2 additions & 1 deletion FMDL-Studio-v2/Assets/Fmdl Studio/fmdl_dictionary.txt
Original file line number Diff line number Diff line change
@@ -13336,6 +13336,7 @@ MESH_RADAR_DEF
MESH_radio
MESH_radio_item_A
MESH_RAIL_IV
MESH_RAIL_LONG_IV
MESH_RAIL_OPTION_IV
MESH_RAIL_SHORT_IV
MESH_RAILGUN
@@ -20656,4 +20657,4 @@ zmb3_skin_c
zmb4_main6
zonbi4
zonbi5
zubon
zubon
Loading

0 comments on commit c4131c0

Please sign in to comment.