Improved Compatibility for GM Action Libraries #240

Merged
merged 3 commits into from Jan 26, 2016

Conversation

Projects
None yet
1 participant
@RobertBColton
Collaborator

RobertBColton commented Jan 25, 2016

These are not regressions and existed in 16b4, the transparency is not removed and the image is not cropped to 24x24 as described below.

First addition is adding the /lib folder to .gitignore so nobody accidentally commits it.

In GameMaker, the bottom left pixel of an action image is used as the transparency key just like sprites. I decided to use the utility method for the transparency key because it already implements the correct behavior. I then crop the image to 24x24 as the manual by Mark Overmars states. This addresses the issue originally reported in #161. This is not a more elaborate fix like I constructed for the master branch. So, it is important to note that this means the action libraries can not be written back to disk by LGM, which is generally ok because LGM does not need to do that, only the action library editor does. LGM also doesn't even have the code to save the libraries if it wanted to.

From the official Mark Overmar's Action Library Maker the manual states:
http://sandbox.yoyogames.com/make/extensions
http://gm6guide.altervista.org/phpBB2/viewtopic.php?t=621&sid=9c170ce54a333371ae972b8dbcab3dda

General Action Information
...Next there is the Image that represents the action. This must be a 32x32 image but the actual image should only be 24x24. (This sounds a bit stupid but this is due to the fact that normally 32x32 icons are used for this.) The bottom left pixel color of the 32x32 image specifies the transparency color. The three basic images for normal actions, drawing actions, and questions are included in the folder Action_Images. You might want to use these as the basis for your images to give the actions a consistent look.

NOTE: The text is clipped with an ellipsis for the "Transformation" actions, a separate issue.
GM Action Library Fix

To verify as best as I could, I created the following action image (must be BMP for GM's format, GitHub does not support BMP).
Test Action Image
I used that to create a new action library using Overmar's editor. It behaved as expected and was cropped to 24x24 with the bottom left pixel (pink) used for transparency. After these changes it also behaves the same way in LGM.
GM8.1 Test Action

Also addressed is an issue where if there was no "- Label" action (the little caption above a group of actions) LGM would throw the actions onto the previous library tab (which could be null/lead to an exception), and that made no sense because it was not part of that library, it would leave its own library tab empty. That was addressed by moving the local inside the for loop, afterwards LGM behaves exactly as GM8.1.
Action Library Caption Label Fix

Fixes Custom Action Library Transparency
In GameMaker, the bottom left pixel of an action image is used as the
transparency key just like sprites. This is not a regression and existed
in 16b4, the transparency is not removed as can be seen below. I decided
to use the utility method for the transparency key because it already
implements the correct behavior. This addresses the issue originally
reported in #161. However, it is important to note that this means the
action libraries can not be written back to disk by LGM, which is
generally ok because LGM does not need to do that only the action library
editor does. This is not a more elaborate fix like I constructed for the master branch.

@RobertBColton RobertBColton changed the title from Fixes Custom Action Library Transparency to Fixes GM Action Library Transparency Jan 25, 2016

Fixes caption label actions and cropping
Crops the images to 24x24 as the Overmar's manual specifies. Also moves a
local variable inside a for loop to make sure actions are not added to the
previous tab, as GM does, and preventing an exception.

@RobertBColton RobertBColton changed the title from Fixes GM Action Library Transparency to Improved Compatibility for GM Action Libraries Jan 25, 2016

RobertBColton added a commit that referenced this pull request Jan 26, 2016

Merge pull request #240 from RobertBColton/16b5
Improved Compatibility for GM Action Libraries

@RobertBColton RobertBColton merged commit 36dc545 into IsmAvatar:16b5 Jan 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment