Light::Light(LIGHT_TYPE type) { lights.push_back(this); if(availableLights.size() > 0) { lightNum = availableLights[0]; availableLights.erase(availableLights.begin()); Visible(true); setLightType(type); setPosition(0, 0, 0); setCutoff(45); setExponent(12); setSpotDirection(0, -1, 0); setAmbient(0, 0, 0, 1); setDiffuse(1, 1, 1, 1); setSpecular(1, 1, 1, 1); updateLight(); } else { lightNum = 0; Visible(false); } }
void EntityRender () { int polymode[2]; bool wireframe; int x, y; int elapsed; //Draw all textured objects glGetIntegerv (GL_POLYGON_MODE, &polymode[0]); wireframe = polymode[0] != GL_FILL; if (RenderFlat ()) glDisable (GL_TEXTURE_2D); //If we're not using a loading screen, make the wireframe fade out via fog if (!LOADING_SCREEN && wireframe) { elapsed = 6000 - WorldSceneElapsed (); if (elapsed >= 0 && elapsed <= 6000) RenderFogFX ((float)elapsed / 6000.0f); else return; } for (x = 0; x < GRID_SIZE; x++) { for (y = 0; y < GRID_SIZE; y++) { if (Visible (x,y)) glCallList (cell_list[x][y].list_textured); } } //draw all flat colored objects glBindTexture(GL_TEXTURE_2D, 0); glColor3f (0, 0, 0); for (x = 0; x < GRID_SIZE; x++) { for (y = 0; y < GRID_SIZE; y++) { if (Visible (x, y)) { if (wireframe) glCallList (cell_list[x][y].list_flat_wireframe); else glCallList (cell_list[x][y].list_flat); } } } //draw all alpha-blended objects glBindTexture(GL_TEXTURE_2D, 0); glColor3f (0, 0, 0); glEnable (GL_BLEND); for (x = 0; x < GRID_SIZE; x++) { for (y = 0; y < GRID_SIZE; y++) { if (Visible (x,y)) { glCallList (cell_list[x][y].list_alpha); } } } }
ARCEMU_INLINE bool SetFlagVisible(uint8 & flag, bool set) { if(ForcedInvisible(flag) || Hidden(flag)) return false; else if(set && !Visible(flag)) flag |= FACTION_FLAG_VISIBLE; else if(!set && Visible(flag)) flag &= ~FACTION_FLAG_VISIBLE; else return false; return true; }
int GDialog::DoModal(OsView OverideParent) { d->ModalStatus = 0; if (Wnd && Attach(0)) { GWindow *Owner = GetParent() ? GetParent()->GetWindow() : 0; if (Owner) { GRect Pr = Owner->GetPos(); GRect Mr = GetPos(); Mr.Offset( Pr.x1 + (Pr.X() - Mr.X()) / 2 - Mr.x1, Pr.y1 + (Pr.Y() - Mr.Y()) / 2 - Mr.y1); SetPos(Mr); Owner->SetChildDialog(this); } d->IsModal = true; AttachChildren(); Visible(true); RunAppModalLoopForWindow(Wnd); if (Owner) Owner->SetChildDialog(0); } return d->ModalStatus; }
void WeaselTrayIcon::Refresh() { if (!m_style.display_tray_icon) { if (m_mode != INITIAL) { RemoveIcon(); m_mode = INITIAL; } return; } WeaselTrayMode mode = m_status.disabled ? DISABLED : m_status.ascii_mode ? ASCII : ZHUNG; if (mode != m_mode) { m_mode = mode; ShowIcon(); SetIcon(mode_icon[mode]); if (mode_label[mode]) { ShowBalloon(mode_label[mode], WEASEL_IME_NAME); } } else if (!Visible()) { ShowIcon(); } }
void CLight::Render () { int angle; GLvector pos; GLvector camera; GLvector camera_position; GLvector2 offset; if (!Visible (_cell_x, _cell_z)) return; camera = CameraAngle (); camera_position = CameraPosition (); if (fabs (camera_position.x - _position.x) > RenderFogDistance ()) return; if (fabs (camera_position.z - _position.z) > RenderFogDistance ()) return; if (_blink && (GetTickCount () % _blink_interval) > 200) return; angle = (int)MathAngle (camera.y); offset = angles[_size][angle]; pos = _position; glColor4fv (&_color.red); glTexCoord2f (0, 0); glVertex3f (pos.x + offset.x, pos.y - _vert_size, pos.z + offset.y); glTexCoord2f (0, 1); glVertex3f (pos.x - offset.x, pos.y - _vert_size, pos.z - offset.y); glTexCoord2f (1, 1); glVertex3f (pos.x - offset.x, pos.y + _vert_size, pos.z - offset.y); glTexCoord2f (1, 0); glVertex3f (pos.x + offset.x, pos.y + _vert_size, pos.z + offset.y); }
const BOOL VentanaDump::Mostrar(const TCHAR *PathDump) { _PathDump = PathDump; UINT YC = 6; if (Sistema.App.Config.UtilizarBarraTituloWindows == true) { CrearVentana(0, TEXT("BubaTronik_VentanaDump"), WS_OVERLAPPED | WS_SYSMENU, IDIOMA__ERROR_GRAVE, DWL_CENTRADO, DWL_CENTRADO, 547, 150, 0); YC = 80; } else { CrearVentana(0, TEXT("BubaTronik_VentanaDump"), WS_POPUP, IDIOMA__ERROR_GRAVE, DWL_CENTRADO, DWL_CENTRADO, 543, 145, 0); HRGN Region = CreateRoundRectRgn(0, 0, 544, 146, 11, 11); SetWindowRgn(_hWnd, Region, false); YC = 100; } if (_hWnd == NULL) return FALSE; _Barra.CrearBarraEx(WS_CHILD | WS_VISIBLE, _hWnd, 10, YC, 522, 8, ID_BARRA_DUMP, DWL_BARRAEX_PROGRESO_HORIZONTAL, 0, 1000); _BotonGuardar.CrearBotonEx(WS_CHILD | WS_VISIBLE, _hWnd, IDIOMA__ENVIAR, 196, YC + 13, 70, 20, 101); _BotonTerminar.CrearBotonEx(WS_CHILD | WS_VISIBLE, _hWnd, IDIOMA__TERMINAR, 276, YC + 13, 70, 20, 100); Visible(true); _BotonGuardar.AsignarFoco(); return TRUE; };
void EditBox::Render(){ if(!Visible() || !mText) return; gUiRender->PushTranslate(mPosition.x, mPosition.y); gUiRender->DrawText(mText); if(UiState::mFocus == this){ if(mSelectStart != mSelectEnd){ int x1, x2, h = GetTextHeight(); x1 = GetXFromCaret(mSelectStart); x2 = GetXFromCaret(mSelectEnd); gUiRender->SetDrawColour(0, 150, 255, 128); gUiRender->DrawRect(x1, 0, x2, h); gUiRender->ResetDrawColour(); } if(clock() - mCaretTimer > 600){ mCaretVisible = !mCaretVisible; mCaretTimer = clock(); } if(mCaretVisible){ int y = mText->GetCharHeight('y') - 1; int x1 = GetXFromCaret(mCaret); gUiRender->DrawLine(x1, 0, x1, y); } } gUiRender->PopTranslate(mPosition.x, mPosition.y); }
void DtPrinterIcon::ShowFlag() { if (app_mode == CONFIG_PRINTERS) return; if (Visible() == false || mainw->setPrefD->ShowStatusFlags() == false) { flag->Visible(false); return; } // Update problem flag's visiblity #ifdef aix boolean show_it; if (_print_queue_up) { int i; show_it = false; for (i = 0; i < n_devices; i++) if (_print_device_up[i] == false) { show_it = true; break; } } else show_it = true; flag->Visible(show_it); #else if (_print_queue_up && _print_device_up) flag->Visible(false); else flag->Visible(true); #endif }
void Player::Reputation_OnTalk(FactionDBC * dbc) { // set faction visible if not visible if(!dbc || dbc->RepListId < 0) return; FactionReputation * rep = reputationByListId[dbc->RepListId]; if(!rep) return; if(!Visible(rep->flag)) { SetFlagVisible(rep->flag); if(IsInWorld()) { #ifdef USING_BIG_ENDIAN uint32 swapped = swap32(dbc->RepListId); m_session->OutPacket(SMSG_SET_FACTION_VISIBLE, 4, &swapped); #else m_session->OutPacket(SMSG_SET_FACTION_VISIBLE, 4, &dbc->RepListId); #endif } #ifdef OPTIMIZED_PLAYER_SAVING save_Reputation(); #endif } }
HWND ArbolOpcionesBasicas::Crear(HWND hWndParent, const int cID, const int cX, const int cY, const int cAncho, const int cAlto) { DWL::ControlesEx::DWLArbolEx_Nodo *Nodo = NULL; CrearArbolEx(WS_CHILD, hWndParent, cX, cY, cAncho, cAlto, cID, false); RecargarIdioma(); /* AgregarNodo(NULL, NULL, IDI_INICIO2, IDIOMA__INICIO, 0); // 0 AgregarNodo(NULL, NULL, IDI_GUARDAR, IDIOMA__ABRIR_ARCHIVO, 1); // 1 Nodo = AgregarNodo(NULL, NULL, IDI_AUDIO, IDIOMA__BASE_DE_DATOS, 2); // 3 AgregarNodo(NULL, Nodo, IDI_BD_BUSCAR, IDIOMA__BUSCAR_ARCHIVOS, 1); // 9 AgregarNodo(NULL, Nodo, IDI_BD_REVISAR, IDIOMA__REVISAR, 2); // 9 AgregarNodo(NULL, NULL, IDI_LISTA, IDIOMA__LISTA_DE_REPRODUCCION, 3); // 8 AgregarNodo(NULL, NULL, IDI_EQ, IDIOMA__ECUALIZADOR, 4); // 4 Nodo = AgregarNodo(NULL, NULL, IDI_OPCIONES, IDIOMA__OPCIONES, 5); // 10 AgregarNodo(NULL, Nodo, IDI_LISTA_LLENA, IDIOMA__ASPECTO); // 10 AgregarNodo(NULL, Nodo, IDI_BDV, IDIOMA__BASE_DE_DATOS); // 10 AgregarNodo(NULL, Nodo, IDI_LISTA_MODIFICARPISTA, IDIOMA__TECLAS_RAPIDAS); // 10 AgregarNodo(NULL, Nodo, IDI_LISTA, IDIOMA__LISTA); // 10 AgregarNodo(NULL, Nodo, IDI_OPCIONESV, IDIOMA__VIDEO); // 10 AgregarNodo(NULL, NULL, IDI_PANTALLA, IDIOMA__VER_VIDEO, 6); // 7 AgregarNodo(NULL, NULL, IDI_AYUDA, IDIOMA__AYUDA, 7); // 13*/ // Nodo = AgregarNodo(NULL, NULL, IDI_BDA, TEXT("Audio"), 2); // 2 // Nodo = AgregarNodo(NULL, NULL, IDI_BDV, TEXT("Video"), 3); // 5 // AgregarNodo(NULL, Nodo, IDI_VIDEO, IDIOMA__BASE_DE_DATOS); // 6 // AgregarNodo(NULL, Nodo, IDI_DISCO, TEXT("Audio")); // 11 // AgregarNodo(NULL, Nodo, IDI_OPCIONESV, TEXT("Video")); // 12 // Nodo = AgregarNodo(NULL, NULL, IDI_AYUDA, TEXT("Acerca de.."), 8); // 14 ArbolEx_Estilos.MultiSeleccion = false; ArbolEx_Estilos.SubSeleccion = false; ActualizarTodo(true, true); Visible(true); return _hWnd; }
Filter::Filter() : fade_animator_(FADE_DURATION) { auto& wm = WindowManager::Default(); auto& settings = Settings::Instance(); auto const& work_area = wm.GetWorkAreaGeometry(0); int monitor = wm.MonitorGeometryIn(work_area); int launcher_width = settings.LauncherWidth(monitor); auto const& cv = settings.em(monitor); search_bar_ = SearchBar::Ptr(new SearchBar()); search_bar_->SetMinimumWidth(WIDTH.CP(cv)); search_bar_->SetMaximumWidth(WIDTH.CP(cv)); search_bar_->scale = cv->DPIScale(); search_bar_->live_search_wait = DEFAULT_SEARCH_WAIT; text.SetGetterFunction([this] { return search_bar_->search_string(); }); text.SetSetterFunction([this] (std::string const& t) { search_bar_->search_string = t; return false; }); debug::Introspectable::AddChild(search_bar_.GetPointer()); auto layout = new nux::HLayout(NUX_TRACKER_LOCATION); layout->SetVerticalExternalMargin(0); layout->SetHorizontalExternalMargin(0); layout->AddView(search_bar_.GetPointer()); view_window_ = new nux::BaseWindow(GetName().c_str()); view_window_->SetLayout(layout); view_window_->SetBackgroundColor(nux::color::Transparent); view_window_->SetWindowSizeMatchLayout(true); view_window_->ShowWindow(true); view_window_->PushToFront(); view_window_->SetOpacity(0.0f); view_window_->SetEnterFocusInputArea(search_bar_.GetPointer()); view_window_->SetInputFocus(); view_window_->SetXY(OFFSET_X.CP(cv) + std::max(work_area.x, launcher_width), OFFSET_Y.CP(cv) + work_area.y); fade_animator_.updated.connect([this] (double opacity) { view_window_->SetOpacity(opacity); }); nux::GetWindowCompositor().SetKeyFocusArea(search_bar_->text_entry()); search_bar_->search_changed.connect([this] (std::string const& search) { if (!Visible()) animation::StartOrReverse(fade_animator_, animation::Direction::FORWARD); if (search.empty()) { UpdateFilteredWindows(); text.changed.emit(search); animation::StartOrReverse(fade_animator_, animation::Direction::BACKWARD); } }); search_bar_->live_search_reached.connect([this] (std::string const& search) { if (!search.empty()) { UpdateFilteredWindows(); text.changed.emit(search); search_bar_->SetSearchFinished(); } }); }
void UiProxyWidget::hideEvent(QHideEvent *hide_event) { QGraphicsProxyWidget::hideEvent(hide_event); emit Visible(false); if (control_button_) control_button_->ControlledWidgetHidden(); }
void CCar::Render () { GLvector pos; int angle; int turn; if (!m_ready) return; if (!Visible (m_drive_position)) return; if (m_front) glColor3f (1, 1, 0.8f); else glColor3f (1, 0.2f, 0); glBegin (GL_QUADS); angle = dangles[m_direction]; pos = m_drive_position;// angle = 360 - (int)MathAngle (m_position.x, m_position.z, pos.x, pos.z); angle %= 360; turn = (int)MathAngleDifference ((float)m_drive_angle, (float)angle); m_drive_angle += SIGN (turn); pos += glVector (0.5f, 0.0f, 0.5f); glTexCoord2f (0, 0); glVertex3f (pos.x + angles[angle].x, -CAR_SIZE, pos.z + angles[angle].y); glTexCoord2f (1, 0); glVertex3f (pos.x - angles[angle].x, -CAR_SIZE, pos.z - angles[angle].y); glTexCoord2f (1, 1); glVertex3f (pos.x - angles[angle].x, CAR_SIZE, pos.z - angles[angle].y); glTexCoord2f (0, 1); glVertex3f (pos.x + angles[angle].x, CAR_SIZE, pos.z + angles[angle].y); /* glVertex3f (m_position.x, m_position.y, m_position.z); glVertex3f (m_position.x, m_position.y, m_position.z + 1); glVertex3f (m_position.x + 1, m_position.y, m_position.z + 1); glVertex3f (m_position.x + 1, m_position.y, m_position.z); */ /* glTexCoord2f (0, 0); glVertex3f (m_position.x, m_position.y, m_position.z + 0.2f); glTexCoord2f (0, 2); glVertex3f (m_position.x, m_position.y, m_position.z + 1 - 0.2f); glTexCoord2f (1, 2); glVertex3f (m_position.x + 1, m_position.y, m_position.z + 1 - 0.2f); glTexCoord2f (1, 0); glVertex3f (m_position.x + 1, m_position.y, m_position.z + 0.2f); */ glEnd (); }
void GWindow::SetZoom(GWindowZoom i) { if (_View && IsWindowVisible(_View)) { switch (i) { case GZoomMax: { ShowWindow(Handle(), SW_MAXIMIZE); break; } case GZoomMin: { ShowWindow(Handle(), SW_MINIMIZE); break; } case GZoomNormal: { if (!Visible()) { Visible(true); } if (IsIconic(Handle()) || IsZoomed(Handle())) { ShowWindow(Handle(), SW_NORMAL); } LgiYield(); RECT r; GetWindowRect(Handle(), &r); if (r.left != Pos.x1 || r.top != Pos.y1) { SetWindowPos(Handle(), 0, Pos.x1, Pos.y1, Pos.X(), Pos.Y(), SWP_NOZORDER); } break; } } } d->Show = i; }
void TimeFace::OnHide(int type) { WatchFace::OnHide(type); if ((!Visible()) && (m_timer != NULL)) { Timer_Destroy(m_timer); m_timer = NULL; } }
void Player::SetStanding(uint32 Faction, int32 Value) { ReputationMap::iterator itr = m_reputation.find(Faction); FactionDBC * dbc = dbcFaction.LookupEntry(Faction); if(dbc == 0) return; if(itr == m_reputation.end()) { // New faction! FactionReputation * rep = new FactionReputation; rep->flag = 0; rep->standing = Value; rep->baseStanding = 0; m_reputation[dbc->ID] = rep; if(dbc->RepListId >= 0) reputationByListId[dbc->RepListId] = rep; } else { // Increment it. if(RankChangedFlat(itr->second->standing, Value)) { itr->second->standing = Value; UpdateInrangeSetsBasedOnReputation(); } else { itr->second->standing = Value; } // Set visible if invisible. if(!Visible(itr->second->flag)) { SetFlagVisible(itr->second->flag); if(IsInWorld()) m_session->OutPacket(SMSG_SET_FACTION_VISIBLE, 4, &dbc->RepListId); } // Set at war if we're beyond hostile. Standing rank = GetReputationRankFromStanding(itr->second->standing); if(rank <= STANDING_HOSTILE && !AtWar(itr->second->flag)) SetFlagAtWar(itr->second->flag); else if(rank >= STANDING_NEUTRAL && AtWar(itr->second->flag)) UnsetFlagAtWar(itr->second->flag); if(IsInWorld()) { WorldPacket data(SMSG_SET_FACTION_STANDING, 12); data << uint32(0) << uint8(0) << uint32(itr->second->flag) << dbc->RepListId << itr->second->CalcStanding(); m_session->SendPacket(&data); } } #ifdef OPTIMIZED_PLAYER_SAVING save_Reputation(); #endif }
boolean DtPrinterIcon::SetIcon(IconStyle style) { IconObj::SetIcon(style); if (dnd) dnd->UpdateRects(); ShowDetailsLabel(style, Visible()); return true; }
void Door::TryDetectSecret(int skill) { if (Type != ST_DOOR) return; if (Visible()) return; if (skill > (signed)DiscoveryDiff) { Flags |= DOOR_FOUND; core->PlaySound(DS_FOUNDSECRET); } }
void Door::TryDetectSecret(int skill, ieDword actorID) { if (Type != ST_DOOR) return; if (Visible()) return; if (skill > (signed)DiscoveryDiff) { Flags |= DOOR_FOUND; core->PlaySound(DS_FOUNDSECRET); AddTrigger(TriggerEntry(trigger_detected, actorID)); } }
int GDialog::DoModeless() { d->IsModal = false; if (Attach(0)) { AttachChildren(); Visible(true); } return 0; }
int EditBox::HandleEvent(KeyboardEvent* evt){ if(!Visible()) return 0; if(UiState::mFocus != this) return 0; if(evt->type == KEY_DOWN) OnKeyDown(evt->key); else if(evt->type == KEY_CHAR) OnChar(evt->key); return mID; }
int RadioButton::HandleEvent(MouseEvent* evt){ if(!Visible()) return 0; if(evt->button != LBUTTON) return 0; if(evt->type != BUTTON_DOWN) return 0; if(!IsInside(evt->pos)) return 0; mButtonState = (mButtonState == BS_CLICKED)?BS_MOUSEOVER:BS_CLICKED; if(mParentBox) mParentBox->SetSelected(this); return mID; }
/** * Paint the contents of the window */ void EditorWindow::Paint(void) { if (!Visible()) return; Container::Paint(); // Paint the editor status PaintEditorStatus(); }
void Player::OnModStanding( FactionDBC * dbc, FactionReputation * rep ) { if ( SetFlagVisible( rep->flag, true ) && IsInWorld() ) { #ifdef USING_BIG_ENDIAN uint32 swapped = swap32( dbc->RepListId ); m_session->OutPacket( SMSG_SET_FACTION_VISIBLE, 4, &swapped ); #else m_session->OutPacket( SMSG_SET_FACTION_VISIBLE, 4, &dbc->RepListId ); #endif } SetFlagAtWar( rep->flag, ( GetReputationRankFromStanding( rep->standing ) <= STANDING_HOSTILE ) ); if ( Visible( rep->flag ) && IsInWorld() ) { WorldPacket data( SMSG_SET_FACTION_STANDING, 12 ); data << uint32( 0 ) << uint32( rep->flag ) << dbc->RepListId << rep->CalcStanding(); m_session->SendPacket( &data ); } // PVP title as a reward for exalted reputations switch( dbc->RepListId ) { case FACTION_STORMPIKE_GUARDS: case FACTION_SILVERWING_SENTINELS: case FACTION_THE_LEAGUE_OF_ARATHOR: { if( GetTeam() == 0 && GetStandingRank( 730 ) == STANDING_EXALTED && GetStandingRank( 890 ) == STANDING_EXALTED && GetStandingRank( 509 ) == STANDING_EXALTED ) { SetKnownTitle( PVPTITLE_JUSTICAR , true ); } else SetKnownTitle( PVPTITLE_JUSTICAR , false ); } break; case FACTION_THE_DEFILERS: case FACTION_FROSTWOLF_CLAN: case FACTION_WARSONG_OUTRIDERS: { if( GetTeam() == 1 && GetStandingRank( 510 ) == STANDING_EXALTED && GetStandingRank( 729 ) == STANDING_EXALTED && GetStandingRank( 889 ) == STANDING_EXALTED ) { SetKnownTitle( PVPTITLE_CONQUEROR , true ); } else SetKnownTitle( PVPTITLE_CONQUEROR , false ); } break; } }
int EditBox::Update(Point mouse){ if(!Visible()) return 0; if(mClicked){ mSelectStart = GetCaretFromX(mClickPos.x - mPosition.x); mSelectEnd = GetCaretFromX(mouse.x - mPosition.x); mCaret = mSelectEnd; AlignSelection(); } return IsInside(mouse) || mClicked; }
void Player::OnModStanding( FactionDBC * dbc, FactionReputation * rep ) { if(!Visible(rep->flag)) { SetFlagVisible(rep->flag); if(IsInWorld()) m_session->OutPacket(SMSG_SET_FACTION_VISIBLE, 4, &dbc->RepListId); } if(GetReputationRankFromStanding(rep->standing) <= STANDING_HOSTILE && !AtWar(rep->flag)) SetFlagAtWar(rep->flag); if ( Visible( rep->flag ) && IsInWorld() ) { WorldPacket data( SMSG_SET_FACTION_STANDING, 17 ); data << uint32( 0 ) ; data << uint8( 1 ) ; //count data << uint32( rep->flag ) << dbc->RepListId << rep->CalcStanding(); m_session->SendPacket( &data ); } }
void ClipEdge(float_point_type P1, float_point_type P2, win_edge_type edge, float_polygon_type &poly_out) { float_point_type Pi; if (Visible(P1, edge)) // P is at the same side of window InsertVertex(poly_out, P1.x, P1.y); if (LineIntersectiom(P1, P2, edge)) { Pi = Intersection(P1, P2, edge); InsertVertex(poly_out, Pi.x, Pi.y); } }
bool cUIMenu::Hide() { Enabled( false ); Visible( false ); if ( NULL != mItemSelected ) mItemSelected->SetSkinState( cUISkinState::StateNormal ); mItemSelected = NULL; mItemSelectedIndex = eeINDEX_NOT_FOUND; return true; }
void UiProxyWidget::showEvent(QShowEvent *e) { QGraphicsProxyWidget::showEvent(e); emit Visible(true); emit BringProxyToFrontRequest(this); if (show_animation_enabled_ && animations_) { fade_animation_->setEndValue(1.0); animations_->setDirection(QAbstractAnimation::Forward); animations_->start(); } }