Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sealedoff #1

wants to merge 9 commits into from


Copy link

commented Aug 8, 2018

This branch focuses on "sealing off" this module's script from the global script and from the game.
The goal is to make this module less dependant on any global data from the game.

Specifically :

  • Removing global variables from the script (GUI names, font names...). Now they must be set up externally (only once) at game startup time.
  • Moving as much code as possible from the global script to the module script. Ultimately, the call OptionGui.OnClick would disappear from the global script, but independant click detection is not implemented yet.

Additionally to that, some (moderate) effort is put into gathering global variables from the modules' scripts into objects (structs), as members. This achieves two things : 1) This acts like a primitive namespace (you know instantly where the variables come from), 2) This certifies that there are no unexepected "export" of variables.

BERGOUNIOUX Mathieu added 5 commits Aug 5, 2018
Mathieu Bergounioux
- moved module internal variables to a struct
- removed all global variables (GUIs and fonts). They must now be set once using a function.
- removed export on ItemGiven and created an accessor instead.
- Similarly, added an accessor on UsedAction
Mathieu Bergounioux
- I have split the controllers of GUIs. There's now one controller fo…
…r Save, one for Load and one for Options

- I have removed global variables from the Options script : the fonts and the GUIs must now be set externally, in TemplateSettings
- I have moved "Offset" and "Distance" to a utility class

This comment has been minimized.

Copy link

commented Aug 8, 2018

@jeancallisti , something I noticed:

#ifndef __OPTION_GUI_MODULE__ //a dependency is missing
    void game_start()
        AbortGame("Missing module 'OptionGui'");

You could instead use #error command like

#ifndef __OPTION_GUI_MODULE__ //a dependency is missing
    #error Missing module 'OptionGui'

This will report error at compile time.

Mathieu Bergounioux added 4 commits Aug 9, 2018
Mathieu Bergounioux
- moved more time-related code to the time-related struct
- added reminders to remove references to gMain
- fixed some references to global variables that I overlooked in previous commits
- created a structure to manage translatable buttons and store their …
…data independently frm their current state

- made it possible to setup the buttons and their graphics outside of the module for better integration with larger code base
- now that the values are object members, I have shortened their names
- Made function Verbs::GetButtonAction more robust (had issues dealing with action 0)
- Made most enums start at value 0 instead of 1, to avoid a "dead" value at the beginning of iterations

This comment has been minimized.

Copy link

commented Nov 6, 2018

This pull request has some issues.
GlobalScript Line 48 should be: Verbs.Localize();
GlobalScript Line 62 should be: Verbs.SetAction(Verbs.GetButtonAction(control.AsButton));

Also in your branch the functions dropdown in the AGS Editor doesn't work anymore, or it least it can't show any functions.
I've fixed the bugs and merged your commits manually.

@dkrey dkrey closed this Nov 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.