T
T-bond
Guest
The new macro definition method is super cool, and long wanted.
But for now, I can't figure out the way how to change their value depending on the current configuration.
In GMS 1.4 for every configuration selected there was a separate Macro editor, so for example I could toggle between the ,,NoAd" or ,,Ad" configuration, and it would change my macros value.
If I want to do the same thing in GMS 2, I have to
instead of
There should be an #ifdef directive at least to check if a configuration is enabled.
For example:
It could speed up the runtime a bit, and would be also much easier to handle because of the new auto complete feature can help with macros.
(#macro could be replaced with #define, but it is fine also.)
So what do you think? Should be this added to GMS2 or not? (I'm interested in the whys too.)
If enough people say that they want this too, I will open a bug (suggestion) report for it.
But for now, I can't figure out the way how to change their value depending on the current configuration.
In GMS 1.4 for every configuration selected there was a separate Macro editor, so for example I could toggle between the ,,NoAd" or ,,Ad" configuration, and it would change my macros value.
If I want to do the same thing in GMS 2, I have to
Code:
if(use os_get_config() == "Ads")
//Show ads
Code:
if(ENABLE_ADS)
//Show ads
For example:
Code:
#ifdef __CONFIG_Android__
#macro ENABLE_ACHIEVEMENTS true
#macro ENABLE_CLOUD_SAVE true
#macro ENABLE_ADS true
#macro ENABLE_FACEBOOK true
#macro ENABLE_IAP true
#else
#macro ENABLE_ACHIEVEMENTS true
#macro ENABLE_CLOUD_SAVE true
#macro ENABLE_ADS false
#macro ENABLE_FACEBOOK false
#macro ENABLE_IAP false
#endif
(#macro could be replaced with #define, but it is fine also.)
So what do you think? Should be this added to GMS2 or not? (I'm interested in the whys too.)
If enough people say that they want this too, I will open a bug (suggestion) report for it.
Last edited by a moderator: