IsmAvatar / LateralGM

A free Game Maker source file editor
http://lateralgm.org/
Other
95 stars 25 forks source link

Project Backups With Custom Files #530

Closed Hughtech closed 4 years ago

Hughtech commented 4 years ago

First, let me state that i'm not sure if this is a bug, but i have come across custom fonts placed in the working directory of a gmx project, disappearing at runtime.

to reproduce, create a project. Place your custom font file in the same project you have created. In the create event of an object, place this code

 myfont = font_add("Magic_Sparkle.ttf", 24, true, true, 32, 128)

replacing "Magic_Sparkle.tff" with the name of the font you are using.

In the draw event

  draw_set_font(myfont)
  draw_text(x, y, "Some Text and numbers...0123456789")

Save it and run. At first run, it will work but running it after that, the font disappears.

However if your test project is a gmk file, and the font file is in the within same directory, it works fine and the font remains.

RobertBColton commented 4 years ago

@Hughtech it's the backups mechanism... if your font is inside the GMX... then LGM is renaming the GMX containing the font to the backup name and then writing the project. The backups mechanism doesn't account for users placing their own files into the project folder. I am not sure if it's a good idea for us to support this or not but we could by changing the rename of the project to a file/directory copy and then writing the project.

Hughtech commented 4 years ago

since then, i've found a 'work-around'. By adding the font file as an 'Included' resource and re-configuring its settings as such Screenshot_2020-08-22_12-27-27

Screenshot_2020-08-22_12-28-52

fonts now remain within the project.

I have confirmed this on Linux Mint and Opensuse 32bit machines. I have yet to test on Windows.

RobertBColton commented 4 years ago

That's good and yeah that's technically the more correct thing to do! 👍