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

Document added System entries (GetEngineInteger and GetEngineString) #260

Closed
ericoporto opened this issue Nov 20, 2024 · 7 comments
Closed

Comments

@ericoporto
Copy link
Member

https://github.com/adventuregamestudio/ags-manual/wiki/System

  /// Gets a runtime engine value represented as integer by the given identifier; is meant for diagnostic purposes only
  import static int GetEngineInteger(EngineValueID value, int index = 0); // $AUTOCOMPLETESTATICONLY$
  /// Gets a runtime engine string by the given identifier; is meant for diagnostic purposes only
  import static String GetEngineString(EngineValueID value, int index = 0); // $AUTOCOMPLETESTATICONLY$

Examples of using it

int spritecachemax = System.GetEngineInteger(ENGINE_VALUE_I_SPRCACHE_MAXNORMAL);
int spritecachecurrent = System.GetEngineInteger(ENGINE_VALUE_I_SPRCACHE_NORMAL);
int spritecachepercent = spritecachecurrent * 100 / spritecachemax;
lblInfo.Text = String.Format("Sprite cache: %d / %d (%d%%)", spritecachecurrent, spritecachemax, spritecachepercent);

These were originally added in this PR adventuregamestudio/ags#2358

The enums are documented in #259

@ericoporto
Copy link
Member Author

after this is in, put mention of it from System.DisplayFPS entry

@ivan-mogilko
Copy link
Contributor

@ericoporto
Copy link
Member Author

@ivan-mogilko we don't actually have any II (indexed integer) enums, do we?

@ivan-mogilko
Copy link
Contributor

@ivan-mogilko we don't actually have any II (indexed integer) enums, do we?

Not right now, but this signature is reserved for that purpose.

@ericoporto
Copy link
Member Author

I think it is better to either remove it or make a note that none of those are there yet, otherwise it looks like at least one of the enums must be a typo.

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Dec 18, 2024

Why remove it? It's a future compatible specification. We are saying that if such value IDs will be added, then they will use this pattern. It's a normal thing for expandable API, imo.

It's also mentioned in enum description here:
https://github.com/adventuregamestudio/ags-manual/wiki/StandardEnums#enginevalueid
and in script api header.

@ericoporto
Copy link
Member Author

ok. Closing this as it is done.

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

No branches or pull requests

2 participants