void Widget::DateChanged() { m_Calendar->setFocus(); int year=m_Calendar->selectedDate().year(); int month=m_Calendar->selectedDate().month(); int day=m_Calendar->selectedDate().day(); int lunaryear=0,lunarmonth=0,lunarday=0; QString lunarstring = GetLunarStringX(year,month,day,lunaryear,lunarmonth,lunarday); SetLunarShow(lunaryear,lunarstring); SetZodiac(lunaryear); SetStar(month,day); if(m_YearComboBox->currentIndex()+BEGIN_YEAR==year && m_MonthComboBox->currentIndex()+1==month && m_DayComboBox->currentIndex()+1==day ) return; m_YearComboBox->setCurrentIndex(year-BEGIN_YEAR); m_MonthComboBox->setCurrentIndex(month-1); m_DayComboBox->setCurrentIndex(day-1); }
//ステージを生成するために入れるクラス void Stage::StageCreate(int count){ auto hosimei = std::string("Earth.png"); auto rocket = Rocket::create(); Rect stagerect; switch (count) { case 1: /*ここにステージの大きさを設定する*/ stagerect.setRect(-200, -200, _gamewindou.width + 200, _gamewindou.height + 200); _stagerect = stagerect; /*ここに星を配置するものを入力してください。*/ SetStar(Vec2(_gamewindou.width / 2 + 300, _gamewindou.height / 2 - 100), hosimei); SetStar(Vec2(_gamewindou.width / 2 - 300, _gamewindou.height / 2 - 200), hosimei); SetStar(Vec2(_gamewindou.width / 2 + 100, _gamewindou.height / 2 + 100), hosimei); SetStar(Vec2(_gamewindou.width / 2, _gamewindou.height / 2), hosimei); Setgoalstar(Vec2(200, _gamewindou.height - 200), goalmai); /*ここにロケットの配置場所を入力してください。*/ rocket->setPosition(Vec2(_gamewindou.width-50, 100.0f)); rocket->setRotation(-90); this->addChild(rocket); _rocket = rocket; staticset(); break; case 2: /*ここに星を配置するものを入力してください。*/ SetStar(Vec2(_gamewindou.width / 2 + 300, _gamewindou.height / 2 - 200), hosimei); SetStar(Vec2(_gamewindou.width / 2 - 300, _gamewindou.height / 2 - 200), hosimei); SetStar(Vec2(_gamewindou.width / 2 + 100, _gamewindou.height / 2 + 100), hosimei); SetStar(Vec2(_gamewindou.width / 2, _gamewindou.height / 2), hosimei); Setgoalstar(Vec2(200, _gamewindou.height - 200), goalmai); /*ここにロケットの配置場所を入力してください。*/ rocket->setPosition(_gamewindou.width, 0); rocket->setRotation(-90); this->addChild(rocket); _rocket = rocket; staticset(); break; case 3: /*ここに星を配置するものを入力してください。*/ SetStar(Vec2(_gamewindou.width / 2 + 300, _gamewindou.height / 2 - 200), hosimei); SetStar(Vec2(_gamewindou.width / 2 - 300, _gamewindou.height / 2 - 200), hosimei); SetStar(Vec2(_gamewindou.width / 2 + 100, _gamewindou.height / 2 + 100), hosimei); SetStar(Vec2(_gamewindou.width / 2, _gamewindou.height / 2), hosimei); Setgoalstar(Vec2(200, _gamewindou.height - 200), goalmai); /*ここにロケットの配置場所を入力してください。*/ rocket->setPosition(_gamewindou.width, 0); rocket->setRotation(-90); this->addChild(rocket); _rocket = rocket; staticset(); break; default: break; } }