// sequence operations bool MorphChannel::update(Entity& result, const Entity& rest, unsigned int elapsed_time) { if(updateSelf(elapsed_time)) return updateResult(result, rest); return false; }
void ViewController::update(int deltaTime) { if(mCurrentView) { mCurrentView->update(deltaTime); } updateSelf(deltaTime); }
void RKObjectListViewSettings::addSettingsToMenu (QMenu* menu, QAction* before) { RK_TRACE (APP); menu->insertAction (before, persistent_settings_actions[ShowObjectsHidden]); QMenu *show_fields_menu = new QMenu (i18n ("Show Fields"), menu); show_fields_menu->addAction (persistent_settings_actions[ShowFieldsType]); show_fields_menu->addAction (persistent_settings_actions[ShowFieldsLabel]); show_fields_menu->addAction (persistent_settings_actions[ShowFieldsClass]); menu->insertMenu (before, show_fields_menu); updateSelf (); }
void RKObjectListViewSettings::resetFilters () { RK_TRACE (APP); in_reset_filters = true; if (filter_widget) { type_box->setCurrentIndex (0); filter_on_name_box->setChecked (true); filter_on_label_box->setChecked (true); filter_on_class_box->setChecked (true); depth_box->setCurrentIndex (1); sline->setText (QString ()); } else { hide_functions = hide_non_functions = false; filter_on_class = filter_on_label = filter_on_name = true; depth_limit = 1; setFilterRegExp (QRegExp ()); } in_reset_filters = false; updateSelf (); }
void RKObjectListViewSettings::filterSettingsChanged () { RK_TRACE (APP); if (in_reset_filters) return; // Avoid updating for each setting, individually, when many are changed at once. if (filter_widget) { filter_on_name = filter_on_name_box->isChecked (); filter_on_label = filter_on_label_box->isChecked (); filter_on_class = filter_on_class_box->isChecked (); depth_limit = depth_box->currentIndex (); hide_functions = type_box->currentIndex () == 2; hide_non_functions = type_box->currentIndex () == 1; reset_filters_button->setVisible (!filter_on_name || !filter_on_class || !filter_on_label || (depth_limit != 1) || hide_functions || hide_non_functions || !sline->text ().isEmpty ()); } for (int i = 0; i < SettingsCount; ++i) { persistent_settings[i] = persistent_settings_actions[i]->isChecked (); if (is_tool_window) RKSettingsModuleObjectBrowser::setDefaultForWorkspace ((PersistentSettings) i, persistent_settings[i]); else RKSettingsModuleObjectBrowser::setDefaultForVarselector ((PersistentSettings) i, persistent_settings[i]); } updateSelf (); }
winSkills_t::winSkills_t() { controller = NULL; window.SetWidth(160); window.SetHeight(GetDefaultHeight()); window.SetCaption(gettext("Skills")); window.AddObject(&container); container.SetWidth(160); container.SetHeight(GetDefaultHeight()); container.SetVirtualSize(160, 270); container.SetBGActiveness(false); container.AddObject(&lblExperienceLeft); container.AddObject(&lblExperienceRight); lblExperienceLeft.SetPos(5, 5); lblExperienceLeft.SetWidth(160); lblExperienceLeft.SetHeight(12); lblExperienceLeft.SetBGActiveness(false); lblExperienceLeft.SetCaption(gettext("Experience")); lblExperienceRight.SetPos(160-20, 5); lblExperienceRight.SetWidth(10); lblExperienceRight.SetHeight(12); lblExperienceRight.SetBGActiveness(false); lblExperienceRight.SetCaption("0"); container.AddObject(&lblLevelLeft); container.AddObject(&lblLevelRight); lblLevelLeft.SetPos(5, 15); lblLevelLeft.SetWidth(160); lblLevelLeft.SetHeight(12); lblLevelLeft.SetBGActiveness(false); lblLevelLeft.SetCaption(gettext("Level")); lblLevelRight.SetPos(160 - 20, 15); lblLevelRight.SetWidth(10); lblLevelRight.SetHeight(12); lblLevelRight.SetBGActiveness(false); lblLevelRight.SetCaption("0"); container.AddObject(&pbExperience); pbExperience.SetPos(5, 25); pbExperience.SetWidth(140); pbExperience.SetHeight(5); pbExperience.SetValue(40); #if GLICT_APIREV >= 105 pbExperience.SetBGActiveness(false); pbExperience.SetBorderColor(glictColor(0, 0, 0, 1)); pbExperience.SetFGColor(glictColor(.9,.2,.1,1.)); #else #if _MSC_VER #pragma message ("For visual improvements to skill bars, update to glict rev 105 or higher") #else #warning For visual improvements to skill bars, update to glict rev 105 or higher #endif #endif //////////////////////////////// container.AddObject(&lblHPLeft); container.AddObject(&lblHPRight); lblHPLeft.SetPos(5, 35); lblHPLeft.SetWidth(160); lblHPLeft.SetHeight(12); lblHPLeft.SetBGActiveness(false); lblHPLeft.SetCaption(gettext("Hit Points")); lblHPRight.SetPos(160 - 20, 35); lblHPRight.SetWidth(10); lblHPRight.SetHeight(12); lblHPRight.SetBGActiveness(false); lblHPRight.SetCaption("0"); container.AddObject(&lblMPLeft); container.AddObject(&lblMPRight); lblMPLeft.SetPos(5, 45); lblMPLeft.SetWidth(160); lblMPLeft.SetHeight(12); lblMPLeft.SetBGActiveness(false); lblMPLeft.SetCaption(gettext("Mana")); lblMPRight.SetPos(160 - 20, 45); lblMPRight.SetWidth(10); lblMPRight.SetHeight(12); lblMPRight.SetBGActiveness(false); lblMPRight.SetCaption("0"); container.AddObject(&lblSPLeft); container.AddObject(&lblSPRight); lblSPLeft.SetPos(5, 55); lblSPLeft.SetWidth(160); lblSPLeft.SetHeight(12); lblSPLeft.SetBGActiveness(false); lblSPLeft.SetCaption(gettext("Soul Points")); lblSPRight.SetPos(160 - 20, 55); lblSPRight.SetWidth(10); lblSPRight.SetHeight(12); lblSPRight.SetBGActiveness(false); lblSPRight.SetCaption("0"); container.AddObject(&lblCapLeft); container.AddObject(&lblCapRight); lblCapLeft.SetPos(5, 65); lblCapLeft.SetWidth(160); lblCapLeft.SetHeight(12); lblCapLeft.SetBGActiveness(false); lblCapLeft.SetCaption(gettext("Cap")); lblCapRight.SetPos(160 - 20, 65); lblCapRight.SetWidth(10); lblCapRight.SetHeight(12); lblCapRight.SetBGActiveness(false); lblCapRight.SetCaption("0"); container.AddObject(&lblStaLeft); container.AddObject(&lblStaRight); lblStaLeft.SetPos(5, 75); lblStaLeft.SetWidth(160); lblStaLeft.SetHeight(12); lblStaLeft.SetBGActiveness(false); lblStaLeft.SetCaption(gettext("Stamina")); lblStaRight.SetPos(160 - 20, 75); lblStaRight.SetWidth(10); lblStaRight.SetHeight(12); lblStaRight.SetBGActiveness(false); lblStaRight.SetCaption("0"); container.AddObject(&pbStamina); pbStamina.SetPos(5, 85); pbStamina.SetWidth(140); pbStamina.SetHeight(5); pbStamina.SetValue(40); #if GLICT_APIREV >= 105 pbStamina.SetBGActiveness(false); pbStamina.SetBorderColor(glictColor(0, 0, 0, 1)); #else #if _MSC_VER #pragma message ("GLICT too old, get 105 or newer for visual improvement on some progressbars") #else #warning GLICT too old, get 105 or newer for visual improvement on some progressbars #endif #endif container.AddObject(&lblMagicLevelLeft); container.AddObject(&lblMagicLevelRight); lblMagicLevelLeft.SetPos(5, 95); lblMagicLevelLeft.SetWidth(160); lblMagicLevelLeft.SetHeight(12); lblMagicLevelLeft.SetBGActiveness(false); lblMagicLevelLeft.SetCaption(gettext("Magic Level")); lblMagicLevelRight.SetPos(160 - 20, 95); lblMagicLevelRight.SetWidth(10); lblMagicLevelRight.SetHeight(12); lblMagicLevelRight.SetBGActiveness(false); lblMagicLevelRight.SetCaption("0"); container.AddObject(&pbMagicLevel); pbMagicLevel.SetPos(5, 105); pbMagicLevel.SetWidth(140); pbMagicLevel.SetHeight(5); pbMagicLevel.SetValue(40); #if GLICT_APIREV >= 105 pbMagicLevel.SetBGActiveness(false); pbMagicLevel.SetBorderColor(glictColor(0, 0, 0, 1)); pbMagicLevel.SetFGColor(glictColor(.9,.2,.1,1.)); #else #if _MSC_VER #pragma message ("For visual improvements to skill bars, update to glict rev 105 or higher") #else #warning For visual improvements to skill bars, update to glict rev 105 or higher #endif #endif container.AddObject(&pnlSeparator); pnlSeparator.SetPos(5,115); pnlSeparator.SetWidth(140); pnlSeparator.SetHeight(2); pnlSeparator.SetBGColor(.7, .7, .7, 1.); pnlSeparator.SetSkin(&g_skin.chk); for (int i = 0; i < 7; i++) { container.AddObject(&lblSkillLeft[i]); container.AddObject(&lblSkillRight[i]); lblSkillLeft[i].SetPos(5, 125 + i * 20); lblSkillLeft[i].SetWidth(160); lblSkillLeft[i].SetHeight(12); lblSkillLeft[i].SetBGActiveness(false); lblSkillLeft[i].SetCaption(std::string(gettext("Skill ")) + yatc_itoa(i) ); lblSkillRight[i].SetPos(160 - 20, 125 + i*20); lblSkillRight[i].SetWidth(10); lblSkillRight[i].SetHeight(12); lblSkillRight[i].SetBGActiveness(false); lblSkillRight[i].SetCaption("0"); container.AddObject(&pbSkill[i]); pbSkill[i].SetPos(5, 135 + i*20); pbSkill[i].SetWidth(140); pbSkill[i].SetHeight(5); pbSkill[i].SetValue(40); #if GLICT_APIREV >= 105 pbSkill[i].SetBGActiveness(false); pbSkill[i].SetBorderColor(glictColor(0, 0, 0, 1)); #else #if _MSC_VER #pragma message ("For visual improvements to skill bars, update to glict rev 105 or higher") #else #warning For visual improvements to skill bars, update to glict rev 105 or higher #endif #endif } lblSkillLeft[0].SetCaption(gettext("Fist Fighting")); lblSkillLeft[1].SetCaption(gettext("Club Fighting")); lblSkillLeft[2].SetCaption(gettext("Sword Fighting")); lblSkillLeft[3].SetCaption(gettext("Axe Fighting")); lblSkillLeft[4].SetCaption(gettext("Distance Fighting")); lblSkillLeft[5].SetCaption(gettext("Shielding")); lblSkillLeft[6].SetCaption(gettext("Fishing")); updateSelf(); }
void GameObject::update(GTick ticks) { updateSelf(ticks); }
void getEntry(int *team, int *stype) { int switching = -1; /* confirm switches 7/27/91 TC */ inputMask = CP_OUTFIT; for (;;) { /* updateShips so he knows how many players on each team */ if (blk_flag) updateShips(); sendMaskPacket(tournamentMask(me->p_team)); if (blk_flag) briefUpdateClient(); flushSockBuf(); /* Have we been busted? */ if (me->p_status == PFREE) { me->p_status = PDEAD; me->p_explode = 600; } socketPause(); readFromClient(); if (isClientDead()) { int i; if (noressurect) exitGame(); printf("Ack! The client went away!\n"); printf("I will attempt to resurrect him!\n"); /* UDP fail-safe */ commMode = COMM_TCP; if (udpSock >= 0) closeUdpConn(); /* For next two minutes, we try to restore connection */ shutdown(sock, 2); sock = -1; for (i = 0;; i++) { switch (me->p_status) { case PFREE: me->p_status = PDEAD; me->p_explode = 600; break; case PALIVE: case POBSERVE: me->p_ghostbuster = 0; break; case PDEAD: me->p_explode = 600; break; default: me->p_explode = 600; me->p_ghostbuster = 0; break; } sleep(5); if (connectToClient(host, nextSocket)) break; if (i == 23) { printf("Oh well, maybe I'm getting rusty!\n"); switch (me->p_status) { case PFREE: break; case PALIVE: case POBSERVE: me->p_ghostbuster = 100000; break; case PDEAD: me->p_explode = 0; break; default: me->p_explode = 0; me->p_ghostbuster = 100000; break; } exitGame(); } } printf("A miracle! He's alive!\n"); teamPick = -1; updateSelf(); updateShips(); flushSockBuf(); } if (teamPick != -1) { if (teamPick < 0 || teamPick > 3) { warning("Get real!"); sendPickokPacket(0); teamPick = -1; continue; } if (!(tournamentMask(me->p_team) & (1 << teamPick))) { warning("I cannot allow that. Pick another team"); sendPickokPacket(0); teamPick = -1; continue; } if (((1 << teamPick) != me->p_team) && (me->p_team != ALLTEAM)) /* switching teams 7/27/91 TC */ if ((switching != teamPick) && (me->p_whydead != KGENOCIDE) && !status2->league ) { switching = teamPick; warning("Please confirm change of teams. Select the new team again."); sendPickokPacket(0); teamPick = -1; continue; } /* His team choice is ok. */ if (shipPick < 0 || shipPick >= NUM_TYPES) { warning("That is an illegal ship type. Try again."); sendPickokPacket(0); teamPick = -1; continue; } if (!allowed_ship(1 << teamPick, mystats->st_rank, mystats->st_royal, shipPick)) { sendPickokPacket(0); teamPick = -1; continue; } if (shipvals[shipPick].s_nflags & SFNMASSPRODUCED) { warning("o)utpost, u)tility, or s)tandard?"); sendPickokPacket(0); tmpPick = shipPick; continue; } break; } if (me->p_status == PTQUEUE) { if (status->tourn) detourneyqueue(); /* You don't time out on the tourney queue */ me->p_ghostbuster = 0; } } *team = teamPick; if ((shipvals[tmpPick].s_nflags & SFNMASSPRODUCED) && ((shipvals[shipPick].s_numports) || (shipPick == SCOUT))) { *stype = tmpPick; tmpPick = CRUISER; } else { *stype = shipPick; tmpPick = CRUISER; } sendPickokPacket(1); flushSockBuf(); }