Daniele Bartolini 8 rokov pred
rodič
commit
45c31a1374

+ 1 - 1
makefile

@@ -104,7 +104,7 @@ windows-release64: build/projects/vs2013
 
 .PHONY: rebuild-glib-resources
 rebuild-glib-resources:
-	make -R -C tools/ui rebuild
+	make -R -C tools rebuild
 
 tools-linux-debug64: linux-development64
 	make -R -C build/projects/linux level-editor config=debug

+ 2 - 2
scripts/level-editor.lua

@@ -57,13 +57,13 @@ project "level-editor"
 	}
 
 	buildoptions_vala {
-		"--gresources=" .. CROWN_DIR .. "tools/ui/resources.xml",
+		"--gresources=" .. CROWN_DIR .. "tools/gresources.xml",
 		"--target-glib=2.38",
 	}
 
 	files {
 		CROWN_DIR .. "tools/**.vala",
-		CROWN_DIR .. "tools/ui/resources.c",
+		CROWN_DIR .. "tools/gresources.c",
 	}
 
 	configuration {}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 441 - 3820
tools/gresources.c


+ 32 - 0
tools/gresources.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+	<gresource prefix="/org/crown">
+		<file compressed="true" preprocess="xml-stripblanks">level_editor/level_editor.xml</file>
+		<file compressed="true" preprocess="xml-stripblanks">level_editor/preferences_dialog.ui</file>
+		<file compressed="true" preprocess="xml-stripblanks">level_editor/project_dialog.ui</file>
+
+		<file>ui/icons/128x128/pepper.png</file>
+		<file>ui/icons/16x16/pepper.png</file>
+		<file>ui/icons/24x24/pepper.png</file>
+		<file>ui/icons/256x256/pepper.png</file>
+		<file>ui/icons/32x32/pepper.png</file>
+		<file>ui/icons/64x64/pepper.png</file>
+
+		<file>ui/icons/theme/axis-local.png</file>
+		<file>ui/icons/theme/axis-world.png</file>
+		<file>ui/icons/theme/layer-locked.png</file>
+		<file>ui/icons/theme/layer-visible.png</file>
+		<file>ui/icons/theme/level-layers.png</file>
+		<file>ui/icons/theme/level-tree.png</file>
+		<file>ui/icons/theme/reference-local.png</file>
+		<file>ui/icons/theme/reference-world.png</file>
+		<file>ui/icons/theme/run.png</file>
+		<file>ui/icons/theme/snap-to-grid.png</file>
+		<file>ui/icons/theme/tool-move.png</file>
+		<file>ui/icons/theme/tool-place.png</file>
+		<file>ui/icons/theme/tool-rotate.png</file>
+		<file>ui/icons/theme/tool-scale.png</file>
+
+		<file compressed="true">ui/theme/style.css</file>
+	</gresource>
+</gresources>

+ 17 - 17
tools/level_editor/level_editor.vala

@@ -254,20 +254,20 @@ namespace Crown
 
 			try
 			{
-				Gtk.IconTheme.add_builtin_icon("tool-place",      16, new Pixbuf.from_resource("/org/pepper/icons/theme/tool-place.png"));
-				Gtk.IconTheme.add_builtin_icon("tool-move",       16, new Pixbuf.from_resource("/org/pepper/icons/theme/tool-move.png"));
-				Gtk.IconTheme.add_builtin_icon("tool-rotate",     16, new Pixbuf.from_resource("/org/pepper/icons/theme/tool-rotate.png"));
-				Gtk.IconTheme.add_builtin_icon("tool-scale",      16, new Pixbuf.from_resource("/org/pepper/icons/theme/tool-scale.png"));
-				Gtk.IconTheme.add_builtin_icon("axis-local",      16, new Pixbuf.from_resource("/org/pepper/icons/theme/axis-local.png"));
-				Gtk.IconTheme.add_builtin_icon("axis-world",      16, new Pixbuf.from_resource("/org/pepper/icons/theme/axis-world.png"));
-				Gtk.IconTheme.add_builtin_icon("snap-to-grid",    16, new Pixbuf.from_resource("/org/pepper/icons/theme/snap-to-grid.png"));
-				Gtk.IconTheme.add_builtin_icon("reference-local", 16, new Pixbuf.from_resource("/org/pepper/icons/theme/reference-local.png"));
-				Gtk.IconTheme.add_builtin_icon("reference-world", 16, new Pixbuf.from_resource("/org/pepper/icons/theme/reference-world.png"));
-				Gtk.IconTheme.add_builtin_icon("run",             16, new Pixbuf.from_resource("/org/pepper/icons/theme/run.png"));
-				Gtk.IconTheme.add_builtin_icon("level-tree",      16, new Pixbuf.from_resource("/org/pepper/icons/theme/level-tree.png"));
-				Gtk.IconTheme.add_builtin_icon("level-layers",    16, new Pixbuf.from_resource("/org/pepper/icons/theme/level-layers.png"));
-				Gtk.IconTheme.add_builtin_icon("layer-visible",   16, new Pixbuf.from_resource("/org/pepper/icons/theme/layer-visible.png"));
-				Gtk.IconTheme.add_builtin_icon("layer-locked",    16, new Pixbuf.from_resource("/org/pepper/icons/theme/layer-locked.png"));
+				Gtk.IconTheme.add_builtin_icon("tool-place",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-place.png"));
+				Gtk.IconTheme.add_builtin_icon("tool-move",       16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-move.png"));
+				Gtk.IconTheme.add_builtin_icon("tool-rotate",     16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-rotate.png"));
+				Gtk.IconTheme.add_builtin_icon("tool-scale",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-scale.png"));
+				Gtk.IconTheme.add_builtin_icon("axis-local",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/axis-local.png"));
+				Gtk.IconTheme.add_builtin_icon("axis-world",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/axis-world.png"));
+				Gtk.IconTheme.add_builtin_icon("snap-to-grid",    16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/snap-to-grid.png"));
+				Gtk.IconTheme.add_builtin_icon("reference-local", 16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/reference-local.png"));
+				Gtk.IconTheme.add_builtin_icon("reference-world", 16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/reference-world.png"));
+				Gtk.IconTheme.add_builtin_icon("run",             16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/run.png"));
+				Gtk.IconTheme.add_builtin_icon("level-tree",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/level-tree.png"));
+				Gtk.IconTheme.add_builtin_icon("level-layers",    16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/level-layers.png"));
+				Gtk.IconTheme.add_builtin_icon("layer-visible",   16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/layer-visible.png"));
+				Gtk.IconTheme.add_builtin_icon("layer-locked",    16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/layer-locked.png"));
 			}
 			catch (Error e)
 			{
@@ -287,7 +287,7 @@ namespace Crown
 			_ui_manager = new UIManager();
 			try
 			{
-				_ui_manager.add_ui_from_resource("/org/pepper/level_editor_menu.xml");
+				_ui_manager.add_ui_from_resource("/org/crown/level_editor/level_editor.xml");
 				_ui_manager.insert_action_group(_action_group, 0);
 				add_accel_group(_ui_manager.get_accel_group());
 			}
@@ -1317,7 +1317,7 @@ namespace Crown
 
 			try
 			{
-				dlg.set_logo(new Pixbuf.from_resource("/org/pepper/icons/128x128/pepper.png"));
+				dlg.set_logo(new Pixbuf.from_resource("/org/crown/ui/icons/128x128/pepper.png"));
 			}
 			catch (Error e)
 			{
@@ -1370,7 +1370,7 @@ namespace Crown
 		Gtk.CssProvider provider = new Gtk.CssProvider();
 		Gdk.Screen screen = Gdk.Display.get_default().get_default_screen();
 		Gtk.StyleContext.add_provider_for_screen(screen, provider, STYLE_PROVIDER_PRIORITY_APPLICATION);
-		provider.load_from_resource("/org/pepper/theme/style.css");
+		provider.load_from_resource("/org/crown/theme/style.css");
 
 		Project project = new Project();
 		project.load(args[1], args[2]);

+ 0 - 0
tools/ui/level_editor_menu.xml → tools/level_editor/level_editor.xml


+ 0 - 0
tools/ui/level_editor_preferences_dialog.ui → tools/level_editor/preferences_dialog.ui


+ 1 - 1
tools/level_editor/preferences_dialog.vala

@@ -7,7 +7,7 @@ using Gtk;
 
 namespace Crown
 {
-	[GtkTemplate (ui = "/org/pepper/level_editor_preferences_dialog.ui")]
+	[GtkTemplate (ui = "/org/crown/level_editor/preferences_dialog.ui")]
 	public class PreferencesDialog : Gtk.Dialog
 	{
 		// Data

+ 0 - 0
tools/ui/level_editor_project_dialog.ui → tools/level_editor/project_dialog.ui


+ 37 - 0
tools/makefile

@@ -0,0 +1,37 @@
+OBJS = \
+	level_editor/level_editor.xml      \
+	level_editor/preferences_dialog.ui \
+	level_editor/project_dialog.ui     \
+\
+	ui/icons/128x128/pepper.png        \
+	ui/icons/16x16/pepper.png          \
+	ui/icons/24x24/pepper.png          \
+	ui/icons/256x256/pepper.png        \
+	ui/icons/32x32/pepper.png          \
+	ui/icons/64x64/pepper.png          \
+\
+	ui/icons/theme/axis-local.png      \
+	ui/icons/theme/axis-world.png      \
+	ui/icons/theme/layer-locked.png    \
+	ui/icons/theme/layer-visible.png   \
+	ui/icons/theme/level-layers.png    \
+	ui/icons/theme/level-tree.png      \
+	ui/icons/theme/reference-local.png \
+	ui/icons/theme/reference-world.png \
+	ui/icons/theme/run.png             \
+	ui/icons/theme/snap-to-grid.png    \
+	ui/icons/theme/tool-move.png       \
+	ui/icons/theme/tool-place.png      \
+	ui/icons/theme/tool-rotate.png     \
+	ui/icons/theme/tool-scale.png      \
+
+.PHONY: all
+all: gresources.xml $(OBJS)
+	glib-compile-resources gresources.xml --target=gresources.c --generate
+
+.PHONY: clean
+clean:
+	-@rm gresources.c
+
+.PHONY: rebuild
+rebuild: clean all

+ 0 - 37
tools/ui/makefile

@@ -1,37 +0,0 @@
-OBJS = \
-	level_editor_menu.xml              \
-	level_editor_preferences_dialog.ui \
-	level_editor_project_dialog.ui     \
-\
-	icons/128x128/pepper.png           \
-	icons/16x16/pepper.png             \
-	icons/24x24/pepper.png             \
-	icons/256x256/pepper.png           \
-	icons/32x32/pepper.png             \
-	icons/64x64/pepper.png             \
-\
-	icons/theme/axis-local.png         \
-	icons/theme/axis-world.png         \
-	icons/theme/layer-locked.png       \
-	icons/theme/layer-visible.png      \
-	icons/theme/level-layers.png       \
-	icons/theme/level-tree.png         \
-	icons/theme/reference-local.png    \
-	icons/theme/reference-world.png    \
-	icons/theme/run.png                \
-	icons/theme/snap-to-grid.png       \
-	icons/theme/tool-move.png          \
-	icons/theme/tool-place.png         \
-	icons/theme/tool-rotate.png        \
-	icons/theme/tool-scale.png         \
-
-.PHONY: all
-all: resources.xml $(OBJS)
-	glib-compile-resources resources.xml --target=resources.c --generate
-
-.PHONY: clean
-clean:
-	-@rm resources.c
-
-.PHONY: rebuild
-rebuild: clean all

+ 0 - 32
tools/ui/resources.xml

@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gresources>
-	<gresource prefix="/org/pepper">
-		<file compressed="true" preprocess="xml-stripblanks">level_editor_menu.xml</file>
-		<file compressed="true" preprocess="xml-stripblanks">level_editor_preferences_dialog.ui</file>
-		<file compressed="true" preprocess="xml-stripblanks">level_editor_project_dialog.ui</file>
-
-		<file>icons/128x128/pepper.png</file>
-		<file>icons/16x16/pepper.png</file>
-		<file>icons/24x24/pepper.png</file>
-		<file>icons/256x256/pepper.png</file>
-		<file>icons/32x32/pepper.png</file>
-		<file>icons/64x64/pepper.png</file>
-
-		<file>icons/theme/axis-local.png</file>
-		<file>icons/theme/axis-world.png</file>
-		<file>icons/theme/layer-locked.png</file>
-		<file>icons/theme/layer-visible.png</file>
-		<file>icons/theme/level-layers.png</file>
-		<file>icons/theme/level-tree.png</file>
-		<file>icons/theme/reference-local.png</file>
-		<file>icons/theme/reference-world.png</file>
-		<file>icons/theme/run.png</file>
-		<file>icons/theme/snap-to-grid.png</file>
-		<file>icons/theme/tool-move.png</file>
-		<file>icons/theme/tool-place.png</file>
-		<file>icons/theme/tool-rotate.png</file>
-		<file>icons/theme/tool-scale.png</file>
-
-		<file compressed="true">theme/style.css</file>
-	</gresource>
-</gresources>

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov