added support for logoed studs

Sun, 18 Aug 2013 16:33:38 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 18 Aug 2013 16:33:38 +0300
changeset 457
3327a32436f4
parent 456
ae4fea87d6a1
child 458
cb360f4d8979

added support for logoed studs

changelog.txt file | annotate | diff | comparison | revisions
src/configDialog.cpp file | annotate | diff | comparison | revisions
src/file.cpp file | annotate | diff | comparison | revisions
src/ui/config.ui file | annotate | diff | comparison | revisions
--- a/changelog.txt	Sun Aug 18 16:04:36 2013 +0300
+++ b/changelog.txt	Sun Aug 18 16:33:38 2013 +0300
@@ -13,6 +13,7 @@
 	- Fixed: Checking the Hi-Res option would not allow segment values over 16.
 	- Added support for multiple spaces before the ring number.
 - Added new action "Add History Line" for quickly inserting 0 !HISTORY lines to headers
+- Added support for logoed studs, this should satisfy Steffen. :p
 - Added support for '0 BFC CLIP' and '0 BFC NOCLIP' and added auto-correction from errorneous MLCAD
 	syntax ('0 BFC CERTIFY CLIP').
 - When an external program is attempted to be used without a binary path defined, one will be asked
--- a/src/configDialog.cpp	Sun Aug 18 16:04:36 2013 +0300
+++ b/src/configDialog.cpp	Sun Aug 18 16:33:38 2013 +0300
@@ -50,6 +50,7 @@
 extern_cfg (str, net_downloadpath);
 extern_cfg (bool, net_guesspaths);
 extern_cfg (bool, net_autoclose);
+extern_cfg (bool, io_logostuds);
 
 extern_cfg (str, prog_ytruder);
 extern_cfg (str, prog_rectifier);
@@ -120,6 +121,7 @@
 	ui->blackEdges->setChecked (gl_blackedges);
 	// ui->scemanticInlining->setChecked (edit_schemanticinline);
 	ui->implicitFiles->setChecked (gui_implicitfiles);
+	ui->m_logostuds->setChecked (io_logostuds);
 }
 
 // =============================================================================
@@ -589,6 +591,7 @@
 		net_downloadpath = dlg.getUI()->downloadPath->text();
 		net_guesspaths = dlg.getUI()->guessNetPaths->isChecked();
 		net_autoclose = dlg.getUI()->autoCloseNetPrompt->isChecked();
+		io_logostuds = dlg.getUI()->m_logostuds->isChecked();
 		
 		if (net_downloadpath.value.right (1) != DIRSLASH)
 			net_downloadpath += DIRSLASH;
--- a/src/file.cpp	Sun Aug 18 16:04:36 2013 +0300
+++ b/src/file.cpp	Sun Aug 18 16:33:38 2013 +0300
@@ -34,6 +34,7 @@
 
 cfg (str, io_ldpath, "");
 cfg (str, io_recentfiles, "");
+cfg (bool, io_logostuds, false);
 extern_cfg (str, net_downloadpath);
 
 static bool g_loadingMainFile = false;
@@ -176,6 +177,26 @@
 // =============================================================================
 // -----------------------------------------------------------------------------
 File* openLDrawFile (str relpath, bool subdirs) {
+	{
+		File* logofile;
+		
+		// Special exception for logoed studs:
+		// stud.dat -> stud-logo.dat
+		// stud2.dat -> stud2-logo.dat
+		// NOTE: This is probably going to change in the very near future!
+		if (
+			relpath == "stud.dat" &&
+			(logofile = openLDrawFile ("stud-logo.dat", subdirs)) != null
+		)
+			return logofile;
+		
+		if (
+			relpath == "stud2.dat" &&
+			(logofile = openLDrawFile ("stud2-logo.dat", subdirs)) != null
+		)
+			return logofile;
+	}
+	
 	print ("%1: Try to open %2\n", __func__, relpath);
 	File* f = new File;
 	str fullPath;
--- a/src/ui/config.ui	Sun Aug 18 16:04:36 2013 +0300
+++ b/src/ui/config.ui	Sun Aug 18 16:33:38 2013 +0300
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>513</width>
-    <height>377</height>
+    <height>351</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -190,41 +190,73 @@
         </layout>
        </item>
        <item>
-        <widget class="QCheckBox" name="colorizeObjects">
-         <property name="whatsThis">
-          <string>Makes colored objects (non-16 and 24) appear colored in the list view. A red triangle will, for instance, have its entry written in red text. This can be useful to locate colored objects.</string>
-         </property>
-         <property name="text">
-          <string>Colorize objects in list view</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="colorBFC">
-         <property name="whatsThis">
-          <string>Polygons' front sides become green and back sides red.</string>
-         </property>
-         <property name="text">
-          <string>Red/green BFC view (incomplete)</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="blackEdges">
-         <property name="whatsThis">
-          <string>Makes all edgelines appear black. If this is not set, edge lines take their color as defined in LDConfig.ldr.</string>
-         </property>
-         <property name="text">
-          <string>Black edges</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="implicitFiles">
-         <property name="text">
-          <string>List implicitly loaded files</string>
-         </property>
-        </widget>
+        <layout class="QHBoxLayout" name="horizontalLayout_8">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_11">
+           <item>
+            <widget class="QCheckBox" name="blackEdges">
+             <property name="whatsThis">
+              <string>Makes all edgelines appear black. If this is not set, edge lines take their color as defined in LDConfig.ldr.</string>
+             </property>
+             <property name="text">
+              <string>Black edges</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="colorBFC">
+             <property name="whatsThis">
+              <string>Polygons' front sides become green and back sides red.</string>
+             </property>
+             <property name="text">
+              <string>Red/green BFC view (incomplete)</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="colorizeObjects">
+             <property name="whatsThis">
+              <string>Makes colored objects (non-16 and 24) appear colored in the list view. A red triangle will, for instance, have its entry written in red text. This can be useful to locate colored objects.</string>
+             </property>
+             <property name="text">
+              <string>Colorize objects in list view</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="implicitFiles">
+             <property name="text">
+              <string>List implicitly loaded files</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_12">
+           <item>
+            <widget class="QCheckBox" name="m_logostuds">
+             <property name="text">
+              <string>Use logoed studs</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_6">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+        </layout>
        </item>
       </layout>
      </widget>

mercurial