Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Application config file #3

Merged
merged 1 commit into from
Jun 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/midnight/Classes/landscaping/LandscapeColour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion main/midnight/Classes/models/selectmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion main/midnight/Classes/panels/panel_dedication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 14 additions & 14 deletions main/midnight/Classes/panels/panel_look.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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?

Expand All @@ -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) ) {
}
}
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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 ) ) {
Expand All @@ -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 ) ) {
Expand All @@ -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;
Expand Down Expand Up @@ -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; ii<NUMELE(movementIndicators); ii++ ) {
Expand All @@ -1521,15 +1521,15 @@ void panel_look::updateMovementIndicators(LANDSCAPE_MOVEMENT movement)

bool panel_look::allowDragDownMove()
{
int value = mr->config->nav_mode ;
int value = mr->settings->nav_mode ;
if ( value != CF_NAV_PRESS)
return TRUE;
return FALSE;
}

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;
Expand Down
2 changes: 1 addition & 1 deletion main/midnight/Classes/panels/panel_mainmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down
6 changes: 3 additions & 3 deletions main/midnight/Classes/panels/panel_night.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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{
Expand Down
10 changes: 5 additions & 5 deletions main/midnight/Classes/panels/panel_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 ;


Expand All @@ -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 ) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -268,7 +268,7 @@ void panel_options::SetMenu ( int id )


#if defined(_OS_DESKTOP_)
mr->config->showmovementindicators=FALSE;
mr->settings->showmovementindicators=FALSE;
#endif

SetValues();
Expand Down
2 changes: 1 addition & 1 deletion main/midnight/Classes/panels/panel_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions main/midnight/Classes/panels/panel_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion main/midnight/Classes/panels/panel_select.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down
2 changes: 1 addition & 1 deletion main/midnight/Classes/panels/panel_splashscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading