Skip to content

Commit 4b75acd

Browse files
committed
Fix issue with {appfolder} usage in templates
1 parent d8fc345 commit 4b75acd

File tree

7 files changed

+13
-57
lines changed

7 files changed

+13
-57
lines changed

CardMaker/Card/CardPathUtil.cs

Lines changed: 0 additions & 49 deletions
This file was deleted.

CardMaker/Card/ImageCache.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
using System.Drawing;
3030
using System.Drawing.Imaging;
3131
using System.IO;
32-
using System.Linq.Expressions;
3332
using CardMaker.Data;
3433
using CardMaker.Data.Serialization;
3534
using CardMaker.Events.Managers;
@@ -46,6 +45,8 @@ namespace CardMaker.Card
4645
{
4746
public static class ImageCache
4847
{
48+
private const string APPLICATION_FOLDER_MARKER = "{appfolder}";
49+
4950
public enum ImageCacheEntryType
5051
{
5152
File,
@@ -335,6 +336,12 @@ private static string GetExistingFilePath(string sFile)
335336
{
336337
try
337338
{
339+
if (sFile.StartsWith(APPLICATION_FOLDER_MARKER))
340+
{
341+
sFile = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
342+
sFile.Replace(APPLICATION_FOLDER_MARKER, string.Empty));
343+
}
344+
338345
if (File.Exists(sFile))
339346
{
340347
return sFile;

CardMaker/CardMaker.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
<Compile Include="Card\CardCanvas.cs">
8080
<SubType>UserControl</SubType>
8181
</Compile>
82-
<Compile Include="Card\CardPathUtil.cs" />
8382
<Compile Include="Card\CardRenderer.cs" />
8483
<Compile Include="Card\CommandLine\CommandLineEnumerations.cs" />
8584
<Compile Include="Card\CommandLine\CommandLineExporterBase.cs" />

CardMaker/CardMakerBuild.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// SOFTWARE.
2323
////////////////////////////////////////////////////////////////////////////////
2424

25-
//#define UNSTABLE
25+
#define UNSTABLE
2626

2727
namespace CardMaker
2828
{
@@ -31,7 +31,7 @@ public static class CardMakerBuild
3131
public static string GetBuildSuffix()
3232
{
3333
#if UNSTABLE
34-
return "[UNSTABLE] V.A8";
34+
return "[UNSTABLE] V.A1";
3535
#else
3636
return string.Empty;
3737
#endif

CardMaker/CardMaker_Mono.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
<Compile Include="Card\CardCanvas.cs">
7979
<SubType>UserControl</SubType>
8080
</Compile>
81-
<Compile Include="Card\CardPathUtil.cs" />
8281
<Compile Include="Card\CardRenderer.cs" />
8382
<Compile Include="Card\CommandLine\CommandLineEnumerations.cs" />
8483
<Compile Include="Card\CommandLine\CommandLineExporterBase.cs" />

CardMaker/Forms/MDIElementControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ private void btnSetSizeToImage_Click(object sender, EventArgs e)
640640
Logger.AddLogLine("Unable to set element size. Is an element selected?");
641641
return;
642642
}
643-
var zBmp = ImageCache.LoadCustomImageFromCache(CardPathUtil.getPath(txtElementVariable.Text), zElement);
643+
var zBmp = ImageCache.LoadCustomImageFromCache(txtElementVariable.Text, zElement);
644644
if (null == zBmp)
645645
{
646646
// attempt a translated version of the element variable

CardMaker/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("1.4.0.0")]
32-
[assembly: AssemblyFileVersion("1.4.0.0")]
31+
[assembly: AssemblyVersion("1.5.0.0")]
32+
[assembly: AssemblyFileVersion("1.5.0.0")]

0 commit comments

Comments
 (0)