void pfGUIControlMod::SetFocused( bool e ) { if( e == fFocused ) return; fFocused = e; IUpdate(); }
void pfGUIControlMod::SetEnabled( bool e ) { if( e == fEnabled ) return; fEnabled = e; IUpdate(); }
void pfGUIControlMod::SetInteresting( bool i ) { if( i == fInteresting ) return; fInteresting = i; IUpdate(); if ( fNotifyOnInteresting && fDialog && fDialog->GetHandler() ) fDialog->GetHandler()->OnInterestingEvent(this); }
void pfGUIMenuItem::SetName( const wchar_t *name ) { delete [] fName; if (name != nil) { fName = new wchar_t[wcslen(name)+1]; wcscpy(fName,name); } else fName = nil; IUpdate(); }
hsBool pfMarkerMgr::MsgReceive(plMessage* msg) { plEvalMsg* evalMsg = plEvalMsg::ConvertNoRef(msg); if (evalMsg) { IUpdate(); return true; } // Somebody hit a marker plNotifyMsg* notify = plNotifyMsg::ConvertNoRef(msg); if (notify) { proCollisionEventData* cEvent = (proCollisionEventData*)notify->FindEventRecord(proEventData::kCollision); if (cEvent) { plKey markerKey = cEvent->fHittee; plKey playerKey = cEvent->fHitter; if (plNetClientMgr::GetInstance()->IsAPlayerKey(cEvent->fHittee)) { // swap the above, since the hittee is actually the player playerKey = cEvent->fHittee; markerKey = cEvent->fHitter; } IMarkerHit(markerKey, playerKey); } return true; } plLoadCloneMsg* cloneMsg = plLoadCloneMsg::ConvertNoRef(msg); if (cloneMsg) { plKey cloneKey = cloneMsg->GetCloneKey(); if (cloneMsg->GetIsLoading() && cloneKey) { uint32_t id; pfMarkerInfo* marker = IFindMarker(cloneKey, id); marker->InitSpawned(cloneKey); } return true; } return hsKeyedObject::MsgReceive(msg); }
void pfGUIControlMod::Refresh( void ) { IUpdate(); }
bool pfGUIControlMod::ISetUpDynTextMap( plPipeline *pipe ) { if( fDynTextMap == nil ) { hsAssert( false, "Trying to set up a nil dynamicTextMap in a GUI control" ); return true; } if( fDynTextLayer == nil || fInitialBounds.GetType() == kBoundsUninitialized )//|| fDialog == nil ) return false; uint32_t scrnWidth, scrnHeight; if( !HasFlag( kScaleTextWithResolution ) ) { // Scale so that there is a 1:1 pixel:textel ratio scrnWidth = pipe->Width(); scrnHeight = pipe->Height(); } else { // Scale with the resolution so that we take up the same % of screen space no matter what resolution // Assume a base "resolution" of 1024xX, where X is such that the ratio "1024/X = scrnWidth/scrnHt" holds const int kBaseScaleRes = 1024; const int kBaseScaleHeightRes = 768; scrnWidth = kBaseScaleRes; scrnHeight = kBaseScaleHeightRes; // we are going to just force things to be in 4 by 3 ratio... // ...cause it seems to work better. /////// scrnHeight = ( pipe->Height() * kBaseScaleRes ) / pipe->Width(); } const hsBounds3 &bounds = fInitialBounds;//GetBounds(); uint16_t width = (uint16_t)(( bounds.GetMaxs().fX - bounds.GetMins().fX ) * scrnWidth); uint16_t height = (uint16_t)(( bounds.GetMaxs().fY - bounds.GetMins().fY ) * scrnHeight); // Allow derived controls to allocate some extra scratch space if desired // (Do it this way so we can pass in our current calculated dimensions for them to play with) uint16_t extraW = width, extraH = height; IGrowDTMDimsToDesiredSize( extraW, extraH ); extraW -= width; extraH -= height; fDynTextMap->Reset(); fDynTextMap->Create( width, height, HasFlag( kXparentBgnd ), extraW, extraH, true ); fDynTextMap->SetFont( GetColorScheme()->fFontFace, GetColorScheme()->fFontSize, GetColorScheme()->fFontFlags, HasFlag( kXparentBgnd ) ? false : true ); fDynTextMap->SetTextColor( GetColorScheme()->fForeColor, ( HasFlag( kXparentBgnd ) && GetColorScheme()->fBackColor.a == 0.f ) ? true : false ); // Now we gotta set the texture transform on the layer so our texture comes // out with 1:1 mapping from textel to pixel plLayer *layer = (plLayer *)fDynTextLayer; layer->SetTransform( fDynTextMap->GetLayerTransform() ); layer->SetBlendFlags( layer->GetBlendFlags() | hsGMatState::kBlendAlphaPremultiplied ); // Let the derived classes do their things IPostSetUpDynTextMap(); // Do our first update IUpdate(); return true; }
void pfGUIUpDownPairMod::SetCurrValue( float v ) { pfGUIValueCtrl::SetCurrValue( v ); IUpdate(); }
void pfGUIUpDownPairMod::SetRange( float min, float max ) { pfGUIValueCtrl::SetRange( min, max ); IUpdate(); }
void pfGUIUpDownPairMod::Update( void ) { IUpdate(); }