00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "Common/Time.h"
00012 #include "Common/LocalizedString.h"
00013 #include "Render/Render.h"
00014 #include "Render/Font.h"
00015 #include "Sound/SoundDS.h"
00016 #include "Client/GameClient.h"
00017 #include "Mod_Aeternis_Client/A_Interface.h"
00018 #include "Mod_Aeternis_Client/A_WinOptionsAudio.h"
00019
00020 #define GUIDIR( __gui ) KStr( "GUI/%s/%s", GETLANGUAGEPREFIX(), __gui )
00021
00022 #define BUTTONBACK GUIDIR("Return")
00023 #define BUTTONBACKHL GUIDIR("Return_HL")
00024 #define BUTTONBACKC GUIDIR("Return_C")
00025
00026
00027 KAWinOptionsAudio::KAWinOptionsAudio( KWin* pFather, KFPt& Pos, KFPt& Size, KInterface* pInterface )
00028 : KWin( pFather, Pos, Size, pInterface )
00029 {
00030 m_BackGround = KSHADER_NO;
00031
00032 KFPt ButtonSize = KFPt( 0.15f, 0.12f );
00033
00034
00035 m_pButtonBack = new KButton( this, KFPt( 0.8f, 0.9f ) - ButtonSize / 2, KFPt( 0.25f, 0.04f ), m_pInterface );
00036
00037 m_pMusicVolumeText = new KText(this, KFPt( 0.1f , 0.25f ), ButtonSize, m_pInterface,"") ;
00038 m_pSoundEffectVolumeText= new KText(this, KFPt( 0.1f , 0.45f ), ButtonSize, m_pInterface,"") ;
00039
00040
00041 m_pSliderMusicVolume = new KSlider( this, KFPt( 0.1f, 0.3f ), KFPt( 0.5f, 0.03f ), m_pInterface,true,KFPt( 0.02f, 0.05f )) ;
00042 m_pSliderMusicVolume->SetPosSliderBar(((KAInterface*)m_pInterface)->GetpSound()->GetVolume()) ;
00043 m_pSliderSoundEffectVolume = new KSlider( this, KFPt( 0.1f, 0.5f ), KFPt( 0.5f, 0.03f ), m_pInterface,true,KFPt( 0.02f, 0.05f )) ;
00044 m_pSliderSoundEffectVolume->SetPosSliderBar(0.7f) ;
00045 }
00046
00047
00048 KAWinOptionsAudio::~KAWinOptionsAudio()
00049 {
00050 }
00051
00052
00053 void KAWinOptionsAudio::Display()
00054 {
00055 u8 FadeAlpha = (u8)(255.0f * GetFade());
00056
00057 m_pInterface->ShowMouse();
00058 DrawQuad( 0.0f, 0.0f, 1.0f, 1.0f, m_BackGround, KRGBA( 255, 255, 255, FadeAlpha ) );
00059 }
00060
00061
00062 void KAWinOptionsAudio::Manage()
00063 {
00064
00065 if( m_pButtonBack->IsClicked() )
00066 {
00067 m_pButtonBack->Reset() ;
00068 ((KAInterface*)m_pInterface)->SetWin( KAIW_OPTIONS );
00069 }
00070
00071
00072 }
00073
00074
00075 void KAWinOptionsAudio::Load()
00076 {
00077 KWin::Load();
00078
00079 m_pMusicVolumeText->SetpText((char*)GETLOCALSTRING(LS_MUSICVOLUME)) ;
00080 m_pSoundEffectVolumeText->SetpText((char*)GETLOCALSTRING(LS_SOUNDEFFECTVOLUME)) ;
00081
00082 m_BackGround = m_pRender->GetpShaderBank()->LoadShader( GUIDIR("Audio_bg") );
00083 m_pButtonBack->SetShaders( BUTTONBACK, BUTTONBACKHL, BUTTONBACKC );
00084 }
00085
00086
00087 void KAWinOptionsAudio::Unload()
00088 {
00089 KWin::Unload();
00090
00091 m_pRender->GetpShaderBank()->UnloadShader( m_BackGround );
00092 }