<commit_before>#include "SettingMenuLayer.h"
#include "MainScene.h"
#include "GameManager.h"

USING_NS_CC;

const float DEFAULT_BGM_VOLUME = 80.0f;
const float DEFAULT_SE_VOLUME = 70.0f;

const int BGM_SLIDER_TAG = 1;
const int SE_SLIDER_TAG = 2;

bool CSettingMenuLayer::init()
{
	//////////////////////////////
    // 1. super init first
    if ( !CCLayer::init() )
    {
        return false;
    }
    
    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();

	/////////////////////////////
	// 2. add menus
	CCMenuItemImage *pBackToMainButton = CCMenuItemImage::create(
										"image/MAIN_exit.png",
										"image/MAIN_exit_selected.png",
										this,
										menu_selector(CSettingMenuLayer::MainSceneCallback)
										);
    
	CCMenuItemImage *pFacebookLoginButton = CCMenuItemImage::create(
										"image/LOGIN_WITH_FACEBOOK.png",
										"image/LOGIN_WITH_FACEBOOK.png",
										this,
										menu_selector(CSettingMenuLayer::GoogleLoginCallback)
										);

	m_pBGMVolume = extension::CCControlSlider::create("image/BAR_BACKGROUND.png", "image/BAR_PROGRESS.png", "image/BAR_THUMB.png");
	m_pSEVolume = extension::CCControlSlider::create("image/BAR_BACKGROUND.png", "image/BAR_PROGRESS.png", "image/BAR_THUMB.png");

	// create menu, it's an autorelease object
	CCMenu* pMenu = CCMenu::create(NULL, NULL);

	pMenu->addChild(pFacebookLoginButton);

	this->addChild(m_pBGMVolume);
	this->addChild(m_pSEVolume);

	// set BGM slider
	m_pBGMVolume->setPosition( ccp(pMenu->getPositionX(), 100) );
	m_pBGMVolume->setMaximumAllowedValue(100.0);
	m_pBGMVolume->setMaximumValue(100.0);
	m_pBGMVolume->setMinimumAllowedValue(100.0);
	m_pBGMVolume->setMinimumValue(0.0);
	m_pBGMVolume->setValue(DEFAULT_BGM_VOLUME);
	m_pBGMVolume->setTag(BGM_SLIDER_TAG);

	// set SE slider
	m_pSEVolume->setPosition( ccp(pMenu->getPositionX(), 150) );
	m_pSEVolume->setMaximumAllowedValue(100.0);
	m_pSEVolume->setMaximumValue(100.0);
	m_pSEVolume->setMinimumAllowedValue(100.0);
	m_pSEVolume->setMinimumValue(0.0);
	m_pSEVolume->setValue(DEFAULT_SE_VOLUME);
	m_pSEVolume->setTag(SE_SLIDER_TAG);

	pMenu->addChild(pBackToMainButton);

	pMenu->alignItemsVertically();

	this->addChild(pMenu);
    
	return true;
}

void CSettingMenuLayer::MainSceneCallback(CCObject* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)<commit_msg>Audio Volume 0.0 ~ 1.0 으로 제한 (Framework와 호환성 문제)<commit_after>#include "SettingMenuLayer.h"
#include "MainScene.h"
#include "GameManager.h"

USING_NS_CC;

const float DEFAULT_BGM_VOLUME = 0.8f;
const float DEFAULT_SE_VOLUME = 0.8f;

const int BGM_SLIDER_TAG = 1;
const int SE_SLIDER_TAG = 2;

bool CSettingMenuLayer::init()
{
	//////////////////////////////
    // 1. super init first
    if ( !CCLayer::init() )
    {
        return false;
    }
    
    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();

	/////////////////////////////
	// 2. add menus
	CCMenuItemImage *pBackToMainButton = CCMenuItemImage::create(
										"image/MAIN_exit.png",
										"image/MAIN_exit_selected.png",
										this,
										menu_selector(CSettingMenuLayer::MainSceneCallback)
										);
    
	CCMenuItemImage *pFacebookLoginButton = CCMenuItemImage::create(
										"image/LOGIN_WITH_FACEBOOK.png",
										"image/LOGIN_WITH_FACEBOOK.png",
										this,
										menu_selector(CSettingMenuLayer::GoogleLoginCallback)
										);

	m_pBGMVolume = extension::CCControlSlider::create("image/BAR_BACKGROUND.png", "image/BAR_PROGRESS.png", "image/BAR_THUMB.png");
	m_pSEVolume = extension::CCControlSlider::create("image/BAR_BACKGROUND.png", "image/BAR_PROGRESS.png", "image/BAR_THUMB.png");

	// create menu, it's an autorelease object
	CCMenu* pMenu = CCMenu::create(NULL, NULL);

	pMenu->addChild(pFacebookLoginButton);

	this->addChild(m_pBGMVolume);
	this->addChild(m_pSEVolume);

	// set BGM slider
	m_pBGMVolume->setPosition( ccp(pMenu->getPositionX(), 100) );
	m_pBGMVolume->setMaximumAllowedValue(1.0);
	m_pBGMVolume->setMaximumValue(1.0);
	m_pBGMVolume->setMinimumAllowedValue(0.0);
	m_pBGMVolume->setMinimumValue(0.0);
	m_pBGMVolume->setValue(DEFAULT_BGM_VOLUME);
	m_pBGMVolume->setTag(BGM_SLIDER_TAG);

	// set SE slider
	m_pSEVolume->setPosition( ccp(pMenu->getPositionX(), 150) );
	m_pSEVolume->setMaximumAllowedValue(1.0);
	m_pSEVolume->setMaximumValue(1.0);
	m_pSEVolume->setMinimumAllowedValue(0.0);
	m_pSEVolume->setMinimumValue(0.0);
	m_pSEVolume->setValue(DEFAULT_SE_VOLUME);
	m_pSEVolume->setTag(SE_SLIDER_TAG);

	pMenu->addChild(pBackToMainButton);

	pMenu->alignItemsVertically();

	this->addChild(pMenu);
    
	return true;
}

void CSettingMenuLayer::MainSceneCallback(CCObject* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
{'fraction_non_alphanumeric': 0.15051380213580495, 'fraction_numerical': 0.01611928269192021, 'mean_word_length': 4.247357293868922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7030251', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1810, 'n_words': 235}