Skip to content

Commit

Permalink
Proper fix for map_spot hind show logic
Browse files Browse the repository at this point in the history
  • Loading branch information
joye-ramone committed Dec 3, 2018
1 parent 067eb86 commit e7651ab
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ogsr_engine/xrGame/map_spot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ void CMapSpot::Load(CUIXml* xml, LPCSTR path)
int i = xml->ReadAttribInt(path, 0, "scale", 0);
m_bScale = (i==1);

SetWidth(GetWidth() * UI()->get_current_kx() );
SetStretchTexture(true);
SetWidth(GetWidth() * UI()->get_current_kx() );
SetStretchTexture(true);

m_originSize = GetWndSize();
}

LPCSTR CMapSpot::GetHint()
{
return MapLocation() ? MapLocation()->GetHint() : nullptr;
return MapLocation()->GetHint();
}

void CMapSpot::Update()
{
inherited::Update();
if ( m_bCursorOverWindow && xr_strlen( GetHint() ) ) {
LPCSTR h = GetHint();
if ( m_bCursorOverWindow && h && xr_strlen( h ) ) {
VERIFY(m_dwFocusReceiveTime>=0);
if( Device.dwTimeGlobal>(m_dwFocusReceiveTime+500) ){
GetMessageTarget()->SendMessage(this, MAP_SHOW_HINT, NULL);
Expand Down Expand Up @@ -74,7 +75,8 @@ bool CMapSpot::OnMouseDown (int mouse_btn)
void CMapSpot::OnFocusLost ()
{
inherited::OnFocusLost ();
if ( xr_strlen( GetHint() ) )
LPCSTR h = GetHint();
if ( h && xr_strlen( h ) )
GetMessageTarget()->SendMessage( this, MAP_HIDE_HINT, NULL );
}

Expand Down

0 comments on commit e7651ab

Please sign in to comment.