Revision: 10368
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=10368&view=rev
Author: z-man
Date: 2012-02-20 16:09:12 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
Merging branch 0.2.8 from revision 10359 to 10367:
------------------------------------------------------------------------
r10367 | bazaaarmagetron | 2012-02-20 16:53:56 +0100 (Mon, 20 Feb 2012) | 2 lines
Manuel Moos: Network wait loops are now abortable if you hammer ESC.
------------------------------------------------------------------------
r10366 | bazaaarmagetron | 2012-02-20 13:23:38 +0100 (Mon, 20 Feb 2012) | 5 lines
author: Manuel Moos
Server browser tooltips are now displayed in small font using the same
text output area as the server details, avoiding overlaps; the
server lists now shrinks to make room for extra long server details.
------------------------------------------------------------------------
r10365 | bazaaarmagetron | 2012-02-20 00:44:37 +0100 (Mon, 20 Feb 2012) | 2 lines
Manuel Moos: Better face replacement finding, less likely to fail.
------------------------------------------------------------------------
r10364 | bazaaarmagetron | 2012-02-18 06:17:48 +0100 (Sat, 18 Feb 2012) | 1 line
Daniel Lee Harple: Fix language string identifier typo.
------------------------------------------------------------------------
Revision Links:
--------------
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=10359&view=rev
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=10367&view=rev
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=10366&view=rev
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=10365&view=rev
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=10364&view=rev
Modified Paths:
--------------
armagetronad/branches/0.4/armagetronad/src/engine/eGrid.cpp
armagetronad/branches/0.4/armagetronad/src/engine/ePlayer.cpp
armagetronad/branches/0.4/armagetronad/src/network/nNetObject.cpp
armagetronad/branches/0.4/armagetronad/src/tron/gServerBrowser.cpp
armagetronad/branches/0.4/armagetronad/src/ui/uMenu.cpp
armagetronad/branches/0.4/armagetronad/src/ui/uMenu.h
Property Changed:
----------------
armagetronad/branches/0.4/
Property changes on: armagetronad/branches/0.4
___________________________________________________________________
Modified: svn:mergeinfo
- /armagetronad/branches/0.2.8:8751-8852,8855-9185,9192-9201,9220-9514,9529-10044,10054-10359
/armagetronad/branches/0.2.8.3:9309-10004
+ /armagetronad/branches/0.2.8:8751-8852,8855-9185,9192-9201,9220-9514,9529-10044,10054-10367
/armagetronad/branches/0.2.8.3:9309-10004
Modified: armagetronad/branches/0.4/armagetronad/src/engine/eGrid.cpp
===================================================================
--- armagetronad/branches/0.4/armagetronad/src/engine/eGrid.cpp 2012-02-20 15:53:56 UTC (rev 10367)
+++ armagetronad/branches/0.4/armagetronad/src/engine/eGrid.cpp 2012-02-20 16:09:12 UTC (rev 10368)
@@ -359,7 +359,7 @@
{
// return invalid return if the face was already visited
if ( arg.visited.find( old ) != arg.visited.end() )
- return eFaceScorePair( 0, -se_maxGridSize );
+ return eFaceScorePair( 0, -se_maxGridSize*se_maxGridSize );
// register face as visited
arg.visited.insert( old );
@@ -374,7 +374,7 @@
// iterate it
// the currently best face/insideness pair
- std::pair< eFace*, REAL > best( 0, -100000 );
+ std::pair< eFace*, REAL > best( 0, -se_maxGridSize*se_maxGridSize );
for( eReplacementStorage::const_iterator i = storage.begin(); i != storage.end(); ++i )
{
// the current face/insideness pair
@@ -396,8 +396,10 @@
current = se_FindBestReplacement( face, arg );
}
- if ( current.second > best.second && current.first )
+ if ( ( current.second > best.second && current.first ) || !best.first )
+ {
best = current;
+ }
}
return best;
Modified: armagetronad/branches/0.4/armagetronad/src/engine/ePlayer.cpp
===================================================================
--- armagetronad/branches/0.4/armagetronad/src/engine/ePlayer.cpp 2012-02-20 15:53:56 UTC (rev 10367)
+++ armagetronad/branches/0.4/armagetronad/src/engine/ePlayer.cpp 2012-02-20 16:09:12 UTC (rev 10368)
@@ -9381,7 +9381,7 @@
if ( !( !bool(this->voter_) || voter_->AllowNameChange() || nameFromServer_.Len() <= 1 ) && nameFromServer_ != nameFromClient_ )
{
// inform victim to avoid complaints
- tOutput message( "$player_rename_rejected_kickvote", nameFromServer_, nameFromClient_ );
+ tOutput message( "$player_rename_rejected_votekick", nameFromServer_, nameFromClient_ );
sn_ConsoleOut( message, Owner() );
con << message;
return false;
Modified: armagetronad/branches/0.4/armagetronad/src/network/nNetObject.cpp
===================================================================
--- armagetronad/branches/0.4/armagetronad/src/network/nNetObject.cpp 2012-02-20 15:53:56 UTC (rev 10367)
+++ armagetronad/branches/0.4/armagetronad/src/network/nNetObject.cpp 2012-02-20 16:09:12 UTC (rev 10368)
@@ -483,6 +483,12 @@
sn_SendPlanned();
// st_Breakpoint();
tAdvanceFrame(1000000);
+
+ // check for user abort, but just make it time out faster
+ if ( tConsole::Idle() )
+ {
+ timeout -= 10;
+ }
}
if (tSysTimeFloat()>=timeout)
tERR_ERROR_INT("Not enough nNetObject IDs to distribute. Sorry!\n");
@@ -1112,7 +1118,15 @@
bool printMessage=true;
while (sn_Connections[0].socket &&
- NULL==(ret=sn_netObjects[i]) && timeout >tSysTimeFloat()){ // wait until it is spawned
+ NULL==(ret=sn_netObjects[i]) && timeout >tSysTimeFloat())
+ { // wait until it is spawned
+
+ // check for user abort, but just make it time out faster
+ if ( tConsole::Idle() )
+ {
+ timeout -= 10;
+ }
+
if (tSysTimeFloat()>timeout-(totalTimeout + printMessageTimeout))
{
if (printMessage)
@@ -2077,6 +2091,13 @@
if (sync_sn_netObjects)
nNetObject::SyncAll();
sn_SendPlanned();
+
+ // check for user abort, but just make it time out faster
+ if ( tConsole::Idle() )
+ {
+ endTime -= 10;
+ timeout *= .5;
+ }
}
// decrease timeout for next try
@@ -2113,6 +2134,12 @@
}
}
+ // check for user abort, but just make it time out faster
+ if ( tConsole::Idle() )
+ {
+ endTime -= 10;
+ }
+
if (tSysTimeFloat()>endTime)
{
goon=false;
Modified: armagetronad/branches/0.4/armagetronad/src/tron/gServerBrowser.cpp
===================================================================
--- armagetronad/branches/0.4/armagetronad/src/tron/gServerBrowser.cpp 2012-02-20 15:53:56 UTC (rev 10367)
+++ armagetronad/branches/0.4/armagetronad/src/tron/gServerBrowser.cpp 2012-02-20 16:09:12 UTC (rev 10368)
@@ -130,6 +130,9 @@
class gBrowserMenuItem: public uMenuItem
{
protected:
+ bool displayHelp_;
+ REAL helpAlpha_;
+
gBrowserMenuItem(uMenu *M,const tOutput &help): uMenuItem( M, help )
{
}
@@ -138,6 +141,13 @@
virtual bool Event( SDL_Event& event );
virtual void RenderBackground();
+
+ virtual bool DisplayHelp( bool display, REAL y, REAL alpha )
+ {
+ helpAlpha_ = alpha;
+ displayHelp_ = display;
+ return false;
+ }
};
class gServerMenuItem: public gBrowserMenuItem
@@ -687,18 +697,22 @@
#endif
}
+static REAL sg_menuBottom = -.9;
+static REAL sg_requestBottom = -.9;
void gServerMenuItem::RenderBackground()
{
#ifndef DEDICATED
+ REAL helpTopReal = sg_requestBottom*shrink + displace - .05;;
+
gBrowserMenuItem::RenderBackground();
+ rTextField::SetDefaultColor( tColor(1,1,1) );
+
+ rTextField players( -.9, helpTopReal, text_height, sr_fontServerDetails );
+ players.EnableLineWrap();
if ( server )
{
- rTextField::SetDefaultColor( tColor(1,1,1) );
-
- rTextField players( -.9, -.3, text_height, sr_fontServerDetails );
- players.EnableLineWrap();
players << tOutput( "$network_master_players" );
if ( server->UserNamesOneLine().Len() > 2 )
players << server->UserNamesOneLine();
@@ -712,6 +726,28 @@
options << server->Options();
players << tOutput( "$network_master_serverinfo", server->Release(), uri, options );
}
+
+ if( displayHelp_ )
+ {
+ players << "\n";
+ players.SetColor(tColor(1,1,1,helpAlpha_));
+ players << Help();
+ }
+
+ REAL helpSpace = players.GetTop() - players.GetBottom();
+ REAL helpTop = -.85 + helpSpace;
+ REAL helpTopScaled = ( helpTop - displace )/shrink;
+ REAL helpTopMax = .25;
+ REAL helpTopMin = -.9;
+ if( helpTopScaled > helpTopMax )
+ {
+ helpTopScaled = helpTopMax;
+ }
+ if( helpTopScaled < helpTopMin )
+ {
+ helpTopScaled = helpTopMin;
+ }
+ sg_requestBottom = helpTopScaled;
#endif
}
@@ -823,6 +859,24 @@
void gBrowserMenuItem::RenderBackground()
{
+ if( menu )
+ {
+ double now = tSysTimeFloat();
+ static double lastTime = now;
+ if( sg_menuBottom > sg_requestBottom )
+ {
+ sg_menuBottom -= now - lastTime;
+ }
+ lastTime = now;
+ if( sg_menuBottom < sg_requestBottom )
+ {
+ sg_menuBottom = sg_requestBottom;
+ }
+
+ menu->SetBot( sg_menuBottom );
+ sg_requestBottom = -.9;
+ }
+
sn_Receive();
sn_SendPlanned();
Modified: armagetronad/branches/0.4/armagetronad/src/ui/uMenu.cpp
===================================================================
--- armagetronad/branches/0.4/armagetronad/src/ui/uMenu.cpp 2012-02-20 15:53:56 UTC (rev 10367)
+++ armagetronad/branches/0.4/armagetronad/src/ui/uMenu.cpp 2012-02-20 16:09:12 UTC (rev 10368)
@@ -350,21 +350,27 @@
if (YPos(menuentries-1)>menuTop && (int(tSysTimeFloat())+1)%2)
arrow(.9,menuTop,1,.05);
- if (tSysTimeFloat()-lastkey>timeout){
- disphelp=true;
+ REAL helpAlpha = tSysTimeFloat()-lastkey-timeout;
+ if( helpAlpha > 1 )
+ {
+ helpAlpha = 1;
+ }
+
+ disphelp = helpAlpha > 0;
+ if ( items[selected]->DisplayHelp( disphelp, menuBot, helpAlpha ) )
+ {
if (sr_alphaBlend)
- glColor4f(1,.8,.8,tSysTimeFloat()-lastkey-timeout);
+ glColor4f(1,.8,.8, helpAlpha );
else
- Color(tSysTimeFloat()-lastkey-timeout,
- .8*(tSysTimeFloat()-lastkey-timeout),
- .8*(tSysTimeFloat()-lastkey-timeout));
+ Color(helpAlpha,
+ .8*helpAlpha,
+ .8*helpAlpha);
rTextField c(-.95f,menuBot-.04f,rCHEIGHT_NORMAL, sr_fontMenu);
c.SetWidth(1.9f-items[selected]->SpaceRight());
c.EnableLineWrap();
c << items[selected]->Help();
}
- else disphelp=false;
}
else
#endif
Modified: armagetronad/branches/0.4/armagetronad/src/ui/uMenu.h
===================================================================
--- armagetronad/branches/0.4/armagetronad/src/ui/uMenu.h 2012-02-20 15:53:56 UTC (rev 10367)
+++ armagetronad/branches/0.4/armagetronad/src/ui/uMenu.h 2012-02-20 16:09:12 UTC (rev 10368)
@@ -232,7 +232,13 @@
menu->items.Remove(this,idnum);
}
-virtual tString Help(){return tString(helpText);}
+ //! called when the menu item is selected, the incoming parameter says
+ //! whether help should be displayed, the function returns true if
+ //! the menu code itself should handle the display or whether the menu item
+ //! does that.
+ virtual bool DisplayHelp( bool display, REAL y, REAL alpha ){return display;}
+
+ virtual tString Help(){return tString(helpText);}
// displays the menuitem at position x,y. set selected to true
// if the item is currently under the cursor
virtual void Render(REAL ,REAL ,REAL =1,bool =0){}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|