Use a default icon
This commit is contained in:
@@ -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 ("/");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -390,9 +391,17 @@ class IOSPlatform extends PlatformTarget {
|
||||
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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
0
templates/project/Assets/.gitignore
vendored
Normal file
0
templates/project/Assets/.gitignore
vendored
Normal 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>
|
||||
Reference in New Issue
Block a user