User Tools

Site Tools


en:examples:config:getting_values_source_section

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:examples:config:getting_values_source_section [2020/07/01 00:02 (10 days ago)] (current)
sausage created
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 =====
 +
 +<​code=ini>​
 +[WeaponPointing]
 +Hits = 10000
 +
 +[[email protected]]
 +Plasma = true
 +Beam = true
 +
 +[[email protected]]
 +Type = Boss
 +
 +</​code>​
 +
 +===== Code =====
 +
 +<​code=c>​
 + if (orxConfig_HasSection("​Enemy"​)){
 + if (orxConfig_PushSection("​Enemy"​) != orxSTATUS_FAILURE){
 + orxU32 hits = orxConfig_GetU32("​Hits"​);​
 + const orxSTRING sectionHitIsIn = orxConfig_GetValueSource("​Hits"​);​
 + }
 + }
 +</​code>​
 +
 +===== Result =====
 +<WRAP center round box 60%>
 +10000
 +
 +WeaponPointing
 +</​WRAP>​
 +
 +===== See also =====
 +  - [[en:​orx:​config:​main|Main Config Overview]]
 +  - [[en:​examples:​config:​main|Configuration Examples]]
 +  - [[en:​tutorials:​main#​config|Configuration Tutorials]]
 +
 +
  
en/examples/config/getting_values_source_section.txt ยท Last modified: 2020/07/01 00:02 (10 days ago) by sausage