Member Controls

Developers > ImportGmdcGroups.cs - Only auto-set "Replace" for matches patch
pljonesLink to postposted: Sat Sep 08, 2007 2:24 pm
Avator for pljones

Member since:
 2005-04-02
From:
 London, UK
Posts:
 610

This is a patch against my local working codebase to change the way the Gmdc importer picks how to pair up matching resources, only setting to "Replace" if there's a good match.  Otherwise, the user is required to decide.  This might not be to everyone's taste.

 

Index: J:/Dynamic/Projects/SimPE/fullsimpe-svn/SimPe GMDC Exporter Base/ImportGmdcGroups.cs
===================================================================
--- J:/Dynamic/Projects/SimPE/fullsimpe-svn/SimPe GMDC Exporter Base/ImportGmdcGroups.cs    (revision 330)
+++ J:/Dynamic/Projects/SimPE/fullsimpe-svn/SimPe GMDC Exporter Base/ImportGmdcGroups.cs    (working copy)
@@ -696,11 +696,16 @@
                     a.Group.Opacity = (uint)MeshOpacity.Shadow;
                 if (a.Group.Opacity>0x10 && f.cbBMesh.Enabled) a.UseInBoundingMesh = true;
 
-                if (a.Target.Name=="") 
-                {
-                    a.Target.Name = a.Group.Name;
-                    a.Target.Index = gmdc.FindGroupByName(a.Target.Name);
-                }
+                if ((a.Target.Index = gmdc.FindGroupByName(a.Group.Name)) >= 0)
+                {
+                    a.Action = GmdcImporterAction.Replace;
+                    a.Target.Name = a.Group.Name;
+                }
+                else
+                {
+                    a.Action = GmdcImporterAction.Nothing;
+                    a.Target.Name = "";
+                }
                 ListViewItem lvi = new ListViewItem(a.Group.Name);
                 lvi.SubItems.Add(a.Action.ToString());
                 lvi.SubItems.Add(a.Target.Name);                
Inge JonesLink to postposted: Sun Sep 09, 2007 12:07 pm
Avator for Inge Jones

Member since:
 2005-03-06
Posts:
 1899
Yes, when I asked people whether they would like this before, the majority of replies were negative.  Could we just offer the patch to people who want it at our site?


viewthread, 0, 0, ImportGmdcGroupscs-Only-auto-set-Replace-for-matches