This shows you the differences between two versions of the page.
— | en:examples:config:getting_values_source_section [2020/06/30 17:02 (4 years ago)] (current) – created sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Getting the source section of a value ====== | ||
+ | |||
+ | This is for sections that are inherited, and you want to know what section the inherited value comes from. | ||
+ | |||
+ | ===== Example Config ===== | ||
+ | |||
+ | < | ||
+ | [WeaponPointing] | ||
+ | Hits = 10000 | ||
+ | |||
+ | [Weapons@WeaponPointing] | ||
+ | Plasma = true | ||
+ | Beam = true | ||
+ | |||
+ | [Enemy@Weapons] | ||
+ | Type = Boss | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Code ===== | ||
+ | |||
+ | < | ||
+ | if (orxConfig_HasSection(" | ||
+ | if (orxConfig_PushSection(" | ||
+ | orxU32 hits = orxConfig_GetU32(" | ||
+ | const orxSTRING sectionHitIsIn = orxConfig_GetValueSource(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Result ===== | ||
+ | <WRAP center round box 60%> | ||
+ | 10000 | ||
+ | |||
+ | WeaponPointing | ||
+ | </ | ||
+ | |||
+ | ===== See also ===== | ||
+ | - [[en: | ||
+ | - [[en: | ||
+ | - [[en: | ||
+ | |||
+ | |||