Pol  Revision:cb584c9
cmbtcfg.cpp
Go to the documentation of this file.
1 
12 #include "cmbtcfg.h"
13 
14 #include "../clib/cfgelem.h"
15 #include "../clib/cfgfile.h"
16 #include "../clib/fileutil.h"
17 #include "../clib/logfacility.h"
18 #include "../plib/systemstate.h"
19 #include "globals/settings.h"
20 
21 namespace Pol
22 {
23 namespace Core
24 {
26 {
28  Clib::ConfigElem elem;
29  if ( Clib::FileExists( "config/combat.cfg" ) )
30  {
31  cf.open( "config/combat.cfg" );
32  cf.readraw( elem );
33  }
34  else if ( Plib::systemstate.config.loglevel > 1 )
35  INFO_PRINT << "File config/combat.cfg not found, skipping.\n";
36 
38  elem.remove_bool( "DisplayParrySuccessMessages", false );
40  elem.remove_bool( "WarmodeInhibitsRegen", false );
41  settingsManager.combat_config.attack_self = elem.remove_bool( "SingleCombat", false );
42  settingsManager.combat_config.warmode_delay = elem.remove_ulong( "WarModeDelay", 1 );
43  settingsManager.combat_config.core_hit_sounds = elem.remove_bool( "CoreHitSounds", false );
45  elem.remove_bool( "ScriptedAttackChecks", false );
46  settingsManager.combat_config.reset_swing_onturn = elem.remove_bool( "ResetSwingOnTurn", false );
47  settingsManager.combat_config.send_swing_packet = elem.remove_bool( "SendSwingPacket", true );
48  settingsManager.combat_config.send_damage_packet = elem.remove_bool( "SendDamagePacket", false );
49  settingsManager.combat_config.attack_while_frozen = elem.remove_bool( "AttackWhileFrozen", true );
50  settingsManager.combat_config.send_attack_msg = elem.remove_bool( "SendAttackMsg", true );
51 }
52 }
53 }
bool display_parry_success_messages
Definition: cmbtcfg.h:17
SystemState systemstate
Definition: systemstate.cpp:12
unsigned int remove_ulong(const char *propname)
Definition: cfgfile.cpp:461
static void read_combat_config()
Definition: cmbtcfg.cpp:25
void readraw(ConfigElem &elem)
Definition: cfgfile.cpp:1028
void open(const char *i_filename)
Definition: cfgfile.cpp:600
SettingsManager settingsManager
Definition: settings.cpp:14
CombatConfig combat_config
Definition: settings.h:28
bool FileExists(const char *filename)
Definition: fileutil.cpp:118
#define INFO_PRINT
Definition: logfacility.h:223
Definition: berror.cpp:12
unsigned int warmode_delay
Definition: cmbtcfg.h:20
bool remove_bool(const char *propname)
Definition: cfgfile.cpp:426