Skip to content

Commit

Permalink
restart功能好像会在Ubuntu下出错,暂时删除restart功能
Browse files Browse the repository at this point in the history
  • Loading branch information
wkcn committed Jul 26, 2015
1 parent 0750597 commit 4aeb52f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
22 changes: 14 additions & 8 deletions Sicily.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ void Sicily::InitData(){
mouseCount = 0;
mouseTime = GetClock();
sleeped = false;
tabDesktop = false;
tabDesktopTime = 0;
//tabDesktop = false;
//tabDesktopTime = 0;

cancover = true;

Expand Down Expand Up @@ -175,10 +175,13 @@ void Sicily::UpdateButton(){
}

//REPEAT SAY
/*
if (mouseCount == 2 && mouseList[0] && mouseList[1]){
SicilySay("",5);
mouseCount = 0;
}
*/


if(sleeped && mouseCount > 0){
//醒来了
Expand Down Expand Up @@ -249,12 +252,14 @@ void Sicily::UpdateButton(){
}

//TabDesktop
/*
if(tabDesktop){
tabDesktopTime ++;
if(tabDesktopTime >= 5){
Restart();
}
}
*/

//互动

Expand Down Expand Up @@ -323,13 +328,13 @@ void Sicily::UpdateChatBox(){
}

void Sicily::SaveData(){
ofstream fout(GetStdFileDir("data.tmp").c_str());
ofstream fout(GetStdFileDir("Data\\data.tmp").c_str());
fout<<playTime<<" "<<lastTime;
fout.close();
}

void Sicily::LoadData(){
ifstream fin(GetStdFileDir("data.tmp").c_str());
ifstream fin(GetStdFileDir("Data\\data.tmp").c_str());
if(fin){
fin>>playTime>>lastTime;
}
Expand Down Expand Up @@ -417,11 +422,12 @@ void Sicily::mouseReleaseEvent(QMouseEvent *event){

void Sicily::mouseMoveEvent(QMouseEvent *event){

QPoint p = event->globalPos()-dragPosition;
int x = p.x();
int y = p.y();
//QPoint p = event->globalPos()-dragPosition;
//int x = p.x();
//int y = p.y();

//qDebug("%d %d",x,y);
/*
if(y<50 - this->height()){
if(x<300){
Restart();
Expand All @@ -431,7 +437,7 @@ void Sicily::mouseMoveEvent(QMouseEvent *event){
tabDesktop = true;
}
}

*/

move(event->globalPos()-dragPosition);
event->accept();
Expand Down
4 changes: 2 additions & 2 deletions Sicily.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ private slots:
int mouseTime;
bool sleeped;
int sleepTime;
bool tabDesktop;
int tabDesktopTime;
//bool tabDesktop;
//int tabDesktopTime;

void UpdateChatBox();
void UpdateChatBoxDis();
Expand Down

0 comments on commit 4aeb52f

Please sign in to comment.