From de4fc0639e5c8aeaa5e1a0820c674a0200adfb00 Mon Sep 17 00:00:00 2001
From: Realself-Ma <52282764+Realself-Ma@users.noreply.github.com>
Date: Sun, 23 Aug 2020 22:05:49 +0800
Subject: [PATCH] =?UTF-8?q?[add]=E6=B7=BB=E5=8A=A0=E9=9D=99=E9=9F=B3?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Dungeon.cpp | 25 +++++++++++++++++++++++--
Dungeon.h | 1 +
menu.cpp | 4 ++++
menu.h | 1 +
sound.cpp | 2 +-
sound.h | 1 +
sources.qrc | 2 ++
7 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/Dungeon.cpp b/Dungeon.cpp
index f93ae20..1910ad5 100755
--- a/Dungeon.cpp
+++ b/Dungeon.cpp
@@ -49,7 +49,7 @@ Dungeon::Dungeon(QWidget *parent): QWidget(parent)
pre_floor=1;
MyPonit=0;
CmptorPoint=0;
- CountDown=180;
+ CountDown=80;
NetModeStart=false;
MyWin=false;
dogFall=false;
@@ -960,6 +960,7 @@ void Dungeon::initialinfoWidget()
connect(menu->ReturnRooms,SIGNAL(clicked()),this,SLOT(ReturnRoomsPlay()));
connect(menu->Help,SIGNAL(clicked()),this,SLOT(HelpPlay()));
connect(help->Return,SIGNAL(clicked()),this,SLOT(HelpReturnPlay()));
+ connect(menu->music,SIGNAL(clicked()),this,SLOT(musicChangePlay()));
infoWidget->setMinimumSize(300,672);
infoWidget->setStyleSheet("color:white;border-image: url(:/interface/image/interface/infobg.png);");
@@ -1023,6 +1024,26 @@ void Dungeon::HelpReturnPlay()
{
help->hide();
}
+void Dungeon::musicChangePlay()
+{
+ music->musicChange=!music->musicChange;
+ if(music->musicChange==false)
+ {
+ music->InterfaceBGM->setVolume(0);
+ music->DungeonBGM->setVolume(0);
+ music->DungeonSound->setVolume(0);
+ music->FightSound->setVolume(0);
+ menu->music->setStyleSheet("border-image: url(:/info/image/information/music-off.png);");
+ }
+ else
+ {
+ music->InterfaceBGM->setVolume(50);
+ music->DungeonBGM->setVolume(50);
+ music->DungeonSound->setVolume(80);
+ music->FightSound->setVolume(80);
+ menu->music->setStyleSheet("border-image: url(:/info/image/information/music-on.png);");
+ }
+}
void Dungeon::ShowFog()
{
for(int i=0;i<12;i++)
@@ -1172,7 +1193,7 @@ void Dungeon::NetModeCountDownRun()
NetMode_secondes->setText(QString::number(--CountDown));
if(CountDown<=0)
{
- CountDown=180;
+ CountDown=80;
surface->sign->roomWidget->chatRoom->pkRequest();
NetModeCountDownTimer->stop();
}
diff --git a/Dungeon.h b/Dungeon.h
index 77f70e1..6b11a6e 100755
--- a/Dungeon.h
+++ b/Dungeon.h
@@ -172,6 +172,7 @@ private slots:
void ReturnRoomsPlay();//返回游戏房间
void HelpPlay();//帮助界面
void HelpReturnPlay();//帮助界面返回
+ void musicChangePlay();//打开/关闭音乐
void EnterDungeon();//角色名设置完成,进入地牢
void NetStart();
void pkStart();
diff --git a/menu.cpp b/menu.cpp
index b873f4b..ce6765a 100755
--- a/menu.cpp
+++ b/menu.cpp
@@ -21,6 +21,10 @@ Menu::Menu(QWidget *parent) :
ReturnRooms=fac->CreateQPushButton(MenuWidget,200,200,120,30,"返回房间",button_style,fontLabel);
ReturnRooms->hide();
Help=fac->CreateQPushButton(MenuWidget,200,280,120,30,"帮助",button_style,fontLabel);
+
+ music=fac->CreateQPushButton(MenuWidget,300,40,30,30,"",
+ "border-image: url(:/info/image/information/music-on.png);");
+
}
void Menu::showEvent(QShowEvent *)
{
diff --git a/menu.h b/menu.h
index c5b1223..d35982a 100755
--- a/menu.h
+++ b/menu.h
@@ -16,6 +16,7 @@ class Menu: public QWidget
QPushButton *Continue;
QPushButton *ReturnRooms;
QPushButton *Help;
+ QPushButton *music;
bool MenuWinShow;
private:
Factory* fac;
diff --git a/sound.cpp b/sound.cpp
index e4284ac..c4097b0 100755
--- a/sound.cpp
+++ b/sound.cpp
@@ -21,10 +21,10 @@ Sound::Sound(QWidget *parent) :
FightSoundTimer=new QTimer(this);
connect(FightSoundTimer,SIGNAL(timeout()),this,SLOT(CheckFightSoundstate()));
-
DungeonSoundTimer=new QTimer(this);
connect(DungeonSoundTimer,SIGNAL(timeout()),this,SLOT(SoundStop()));
+ musicChange=true;
}
void Sound::CheckInterfaceBGMstate()
{
diff --git a/sound.h b/sound.h
index 1e8bba4..7f61772 100755
--- a/sound.h
+++ b/sound.h
@@ -16,6 +16,7 @@ class Sound: public QWidget
QTimer *DungeonSoundTimer;
QTimer *InterfaceBGMTimer;
QTimer *DungeonBGMTimer;
+ bool musicChange;
public:
void SoundPlay(int CurrentIndex);
private:
diff --git a/sources.qrc b/sources.qrc
index be79ff3..9291df8 100755
--- a/sources.qrc
+++ b/sources.qrc
@@ -28,6 +28,8 @@
image/information/房间.png
image/information/MarioLeft.png
image/information/MarioRight.png
+ image/information/music-off.png
+ image/information/music-on.png
image/interface/labelbg.png