TmoodView::TmoodView(QWidget *parent) : QGraphicsView(parent) { setScene(new QGraphicsScene(this)); setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setFrameShape(QFrame::NoFrame); setStyleSheet("background-color: transparent"); QPen commonPen(Qt::darkRed, 5, Qt::SolidLine, Qt::RoundCap); QGraphicsEllipseItem *face = scene()->addEllipse(0, 0, 400, 400, commonPen, QBrush(Qt::yellow)); face->setZValue(1); face->setGraphicsEffect(new QGraphicsDropShadowEffect); QGraphicsEllipseItem *eye1 = scene()->addEllipse(100, 100, 20, 20, commonPen); eye1->setZValue(2); QGraphicsEllipseItem *eye2 = scene()->addEllipse(280, 100, 20, 20, commonPen); eye2->setZValue(2); QPainterPath path; path.moveTo(200, 150); path.cubicTo(180, 250, 200, 250, 200, 200); QGraphicsPathItem *nose = scene()->addPath(path, commonPen); nose->setZValue(2); m_mood = new QGraphicsPathItem(); scene()->addItem(m_mood); m_mood->setPen(commonPen); m_mood->setZValue(3); setMood(1.0); }
void TrackInfo::resetUnsupportedValues() { setConductor(QString()); setISRC(QString()); setLanguage(QString()); setLyricist(QString()); setMood(QString()); setMusicBrainzArtistId(QString()); setMusicBrainzReleaseId(QString()); setRecordLabel(QString()); setRemixer(QString()); setSubtitle(QString()); }
MoodDlg::MoodDlg(PsiAccount* pa) : QDialog(0), pa_(pa) { setAttribute(Qt::WA_DeleteOnClose); ui_.setupUi(this); setModal(false); connect(ui_.pb_cancel, SIGNAL(clicked()), SLOT(close())); connect(ui_.pb_ok, SIGNAL(clicked()), SLOT(setMood())); ui_.cb_type->addItem(tr("<unset>")); foreach(MoodCatalog::Entry e, MoodCatalog::instance()->entries()) { ui_.cb_type->addItem(e.text()); }
RosterAvatarFrame::RosterAvatarFrame(QWidget *parent) : QFrame(parent) , statusMessage_("") { ui_.setupUi(this); layout()->setMargin(PsiOptions::instance()->getOption("options.ui.contactlist.roster-avatar-frame.avatar.margin").toInt()); layout()->setSpacing(0); setMoodIcon("mood/"); setActivityIcon("activities/other"); setFont(); connect(ui_.le_status_text, SIGNAL(returnPressed()), this, SLOT(statusMessageReturnPressed())); connect(ui_.tb_mood, SIGNAL(pressed()), this, SIGNAL(setMood())); connect(ui_.tb_activity, SIGNAL(pressed()), this, SIGNAL(setActivity())); connect(PsiOptions::instance(), SIGNAL(optionChanged(QString)),this, SLOT(optionChanged(QString))); }
void Opcode80DEHandler::_run() { Logger::debug("SCRIPT") << "[80DE] [*] void start_gdialog(int msgFileID, GameCritterObject* critter, int mood, int headID, int backgroundID)" << std::endl; int backgroundID = _vm->dataStack()->popInteger(); int headID = _vm->dataStack()->popInteger(); int mood = _vm->dataStack()->popInteger(); auto critter = dynamic_cast<Game::CritterObject*>(_vm->dataStack()->popObject()); if (!critter) _error("start_gdialog - wrong critter pointer"); int msgFileID = _vm->dataStack()->popInteger(); auto interact = new State::CritterInteract(); interact->setBackgroundID(backgroundID); interact->setHeadID(headID); interact->setMood(mood); interact->setCritter(critter); interact->setMsgFileID(msgFileID); interact->setScript(_vm); Game::getInstance()->pushState(interact); }
MoodDlg::MoodDlg(QList<PsiAccount*> list) : QDialog(nullptr), pa_(list) { setAttribute(Qt::WA_DeleteOnClose); if(pa_.isEmpty()) close(); ui_.setupUi(this); setWindowIcon(IconsetFactory::icon("mood/").icon()); setModal(false); connect(ui_.pb_cancel, SIGNAL(clicked()), SLOT(close())); connect(ui_.pb_ok, SIGNAL(clicked()), SLOT(setMood())); ui_.cb_type->addItem(tr("<unset>")); PsiAccount *pa = pa_.first(); Mood::Type mt = pa->mood().type(); int i=1; foreach(MoodCatalog::Entry e, MoodCatalog::instance()->entries()) { ui_.cb_type->addItem(IconsetFactory::icon("mood/"+e.value()).icon(), e.text()); if (e.type() == mt) { ui_.cb_type->setCurrentIndex(i); } i++; }
// We are going to override (is that the right word?) the draw() // method of ModelerView to draw out SampleModel void SampleModel::draw() { // This call takes care of a lot of the nasty projection // matrix stuff. Unless you want to fudge directly with the // projection matrix, don't bother with this ... ModelerView::draw(); // draw the floor setAmbientColor(.1f,.1f,.1f); setDiffuseColor(1, 1, 1); //drawSphere(6.0); // drawTwoBalls(); drawWeb(9, 15); setDiffuseColor(0.5f, 0.4f, 0.4f); #define DETAIL (VAL(LEVEL_OF_DETAIL)) if (currMood != VAL(MOOD)) { setMood(); currMood = VAL(MOOD); } if (VAL(ANIMATE)) { animate(); } // whole glPushMatrix(); glTranslated(VAL(XPOS), VAL(YPOS), VAL(ZPOS)); glTranslated(0, 1.5, 0); glRotated(VAL(SPIDER_ROTATE_Z), 0, 0, 1); if (DETAIL >= 1) { // belly glPushMatrix(); glTranslated(1.5, 0, 0); glScaled(1.1, 0.7, 0.8); drawSphere(1.2); // spinneret if (DETAIL >= 2) { glPushMatrix(); glTranslated(1.1, 0, 0); glRotated(VAL(SPINNERET_ROTATE_Y), 0, 1, 0); // 90 glRotated(VAL(SPINNERET_ROTATE_X), 1, 0, 0); // 0 drawCylinder(0.3, 0.2, 0); glPopMatrix(); } glPopMatrix(); } if (DETAIL >= 1) { // body if (DETAIL >= 2) { glPushMatrix(); glRotated(VAL(BODY_ROTATE_Z), 0, 0, 1); glPushMatrix(); glScaled(1.3, 1, 1); drawSphere(0.5); glPopMatrix(); // legs if (DETAIL >= 3) { // left legs glPushMatrix(); glTranslated(0, 0, 0.3); if (DETAIL >= 4) { // left 1 glPushMatrix(); glRotated(VAL(LEFT_LEG_1_1_ROTATE_Y), 0, 1, 0); // -60 glRotated(VAL(LEFT_LEG_1_1_ROTATE_X), 1, 0, 0); // -30 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(LEFT_LEG_1_2_ROTATE_Y), 0, 1, 0); // -40 glRotated(VAL(LEFT_LEG_1_2_ROTATE_X), 1, 0, 0); // 50 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(LEFT_LEG_1_3_ROTATE_Y), 0, 1, 0); // -20 glRotated(VAL(LEFT_LEG_1_3_ROTATE_X), 1, 0, 0); // 20 drawCylinder(2, 0.1, 0); // drawSphere(0.2); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // left 2 glPushMatrix(); glRotated(VAL(LEFT_LEG_2_1_ROTATE_Y), 0, 1, 0); // -30 glRotated(VAL(LEFT_LEG_2_1_ROTATE_X), 1, 0, 0); // -25 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(LEFT_LEG_2_2_ROTATE_Y), 0, 1, 0); // -30 glRotated(VAL(LEFT_LEG_2_2_ROTATE_X), 1, 0, 0); // 40 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(LEFT_LEG_2_3_ROTATE_Y), 0, 1, 0); // -20 glRotated(VAL(LEFT_LEG_2_3_ROTATE_X), 1, 0, 0); // 30 drawCylinder(1.5, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // left 3 glPushMatrix(); glRotated(VAL(LEFT_LEG_3_1_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(LEFT_LEG_3_1_ROTATE_X), 1, 0, 0); // -30 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(LEFT_LEG_3_2_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(LEFT_LEG_3_2_ROTATE_X), 1, 0, 0); // 50 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(LEFT_LEG_3_3_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(LEFT_LEG_3_3_ROTATE_X), 1, 0, 0); // 40 drawCylinder(1.5, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // left 4 glPushMatrix(); glRotated(VAL(LEFT_LEG_4_1_ROTATE_Y), 0, 1, 0); // 60 glRotated(VAL(LEFT_LEG_4_1_ROTATE_X), 1, 0, 0); // -20 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(LEFT_LEG_4_2_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(LEFT_LEG_4_2_ROTATE_X), 1, 0, 0); // 40 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(LEFT_LEG_4_3_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(LEFT_LEG_4_3_ROTATE_X), 1, 0, 0); // 20 drawCylinder(2, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // right legs glPushMatrix(); glTranslated(0, 0, -0.3); if (DETAIL >= 4) { // right 1 glPushMatrix(); glRotated(VAL(RIGHT_LEG_1_1_ROTATE_Y), 0, 1, 0); // -60 glRotated(VAL(RIGHT_LEG_1_1_ROTATE_X), 1, 0, 0); // -30 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(RIGHT_LEG_1_2_ROTATE_Y), 0, 1, 0); // -40 glRotated(VAL(RIGHT_LEG_1_2_ROTATE_X), 1, 0, 0); // 50 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(RIGHT_LEG_1_3_ROTATE_Y), 0, 1, 0); // -20 glRotated(VAL(RIGHT_LEG_1_3_ROTATE_X), 1, 0, 0); // 20 drawCylinder(2, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // right 2 glPushMatrix(); glRotated(VAL(RIGHT_LEG_2_1_ROTATE_Y), 0, 1, 0); // -30 glRotated(VAL(RIGHT_LEG_2_1_ROTATE_X), 1, 0, 0); // -25 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(RIGHT_LEG_2_2_ROTATE_Y), 0, 1, 0); // -30 glRotated(VAL(RIGHT_LEG_2_2_ROTATE_X), 1, 0, 0); // 40 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(RIGHT_LEG_2_3_ROTATE_Y), 0, 1, 0); // -20 glRotated(VAL(RIGHT_LEG_2_3_ROTATE_X), 1, 0, 0); // 30 drawCylinder(1.5, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // right 3 glPushMatrix(); glRotated(VAL(RIGHT_LEG_3_1_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(RIGHT_LEG_3_1_ROTATE_X), 1, 0, 0); // -30 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(RIGHT_LEG_3_2_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(RIGHT_LEG_3_2_ROTATE_X), 1, 0, 0); // 50 drawCylinder(1.5, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 1.5); glRotated(VAL(RIGHT_LEG_3_3_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(RIGHT_LEG_3_3_ROTATE_X), 1, 0, 0); // 40 drawCylinder(1.5, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); // right 4 glPushMatrix(); glRotated(VAL(RIGHT_LEG_4_1_ROTATE_Y), 0, 1, 0); // 60 glRotated(VAL(RIGHT_LEG_4_1_ROTATE_X), 1, 0, 0); // -20 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(RIGHT_LEG_4_2_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(RIGHT_LEG_4_2_ROTATE_X), 1, 0, 0); // 40 drawCylinder(2, 0.1, 0.1); if (DETAIL >= 6) { glPushMatrix(); glTranslated(0, 0, 2); glRotated(VAL(RIGHT_LEG_4_3_ROTATE_Y), 0, 1, 0); // 20 glRotated(VAL(RIGHT_LEG_4_3_ROTATE_X), 1, 0, 0); // 20 drawCylinder(2, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); } glPopMatrix(); } if (DETAIL >= 3) { // head glPushMatrix(); glTranslated(-0.6, 0, 0); drawSphere(0.5); if (DETAIL >= 4) { // left tooth glPushMatrix(); glTranslated(-0.3, 0, 0.2); glRotated(VAL(LEFT_TOOTH_ROTATE_Y), 0, 1, 0); drawCylinder(0.25, 0.25, 0.05); glPopMatrix(); // right tooth glPushMatrix(); glTranslated(-0.3, 0, -0.2); glRotated(VAL(RIGHT_TOOTH_ROTATE_Y), 0, 1, 0); drawCylinder(0.25, 0.25, 0.05); glPopMatrix(); // left antenna glPushMatrix(); glTranslated(-0.3, 0, 0.4); glRotated(VAL(LEFT_ANTENNA_ROTATE_Y), 0, 1, 0); // -75 glRotated(VAL(LEFT_ANTENNA_ROTATE_X), 1, 0, 0); // -30 drawCylinder(1, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 1); glRotated(VAL(LEFT_ANTENNA_UPPER_ROTATE_Y), 0, 1, 0); // -30 glRotated(VAL(LEFT_ANTENNA_UPPER_ROTATE_X), 1, 0, 0); // 45 drawCylinder(0.7, 0.1, 0); glPopMatrix(); } glPopMatrix(); // right antenna glPushMatrix(); glTranslated(-0.3, 0, -0.4); glRotated(VAL(RIGHT_ANTENNA_ROTATE_Y), 0, 1, 0); glRotated(VAL(RIGHT_ANTENNA_ROTATE_X), 1, 0, 0); drawCylinder(1, 0.1, 0.1); if (DETAIL >= 5) { glPushMatrix(); glTranslated(0, 0, 1); glRotated(VAL(RIGHT_ANTENNA_UPPER_ROTATE_Y), 0, 1, 0); glRotated(VAL(RIGHT_ANTENNA_UPPER_ROTATE_X), 1, 0, 0); drawCylinder(0.7, 0.1, 0); glPopMatrix(); } glPopMatrix(); } glPopMatrix(); } glPopMatrix(); } } glPopMatrix(); }
Private(ContactListAccountMenu* menu, ContactListAccountGroup* _account) : QObject(0) , account(_account) , menu_(menu) { connect(menu, SIGNAL(aboutToShow()), SLOT(updateActions())); connect(account->account(), SIGNAL(updatedActivity()), SLOT(updateActions())); connect(account->account(), SIGNAL(updatedAccount()), SLOT(updateActions())); statusMenu_ = new StatusMenu(0); statusMenu_->setTitle(tr("&Status")); connect(statusMenu_, SIGNAL(statusChanged(XMPP::Status::Type)), SLOT(statusChanged(XMPP::Status::Type))); moodAction_ = new QAction(tr("Mood"), this); connect(moodAction_, SIGNAL(triggered()), SLOT(setMood())); setAvatarAction_ = new QAction(tr("Set Avatar"), this); connect(setAvatarAction_, SIGNAL(triggered()), SLOT(setAvatar())); unsetAvatarAction_ = new QAction(tr("Unset Avatar"), this); connect(unsetAvatarAction_, SIGNAL(triggered()), SLOT(unsetAvatar())); bookmarksManageAction_ = new QAction(tr("Manage..."), this); connect(bookmarksManageAction_, SIGNAL(triggered()), SLOT(bookmarksManage())); addContactAction_ = new IconAction(tr("&Add a Contact"), this, "psi/addContact"); connect(addContactAction_, SIGNAL(triggered()), SLOT(addContact())); serviceDiscoveryAction_ = new IconAction(tr("Service &Discovery"), this, "psi/disco"); connect(serviceDiscoveryAction_, SIGNAL(triggered()), SLOT(serviceDiscovery())); newMessageAction_ = new IconAction(tr("New &Blank Message"), this, "psi/sendMessage"); connect(newMessageAction_, SIGNAL(triggered()), SLOT(newMessage())); xmlConsoleAction_ = new IconAction(tr("&XML Console"), this, "psi/xml"); connect(xmlConsoleAction_, SIGNAL(triggered()), SLOT(xmlConsole())); modifyAccountAction_ = new IconAction(tr("&Modify Account..."), this, "psi/account"); connect(modifyAccountAction_, SIGNAL(triggered()), SLOT(modifyAccount())); adminOnlineUsersAction_ = new IconAction(tr("Online Users"), this, "psi/disco"); connect(adminOnlineUsersAction_, SIGNAL(triggered()), SLOT(adminOnlineUsers())); adminSendServerMessageAction_ = new IconAction(tr("Send Server Message"), this, "psi/sendMessage"); connect(adminSendServerMessageAction_, SIGNAL(triggered()), SLOT(adminSendServerMessage())); adminSetMotdAction_ = new QAction(tr("Set MOTD"), this); connect(adminSetMotdAction_, SIGNAL(triggered()), SLOT(adminSetMotd())); adminUpdateMotdAction_ = new QAction(tr("Update MOTD"), this); connect(adminUpdateMotdAction_, SIGNAL(triggered()), SLOT(adminUpdateMotd())); adminDeleteMotdAction_ = new IconAction(tr("Delete MOTD"), this, "psi/remove"); connect(adminDeleteMotdAction_, SIGNAL(triggered()), SLOT(adminDeleteMotd())); menu->addMenu(statusMenu_); menu->addAction(moodAction_); avatarMenu_ = menu->addMenu(tr("Avatar")); avatarMenu_->addAction(setAvatarAction_); avatarMenu_->addAction(unsetAvatarAction_); bookmarksMenu_ = menu->addMenu(tr("Bookmarks")); bookmarksMenu_->addAction(bookmarksManageAction_); menu->addSeparator(); menu->addAction(addContactAction_); menu->addAction(serviceDiscoveryAction_); menu->addAction(newMessageAction_); menu->addSeparator(); menu->addAction(xmlConsoleAction_); menu->addSeparator(); menu->addAction(modifyAccountAction_); adminMenu_ = menu->addMenu("&Admin"); adminMenu_->addAction(adminOnlineUsersAction_); adminMenu_->addAction(adminSendServerMessageAction_); adminMenu_->addAction(adminSetMotdAction_); adminMenu_->addAction(adminUpdateMotdAction_); adminMenu_->addAction(adminDeleteMotdAction_); updateActions(); }
void Panda::resetPandaMood(){ setMood(80); }
void Panda::pandaAddTaskPoints(int points){ int newmood = getMood(); newmood += points; setMood(newmood); }