From: Jeffrey D. <ha...@us...> - 2003-12-10 19:56:05
|
Log Message: ----------- More radar Options- - Drak did these. I made them use the 3d area though Also a denagent version fix Modified Files: -------------- /cvsroot/decaldev/source/Inject: BarLayer.cpp BarLayer.h RootLayer.cpp View.cpp Revision Data ------------- Index: BarLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- BarLayer.cpp 19 Nov 2003 19:19:14 -0000 1.16 +++ BarLayer.cpp 10 Dec 2003 19:56:03 -0000 1.17 @@ -9,8 +9,17 @@ // cBarLayer // Drakier: Added constants for Panel and Radar size -const long RADAR_SIZE = 110; -const long PANEL_SIZE = 308; +const int RADAR_SIZE = 110; +const int PANEL_SIZE = 308; +const int VITALS_SIZE = 28; +const int CHATBAR_SIZE = 101; +const int CHATBAR_MAX_SIZE = 259; +const int LOOT_SIZE = 101; + +// Drakier: Added constants for docking position +const int DOCK_TOP = 0; +const int DOCK_LEFT = 1; +const int DOCK_RIGHT = 2; enum eChildID { @@ -21,31 +30,57 @@ eChildBarFirst = 1000 }; -cBarLayer::cBarLayer() : m_nBarStartPos( 0 ), m_nScreenWidth( 0 ), m_nScreenHeight( 0 ), m_nBarLength( 0 ), m_nPosition( 0 ), m_nDragging( 0 ), m_nMinMax( eStateMax ) +cBarLayer::cBarLayer() : m_nBarStartPos( 0 ), m_nBarDock( DOCK_TOP ), m_nScreenWidth( 0 ), m_nScreenHeight( 0 ), m_nBarLength( 0 ), m_nPosition( 0 ), m_nDragging( 0 ), m_nMinMax( eStateMax ) { } void cBarLayer::onCreate() { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + m_pSite->get_PluginSite( &m_pPlugin ); + m_pPlugin->get_Hooks( &m_pHooks ); + _ASSERTE( m_pPlugin.p != NULL ); - _ASSERTE( pPlugin.p != NULL ); + m_pPlugin->LoadBitmapPortal( 0x06001115, &m_pBackground ); - long lH; - long lW; - pPlugin->QueryMemLoc( _bstr_t( "3DAreaHeight" ), &lH ); - pPlugin->QueryMemLoc( _bstr_t( "3DAreaWidth" ), &lW ); - m_p3DH = reinterpret_cast< long * >( lH ); - m_p3DW = reinterpret_cast< long * >( lW ); + _ASSERTE( m_pBackground.p != NULL ); - pPlugin->LoadBitmapPortal( 0x06001115, &m_pBackground ); - _ASSERTE( m_pBackground.p != NULL ); + RegKey key; + key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); + + DWORD dwAlpha = 255, dwRadarDraw = 1; + m_bRadarDraw = true; + + if( key.QueryDWORDValue( "BarAlpha", dwAlpha ) == ERROR_SUCCESS ) + m_pSite->put_Alpha( dwAlpha ); + + if( key.QueryDWORDValue( "BarRadarDraw", dwRadarDraw ) == ERROR_SUCCESS ) + m_bRadarDraw = dwRadarDraw ? true : false; + + if( key.QueryDWORDValue( "BarState", m_nMinMax ) != ERROR_SUCCESS ) + m_nMinMax = eStateMax; + + // Drakier: get the bar start pos or default to left + if( key.QueryDWORDValue( "BarStart", (DWORD &)m_nBarStartPos ) != ERROR_SUCCESS ) + m_nBarStartPos = 0; + + // Drakier: get the bar length or default to 250 px + if( key.QueryDWORDValue( "BarLength", (DWORD &)m_nBarLength ) != ERROR_SUCCESS ) + m_nBarLength = 250; + + // Drakier: get the bar dock setting (top/left/right) [default to top] + if( key.QueryDWORDValue( "BarDock", (DWORD &)m_nBarDock ) != ERROR_SUCCESS ) + m_nBarDock = DOCK_TOP; + + if (m_nBarDock != DOCK_TOP) + m_nMinMax = eStateMin; // Ok, first create the 4 background controls - LayerParams lpChild = { eBtnMinMax, { 12, 3, 28, 19 }, eRenderClipped }; + LayerParams lpChild; + lpChild.render = eRenderClipped; + //= { eBtnMinMax, { 12, 3, 28, 19 }, eRenderClipped }; { + lpChild.ID = eBtnMinMax; CComPtr< ILayer > pUnk; HRESULT hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_ILayer, reinterpret_cast< void ** >( &pUnk ) ); @@ -74,7 +109,11 @@ _ASSERTE( m_pBtnForwards.p != NULL ); - m_pBtnForwards->SetImages( 0, 0x06001298, 0x06001299 ); + // Drakier: Bar Dock + if (m_nBarDock != DOCK_TOP) + m_pBtnForwards->SetImages( 0, 0x0600125E, 0x0600125F ); + else + m_pBtnForwards->SetImages( 0, 0x06001298, 0x06001299 ); ICommandEventsImpl< BUTTON_FORWARD, cBarLayer >::advise( m_pBtnForwards ); m_pBtnForwards->put_Matte( RGB( 0, 0, 0 ) ); } @@ -92,7 +131,11 @@ _ASSERTE( m_pBtnBackwards.p != NULL ); - m_pBtnBackwards->SetImages( 0, 0x06001295, 0x06001296 ); + // Drakier: Bar Dock + if (m_nBarDock != DOCK_TOP) + m_pBtnBackwards->SetImages( 0, 0x06001261, 0x06001262 ); + else + m_pBtnBackwards->SetImages( 0, 0x06001295, 0x06001296 ); ICommandEventsImpl< BUTTON_BACK, cBarLayer >::advise( m_pBtnBackwards ); m_pBtnBackwards->put_Matte( RGB( 0, 0, 0 ) ); } @@ -115,37 +158,18 @@ m_pSite->put_Transparent( VARIANT_FALSE ); - RegKey key; - key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); - - DWORD dwAlpha = 255, dwRadarDraw = 1; - m_bRadarDraw = true; - - if( key.QueryDWORDValue( "BarAlpha", dwAlpha ) == ERROR_SUCCESS ) - m_pSite->put_Alpha( dwAlpha ); - - if( key.QueryDWORDValue( "BarRadarDraw", dwRadarDraw ) == ERROR_SUCCESS ) - m_bRadarDraw = dwRadarDraw ? true : false; - - if( key.QueryDWORDValue( "BarState", m_nMinMax ) != ERROR_SUCCESS ) - m_nMinMax = eStateMax; - - // Drakier: get the bar start pos or default to left - if( key.QueryDWORDValue( "BarStart", (DWORD &)m_nBarStartPos ) != ERROR_SUCCESS ) - m_nBarStartPos = 0; - - // Drakier: get the bar length or default to 250 px - if( key.QueryDWORDValue( "BarLength", (DWORD &)m_nBarLength ) != ERROR_SUCCESS ) - m_nBarLength = 250; - if( m_nMinMax == eStateMin ) m_pBtnMinMax->SetImages( 0, 0x0600113C, 0x0600113C ); else m_pBtnMinMax->SetImages( 0, 0x0600113B, 0x0600113B ); + + //::MessageBox( NULL, _T( "Here" ), _T( "[Inject.dll] cBarLayer::onCreate" ), MB_OK ); } void cBarLayer::onDestroy() { + m_pHooks.Release(); + m_pPlugin.Release(); m_pBtnForwards.Release(); m_pBtnBackwards.Release(); m_pBackground.Release(); @@ -161,45 +185,90 @@ m_pBackground->PatBlt( pCanvas, &p.window, &p.org ); - RECT dragBarRect; - dragBarRect.left = 3; - dragBarRect.top = 4; - dragBarRect.right = 4; - dragBarRect.bottom = 19; + if (m_nBarDock == DOCK_TOP) // if we are top docked + { + RECT dragBarRect; + dragBarRect.left = 3; + dragBarRect.top = 4; + dragBarRect.right = 4; + dragBarRect.bottom = 19; - pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); - - dragBarRect.left += 1; - dragBarRect.right += 1; - pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + + dragBarRect.left += 1; + dragBarRect.right += 1; + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); - dragBarRect.left += 2; - dragBarRect.right += 2; - pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + dragBarRect.left += 2; + dragBarRect.right += 2; + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); - dragBarRect.left += 1; - dragBarRect.right += 1; - pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + dragBarRect.left += 1; + dragBarRect.right += 1; + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); - // Drakier: draw the right-hand grab bars - dragBarRect.left = m_nBarLength - 4; - dragBarRect.top = 4; - dragBarRect.right = m_nBarLength - 3; - dragBarRect.bottom = 19; + // Drakier: draw the right-hand grab bars + dragBarRect.left = m_nBarLength - 4; + dragBarRect.top = 4; + dragBarRect.right = m_nBarLength - 3; + dragBarRect.bottom = 19; - pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); - dragBarRect.left -= 1; - dragBarRect.right -= 1; - pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + dragBarRect.left -= 1; + dragBarRect.right -= 1; + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); - dragBarRect.left -= 2; - dragBarRect.right -= 2; - pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + dragBarRect.left -= 2; + dragBarRect.right -= 2; + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); - dragBarRect.left -= 1; - dragBarRect.right -= 1; - pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + dragBarRect.left -= 1; + dragBarRect.right -= 1; + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + } + else // draw on the sides + { + RECT dragBarRect; + dragBarRect.top = 3; + dragBarRect.left = 4; + dragBarRect.bottom = 4; + dragBarRect.right = 19; + + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + + dragBarRect.top += 1; + dragBarRect.bottom += 1; + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + + dragBarRect.top += 2; + dragBarRect.bottom += 2; + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + + dragBarRect.top += 1; + dragBarRect.bottom += 1; + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + + // Drakier: draw the right-hand grab bars + dragBarRect.top = m_nBarLength - 4; + dragBarRect.left = 4; + dragBarRect.bottom = m_nBarLength - 3; + dragBarRect.right = 19; + + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + + dragBarRect.top -= 1; + dragBarRect.bottom -= 1; + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + + dragBarRect.top -= 2; + dragBarRect.bottom -= 2; + pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); + + dragBarRect.top -= 1; + dragBarRect.bottom -= 1; + pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); + } _ASSERTMEM( _CrtCheckMemory( ) ); @@ -220,13 +289,15 @@ // ::MessageBox( NULL, _T( "cBarLayer::reformat" ), _T( "Inject.dll" ), MB_OK ); SIZE sz; - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); - pPlugin->GetScreenSize( &sz ); - if ( sz.cx > 0 ) - m_nScreenWidth = sz.cx; - if ( sz.cy > 0) - m_nScreenHeight = sz.cy; + m_pPlugin->GetScreenSize( &sz ); + long lX = sz.cx, lY = sz.cy; + m_pHooks->get_Area3DHeight( &lY ); + m_pHooks->get_Area3DWidth( &lX ); + + if( (lX > 0) && (lY < 5000) ) + m_nScreenWidth = lX; + if( (lX > 0) && (lY < 5000) ) + m_nScreenHeight = lY; // Drakier: set up the bar position // Drakier: make sure bar isn't off of left side of screen @@ -235,41 +306,135 @@ m_nBarStartPos = 0; if (m_nBarLength < 112) m_nBarLength = 250; - // Drakier: the right edge of the 3D area is (m_nScreenWidth - PANEL_SIZE) - // If you include the radar (110) it is (m_nScreenWidth - (PANEL_SIZE + RADAR_SIZE)) + // Drakier: the right edge of the 3D area is (m_nScreenWidth) + // If you include the radar (110) it is (m_nScreenWidth - RADAR_SIZE) - // Drakier: make sure bar isn't off RIGHT side of screen - if (m_nBarLength > (m_nScreenWidth - PANEL_SIZE) ) - m_nBarLength = m_nScreenWidth - PANEL_SIZE; + // Drakier: need 2 of these sections. One for top dock and one for side dock + // Drakier: TOP DOCK + if (m_nBarDock == DOCK_TOP) + { + // make sure bar isn't off RIGHT side of screen + if (m_nBarLength > m_nScreenWidth ) + m_nBarLength = m_nScreenWidth; - // Drakier: adjust bar start position so its not offscreen - if (m_nBarStartPos > (m_nScreenWidth - PANEL_SIZE) ) - m_nBarStartPos = (m_nScreenWidth - PANEL_SIZE) - m_nBarLength; + // Drakier: adjust bar start position so its not offscreen + if (m_nBarStartPos > m_nScreenWidth ) + m_nBarStartPos = m_nScreenWidth - m_nBarLength; - // Drakier: Adjust for Panel - if ((m_nBarStartPos + m_nBarLength) > (m_nScreenWidth - PANEL_SIZE) ) - m_nBarLength = (m_nScreenWidth - PANEL_SIZE) - m_nBarStartPos; + // Drakier: Adjust for Panel + if ((m_nBarStartPos + m_nBarLength) > m_nScreenWidth ) + m_nBarLength = m_nScreenWidth - m_nBarStartPos; - // Drakier: Adjust for Radar - if ( (!m_bRadarDraw) && ((m_nBarStartPos + m_nBarLength) > (m_nScreenWidth - (PANEL_SIZE + RADAR_SIZE))) ) - m_nBarLength = (m_nScreenWidth - (PANEL_SIZE + RADAR_SIZE)) - m_nBarStartPos; + // Drakier: Adjust for Radar + if ( (!m_bRadarDraw) && ((m_nBarStartPos + m_nBarLength) > (m_nScreenWidth - RADAR_SIZE)) ) + m_nBarLength = m_nScreenWidth - RADAR_SIZE - m_nBarStartPos; + } + else + { + // Drakier: SIDE DOCK + // Drakier: make sure bar isn't off BOTTOM of screen + if (m_nBarLength > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) + m_nBarLength = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)); + + // Drakier: adjust bar start position so its not offscreen + if (m_nBarStartPos > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) + m_nBarStartPos = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) - m_nBarLength; + + // Drakier: Adjust for Panels + if ((m_nBarStartPos + m_nBarLength) > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) + m_nBarLength = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) - m_nBarStartPos; + } // Drakier: Draw the bar - RECT rc1 = { m_nBarStartPos, 0, m_nBarStartPos + m_nBarLength, 23 }; - m_pSite->put_Position( &rc1 ); + RECT rc; + if (m_nBarDock == DOCK_LEFT) // Left Dock + { + rc.left = 0; + rc.top = m_nBarStartPos; + rc.right = 23; + rc.bottom = m_nBarStartPos + m_nBarLength; + } + else if (m_nBarDock == DOCK_RIGHT) // Right Dock + { + rc.left = m_nScreenWidth - 23; + rc.top = m_nBarStartPos; + rc.right = m_nScreenWidth; + rc.bottom = m_nBarStartPos + m_nBarLength; + } + else // Top Dock + { + rc.left = m_nBarStartPos; + rc.top = 0; + rc.right = m_nBarStartPos + m_nBarLength; + rc.bottom = 23; + } + m_pSite->put_Position( &rc ); + + // Now do the MinMax button + // { 12, 3, 28, 19 } + if (m_nBarDock != DOCK_TOP) // Side Dock + { + //rc.left = 3; + //rc.top = 12; + //rc.right = 19; + //rc.bottom = 28; + + rc.left = -12; + rc.top = -12; + rc.right = -2; + rc.bottom = -2; + } + else // Top Dock + { + rc.left = 12; + rc.top = 3; + rc.right = 28; + rc.bottom = 19; + } + CComPtr< ILayerSite > pMinMaxSite; + m_pSite->get_Child( eBtnMinMax, ePositionByID, &pMinMaxSite ); + pMinMaxSite->put_Position( &rc ); // Now do the backwards - RECT rc = { 30, 3, 46, 19 }; + if (m_nBarDock != DOCK_TOP) // Side Dock + { + //rc.left = 3; + //rc.top = 30; + //rc.right = 19; + //rc.bottom = 46; + + rc.left = 3; + rc.top = 12; + rc.right = 19; + rc.bottom = 28; + } + else // Top Dock + { + rc.left = 30; + rc.top = 3; + rc.right = 46; + rc.bottom = 19; + } CComPtr< ILayerSite > pBackwardsSite; m_pSite->get_Child( eBtnBackwards, ePositionByID, &pBackwardsSite ); pBackwardsSite->put_Position( &rc ); // Drakier: this is a change because of the new LENGTH system - rc.left = m_nBarLength - 28; - rc.top = 3; - rc.right = m_nBarLength - 12; - rc.bottom = 19; - + // Now do the forwards + if (m_nBarDock != DOCK_TOP) // Side Dock + { + rc.left = 3; + rc.top = m_nBarLength - 28; + rc.right = 19; + rc.bottom = m_nBarLength - 12; + } + else // Top Dock + { + rc.left = m_nBarLength - 28; + rc.top = 3; + rc.right = m_nBarLength - 12; + rc.bottom = 19; + } CComPtr< ILayerSite > pFwdSite; m_pSite->get_Child( eBtnForwards, ePositionByID, &pFwdSite ); pFwdSite->put_Position( &rc ); @@ -278,12 +443,27 @@ CComPtr< ILayerSite > pPagerSite; m_pSite->get_Child( ePager, ePositionByID, &pPagerSite ); - RECT rc3 = { 50, 1, m_nBarLength - 30, 22}; - pPagerSite->put_Position( &rc3 ); + if (m_nBarDock != DOCK_TOP) // Side Dock + { + rc.left = 1; + //rc.top = 50; + rc.top = 30; + rc.right = 22; + rc.bottom = m_nBarLength - 30; + } + else // Top Dock + { + rc.left = 50; + rc.top = 1; + rc.right = m_nBarLength - 30; + rc.bottom = 22; + } + pPagerSite->put_Position( &rc ); m_offsets.clear(); - + long nOffset = 0; + long nDesired; long nChildren; pPagerSite->get_ChildCount( &nChildren ); @@ -306,24 +486,47 @@ pParams.state = m_nMinMax; pBarNative->put_Params(&pParams); - long nDesired; - - pBarNative->get_RenderWidth( &nDesired ); - // We always give bars their desired size - RECT rcChild = { nOffset, 0, nOffset + nDesired, 21 }; - pChildSite->put_Position( &rcChild ); + pBarNative->get_RenderWidth( &nDesired ); + if (m_nBarDock != DOCK_TOP) // Side Dock + { + nDesired = 20; + rc.left = 0; + rc.top = nOffset; + rc.right = 21; + rc.bottom = nOffset + nDesired; + } + else // Top Dock + { + rc.left = nOffset; + rc.top = 0; + rc.right = nOffset + nDesired; + rc.bottom = 21; + } + pChildSite->put_Position( &rc ); m_offsets.push_back( nOffset ); nOffset += nDesired + 2; } + /* Drakier: Testing if un-needed // Check if the position is wrong now if( m_nPosition >= m_offsets.size() ) m_nPosition = m_offsets.size() - 1; - + */ POINT pt = { ( m_nPosition <= 0 ) ? 0 : m_offsets[ m_nPosition ], 0 }; + if (m_nBarDock != DOCK_TOP) // Side Dock + { + pt.x = 0; + pt.y = ( m_nPosition <= 0 ) ? 0 : m_offsets[ m_nPosition ]; + } + else // Top Dock + { + pt.x = ( m_nPosition <= 0 ) ? 0 : m_offsets[ m_nPosition ]; + pt.y = 0; + } + m_pPager->ScrollTo( &pt ); m_pSite->Invalidate(); @@ -335,24 +538,56 @@ switch( nCommand ) { case eBtnForwards: - if( m_nPosition < ( m_offsets.size() - 1 ) ) + if (m_nBarDock != DOCK_TOP) // Side Dock { - ++ m_nPosition; - *pnX = m_offsets[ m_nPosition ]; - *pnY = 0; + if( !m_bLocked && ( m_nPosition < ( m_offsets.size() - 1 ) ) ) + { + m_bLocked = TRUE; + m_nPosition++; + *pnX = 0; + *pnY = m_offsets[ m_nPosition ]; - return VARIANT_TRUE; + return VARIANT_TRUE; + } + } + else // Top Dock + { + if( !m_bLocked && ( m_nPosition < ( m_offsets.size() - 1 ) ) ) + { + m_bLocked = TRUE; + m_nPosition++; + *pnX = m_offsets[ m_nPosition ]; + *pnY = 0; + + return VARIANT_TRUE; + } } break; case eBtnBackwards: - if( m_nPosition > 0 ) + if (m_nBarDock != DOCK_TOP) // Side Dock { - -- m_nPosition; - *pnX = m_offsets[ m_nPosition ]; - *pnY = 0; + if( !m_bLocked && m_nPosition > 0 ) + { + m_bLocked = TRUE; + m_nPosition--; + *pnX = 0; + *pnY = m_offsets[ m_nPosition ]; - return VARIANT_TRUE; + return VARIANT_TRUE; + } + } + else // Top Dock + { + if( !m_bLocked && m_nPosition > 0 ) + { + m_bLocked = TRUE; + m_nPosition--; + *pnX = m_offsets[ m_nPosition ]; + *pnY = 0; + + return VARIANT_TRUE; + } } break; @@ -478,19 +713,38 @@ if( !cManager::_p->m_bContainer ) pt.y -= 28; - - // Drakier: Grabbing the left drag bar - if (pt.y >= rSize.top && pt.y <= rSize.bottom && pt.x >= rSize.left + 1 && pt.x <= rSize.left + 8) + + if (m_nBarDock != DOCK_TOP) // Side Dock { - m_nDragging = -1; - m_DeltaX = pt.x; - } + // Drakier: Grabbing the Top drag bar + if (pt.x >= rSize.left && pt.x <= rSize.right && pt.y >= rSize.top + 1 && pt.y <= rSize.top + 8) + { + m_nDragging = -1; + m_DeltaY = pt.y; + } - // Drakier: Grabbing the right drag bar - if (pt.y >= rSize.top && pt.y <= rSize.bottom && pt.x >= rSize.right - 8 && pt.x <= rSize.right - 1) + // Drakier: Grabbing the right drag bar + if (pt.x >= rSize.left && pt.x <= rSize.right && pt.y >= rSize.bottom - 8 && pt.y <= rSize.bottom - 1) + { + m_nDragging = 1; + m_DeltaY = pt.y; + } + } + else // Top Dock { - m_nDragging = 1; - m_DeltaX = pt.x; + // Drakier: Grabbing the left drag bar + if (pt.y >= rSize.top && pt.y <= rSize.bottom && pt.x >= rSize.left + 1 && pt.x <= rSize.left + 8) + { + m_nDragging = -1; + m_DeltaX = pt.x; + } + + // Drakier: Grabbing the right drag bar + if (pt.y >= rSize.top && pt.y <= rSize.bottom && pt.x >= rSize.right - 8 && pt.x <= rSize.right - 1) + { + m_nDragging = 1; + m_DeltaX = pt.x; + } } break; @@ -508,48 +762,87 @@ break; case WM_MOUSEMOVE: - if ( m_nDragging == -1 ) // Drakier: Drag Left + if (m_nBarDock != DOCK_TOP) // Side Dock { - POINTS pt; - pt = MAKEPOINTS(lParam); - - if( !cManager::_p->m_bContainer ) - pt.y -= 28; - - if ( ((m_nBarLength - (pt.x - m_DeltaX)) > 112 ) && (((pt.x - m_DeltaX) + m_nBarStartPos) >= 0) ) + if ( m_nDragging == -1 ) // Drakier: Drag Left { - m_nBarStartPos += pt.x - m_DeltaX; - m_nBarLength += (-1) * (pt.x - m_DeltaX); - m_DeltaX = pt.x; + POINTS pt; + pt = MAKEPOINTS(lParam); + + if( !cManager::_p->m_bContainer ) + pt.y -= 28; + + if ( ((m_nBarLength - (pt.y - m_DeltaY)) > 112 ) && (((pt.y - m_DeltaY) + m_nBarStartPos) >= 0) ) + { + m_nBarStartPos += pt.y - m_DeltaY; + m_nBarLength += (-1) * (pt.y - m_DeltaY); + m_DeltaY = pt.y; + } + + Reformat( ); } + else if ( m_nDragging == 1 ) // Drakier: Drag Right + { + POINTS pt; + pt = MAKEPOINTS(lParam); + + if( !cManager::_p->m_bContainer ) + pt.y -= 28; - Reformat( ); + if ( ((pt.y - m_DeltaY + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.y - m_DeltaY) <= (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE))) ) + { + m_nBarLength += pt.y - m_DeltaY; + m_DeltaY = pt.y; + } + Reformat( ); + } } - else if ( m_nDragging == 1 ) // Drakier: Drag Right + else // Top Dock { - POINTS pt; - pt = MAKEPOINTS(lParam); - - if( !cManager::_p->m_bContainer ) - pt.y -= 28; - if ( !m_bRadarDraw ) // Drakier: Radar on? + if ( m_nDragging == -1 ) // Drakier: Drag Left { - if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (m_nScreenWidth - (PANEL_SIZE + RADAR_SIZE))) ) + POINTS pt; + pt = MAKEPOINTS(lParam); + + if( !cManager::_p->m_bContainer ) + pt.y -= 28; + + if ( ((m_nBarLength - (pt.x - m_DeltaX)) > 112 ) && (((pt.x - m_DeltaX) + m_nBarStartPos) >= 0) ) { - m_nBarLength += pt.x - m_DeltaX; + m_nBarStartPos += pt.x - m_DeltaX; + m_nBarLength += (-1) * (pt.x - m_DeltaX); m_DeltaX = pt.x; } + + Reformat( ); } - else // Drakier: Radar off! + else if ( m_nDragging == 1 ) // Drakier: Drag Right { - if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (m_nScreenWidth - PANEL_SIZE)) ) + POINTS pt; + pt = MAKEPOINTS(lParam); + + if( !cManager::_p->m_bContainer ) + pt.y -= 28; + if ( !m_bRadarDraw ) // Drakier: Radar on? { - m_nBarLength += pt.x - m_DeltaX; - m_DeltaX = pt.x; + if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (m_nScreenWidth - RADAR_SIZE)) ) + { + m_nBarLength += pt.x - m_DeltaX; + m_DeltaX = pt.x; + } } - } - Reformat( ); + else // Drakier: Radar off! + { + if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (m_nScreenWidth /*- PANEL_SIZE*/)) ) + { + m_nBarLength += pt.x - m_DeltaX; + m_DeltaX = pt.x; + } + } + + Reformat( ); + } } break; } Index: BarLayer.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- BarLayer.h 19 Nov 2003 19:19:14 -0000 1.7 +++ BarLayer.h 10 Dec 2003 19:56:03 -0000 1.8 @@ -31,6 +31,8 @@ cBarLayer(); // Important child objects + CComPtr< IPluginSite > m_pPlugin; + CComPtr< IACHooks > m_pHooks; CComPtr< IPager > m_pPager; CComPtr< IButton > m_pBtnForwards, m_pBtnBackwards, m_pBtnMinMax; @@ -40,10 +42,11 @@ // This the the list of bars typedef std::vector< long > cOffsetList; cOffsetList m_offsets; - long m_nPosition; + unsigned long m_nPosition; unsigned long m_nMinMax; long m_DeltaX; + long m_DeltaY; long m_nScreenWidth; long m_nScreenHeight; //long m_TotalDelta; @@ -54,7 +57,10 @@ long m_nBarLength; int m_nDragging; + int m_nBarDock; bool m_bRadarDraw; + bool m_bButtonDown; + bool m_bLocked; void onCreate(); void onDestroy(); @@ -89,11 +95,14 @@ // Button Back and Forward event handlers void __stdcall onCommandHit( long nID ) { + m_bButtonDown = TRUE; m_pPager->put_Command( nID ); } void __stdcall onCommandUnhit( long ) { + m_bButtonDown = FALSE; + m_bLocked = FALSE; m_pPager->FinishCommand(); } Index: RootLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/RootLayer.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- RootLayer.cpp 2 Oct 2003 11:49:59 -0000 1.8 +++ RootLayer.cpp 10 Dec 2003 19:56:03 -0000 1.9 @@ -50,9 +50,24 @@ m_pSite->CreateChild( &lpBars, pBars ); - if( m_nViewMode == 0 ) // Single Mode + + RegKey key; + key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); + + DWORD dwBarDock; + if( key.QueryDWORDValue( "BarDock", dwBarDock ) != ERROR_SUCCESS ) + dwBarDock = 0; + + if( dwBarDock == 1 ) + m_lDefaultX = 25; + else + m_lDefaultX = 5; + + m_lDefaultY = 5; + + if( m_nViewMode == 0 ) // Single Mode { - LayerParams lpPanel = { eChildPanel, { 0, 0, 0, 0 }, 0 }; + LayerParams lpPanel = { eChildPanel, { m_lDefaultY, m_lDefaultX, 0, 0 }, 0 }; CComObject< cPanel > *pPanel; CComObject< cPanel >::CreateInstance( &pPanel ); @@ -146,7 +161,7 @@ if( m_nViewMode == 1 ) // Multi Mode { - LayerParams lpPanel = { m_nNextViewID, { 0, 0, 0, 0 }, 0 }; + LayerParams lpPanel = { m_nNextViewID, { m_lDefaultX, m_lDefaultY, 0, 0 }, 0 }; CComObject< cPanel > *pPanel; CComObject< cPanel >::CreateInstance( &pPanel ); @@ -218,7 +233,7 @@ if( m_nViewMode == 1 ) // Multi Mode { - LayerParams lpPanel = { m_nNextViewID, { 0, 0, 0, 0 }, 0 }; + LayerParams lpPanel = { m_nNextViewID, { m_lDefaultX, m_lDefaultY, 0, 0 }, 0 }; CComObject< cPanel > *pPanel; CComObject< cPanel >::CreateInstance( &pPanel ); Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- View.cpp 6 Oct 2003 00:22:10 -0000 1.30 +++ View.cpp 10 Dec 2003 19:56:03 -0000 1.31 @@ -118,14 +118,16 @@ if (m_VP.iconLibrary == 0 && m_VP.icon != 0) m_VP.icon += 0x06000000; - if(vLeft.vt == VT_NULL) - m_VP.left = 0; - else +// if(vLeft.vt == VT_NULL) + // m_VP.left = 0; + // else + if(vLeft.vt != VT_NULL) m_VP.left = static_cast< long >(vLeft); - if(vTop.vt == VT_NULL) - m_VP.top = 70; - else +// if(vTop.vt == VT_NULL) + // m_VP.top = 70; + // else + if(vTop.vt != VT_NULL) m_VP.top = static_cast< long >(vTop); if(vWidth.vt == VT_NULL) |
From: Jeffrey D. <ha...@us...> - 2003-12-10 19:57:32
|
Log Message: ----------- More radar Options- - Drak did these. I made them use the 3d area though Also a denagent version fix Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: DenAgent.rc OptionsDlg.cpp resource.h Revision Data ------------- Index: DenAgent.rc =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgent.rc,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- DenAgent.rc 27 Sep 2003 06:22:39 -0000 1.77 +++ DenAgent.rc 10 Dec 2003 19:57:30 -0000 1.78 @@ -1,6 +1,7 @@ // Microsoft Visual C++ generated resource script. // #include "resource.h" +#include "..\Include\DecalVersion.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -123,34 +124,36 @@ IDC_STATIC,7,7,165,14,SS_CENTERIMAGE END -IDD_OPTIONS DIALOGEX 0, 0, 271, 220 +IDD_OPTIONS DIALOGEX 0, 0, 271, 221 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Decal Options" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "OK",IDOK,155,199,50,14 - PUSHBUTTON "Cancel",IDCANCEL,214,199,50,14 + DEFPUSHBUTTON "OK",IDOK,155,200,50,14 + PUSHBUTTON "Cancel",IDCANCEL,214,200,50,14 + GROUPBOX "View Options",IDC_STATIC,7,7,257,157 CTEXT "Bar Alpha",IDC_STATIC,17,20,35,8,SS_CENTERIMAGE - EDITTEXT IDC_BARALPHA,59,16,45,14,ES_CENTER | ES_AUTOHSCROLL | - ES_NUMBER CONTROL "Spin1",IDC_BARALPHA_SPIN,"msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,47,16,11,14 - CTEXT "View Alpha",IDC_STATIC,19,34,35,8,SS_CENTERIMAGE - EDITTEXT IDC_VIEWALPHA,59,31,45,14,ES_CENTER | ES_AUTOHSCROLL | + EDITTEXT IDC_BARALPHA,59,16,45,14,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER + CTEXT "View Alpha",IDC_STATIC,19,34,35,8,SS_CENTERIMAGE CONTROL "Spin2",IDC_VIEWALPHA_SPIN,"msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,47,31,11,14 + EDITTEXT IDC_VIEWALPHA,59,31,45,14,ES_CENTER | ES_AUTOHSCROLL | + ES_NUMBER CTEXT "0 is Transparent - 255 is Opaque",IDC_STATIC,21,46,106, 9 - GROUPBOX "Decal Update URL",IDC_STATIC,7,164,257,29 - LTEXT "http://decaldev.sourceforge.net",IDC_PLUGINDIR,14,177, - 169,8,SS_CENTERIMAGE - PUSHBUTTON "Change",IDC_CHANGE_DIR,208,173,50,14 - CONTROL "Start on Bootup",IDC_CHECK_AUTOSTART,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,14,201,63,12 - PUSHBUTTON "Reset Bar Position",IDC_BTN_RESET,81,199,68,14 + CONTROL "Use Hardware Mode",IDC_BLENDINGGDIPLUS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,144,16,114,9 + CONTROL "Multiple Views",IDC_VIEWMULTI,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,144,26,114,9 + CONTROL "Adjust Bar for Radar",IDC_RADARYES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,144,36,114,9 + CONTROL "Use Old Injection Method",IDC_OLDINJECT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,144,46,114,10 GROUPBOX "Font Options",IDC_STATIC,14,66,244,28 CONTROL "Default",IDC_DEFAULT_FONT_RADIO,"Button", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,21,78,39,10 @@ -159,34 +162,35 @@ CONTROL "Custom",IDC_CUSTOM_FONT_RADIO,"Button", BS_AUTORADIOBUTTON | WS_TABSTOP,111,78,39,10 EDITTEXT IDC_CUSTOM_FONT_EDIT,151,76,98,12,ES_AUTOHSCROLL - GROUPBOX "View Options",IDC_STATIC,7,7,257,156 - CONTROL "Use Hardware Mode",IDC_BLENDINGGDIPLUS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,144,16,114,9 - CONTROL "Multiple Views",IDC_VIEWMULTI,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,144,26,114,9 - CONTROL "Adjust Bar for Radar",IDC_RADARYES,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,144,36,114,9 + GROUPBOX "Time Stamping",IDC_STATIC,14,95,244,27 CONTROL "Enabled",IDC_TIMESTAMPON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,108,44,9,WS_EX_RIGHT | WS_EX_RTLREADING - GROUPBOX "Time Stamping",IDC_STATIC,14,95,244,27 + LTEXT "Color",IDC_STATIC,71,108,19,11 COMBOBOX IDC_FORMATCLR,92,105,29,67,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_FORMATSTR,151,105,88,12,ES_AUTOHSCROLL - LTEXT "Color",IDC_STATIC,71,108,19,11 LTEXT "Format",IDC_STATIC,123,108,25,9 + EDITTEXT IDC_FORMATSTR,151,105,88,12,ES_AUTOHSCROLL PUSHBUTTON "?",IDC_FORMATHELP,244,105,7,12 - CONTROL "Use Old Injection Method",IDC_OLDINJECT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,144,46,114,10 + GROUPBOX "Client Patches",IDC_STATIC,14,122,139,35 CONTROL "Dual Log",IDC_DUALLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,131,44,11 CONTROL "Windowed Mode",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,143,71,11 - GROUPBOX "Client Patches",IDC_STATIC,14,122,244,35 - PUSHBUTTON "?",IDC_PATCHHELP,241,135,10,15 CONTROL "No Movies",IDC_NOMOVIES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,101,131,67,11 + WS_TABSTOP,91,130,47,11 CONTROL "No Logos",IDC_NOLOGOS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,101,143,67,11 + WS_TABSTOP,91,142,45,11 + PUSHBUTTON "?",IDC_PATCHHELP,139,135,10,15 + GROUPBOX "Decal Bar Docking Position",IDC_STATIC,155,122,103,35 + COMBOBOX IDC_DOCKPOS,159,135,92,43,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + GROUPBOX "Decal Update URL",IDC_STATIC,7,166,257,28 + LTEXT "http://decaldev.sourceforge.net",IDC_PLUGINDIR,14,178, + 169,8,SS_CENTERIMAGE + PUSHBUTTON "Change",IDC_CHANGE_DIR,208,175,50,14 + CONTROL "Start on Bootup",IDC_CHECK_AUTOSTART,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,14,202,63,12 + PUSHBUTTON "Reset Bar Position",IDC_BTN_RESET,81,200,68,14 END IDD_DOWNLOADER DIALOG 0, 0, 202, 86 @@ -212,8 +216,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,6,0,0 - PRODUCTVERSION 2,6,0,0 + FILEVERSION DECAL_MAJOR,DECAL_MINOR,DECAL_BUGFIX,DECAL_RELEASE + PRODUCTVERSION DECAL_MAJOR,DECAL_MINOR,DECAL_BUGFIX,DECAL_RELEASE FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -230,12 +234,12 @@ BEGIN VALUE "Comments", "DenAgent is the program that manages Decal settings" VALUE "FileDescription", "DenAgent MFC Application" - VALUE "FileVersion", "2, 6, 0, 0" + VALUE "FileVersion", DECAL_VERSION_STRING VALUE "InternalName", "DenAgent" VALUE "LegalCopyright", "Copyright (C) 2000, 2001" VALUE "OriginalFilename", "DenAgent.EXE" VALUE "ProductName", "DenAgent Application" - VALUE "ProductVersion", "2, 6, 0, 0" + VALUE "ProductVersion", DECAL_VERSION_STRING END END BLOCK "VarFileInfo" @@ -315,7 +319,7 @@ VERTGUIDE, 14 VERTGUIDE, 258 TOPMARGIN, 7 - BOTTOMMARGIN, 213 + BOTTOMMARGIN, 214 END IDD_DOWNLOADER, DIALOG @@ -422,6 +426,12 @@ 0x3132, "\000" IDC_FORMATCLR, 0x403, 3, 0 0x3232, "\000" + IDC_DOCKPOS, 0x403, 4, 0 +0x6f54, 0x0070, + IDC_DOCKPOS, 0x403, 5, 0 +0x654c, 0x7466, "\000" + IDC_DOCKPOS, 0x403, 6, 0 +0x6952, 0x6867, 0x0074, 0 END Index: OptionsDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/OptionsDlg.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- OptionsDlg.cpp 19 Nov 2003 23:29:29 -0000 1.26 +++ OptionsDlg.cpp 10 Dec 2003 19:57:30 -0000 1.27 @@ -127,6 +127,10 @@ key.QueryDWORDValue( "TimestampColor", dwTSColor ); ::SendMessage( GetDlgItem( IDC_FORMATCLR )->m_hWnd, CB_SETCURSEL, ++dwTSColor, 0 ); + DWORD dwDockPos = 0; + key.QueryDWORDValue( "BarDock", dwDockPos ); + ::SendMessage( GetDlgItem( IDC_DOCKPOS )->m_hWnd, CB_SETCURSEL, dwDockPos, 0 ); + char szFormat[MAX_PATH]; DWORD dwFormatLen = MAX_PATH; if( key.QueryStringValue( "TimestampFormat", szFormat, &dwFormatLen ) != ERROR_SUCCESS ) //just thieved from achooks @@ -297,6 +301,9 @@ DWORD dwColor = ::SendMessage(GetDlgItem(IDC_FORMATCLR)->m_hWnd, CB_GETCURSEL, 0, 0); key.SetDWORDValue( "TimestampColor", --dwColor ); + + DWORD dwDockPos = ::SendMessage(GetDlgItem(IDC_DOCKPOS)->m_hWnd, CB_GETCURSEL, 0, 0); + key.SetDWORDValue( "BarDock", dwDockPos); char szFormat[MAX_PATH]; ::SendMessage( GetDlgItem(IDC_FORMATSTR)->m_hWnd, WM_GETTEXT, MAX_PATH, (LPARAM)szFormat); Index: resource.h =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/resource.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- resource.h 27 Sep 2003 05:49:07 -0000 1.24 +++ resource.h 10 Dec 2003 19:57:30 -0000 1.25 @@ -87,6 +87,7 @@ #define IDC_NOMOVIES 1058 #define IDC_NOMOVIES2 1059 #define IDC_NOLOGOS 1059 +#define IDC_DOCKPOS 1060 #define ID_SYSTRAY_CONFIGURE 32771 #define ID_SYSTRAY_EXIT 32772 @@ -96,7 +97,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 152 #define _APS_NEXT_COMMAND_VALUE 32776 -#define _APS_NEXT_CONTROL_VALUE 1059 +#define _APS_NEXT_CONTROL_VALUE 1061 #define _APS_NEXT_SYMED_VALUE 105 #endif #endif |
From: Jeffrey D. <ha...@us...> - 2003-12-12 17:04:51
|
Log Message: ----------- More radar Options- - Drak did these. I made them use the 3d area though Also a denagent version fix Modified Files: -------------- /cvsroot/decaldev/source/Inject: RootLayer.h Revision Data ------------- Index: RootLayer.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/RootLayer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- RootLayer.h 30 May 2003 01:49:29 -0000 1.6 +++ RootLayer.h 12 Dec 2003 17:04:20 -0000 1.7 @@ -39,6 +39,8 @@ typedef std::list< cView * > cViewList; cViewList m_views; long m_nNextViewID; + long m_lDefaultX; + long m_lDefaultY; void addView( cView *pView, ILayer *pRootLayer ); void removeView( cView *pView ); |