Use a default icon

This commit is contained in:
Joshua Granick
2015-07-11 20:30:47 -07:00
parent ffdf15f080
commit 8920ff5317
11 changed files with 136 additions and 67 deletions

View File

@@ -16,6 +16,7 @@ import lime.tools.helpers.ProcessHelper;
import lime.project.Architecture;
import lime.project.AssetType;
import lime.project.HXProject;
import lime.project.Icon;
import lime.project.PlatformTarget;
import sys.io.File;
import sys.FileSystem;
@@ -322,10 +323,17 @@ class AndroidPlatform extends PlatformTarget {
var iconTypes = [ "ldpi", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi" ];
var iconSizes = [ 36, 48, 72, 96, 144, 192 ];
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
for (i in 0...iconTypes.length) {
if (IconHelper.createIcon (project.icons, iconSizes[i], iconSizes[i], destination + "/res/drawable-" + iconTypes[i] + "/icon.png")) {
if (IconHelper.createIcon (icons, iconSizes[i], iconSizes[i], destination + "/res/drawable-" + iconTypes[i] + "/icon.png")) {
context.HAS_ICON = true;
@@ -333,7 +341,7 @@ class AndroidPlatform extends PlatformTarget {
}
IconHelper.createIcon (project.icons, 732, 412, destination + "/res/drawable-xhdpi/ouya_icon.png");
IconHelper.createIcon (icons, 732, 412, destination + "/res/drawable-xhdpi/ouya_icon.png");
var packageDirectory = project.meta.packageName;
packageDirectory = destination + "/src/" + packageDirectory.split (".").join ("/");

View File

@@ -16,6 +16,7 @@ import lime.tools.helpers.ProcessHelper;
import lime.project.AssetType;
import lime.project.Haxelib;
import lime.project.HXProject;
import lime.project.Icon;
import lime.project.NDLL;
import lime.project.PlatformTarget;
import sys.io.File;
@@ -320,9 +321,17 @@ class BlackBerryPlatform extends PlatformTarget {
context.ICONS = [];
context.HAS_ICON = false;
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
for (size in [ 114, 86 ]) {
if (IconHelper.createIcon (project.icons, size, size, PathHelper.combine (destination, "icon-" + size + ".png"))) {
if (IconHelper.createIcon (icons, size, size, PathHelper.combine (destination, "icon-" + size + ".png"))) {
context.ICONS.push ("icon-" + size + ".png");
context.HAS_ICON = true;

View File

@@ -8,6 +8,7 @@ import lime.tools.helpers.IconHelper;
import lime.tools.helpers.PathHelper;
import lime.tools.helpers.LogHelper;
import lime.project.HXProject;
import lime.project.Icon;
import sys.FileSystem;
@@ -68,10 +69,17 @@ class FirefoxPlatform extends HTML5Platform {
FileHelper.recursiveCopyTemplate (project.templatePaths, "firefox/template", destination, context);
var sizes = [ 32, 48, 60, 64, 128, 512 ];
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
for (size in sizes) {
IconHelper.createIcon (project.icons, size, size, PathHelper.combine (destination, "icon-" + size + ".png"));
IconHelper.createIcon (icons, size, size, PathHelper.combine (destination, "icon-" + size + ".png"));
}

View File

@@ -23,6 +23,7 @@ import lime.project.Asset;
import lime.project.AssetType;
import lime.project.Haxelib;
import lime.project.HXProject;
import lime.project.Icon;
import lime.project.Keystore;
import lime.project.NDLL;
import lime.project.Platform;
@@ -384,15 +385,23 @@ class IOSPlatform extends PlatformTarget {
{ name : "Icon-76@2x.png", size : 152 },
{ name : "Icon-60@3x.png", size : 180 },
];
context.HAS_ICON = true;
var iconPath = PathHelper.combine (projectDirectory, "Images.xcassets/AppIcon.appiconset");
PathHelper.mkdir (iconPath);
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
for (iconSize in iconSizes) {
if (!IconHelper.createIcon (project.icons, iconSize.size, iconSize.size, PathHelper.combine (iconPath, iconSize.name))) {
if (!IconHelper.createIcon (icons, iconSize.size, iconSize.size, PathHelper.combine (iconPath, iconSize.name))) {
context.HAS_ICON = false;

View File

@@ -19,6 +19,7 @@ import lime.project.AssetType;
import lime.project.Architecture;
import lime.project.Haxelib;
import lime.project.HXProject;
import lime.project.Icon;
import lime.project.Platform;
import lime.project.PlatformTarget;
import sys.io.File;
@@ -317,7 +318,15 @@ class MacPlatform extends PlatformTarget {
FileHelper.copyFileTemplate (project.templatePaths, "mac/Info.plist", targetDirectory + "/bin/" + project.app.file + ".app/Contents/Info.plist", context);
FileHelper.copyFileTemplate (project.templatePaths, "mac/Entitlements.plist", targetDirectory + "/bin/" + project.app.file + ".app/Contents/Entitlements.plist", context);
context.HAS_ICON = IconHelper.createMacIcon (project.icons, PathHelper.combine (contentDirectory,"icon.icns"));
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
context.HAS_ICON = IconHelper.createMacIcon (icons, PathHelper.combine (contentDirectory, "icon.icns"));
for (asset in project.assets) {

View File

@@ -13,6 +13,7 @@ import lime.tools.helpers.ProcessHelper;
import lime.tools.helpers.TizenHelper;
import lime.project.AssetType;
import lime.project.HXProject;
import lime.project.Icon;
import lime.project.PlatformTarget;
import sys.io.File;
import sys.FileSystem;
@@ -180,7 +181,15 @@ class TizenPlatform extends PlatformTarget {
PathHelper.mkdir (destination + "shared/res/screen-density-xhigh");
if (IconHelper.createIcon (project.icons, 117, 117, PathHelper.combine (destination + "shared/res/screen-density-xhigh", "mainmenu.png"))) {
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
if (IconHelper.createIcon (icons, 117, 117, PathHelper.combine (destination + "shared/res/screen-density-xhigh", "mainmenu.png"))) {
context.APP_ICON = "mainmenu.png";

View File

@@ -13,6 +13,7 @@ import lime.tools.helpers.ProcessHelper;
import lime.tools.helpers.WebOSHelper;
import lime.project.AssetType;
import lime.project.HXProject;
import lime.project.Icon;
import lime.project.PlatformTarget;
import sys.io.File;
import sys.FileSystem;
@@ -151,7 +152,15 @@ class WebOSPlatform extends PlatformTarget {
var context = project.templateContext;
context.CPP_DIR = targetDirectory + "/obj";
if (IconHelper.createIcon (project.icons, 64, 64, PathHelper.combine (destination, "icon.png"))) {
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
if (IconHelper.createIcon (icons, 64, 64, PathHelper.combine (destination, "icon.png"))) {
context.APP_ICON = "icon.png";

View File

@@ -3,6 +3,7 @@ package lime.tools.platforms;
import haxe.io.Path;
import haxe.Template;
import lime.project.Icon;
import lime.tools.helpers.AssetHelper;
import lime.tools.helpers.CPPHelper;
import lime.tools.helpers.DeploymentHelper;
@@ -95,6 +96,14 @@ class WindowsPlatform extends PlatformTarget {
}
var icons = project.icons;
if (icons.length == 0) {
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
}
//IconHelper.createIcon (project.icons, 32, 32, PathHelper.combine (applicationDirectory, "icon.png"));
if (targetType == "neko") {
@@ -103,7 +112,7 @@ class WindowsPlatform extends PlatformTarget {
var iconPath = PathHelper.combine (applicationDirectory, "icon.ico");
if (!IconHelper.createWindowsIcon (project.icons, iconPath)) {
if (!IconHelper.createWindowsIcon (icons, iconPath)) {
iconPath = null;
@@ -150,7 +159,7 @@ class WindowsPlatform extends PlatformTarget {
var iconPath = PathHelper.combine (applicationDirectory, "icon.ico");
if (IconHelper.createWindowsIcon (project.icons, iconPath) && PlatformHelper.hostPlatform == WINDOWS) {
if (IconHelper.createWindowsIcon (icons, iconPath) && PlatformHelper.hostPlatform == WINDOWS) {
var templates = [ PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates" ].concat (project.templatePaths);
ProcessHelper.runCommand ("", PathHelper.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ executablePath, iconPath, "1" ], true, true);

View File

@@ -1,54 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
]>
<svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1371.6px"
height="1371.6px" viewBox="0 0 1371.6 1371.6" enable-background="new 0 0 1371.6 1371.6" xml:space="preserve">
<metadata>
<sfw xmlns="&ns_sfw;">
<slices></slices>
<sliceSourceBounds width="1079.91" height="1367.408" bottomLeftOrigin="true" x="-234.016" y="-286.092"></sliceSourceBounds>
</sfw>
</metadata>
<g id="Shape_19_1_" enable-background="new ">
<g id="Shape_19">
<g>
<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#8C9C42" points="1195.316,936.171 1190.961,422.366 711.929,152.4
711.929,56.606 176.284,409.303 184.994,962.297 646.607,1227.909 646.607,1310.64 "/>
</g>
<g>
<polygon fill="none" stroke="#71AD1B" stroke-width="60.4839" stroke-miterlimit="100" points="1195.316,936.171
1190.961,422.366 711.929,152.4 711.929,56.606 176.284,409.303 184.994,962.297 646.607,1227.909 646.607,1310.64 "/>
</g>
</g>
</g>
<g id="Shape_18_copy_1_" opacity="0.502" enable-background="new ">
<g id="Shape_18_copy">
<g>
<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" points="703.219,683.623 698.155,695.438 698.865,182.88
664.026,148.046 663.338,680.291 212.916,938 230.336,968.167 685.8,705.394 684.814,703.093 694.922,702.98 690.155,714.103
1143.058,949.234 1164.832,923.109 "/>
</g>
</g>
</g>
<g id="Shape_20_copy_1_" enable-background="new ">
<g id="Shape_20_copy">
<g>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M1172.718,936.171h0.824l2.218-498.411l-7.035-4.166
l0.189-0.341l-470.05-273.635V91.44L250.903,386.114l-57.2,31.898l4.355,531.223l1.297-0.324l-1.348,2.316l466.018,271.956
v61.332l501.303-341.361l8.505-5.133L1172.718,936.171z M665.741,194.562l447.104,247.473L684.288,675.308L244.653,428.044
L665.741,194.562z M698.865,707.025l439.818-239.87l0.02,451.38l-439.838,265.454V707.025z M232.897,931.221V461.399
l431.129,242.479v478.15L232.897,931.221z"/>
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
]>
<svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1371.6px"
height="1371.6px" viewBox="0 0 1371.6 1371.6" enable-background="new 0 0 1371.6 1371.6" xml:space="preserve">
<metadata>
<sfw xmlns="&ns_sfw;">
<slices></slices>
<sliceSourceBounds width="1079.91" height="1367.408" bottomLeftOrigin="true" x="-234.016" y="-286.092"></sliceSourceBounds>
</sfw>
</metadata>
<g id="Shape_19_1_" enable-background="new ">
<g id="Shape_19">
<g>
<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#8C9C42" points="1195.316,936.171 1190.961,422.366 711.929,152.4
711.929,56.606 176.284,409.303 184.994,962.297 646.607,1227.909 646.607,1310.64 "/>
</g>
<g>
<polygon fill="none" stroke="#71AD1B" stroke-width="60.4839" stroke-miterlimit="100" points="1195.316,936.171
1190.961,422.366 711.929,152.4 711.929,56.606 176.284,409.303 184.994,962.297 646.607,1227.909 646.607,1310.64 "/>
</g>
</g>
</g>
<g id="Shape_18_copy_1_" opacity="0.502" enable-background="new ">
<g id="Shape_18_copy">
<g>
<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" points="703.219,683.623 698.155,695.438 698.865,182.88
664.026,148.046 663.338,680.291 212.916,938 230.336,968.167 685.8,705.394 684.814,703.093 694.922,702.98 690.155,714.103
1143.058,949.234 1164.832,923.109 "/>
</g>
</g>
</g>
<g id="Shape_20_copy_1_" enable-background="new ">
<g id="Shape_20_copy">
<g>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M1172.718,936.171h0.824l2.218-498.411l-7.035-4.166
l0.189-0.341l-470.05-273.635V91.44L250.903,386.114l-57.2,31.898l4.355,531.223l1.297-0.324l-1.348,2.316l466.018,271.956
v61.332l501.303-341.361l8.505-5.133L1172.718,936.171z M665.741,194.562l447.104,247.473L684.288,675.308L244.653,428.044
L665.741,194.562z M698.865,707.025l439.818-239.87l0.02,451.38l-439.838,265.454V707.025z M232.897,931.221V461.399
l431.129,242.479v478.15L232.897,931.221z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

0
templates/project/Assets/.gitignore vendored Normal file
View File

View File

@@ -8,7 +8,6 @@
<haxelib name="lime" />
<assets path="Assets" rename="assets" exclude="lime.svg" />
<icon path="Assets/lime.svg" />
<assets path="Assets" rename="assets" />
</project>