-
Notifications
You must be signed in to change notification settings - Fork 0
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
Autocomplete list should display constants anywhere #40
Comments
Ah, got it working finally. Needs a standalone line and the constants must be defined in the script. Constants defined in constants.txt are not included on the list. Constants are not yet included with the Ctrl+Space documentation under Hotkeys. Syntax highlighting for constants would be nice to have. Then you know you've spelled it right. I've been modifying the descriptors of constants with proper case and a trailing underscore to prompt the user towards a filtered list. For example;
|
those are essentially enums #20
constants.txt had been implemented recently and not integrated with the autocomplete feature yet. makes sense to correct this.
not sure if that documentation should be exhaustive, as autocomplete is very context-sensitive and would be tedious to list all use cases. maybe need to rewrite to something more general |
another note: list of values for an "extended" param (enum) should not include functions (currently it does). |
How are you defining the difference between Constants and Enums? My initial lists only included stuff that was defined as constants by constant specific opcodes. But the use of constants isn't terribly consistent in the scripts. The only thing that seemed defined completely within the script (SA) and not dependent on outside resources is, iirc, Town Number. I'm dropping the proper case for descriptors of Enums/Constants. It just looks funny. |
Constant is an immutable named value. Example: True=1, False=0, Pi=3.1415. Constants represent values in a human-friendly form, so you don't need to remember them. Enums are scoped constants i.e. a group of constants under a common prefix. Example: you can group town numbers in one enum enum Town then you could use Enums and constants are usually interchangeable, so one can define
|
"Extended" params defined with Sanny classes are also enums, but they don't have the scope name (15 years ago I had to invent many things on my own 🤷♂️) |
This is nice, Sanny doesn't protest about trailing periods in descriptors like it does for constants. Will enums decompile the same way that constants do now? I don't need to imagine. I converted 7000+ sounds from audioevents.txt to constants. It worked, but Sanny wasn't happy about it and took forever to managed the list. |
currently constants are only displaying when the list is called on a standalone statement, not within an opcode. Contansts are applicable anywhere and therefore the list should get a general availability.
Constants defined in constants.txt are not included on the list.
another note: list of values for an "extended" param (enum) should not include functions (currently it does).
should display user-defined constants (const..end)
The text was updated successfully, but these errors were encountered: