Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8309
Modified Files:
basechar.cpp basechar.h uobject.cpp uobject.h
Log Message:
Final fixes for postprocessing and implementation of a resend tooltip functionality.
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** basechar.cpp 28 Nov 2003 05:31:18 -0000 1.50
--- basechar.cpp 25 Jan 2004 20:24:25 -0000 1.51
***************
*** 2059,2060 ****
--- 2059,2061 ----
return result;
}
+
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** basechar.h 23 Sep 2003 12:40:18 -0000 1.38
--- basechar.h 25 Jan 2004 20:24:26 -0000 1.39
***************
*** 108,116 ****
virtual void log( const QString &string ) = 0;
unsigned int damage( eDamageType type, unsigned int amount, cUObject *source = 0 );
!
// other public methods
// Simple Property setting and getting for script engines.
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void updateHealth( void );
void action( uchar id ); // Do an action
--- 108,116 ----
virtual void log( const QString &string ) = 0;
unsigned int damage( eDamageType type, unsigned int amount, cUObject *source = 0 );
!
// other public methods
// Simple Property setting and getting for script engines.
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void updateHealth( void );
void action( uchar id ); // Do an action
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -C2 -d -r1.123 -r1.124
*** uobject.cpp 25 Jan 2004 01:07:49 -0000 1.123
--- uobject.cpp 25 Jan 2004 20:24:26 -0000 1.124
***************
*** 474,483 ****
// Checks if the specified object is in range
! bool cUObject::inRange( const cUObject *object, UINT32 range ) const
{
if( !object )
return false;
! return ( pos_.distance( object->pos_ ) <= range );
}
--- 474,500 ----
// Checks if the specified object is in range
! bool cUObject::inRange( cUObject *object, UINT32 range ) const
{
if( !object )
return false;
! Coord_cl pos = object->pos_;
!
! if (object->isItem()) {
! P_ITEM pItem = dynamic_cast<P_ITEM>(object);
!
! if (pItem) {
! P_ITEM pCont = pItem->getOutmostItem();
! P_CHAR pEquipped = pItem->getOutmostChar();
!
! if (pEquipped) {
! pos = pEquipped->pos();
! } else if (pCont) {
! pos = pCont->pos();
! }
! }
! }
!
! return pos_.distance(pos) <= range;
}
***************
*** 716,719 ****
--- 733,757 ----
}
+ void cUObject::resendTooltip() {
+ tooltip_ = World::instance()->getUnusedTooltip();
+ setTooltip(tooltip_);
+
+ cUOTxAttachTooltip tooltip;
+
+ tooltip.setId( tooltip_ );
+ tooltip.setSerial( serial() );
+
+ cUOTxAttachTooltip attach;
+ attach.setId(tooltip_);
+ attach.setSerial(serial_);
+
+ for (cUOSocket *s = cNetwork::instance()->first(); s; s = cNetwork::instance()->next()) {
+ if (s->player() && s->player()->inRange(this, s->player()->visualRange())) {
+ s->addTooltip(tooltip_);
+ s->send(&attach);
+ }
+ }
+ }
+
/****************************
*
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** uobject.h 6 Jan 2004 22:30:06 -0000 1.78
--- uobject.h 25 Jan 2004 20:24:26 -0000 1.79
***************
*** 123,127 ****
bool del();
! bool inRange( const cUObject *object, UINT32 range ) const;
void removeFromView( bool clean = true );
--- 123,127 ----
bool del();
! bool inRange( cUObject *object, UINT32 range ) const;
void removeFromView( bool clean = true );
***************
*** 172,175 ****
--- 172,176 ----
virtual stError *getProperty( const QString &name, cVariant &value ) const;
virtual void flagUnchanged() { changed_ = false; }
+ void resendTooltip();
char direction( cUObject* ) const;
|