diff --git a/main/midnight/Classes/landscaping/LandscapeColour.cpp b/main/midnight/Classes/landscaping/LandscapeColour.cpp index 5e92e727..8a67e7bd 100644 --- a/main/midnight/Classes/landscaping/LandscapeColour.cpp +++ b/main/midnight/Classes/landscaping/LandscapeColour.cpp @@ -7,7 +7,7 @@ #include "LandscapeColour.h" #include "../ui/uihelper.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "LandscapeView.h" USING_NS_CC; diff --git a/main/midnight/Classes/models/selectmodel.cpp b/main/midnight/Classes/models/selectmodel.cpp index 6ba5e0ad..ab6eebe2 100644 --- a/main/midnight/Classes/models/selectmodel.cpp +++ b/main/midnight/Classes/models/selectmodel.cpp @@ -9,7 +9,7 @@ #include "selectmodel.h" #include "../system/tmemanager.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../tme_interface.h" using namespace chilli::lib; diff --git a/main/midnight/Classes/panels/panel_dedication.cpp b/main/midnight/Classes/panels/panel_dedication.cpp index 014e70eb..e1d179fb 100644 --- a/main/midnight/Classes/panels/panel_dedication.cpp +++ b/main/midnight/Classes/panels/panel_dedication.cpp @@ -10,7 +10,7 @@ #include "panel_mainmenu.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/resolutionmanager.h" #include "../system/panelmanager.h" #include "../ui/uihelper.h" diff --git a/main/midnight/Classes/panels/panel_look.cpp b/main/midnight/Classes/panels/panel_look.cpp index 3795cc48..836ae72c 100644 --- a/main/midnight/Classes/panels/panel_look.cpp +++ b/main/midnight/Classes/panels/panel_look.cpp @@ -4,7 +4,7 @@ #include "panel_think.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/helpmanager.h" #include "../system/resolutionmanager.h" #include "../system/keyboardmanager.h" @@ -729,7 +729,7 @@ bool panel_look::moveForward ( void ) // something is in our way that we must fight // so check for auto fight if ( location_flags&lif_fight ) { - if ( mr->config->autofight ) { + if ( mr->settings->autofight ) { // do we have an army? // do we have the correct sword? @@ -747,7 +747,7 @@ bool panel_look::moveForward ( void ) // mr->checkUnhide? if ( Character_IsHidden(c) ) { - if ( mr->config->autounhide ) { + if ( mr->settings->autounhide ) { if ( Character_Hide(c) ) { } } @@ -943,7 +943,7 @@ void panel_look::hideMenus ( void ) void panel_look::fadeIn ( rgb_t colour, f32 initialAlpha, MXVoidCallback callback ) { - if ( !mr->config->screentransitions ) { + if ( !mr->settings->screentransitions ) { if ( callback != nullptr ) { callback(); } @@ -973,7 +973,7 @@ void panel_look::fadeIn ( rgb_t colour, f32 initialAlpha, MXVoidCallback callba void panel_look::fadeOut ( rgb_t colour, f32 initialAlpha, MXVoidCallback callback ) { - if ( !mr->config->screentransitions ) { + if ( !mr->settings->screentransitions ) { if ( callback != nullptr ) { callback(); } @@ -1408,21 +1408,21 @@ bool panel_look::OnMouseEvent( Touch* touch, Event* event, bool pressed ) auto position = touch->getLocation(); - if ( mr->config->nav_mode!=CF_NAV_SWIPE ) { + if ( mr->settings->nav_mode!=CF_NAV_SWIPE ) { int move_press_y = size.height - RES(MOUSE_MOVE_BLEED) ; // use full centre height if we are only pressing - if ( mr->config->nav_mode==CF_NAV_SWIPE_MOVE_PRESS_LOOK) + if ( mr->settings->nav_mode==CF_NAV_SWIPE_MOVE_PRESS_LOOK) move_press_y = size.height * 0.75 ; - else if ( mr->config->nav_mode==CF_NAV_PRESS ) + else if ( mr->settings->nav_mode==CF_NAV_PRESS ) move_press_y = size.height ; if ( IsLeftMouseDown ) { - if ( mr->config->nav_mode!=CF_NAV_SWIPE_MOVE_PRESS_LOOK) { + if ( mr->settings->nav_mode!=CF_NAV_SWIPE_MOVE_PRESS_LOOK) { if ( position.y > move_press_y && (position.x>RES(MOUSE_LOOK_BLEED) && position.x < imgShield->getPosition().x ) ) { @@ -1446,7 +1446,7 @@ bool panel_look::OnMouseEvent( Touch* touch, Event* event, bool pressed ) if ( currentMovementIndicator == LM_NONE ) return true; - if ( mr->config->nav_mode!=CF_NAV_SWIPE_MOVE_PRESS_LOOK) { + if ( mr->settings->nav_mode!=CF_NAV_SWIPE_MOVE_PRESS_LOOK) { if ( position.y > move_press_y && (position.x>RES(MOUSE_LOOK_BLEED) && position.x < imgShield->getPosition().x ) ) { @@ -1473,7 +1473,7 @@ bool panel_look::OnMouseEvent( Touch* touch, Event* event, bool pressed ) void panel_look::setupMovementIndicators() { - if ( !mr->config->showmovementindicators ) + if ( !mr->settings->showmovementindicators ) return; f32 scale = 2.5f; @@ -1502,7 +1502,7 @@ void panel_look::updateMovementIndicators(LANDSCAPE_MOVEMENT movement) bool drawArrows = movement != LM_NONE ; currentMovementIndicator = movement; - if ( !mr->config->showmovementindicators ) + if ( !mr->settings->showmovementindicators ) return; for ( int ii=0; iiconfig->nav_mode ; + int value = mr->settings->nav_mode ; if ( value != CF_NAV_PRESS) return TRUE; return FALSE; @@ -1529,7 +1529,7 @@ bool panel_look::allowDragDownMove() bool panel_look::allowDragLook() { - int value = mr->config->nav_mode ; + int value = mr->settings->nav_mode ; if ( value != CF_NAV_PRESS && value != CF_NAV_SWIPE_MOVE_PRESS_LOOK ) return TRUE; return FALSE; diff --git a/main/midnight/Classes/panels/panel_mainmenu.cpp b/main/midnight/Classes/panels/panel_mainmenu.cpp index 27b532e8..b118136f 100644 --- a/main/midnight/Classes/panels/panel_mainmenu.cpp +++ b/main/midnight/Classes/panels/panel_mainmenu.cpp @@ -164,7 +164,7 @@ void panel_mainmenu::OnMenuNotification( const uinotificationinterface* sender, void panel_mainmenu::OnShowManual() { AreYouSure(_NOVELLA_PROMPT_, [&] { - if ( mr->config->novella_pdf ) { + if ( mr->settings->novella_pdf ) { OpenPDF(_NOVELLA_DOCUMENT_PDF_); }else{ OpenPDF(_NOVELLA_DOCUMENT_); diff --git a/main/midnight/Classes/panels/panel_night.cpp b/main/midnight/Classes/panels/panel_night.cpp index 0a60ab43..0812eb59 100644 --- a/main/midnight/Classes/panels/panel_night.cpp +++ b/main/midnight/Classes/panels/panel_night.cpp @@ -11,7 +11,7 @@ #include "panel_night.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/resolutionmanager.h" #include "../ui/uihelper.h" @@ -65,7 +65,7 @@ bool panel_night::init() void panel_night::OnShown() { - variables::sv_collate_battle_areas = !mr->config->night_battle_full ; + variables::sv_collate_battle_areas = !mr->settings->night_battle_full ; // Initialise in a thread auto atp = AsyncTaskPool::getInstance(); @@ -116,7 +116,7 @@ void panel_night::OnNightNotification ( callback_t* event ) setNightText( msg ); }); - if ( !mr->config->night_display_fast ) + if ( !mr->settings->night_display_fast ) std::this_thread::sleep_for(std::chrono::seconds(2)); }else{ diff --git a/main/midnight/Classes/panels/panel_options.cpp b/main/midnight/Classes/panels/panel_options.cpp index 8aa4a2a1..3a7b5729 100644 --- a/main/midnight/Classes/panels/panel_options.cpp +++ b/main/midnight/Classes/panels/panel_options.cpp @@ -14,7 +14,7 @@ #include "../system/resolutionmanager.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/keyboardmanager.h" #include "../system/panelmanager.h" @@ -171,7 +171,7 @@ bool panel_options::init() SET_OPTION(12, screen_mode); SET_OPTION(13, keyboard_mode); - if ( !mr->config->fullscreensupported ) + if ( !mr->settings->fullscreensupported ) options[12].text = values_screen2 ; @@ -186,7 +186,7 @@ void panel_options::OnMenuNotification( const uinotificationinterface* sender, m if ( tag == ID_HOME ) { Exit(); - mr->config->Save(); + mr->settings->Save(); //gl->SetPanelMode(MODE_MAINMENU,TRANSITION_FADEIN); return; } else if ( tag == ID_MENU_GAME ) { @@ -232,7 +232,7 @@ void panel_options::OnMenuNotification( const uinotificationinterface* sender, m SetValues(); if ( options[index].id == ID_OPTION_TUTORIAL ) { - if ( mr->config->tutorial ) + if ( mr->settings->tutorial ) showHelpWindow(HELP_TUTORIAL_ON); else showHelpWindow(HELP_TUTORIAL_OFF); @@ -268,7 +268,7 @@ void panel_options::SetMenu ( int id ) #if defined(_OS_DESKTOP_) - mr->config->showmovementindicators=FALSE; + mr->settings->showmovementindicators=FALSE; #endif SetValues(); diff --git a/main/midnight/Classes/panels/panel_options.h b/main/midnight/Classes/panels/panel_options.h index baf712ce..8e79773f 100644 --- a/main/midnight/Classes/panels/panel_options.h +++ b/main/midnight/Classes/panels/panel_options.h @@ -31,7 +31,7 @@ typedef struct { } option_t ; #define SET_OPTION(x,z) \ - options[x].var = &mr->config->z; + options[x].var = &mr->settings->z; class panel_options : public uipanel { diff --git a/main/midnight/Classes/panels/panel_select.cpp b/main/midnight/Classes/panels/panel_select.cpp index 97b797c9..0c267951 100644 --- a/main/midnight/Classes/panels/panel_select.cpp +++ b/main/midnight/Classes/panels/panel_select.cpp @@ -11,7 +11,7 @@ #include "panel_select.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/resolutionmanager.h" #include "../ui/uihelper.h" #include "../frontend/language.h" @@ -228,7 +228,7 @@ void panel_select::getCharacters() auto userdata = lord->userData(); - if ( mr->config->keyboard_mode == CF_KEYBOARD_CLASSIC ) + if ( mr->settings->keyboard_mode == CF_KEYBOARD_CLASSIC ) addShortcutKey(tag, mr->keyboard->getKeyboardValue(userdata->shortcut_old)); else addShortcutKey(tag, mr->keyboard->getKeyboardValue(userdata->shortcut_new)); diff --git a/main/midnight/Classes/panels/panel_select.h b/main/midnight/Classes/panels/panel_select.h index 0887d35d..235705cb 100644 --- a/main/midnight/Classes/panels/panel_select.h +++ b/main/midnight/Classes/panels/panel_select.h @@ -13,7 +13,7 @@ #include "../ui/uipanel.h" #include "../ui/uifilterbutton.h" #include "../frontend/layout_id.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../models/selectmodel.h" class panel_select : diff --git a/main/midnight/Classes/panels/panel_splashscreen.cpp b/main/midnight/Classes/panels/panel_splashscreen.cpp index f3560cb8..2e371e2b 100644 --- a/main/midnight/Classes/panels/panel_splashscreen.cpp +++ b/main/midnight/Classes/panels/panel_splashscreen.cpp @@ -5,7 +5,7 @@ #include "../system/resolutionmanager.h" #include "../ui/uihelper.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/panelmanager.h" #include "../system/progressmonitor.h" diff --git a/main/midnight/Classes/system/configmanager.cpp b/main/midnight/Classes/system/configmanager.cpp index 664bd6b7..21dcc270 100644 --- a/main/midnight/Classes/system/configmanager.cpp +++ b/main/midnight/Classes/system/configmanager.cpp @@ -1,184 +1,84 @@ // -// config.cpp -// frontend +// configmanager.cpp +// midnight // -// Created by Chris Wild on 24/04/2012. -// Copyright (c) 2012 Chilli Hugger. All rights reserved. +// Created by Chris Wild on 07/06/2019. +// Copyright © 2019 Chilli Hugger Software. All rights reserved. // #include "configmanager.h" #include "moonring.h" +#include "tmemanager.h" +#include "../library/chilli.h" -#include - -using namespace chilli::lib ; configmanager::configmanager() -{ - tutorial=TRUE; - autofight=FALSE; - autounhide=FALSE; - nav_mode=CF_NAV_BOTH; - screentransitions=TRUE; - - compass_delay = CF_COMPASS_NORMAL ; - compass_feedback = CF_COMPASS_MEDIUM ; - think_paging_mode = CF_THINK_SWIPE ; - - night_display_fast = FALSE ; - night_battle_full = TRUE; - - screen_mode = CF_FULLSCREEN; - keyboard_mode = CF_KEYBOARD_CLASSIC; - fullscreensupported=TRUE; - -#if defined(_OS_DESKTOP_) - showmovementindicators=FALSE; -#else - showmovementindicators=TRUE; -#endif - -#if defined(ADVERT_FREQUENCY) - advert_screen_count=ADVERT_FREQUENCY-4; -#else - advert_screen_count=0; -#endif - -#if defined(_OS_IOS_) || defined(_OS_OSX_) - novella_pdf=false; -#else - novella_pdf=true; -#endif - -//#ifdef _OS_DESKTOP_ -// nav_mode=CF_NAV_PRESS; -//#endif - +{ } - configmanager::~configmanager() { } -bool configmanager::bumpAdvert() +bool configmanager::LoadXmlConfig (const std::string& filename ) { - bool showAdvert = false; - -#if defined(ADVERT_FREQUENCY) - if (advert_screen_count%ADVERT_FREQUENCY==(ADVERT_FREQUENCY-1) ) { - showAdvert = true ; - } - advert_screen_count++; - Save(); -#endif + using xml = chilli::lib::xml; + //char path[MAX_PATH]; - return showAdvert; -} - -BOOL configmanager::Save ( void ) -{ - char filename[MAX_PATH]={0}; - sprintf(filename,"%s/%s", mr->getWritablePath(), CONFIG_FILENAME ); + UIDEBUG("configmanager::LoadXmlConfig - ENTER"); - chilli::os::file* pFile = new chilli::os::file ( filename, chilli::os::file::modeReadWrite|chilli::os::file::modeCreate ); - if ( pFile == NULL || !pFile->IsOpen() ) { - if ( pFile ) delete pFile; - return FALSE; - } - - chilli::lib::archive ar (pFile, archive::store | archive::bNoFlushOnDelete ); - - u32 version = CONFIG_VERSION ; - - // version 1 - ar << version ; - ar << tutorial ; - - // version 2 - ar << autofight; - ar << autounhide; - ar << showmovementindicators; - ar << nav_mode ; - ar << screentransitions ; - - // version 3 - ar << compass_delay ; - ar << think_paging_mode ; - ar << night_display_fast ; - ar << night_battle_full ; - - // version 4 - ar << compass_feedback ; - - // version 5 - ar << screen_mode ; - - // version 5 - ar << keyboard_mode; - - // version 7 - ar << advert_screen_count; - ar << novella_pdf ; - - ar.Close(); + std::unique_ptr config ( new xml() ); - SAFEDELETE ( pFile ); - - return TRUE; -} - -BOOL configmanager::Load ( void ) -{ - char filename[MAX_PATH]={0}; - sprintf(filename,"%s/%s", mr->getWritablePath(), CONFIG_FILENAME ); - - chilli::os::file* pFile = new chilli::os::file ( filename, chilli::os::file::modeRead ); - if ( !pFile->IsOpen() ) { - if ( pFile ) delete pFile; - return FALSE; + if ( !config->Load ( filename.c_str() ) ) { + COMPLAIN ( "Cannot load config" ); } - - archive ar (pFile, archive::load | archive::bNoFlushOnDelete); - - u32 version=CONFIG_VERSION; - - ar >> version ; - ar >> tutorial ; - - if ( version>=2 ) { - ar >> autofight; - ar >> autounhide; - ar >> showmovementindicators; - ar >> nav_mode ; - ar >> screentransitions ; - } - - if ( version>=3 ) { - ar >> compass_delay ; - ar >> think_paging_mode; - ar >> night_display_fast ; - ar >> night_battle_full ; - } - - if ( version>=5 ) { - ar >> compass_feedback ; - ar >> screen_mode ; + + auto main = config->Find("main"); + if ( main == nullptr ) { + COMPLAIN ( "invalid config file:
" ); } - - if ( version >= 6 ) { - ar >> keyboard_mode ; + + auto variables = main->Find("variables"); + if ( variables == nullptr ) { + UIDEBUG ( "missing tag: " ); + return false; } + +#define IS_VAR(x) \ + c_stricmp(x,name) == 0 + + FOREACHELEMENT(variables,t) { + if ( t->IsType("var") ) { + + auto name = t->ReadStr("id"); + auto value = t->ReadBool("value"); + + UIDEBUG("VAR %s = '%d'", name, value); + + if ( IS_VAR("sv_cheat_armies_noblock") ) { + tme::variables::sv_cheat_armies_noblock = value; + } + + else if ( IS_VAR("sv_cheat_nasties_noblock") ) { + tme::variables::sv_cheat_nasties_noblock = value; + } + + else if ( IS_VAR("sv_cheat_commands_free") ) { + tme::variables::sv_cheat_commands_free = value; + } + + else if ( IS_VAR("sv_cheat_movement_cheap") ) { + tme::variables::sv_cheat_movement_cheap = value; + } + + else if ( IS_VAR("sv_cheat_movement_free") ) { + tme::variables::sv_cheat_movement_free = value; + } - if ( version >= 7 ) { - ar >> advert_screen_count ; - ar >> novella_pdf ; + } } - - ar.Close(); - - SAFEDELETE ( pFile ); - - return TRUE; + + UIDEBUG("configmanager::LoadXmlConfig - EXIT"); + + return true ; } - diff --git a/main/midnight/Classes/system/configmanager.h b/main/midnight/Classes/system/configmanager.h index 23abfff9..65edd184 100644 --- a/main/midnight/Classes/system/configmanager.h +++ b/main/midnight/Classes/system/configmanager.h @@ -1,135 +1,27 @@ // -// config -// frontend +// configmanager.h +// midnight // -// Created by Chris Wild on 24/04/2012. -// Copyright (c) 2012 Chilli Hugger. All rights reserved. +// Created by Chris Wild on 07/06/2019. +// Copyright © 2019 Chilli Hugger Software. All rights reserved. // -#pragma once +#ifndef configmanager_hpp +#define configmanager_hpp +#include "../library/libinc/mxtypes.h" #include "ringcontroller.h" -#include "../tme_interface.h" - - -#define OLD_SAVE_GAME_VERSION 12 -#define NEW_SAVE_GAME_VERSION 13 - -#define FRONTEND_SAVE_GAME_VERSION 20 -#define CONFIG_FILENAME "settings.cfg" -#define CONFIG_VERSION 7 - -#ifndef MX_DEBUG - #define _SHOW_SPLASH_ - #define _SHOW_DEDICATION_ - #define ADVERT_FREQUENCY 16 - //#define _USE_DEBUG_MENU_ - //#define _SHOW_GAME_VERSION_ - #define _DEBUG_UNDO_HISTORY_ 1 -#else - #define _SHOW_SPLASH_ - //#define _SHOW_DEDICATION_ - // #define ADVERT_FREQUENCY 5 - #define _USE_DEBUG_MENU_ - #define _SHOW_GAME_VERSION_ - #define _DEBUG_UNDO_HISTORY_ 10 - //#define _DEBUG_LANDSCAPE_ -#endif - -#define _TME_CHEAT_MODE_ -//#define _TME_DEMO_MODE_ - -#if defined(_LOM_) - #define PRE_RENDERED_LORD_NAMES -#endif - -enum CONFIG_NAV_MODE -{ - CF_NAV_BOTH=0, - CF_NAV_PRESS=1, - CF_NAV_SWIPE=2, - CF_NAV_SWIPE_MOVE_PRESS_LOOK=3, -}; - -enum CONFIG_COMPASS_DELAY -{ - CF_COMPASS_OFF=0, - CF_COMPASS_NORMAL=1, - CF_COMPASS_SHORT=2, - CF_COMPASS_LONG=3, -}; - -enum CONFIG_COMPASS_FEEDBACK -{ - CF_COMPASS_LOW=1, - CF_COMPASS_MEDIUM=2, - CF_COMPASS_HIGH=3, -}; - -enum CONFIG_THINK_PAGING -{ - CF_THINK_SWIPE=0, - CF_THINK_PRESS=1, -}; - -enum CONFIG_SCREEN_MODE -{ - CF_FULLSCREEN=0, - CF_WINDOW_SMALL=1, - CF_WINDOW_MEDIUM=2, - CF_WINDOW_LARGE=3, -}; - -enum CONFIG_KEYBOARD_MODE -{ - CF_KEYBOARD_CLASSIC=0, - CF_KEYBOARD_NEW=1, -}; class configmanager : public ringcontroller { - public: configmanager(); virtual ~configmanager(); - - BOOL Save ( void ); - BOOL Load ( void ); - - bool bumpAdvert(); - -public: - // not stored - BOOL fullscreensupported; - - - // version 1 - BOOL tutorial; - // version 2 - BOOL autofight; - BOOL autounhide; - BOOL showmovementindicators; - BOOL screentransitions; - int nav_mode; - - // version 3 - int compass_delay; - int think_paging_mode; - BOOL night_display_fast; - BOOL night_battle_full; - - // version 4 - int compass_feedback; + bool LoadXmlConfig ( const std::string& scenario ); - // version 5 - int screen_mode; - - // version 6 - int keyboard_mode; - - // version 7 - int advert_screen_count; - BOOL novella_pdf ; +public: }; + +#endif /* configmanager_h */ diff --git a/main/midnight/Classes/system/keyboardmanager.h b/main/midnight/Classes/system/keyboardmanager.h index 6cadf47a..fa707644 100644 --- a/main/midnight/Classes/system/keyboardmanager.h +++ b/main/midnight/Classes/system/keyboardmanager.h @@ -8,7 +8,7 @@ #pragma once #include "../cocos.h" -#include "configmanager.h" +#include "settingsmanager.h" #include "../frontend/keyboard_id.h" #include "../frontend/layout_id.h" diff --git a/main/midnight/Classes/system/moonring.cpp b/main/midnight/Classes/system/moonring.cpp index 9d52673d..1f6ee541 100644 --- a/main/midnight/Classes/system/moonring.cpp +++ b/main/midnight/Classes/system/moonring.cpp @@ -10,16 +10,14 @@ #include "moonring.h" #include "helpmanager.h" -#include "configmanager.h" +#include "settingsmanager.h" #include "storymanager.h" #include "keyboardmanager.h" #include "tmemanager.h" #include "panelmanager.h" #include "projectconfig.h" #include "progressmonitor.h" - - - +#include "configmanager.h" USING_NS_CC; @@ -30,15 +28,13 @@ static bool mySerialize ( u32 version, chilli::lib::archive& ar ) return moonring::mikesingleton()->serialize(version, ar ); } - - moonring::moonring() { help = new helpmanager(); help->InjectMoonRing(this); - config = new configmanager(); - config->InjectMoonRing(this); + settings = new settingsmanager(); + settings->InjectMoonRing(this); stories = new storymanager(); stories->InjectMoonRing(this); @@ -52,11 +48,14 @@ moonring::moonring() project = new projectconfig(); project->InjectMoonRing(this); + config = new configmanager(); + config->InjectMoonRing(this); + stories->SetLoadSave(&mySerialize); - config->Load(); + settings->Load(); - keyboard->SetKeyboardMode((CONFIG_KEYBOARD_MODE)config->keyboard_mode); + keyboard->SetKeyboardMode((CONFIG_KEYBOARD_MODE)settings->keyboard_mode); } @@ -66,7 +65,7 @@ moonring::~moonring() { SAFEDELETE(panels); SAFEDELETE(help); - SAFEDELETE(config); + SAFEDELETE(settings); SAFEDELETE(stories); SAFEDELETE(keyboard); SAFEDELETE(tme); @@ -565,12 +564,14 @@ void moonring::initialise( progressmonitor* monitor ) // initialise TME TME_Init(); + std::string configFilename = std::string( getWritablePath() ) + "/config.cfg"; + config->LoadXmlConfig( configFilename ); + #ifdef _TME_CHEAT_MODE_ UIDEBUG("Global:: _TME_CHEAT_MODE_"); tme::variables::sv_cheat_armies_noblock = true; tme::variables::sv_cheat_nasties_noblock = true; - //tme::variables::sv_cheat_movement_free = true ; - tme::variables::sv_cheat_movement_cheap = true ; + tme::variables::sv_cheat_movement_free = true ; //variables::sv_cheat_commands_free = true ; #endif @@ -578,9 +579,6 @@ void moonring::initialise( progressmonitor* monitor ) UIDEBUG("Global:: _TME_DEMO_MODE_"); tme::variables::sv_cheat_armies_noblock = true; tme::variables::sv_cheat_nasties_noblock = true; - //variables::sv_cheat_movement_free = true ; - //tme::variables::sv_cheat_movement_cheap = true ; - //tme::variables::sv_cheat_commands_free = true ; #endif #if defined(_LOM_MAP_) diff --git a/main/midnight/Classes/system/moonring.h b/main/midnight/Classes/system/moonring.h index 1e481b11..8bb79d13 100644 --- a/main/midnight/Classes/system/moonring.h +++ b/main/midnight/Classes/system/moonring.h @@ -25,13 +25,14 @@ // #include -FORWARD_REFERENCE(configmanager); +FORWARD_REFERENCE(settingsmanager); FORWARD_REFERENCE(helpmanager); //FORWARD_REFERENCE(storymanager); FORWARD_REFERENCE(keyboardmanager); FORWARD_REFERENCE(tmemanager); FORWARD_REFERENCE(progressmonitor); FORWARD_REFERENCE(projectconfig); +FORWARD_REFERENCE(configmanager); #define RUN_ON_UI_THREAD cocos2d::Director::getInstance()->getScheduler()->performFunctionInCocosThread @@ -112,6 +113,7 @@ class moonring public: panelmanager* panels; + settingsmanager* settings; configmanager* config; helpmanager* help; storymanager* stories; @@ -128,7 +130,7 @@ class moonring }; -#define CONFIG(x) (mr->config->x) +#define CONFIG(x) (mr->settings->x) //void _msg (LPCSTR format, ... ); diff --git a/main/midnight/Classes/system/panelmanager.cpp b/main/midnight/Classes/system/panelmanager.cpp index 8ad83138..eb08f310 100644 --- a/main/midnight/Classes/system/panelmanager.cpp +++ b/main/midnight/Classes/system/panelmanager.cpp @@ -25,7 +25,7 @@ #include "../ui/uioptionitem.h" -#include "configmanager.h" +#include "settingsmanager.h" #include "moonring.h" #include "../ui/uipanel.h" diff --git a/main/midnight/Classes/system/projectconfig.cpp b/main/midnight/Classes/system/projectconfig.cpp index 028c43ea..f104d0c8 100644 --- a/main/midnight/Classes/system/projectconfig.cpp +++ b/main/midnight/Classes/system/projectconfig.cpp @@ -23,23 +23,18 @@ projectconfig::~projectconfig() bool projectconfig::LoadXmlConfig ( LPCSTR scenario, progressmonitor* monitor ) { - //char path[MAX_PATH]; - - UIDEBUG("ProjectConfig::LoadXmlConfig - ENTER"); + UIDEBUG("Frontend: Scenario Config Loading"); auto config = new chilli::lib::xml(); - - //sprintf( path, "%s/%s", FrontendDirectory(), scenario ); - - monitor->Update("Loading Config",0); + monitor->Update("Loading Scenario Config",0); if ( !config->Load ( scenario ) ) { SAFEDELETE(config); - COMPLAIN ( "Cannot load frontend config" ); + COMPLAIN ( "Cannot load scenario config" ); } - monitor->Update("Loaded Config",1); + monitor->Update("Loaded Scenario Config",1); auto base = config->Find("main"); if ( base == NULL ) { @@ -244,7 +239,7 @@ bool projectconfig::LoadXmlConfig ( LPCSTR scenario, progressmonitor* monitor ) SAFEDELETE(config); - UIDEBUG("Frontend: Config Loaded"); + UIDEBUG("Frontend: Scenario Config Loaded"); return TRUE ; } diff --git a/main/midnight/Classes/system/settingsmanager.cpp b/main/midnight/Classes/system/settingsmanager.cpp new file mode 100644 index 00000000..c44ce25b --- /dev/null +++ b/main/midnight/Classes/system/settingsmanager.cpp @@ -0,0 +1,184 @@ +// +// config.cpp +// frontend +// +// Created by Chris Wild on 24/04/2012. +// Copyright (c) 2012 Chilli Hugger. All rights reserved. +// + +#include "settingsmanager.h" +#include "moonring.h" + +#include + +using namespace chilli::lib ; + +settingsmanager::settingsmanager() +{ + tutorial=TRUE; + autofight=FALSE; + autounhide=FALSE; + nav_mode=CF_NAV_BOTH; + screentransitions=TRUE; + + compass_delay = CF_COMPASS_NORMAL ; + compass_feedback = CF_COMPASS_MEDIUM ; + think_paging_mode = CF_THINK_SWIPE ; + + night_display_fast = FALSE ; + night_battle_full = TRUE; + + screen_mode = CF_FULLSCREEN; + keyboard_mode = CF_KEYBOARD_CLASSIC; + fullscreensupported=TRUE; + +#if defined(_OS_DESKTOP_) + showmovementindicators=FALSE; +#else + showmovementindicators=TRUE; +#endif + +#if defined(ADVERT_FREQUENCY) + advert_screen_count=ADVERT_FREQUENCY-4; +#else + advert_screen_count=0; +#endif + +#if defined(_OS_IOS_) || defined(_OS_OSX_) + novella_pdf=false; +#else + novella_pdf=true; +#endif + +//#ifdef _OS_DESKTOP_ +// nav_mode=CF_NAV_PRESS; +//#endif + +} + + +settingsmanager::~settingsmanager() +{ +} + +bool settingsmanager::bumpAdvert() +{ + bool showAdvert = false; + +#if defined(ADVERT_FREQUENCY) + if (advert_screen_count%ADVERT_FREQUENCY==(ADVERT_FREQUENCY-1) ) { + showAdvert = true ; + } + advert_screen_count++; + Save(); +#endif + + return showAdvert; +} + +BOOL settingsmanager::Save ( void ) +{ + char filename[MAX_PATH]={0}; + sprintf(filename,"%s/%s", mr->getWritablePath(), CONFIG_FILENAME ); + + chilli::os::file* pFile = new chilli::os::file ( filename, chilli::os::file::modeReadWrite|chilli::os::file::modeCreate ); + if ( pFile == NULL || !pFile->IsOpen() ) { + if ( pFile ) delete pFile; + return FALSE; + } + + chilli::lib::archive ar (pFile, archive::store | archive::bNoFlushOnDelete ); + + u32 version = CONFIG_VERSION ; + + // version 1 + ar << version ; + ar << tutorial ; + + // version 2 + ar << autofight; + ar << autounhide; + ar << showmovementindicators; + ar << nav_mode ; + ar << screentransitions ; + + // version 3 + ar << compass_delay ; + ar << think_paging_mode ; + ar << night_display_fast ; + ar << night_battle_full ; + + // version 4 + ar << compass_feedback ; + + // version 5 + ar << screen_mode ; + + // version 5 + ar << keyboard_mode; + + // version 7 + ar << advert_screen_count; + ar << novella_pdf ; + + ar.Close(); + + SAFEDELETE ( pFile ); + + return TRUE; +} + +BOOL settingsmanager::Load ( void ) +{ + char filename[MAX_PATH]={0}; + sprintf(filename,"%s/%s", mr->getWritablePath(), CONFIG_FILENAME ); + + chilli::os::file* pFile = new chilli::os::file ( filename, chilli::os::file::modeRead ); + if ( !pFile->IsOpen() ) { + if ( pFile ) delete pFile; + return FALSE; + } + + archive ar (pFile, archive::load | archive::bNoFlushOnDelete); + + u32 version=CONFIG_VERSION; + + ar >> version ; + ar >> tutorial ; + + if ( version>=2 ) { + ar >> autofight; + ar >> autounhide; + ar >> showmovementindicators; + ar >> nav_mode ; + ar >> screentransitions ; + } + + if ( version>=3 ) { + ar >> compass_delay ; + ar >> think_paging_mode; + ar >> night_display_fast ; + ar >> night_battle_full ; + } + + if ( version>=5 ) { + ar >> compass_feedback ; + ar >> screen_mode ; + } + + if ( version >= 6 ) { + ar >> keyboard_mode ; + } + + if ( version >= 7 ) { + ar >> advert_screen_count ; + ar >> novella_pdf ; + } + + ar.Close(); + + SAFEDELETE ( pFile ); + + return TRUE; +} + diff --git a/main/midnight/Classes/system/settingsmanager.h b/main/midnight/Classes/system/settingsmanager.h new file mode 100644 index 00000000..71183e16 --- /dev/null +++ b/main/midnight/Classes/system/settingsmanager.h @@ -0,0 +1,134 @@ +// +// config +// frontend +// +// Created by Chris Wild on 24/04/2012. +// Copyright (c) 2012 Chilli Hugger. All rights reserved. +// + +#pragma once + +#include "ringcontroller.h" +#include "../tme_interface.h" + + +#define OLD_SAVE_GAME_VERSION 12 +#define NEW_SAVE_GAME_VERSION 13 + +#define FRONTEND_SAVE_GAME_VERSION 20 +#define CONFIG_FILENAME "settings.cfg" +#define CONFIG_VERSION 7 + +#ifndef MX_DEBUG + #define _SHOW_SPLASH_ + #define _SHOW_DEDICATION_ + #define ADVERT_FREQUENCY 16 + //#define _USE_DEBUG_MENU_ + //#define _SHOW_GAME_VERSION_ + #define _DEBUG_UNDO_HISTORY_ 1 +#else + #define _SHOW_SPLASH_ + //#define _SHOW_DEDICATION_ + // #define ADVERT_FREQUENCY 5 + #define _USE_DEBUG_MENU_ + #define _SHOW_GAME_VERSION_ + #define _DEBUG_UNDO_HISTORY_ 10 + //#define _DEBUG_LANDSCAPE_ +#endif + +//#define _TME_CHEAT_MODE_ + +#if defined(_LOM_) + #define PRE_RENDERED_LORD_NAMES +#endif + +enum CONFIG_NAV_MODE +{ + CF_NAV_BOTH=0, + CF_NAV_PRESS=1, + CF_NAV_SWIPE=2, + CF_NAV_SWIPE_MOVE_PRESS_LOOK=3, +}; + +enum CONFIG_COMPASS_DELAY +{ + CF_COMPASS_OFF=0, + CF_COMPASS_NORMAL=1, + CF_COMPASS_SHORT=2, + CF_COMPASS_LONG=3, +}; + +enum CONFIG_COMPASS_FEEDBACK +{ + CF_COMPASS_LOW=1, + CF_COMPASS_MEDIUM=2, + CF_COMPASS_HIGH=3, +}; + +enum CONFIG_THINK_PAGING +{ + CF_THINK_SWIPE=0, + CF_THINK_PRESS=1, +}; + +enum CONFIG_SCREEN_MODE +{ + CF_FULLSCREEN=0, + CF_WINDOW_SMALL=1, + CF_WINDOW_MEDIUM=2, + CF_WINDOW_LARGE=3, +}; + +enum CONFIG_KEYBOARD_MODE +{ + CF_KEYBOARD_CLASSIC=0, + CF_KEYBOARD_NEW=1, +}; + +class settingsmanager : public ringcontroller +{ + +public: + settingsmanager(); + virtual ~settingsmanager(); + + BOOL Save ( void ); + BOOL Load ( void ); + + bool bumpAdvert(); + +public: + // not stored + BOOL fullscreensupported; + + + // version 1 + BOOL tutorial; + + // version 2 + BOOL autofight; + BOOL autounhide; + BOOL showmovementindicators; + BOOL screentransitions; + int nav_mode; + + // version 3 + int compass_delay; + int think_paging_mode; + BOOL night_display_fast; + BOOL night_battle_full; + + // version 4 + int compass_feedback; + + // version 5 + int screen_mode; + + // version 6 + int keyboard_mode; + + // version 7 + int advert_screen_count; + BOOL novella_pdf ; + +}; diff --git a/main/midnight/Classes/system/storymanager.cpp b/main/midnight/Classes/system/storymanager.cpp index dd6bd822..f68e1dd2 100644 --- a/main/midnight/Classes/system/storymanager.cpp +++ b/main/midnight/Classes/system/storymanager.cpp @@ -8,7 +8,7 @@ #include "../ui/uihelper.h" #include "storymanager.h" -#include "configmanager.h" +#include "settingsmanager.h" #include "../tme_interface.h" #include "moonring.h" diff --git a/main/midnight/Classes/tme/base/variables.cpp b/main/midnight/Classes/tme/base/variables.cpp index 75d37581..677295df 100644 --- a/main/midnight/Classes/tme/base/variables.cpp +++ b/main/midnight/Classes/tme/base/variables.cpp @@ -365,6 +365,25 @@ namespace tme { return MX_FAILED; } + MXRESULT SetProperty(const c_str& name, const c_str& value) + { + cvarreg_t* var = NULL ; + + for ( u32 ii=0; iistring = value; + sv_Initialise( var ); + + return MX_OK; + } CVar::~CVar() { diff --git a/main/midnight/Classes/tme/baseinc/lomxtypes.h b/main/midnight/Classes/tme/baseinc/lomxtypes.h index 4da8d9a4..9c8add15 100644 --- a/main/midnight/Classes/tme/baseinc/lomxtypes.h +++ b/main/midnight/Classes/tme/baseinc/lomxtypes.h @@ -19,7 +19,6 @@ using namespace chilli::types; //#define _DEFINE_ENUMS_ //#endif -//#define _TME_DEMO_MODE_ //#define _TEST_WINLOSE_CONDITIONS_ // enum control diff --git a/main/midnight/Classes/tme/baseinc/mxengine.h b/main/midnight/Classes/tme/baseinc/mxengine.h index d7751d01..ca343a7b 100644 --- a/main/midnight/Classes/tme/baseinc/mxengine.h +++ b/main/midnight/Classes/tme/baseinc/mxengine.h @@ -3,7 +3,8 @@ #include "info.h" #include "../baseinc/scenario.h" -//#include "IwDebug.h" + +//#define _TME_DEMO_MODE_ #define ISARG(x) c_stricmp( arg, x ) == 0 #define COMMAND(x) static MXRESULT (x)( const c_str& arg, variant argv[], u32 argc) diff --git a/main/midnight/Classes/tme/baseinc/mxinterface.h b/main/midnight/Classes/tme/baseinc/mxinterface.h index a15af8bf..7f9abb0e 100644 --- a/main/midnight/Classes/tme/baseinc/mxinterface.h +++ b/main/midnight/Classes/tme/baseinc/mxinterface.h @@ -23,7 +23,8 @@ namespace tme { MXRESULT GetProperty( const c_str& name, variant& arg) const ; MXRESULT GetProperties ( const c_str& name, variant argv[], u32 argc ); - + MXRESULT SetProperty( const c_str& name, const c_str& value); + MXRESULT Command ( const c_str& command, variant* argv=NULL, u32 args=0 ); MXRESULT Text ( const c_str& command, variant* argv=NULL, u32 args=0 ); diff --git a/main/midnight/Classes/ui/uicommandwindow.cpp b/main/midnight/Classes/ui/uicommandwindow.cpp index 55cbe111..53f82e8d 100644 --- a/main/midnight/Classes/ui/uicommandwindow.cpp +++ b/main/midnight/Classes/ui/uicommandwindow.cpp @@ -12,7 +12,7 @@ #include "../frontend/language.h" #include "../system/resolutionmanager.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/keyboardmanager.h" #include "../frontend/layout_id.h" @@ -241,7 +241,7 @@ void uicommandwindow::initialiseCommands() lord->refreshStatus(); addItem(lord, CHOOSE_CHAR+ii); - if ( mr->config->keyboard_mode == CF_KEYBOARD_CLASSIC ) + if ( mr->settings->keyboard_mode == CF_KEYBOARD_CLASSIC ) addShortcutKey(tag, mr->keyboard->getKeyboardValue(data->shortcut_old)); else addShortcutKey(tag, mr->keyboard->getKeyboardValue(data->shortcut_new)); @@ -376,7 +376,7 @@ void uicommandwindow::show( MXVoidCallback callback ) // and show parent->addChild(this); - if ( mr->config->screentransitions ) { + if ( mr->settings->screentransitions ) { this->setCascadeOpacityEnabled(true); this->setOpacity(ALPHA(0.0f)); diff --git a/main/midnight/Classes/ui/uipanel.cpp b/main/midnight/Classes/ui/uipanel.cpp index 04d98fed..72e4ec46 100644 --- a/main/midnight/Classes/ui/uipanel.cpp +++ b/main/midnight/Classes/ui/uipanel.cpp @@ -11,7 +11,7 @@ #include "../system/resolutionmanager.h" #include "../system/moonring.h" #include "../system/helpmanager.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/panelmanager.h" #include "../ui/uihelper.h" @@ -184,7 +184,7 @@ bool uipanel::showHelpWindow ( helpid_t id, BOOL forceImportant, MXVoidCallback if ( !help->isAlways(id) ) { - if ( !mr->config->tutorial ) { + if ( !mr->settings->tutorial ) { if ( callback != nullptr ) callback(); return true; diff --git a/main/midnight/Classes/ui/uithinkpage.cpp b/main/midnight/Classes/ui/uithinkpage.cpp index cf49444d..08658be6 100644 --- a/main/midnight/Classes/ui/uithinkpage.cpp +++ b/main/midnight/Classes/ui/uithinkpage.cpp @@ -8,7 +8,7 @@ #include "../ui/uihelper.h" #include "uithinkpage.h" #include "../system/moonring.h" -#include "../system/configmanager.h" +#include "../system/settingsmanager.h" #include "../system/resolutionmanager.h" #include "../system/tmemanager.h" #include "../frontend/layout_id.h" diff --git a/main/midnight/proj.ios_mac/midnight.xcodeproj/project.pbxproj b/main/midnight/proj.ios_mac/midnight.xcodeproj/project.pbxproj index 1fcc6271..7a92a4c9 100644 --- a/main/midnight/proj.ios_mac/midnight.xcodeproj/project.pbxproj +++ b/main/midnight/proj.ios_mac/midnight.xcodeproj/project.pbxproj @@ -266,10 +266,14 @@ 83B9BD781FD3114000B4C721 /* uipopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD751FD3114000B4C721 /* uipopup.cpp */; }; 83B9BD7C1FD7298D00B4C721 /* uihelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7A1FD7298D00B4C721 /* uihelper.cpp */; }; 83B9BD7D1FD7298D00B4C721 /* uihelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7A1FD7298D00B4C721 /* uihelper.cpp */; }; - 83B9BD811FD9AE2000B4C721 /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7F1FD9AE2000B4C721 /* configmanager.cpp */; }; - 83B9BD821FD9AE2000B4C721 /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7F1FD9AE2000B4C721 /* configmanager.cpp */; }; + 83B9BD811FD9AE2000B4C721 /* settingsmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7F1FD9AE2000B4C721 /* settingsmanager.cpp */; }; + 83B9BD821FD9AE2000B4C721 /* settingsmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7F1FD9AE2000B4C721 /* settingsmanager.cpp */; }; 83B9BD8A1FD9B13900B4C721 /* moonring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD881FD9B13900B4C721 /* moonring.cpp */; }; 83B9BD8B1FD9B13900B4C721 /* moonring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD881FD9B13900B4C721 /* moonring.cpp */; }; + 83C3D6C122AAA7340040B57D /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83C3D6BF22AAA7340040B57D /* configmanager.cpp */; }; + 83C3D6C222AAA7340040B57D /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83C3D6BF22AAA7340040B57D /* configmanager.cpp */; }; + 83C3D6C322AAA7340040B57D /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83C3D6BF22AAA7340040B57D /* configmanager.cpp */; }; + 83C3D6C422AAA7340040B57D /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83C3D6BF22AAA7340040B57D /* configmanager.cpp */; }; 83D264301F360724001C6F13 /* collections.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83D263E91F360724001C6F13 /* collections.cpp */; }; 83D264311F360724001C6F13 /* collections.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83D263E91F360724001C6F13 /* collections.cpp */; }; 83D264321F360724001C6F13 /* mxengine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83D263EA1F360724001C6F13 /* mxengine.cpp */; }; @@ -459,7 +463,7 @@ 83E301DE21A41BE3005C3F5C /* random.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83D264A11F36077E001C6F13 /* random.cpp */; }; 83E301DF21A41BE3005C3F5C /* panel_credits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD671FD2CC9D00B4C721 /* panel_credits.cpp */; }; 83E301E021A41BE3005C3F5C /* LandscapeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8397AFE71F4C1C99009B00A2 /* LandscapeNode.cpp */; }; - 83E301E121A41BE3005C3F5C /* configmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7F1FD9AE2000B4C721 /* configmanager.cpp */; }; + 83E301E121A41BE3005C3F5C /* settingsmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B9BD7F1FD9AE2000B4C721 /* settingsmanager.cpp */; }; 83E301E221A41BE3005C3F5C /* mxmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83D263F21F360724001C6F13 /* mxmemory.cpp */; }; 83E301E321A41BE3005C3F5C /* uibook.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 831AD5801FE58436001108AC /* uibook.cpp */; }; 83E301E421A41BE3005C3F5C /* progressmonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 834D04ED20D30776001B07CB /* progressmonitor.cpp */; }; @@ -715,11 +719,13 @@ 83B9BD791FD316F700B4C721 /* language.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = language.h; sourceTree = ""; }; 83B9BD7A1FD7298D00B4C721 /* uihelper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = uihelper.cpp; sourceTree = ""; }; 83B9BD7B1FD7298D00B4C721 /* uihelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uihelper.h; sourceTree = ""; }; - 83B9BD7F1FD9AE2000B4C721 /* configmanager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = configmanager.cpp; sourceTree = ""; }; - 83B9BD801FD9AE2000B4C721 /* configmanager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = configmanager.h; sourceTree = ""; }; + 83B9BD7F1FD9AE2000B4C721 /* settingsmanager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = settingsmanager.cpp; sourceTree = ""; }; + 83B9BD801FD9AE2000B4C721 /* settingsmanager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settingsmanager.h; sourceTree = ""; }; 83B9BD871FD9B04D00B4C721 /* keyboard_id.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = keyboard_id.h; sourceTree = ""; }; 83B9BD881FD9B13900B4C721 /* moonring.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = moonring.cpp; sourceTree = ""; }; 83B9BD891FD9B13900B4C721 /* moonring.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = moonring.h; sourceTree = ""; }; + 83C3D6BF22AAA7340040B57D /* configmanager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = configmanager.cpp; sourceTree = ""; }; + 83C3D6C022AAA7340040B57D /* configmanager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = configmanager.h; sourceTree = ""; }; 83D263E91F360724001C6F13 /* collections.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collections.cpp; sourceTree = ""; }; 83D263EA1F360724001C6F13 /* mxengine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mxengine.cpp; sourceTree = ""; }; 83D263EB1F360724001C6F13 /* mxentity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mxentity.cpp; sourceTree = ""; }; @@ -1238,8 +1244,8 @@ 8351A5171FDF26D400D9AB57 /* help_ddr.cpp */, 8351A51A1FDF2D4100D9AB57 /* helpmanager.h */, 8351A51F1FDF398300D9AB57 /* helpmanager.cpp */, - 83B9BD7F1FD9AE2000B4C721 /* configmanager.cpp */, - 83B9BD801FD9AE2000B4C721 /* configmanager.h */, + 83B9BD7F1FD9AE2000B4C721 /* settingsmanager.cpp */, + 83B9BD801FD9AE2000B4C721 /* settingsmanager.h */, 83B9BD881FD9B13900B4C721 /* moonring.cpp */, 83B9BD891FD9B13900B4C721 /* moonring.h */, 8351A5221FE44B3E00D9AB57 /* storymanager.cpp */, @@ -1254,6 +1260,8 @@ 834D04EA20D2FB3C001B07CB /* projectconfig.h */, 834D04ED20D30776001B07CB /* progressmonitor.cpp */, 834D04EE20D30776001B07CB /* progressmonitor.h */, + 83C3D6BF22AAA7340040B57D /* configmanager.cpp */, + 83C3D6C022AAA7340040B57D /* configmanager.h */, ); path = system; sourceTree = ""; @@ -1695,6 +1703,7 @@ 8344EC2C1FD1EC2C0067AAC1 /* panel_splashscreen.cpp in Sources */, 8351A5201FDF398300D9AB57 /* helpmanager.cpp in Sources */, 83B9BD731FD30AF700B4C721 /* uipanel.cpp in Sources */, + 83C3D6C122AAA7340040B57D /* configmanager.cpp in Sources */, 83D264801F360724001C6F13 /* default_scenario.cpp in Sources */, 8397AFE11F4C1A2E009B00A2 /* LandscapeSky.cpp in Sources */, 83D264681F360724001C6F13 /* item_stronghold.cpp in Sources */, @@ -1711,7 +1720,7 @@ 83A9ACBA1FEBBEBB00673B66 /* MyButton.cpp in Sources */, 83A600052187B98700FBDAFC /* uithinkpage.cpp in Sources */, 833172F9219B1E85009A52E7 /* uisinglelord.cpp in Sources */, - 83B9BD811FD9AE2000B4C721 /* configmanager.cpp in Sources */, + 83B9BD811FD9AE2000B4C721 /* settingsmanager.cpp in Sources */, 83D2645E1F360724001C6F13 /* info_unit.cpp in Sources */, 83B5AB6F21760B4100CC29EF /* panel_night.cpp in Sources */, 83B668992185EF5700B130FC /* uifilterbutton.cpp in Sources */, @@ -1886,7 +1895,8 @@ 83B9BD6A1FD2CC9D00B4C721 /* panel_credits.cpp in Sources */, 83784AC71FCF218D00F5AD66 /* LandscapeNode.cpp in Sources */, 83733924227C30D5001D61FD /* mapmodel.cpp in Sources */, - 83B9BD821FD9AE2000B4C721 /* configmanager.cpp in Sources */, + 83C3D6C222AAA7340040B57D /* configmanager.cpp in Sources */, + 83B9BD821FD9AE2000B4C721 /* settingsmanager.cpp in Sources */, 83D264431F360724001C6F13 /* mxmemory.cpp in Sources */, 831AD5831FE58671001108AC /* uibook.cpp in Sources */, 8378E3C621BD4FAD0030AE3C /* panelmodel.cpp in Sources */, @@ -1996,6 +2006,7 @@ 8344EBFA1FD1E43F0067AAC1 /* info_object.cpp in Sources */, 8344EBFB1FD1E43F0067AAC1 /* c_str.cpp in Sources */, 8344EBFC1FD1E43F0067AAC1 /* info_terrain.cpp in Sources */, + 83C3D6C322AAA7340040B57D /* configmanager.cpp in Sources */, 8344EBFD1FD1E43F0067AAC1 /* LandscapeDebug.cpp in Sources */, 8344EBFE1FD1E43F0067AAC1 /* info_unit.cpp in Sources */, 8344EBFF1FD1E43F0067AAC1 /* main.cpp in Sources */, @@ -2094,7 +2105,8 @@ 83E301DF21A41BE3005C3F5C /* panel_credits.cpp in Sources */, 83E301E021A41BE3005C3F5C /* LandscapeNode.cpp in Sources */, 83733926227C30D5001D61FD /* mapmodel.cpp in Sources */, - 83E301E121A41BE3005C3F5C /* configmanager.cpp in Sources */, + 83C3D6C422AAA7340040B57D /* configmanager.cpp in Sources */, + 83E301E121A41BE3005C3F5C /* settingsmanager.cpp in Sources */, 83E301E221A41BE3005C3F5C /* mxmemory.cpp in Sources */, 83E301E321A41BE3005C3F5C /* uibook.cpp in Sources */, 8378E3C721BD4FAD0030AE3C /* panelmodel.cpp in Sources */,