Adventure Game Studio

AGS Development => Editor Development => Topic started by: vga256 on Wed 20/07/2022 19:46:41

Title: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: vga256 on Wed 20/07/2022 19:46:41
I'm not sure if this is a reasonable or easily implementable request, so this is more of an RFC for the time being: would it be possible to add Custom Properties for GUIs and GUI controls in the editor? I'm working on a game that is extremely GUI-heavy, and one of the pain points is being unable to assign custom properties to GUIs and controls that would allow me to customize behaviour for each control.

For example, I have the "Expandable" property which applies to window GUIs. This allows a window to be maximized, minimized, and returned to a standard size. Right now, I keep track of this via a huge struct array that I have to manually populate in script like this:


  Windows[gDottedWindow.ID].Vertical = new WindowExpansion;
  Windows[gDottedWindow.ID].guiID = gDottedWindow.ID;
  Windows[gDottedWindow.ID].Panel = RightPanel;
  Windows[gDottedWindow.ID].Vertical.ExpandedSize = gDottedWindow.Height;
  Windows[gDottedWindow.ID].Vertical.CollapsedSize = WINDOW_TITLEBAR_HEIGHT;
  gDottedWindow.AddToStack();


Ideally, I'd love to be able to do something like this instead:
Via the editor, create "IsExpandable" and "ExpansionState" boolean custom properties to all GUIs.

Then in code I could call it like this:


if (currentGUISelected.GetProperty("IsExpandable"))
{
    ExpandGUI(currentGUISelected);
    currentGUISelected.GetProperty("ExpansionState") = true;
}


I would no longer have to keep track of each GUIs properties via an array of struct, and this would make GUIs more consistent with how Rooms are designed.

Welcoming any thoughts on this idea.
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: Crimson Wizard on Wed 20/07/2022 21:12:31
I guess it's pretty much okay to add Custom Properties to all remaining object types (including GUI, Regions, walkable areas, and whatnot).

I should only note that for "AGS 4" we had an idea of creating a full object hierarchy, where everything goes from same parent type(s), similar to how every gui control inherits GUIControl base type. In that case Get/SetProperty functions might be added to the parent and become available for all at once.
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: vga256 on Sun 24/07/2022 16:03:32
Thanks for the feedback CW.

Hearing no objections to the idea, please consider this as a feature request for a future release of 3.6.x! :)
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: Crimson Wizard on Sun 24/07/2022 17:01:04
Quote from: vga256 on Sun 24/07/2022 16:03:32
Hearing no objections to the idea, please consider this as a feature request for a future release of 3.6.x! :)

I think our current thought is to shift to developing "AGS 4" and only keep 3.* branch for perfomance improvements. This is way long overdue.
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: vga256 on Mon 25/07/2022 01:53:18
Quote from: Crimson Wizard on Sun 24/07/2022 17:01:04
I think our current thought is to shift to developing "AGS 4" and only keep 3.* branch for perfomance improvements. This is way long overdue.

Gotcha.
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: eri0o on Sun 25/08/2024 16:41:58
This was added to ags4 in https://github.com/adventuregamestudio/ags/pull/2479 and https://github.com/adventuregamestudio/ags/pull/2494
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: Crimson Wizard on Mon 26/08/2024 05:57:51
Quote from: eri0o on Sun 25/08/2024 16:41:58This was added to ags4 in https://github.com/adventuregamestudio/ags/pull/2479 and https://github.com/adventuregamestudio/ags/pull/2494

Right, but it's not in the released version yet. Will need to update this topic when these make to the released update.
Title: Re: [Feature Request] Custom Properties for GUIs and GUI controls
Post by: Crimson Wizard on Wed 18/09/2024 02:06:04
This is now added to AGS 4, see:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-4-0-early-alpha-for-public-test/msg636665729/#msg636665729