modified some files as asked

This commit is contained in:
Tarun Samanta 2023-05-22 23:50:45 +05:30
parent ef78e36c6f
commit fcaab778ca
3 changed files with 7 additions and 16 deletions

View file

@ -890,26 +890,18 @@ void CEditor::DoToolbar(CUIRect ToolBar)
if(m_Dialog == DIALOG_NONE && m_EditBoxActive == 0 && Input()->KeyPress(KEY_I) && ModPressed && !ShiftPressed)
{
if(m_ShowTileInfo == SHOW_TILE_HEXADECIMAL)
m_ShowTileInfo = SHOW_TILE_OFF;
m_ShowTileInfo = SHOW_TILE_DECIMAL;
else if(m_ShowTileInfo != SHOW_TILE_OFF)
m_ShowTileInfo = SHOW_TILE_OFF;
else
m_ShowTileInfo = !SHOW_TILE_OFF;
m_ShowTileInfo = SHOW_TILE_DECIMAL;
m_ShowEnvelopePreview = SHOWENV_NONE;
}
// handle shortcut for hex button
if(m_Dialog == DIALOG_NONE && m_EditBoxActive == 0 && Input()->KeyPress(KEY_I) && ModPressed && ShiftPressed)
{
if(m_ShowTileInfo == SHOW_TILE_HEXADECIMAL)
m_ShowTileInfo = SHOW_TILE_OFF;
else if(m_ShowTileInfo != SHOW_TILE_OFF)
m_ShowTileInfo = !SHOW_TILE_OFF;
else
{
m_ShowTileInfo = !SHOW_TILE_OFF;
m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
}
m_ShowTileInfo = m_ShowTileInfo == SHOW_TILE_HEXADECIMAL ? SHOW_TILE_OFF : SHOW_TILE_HEXADECIMAL;
m_ShowEnvelopePreview = SHOWENV_NONE;
}

View file

@ -837,7 +837,6 @@ public:
m_PreventUnusedTilesWasWarned = false;
m_AllowPlaceUnusedTiles = 0;
m_BrushDrawDestructive = true;
m_ShowTileInfo = SHOW_TILE_OFF;
m_Mentions = 0;
}

View file

@ -293,9 +293,9 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect
static int s_ButtonOff = 0;
static int s_ButtonDec = 0;
static int s_ButtonHex = 0;
if(pEditor->DoButton_ButtonDec(&s_ButtonOff, "Off", pEditor->m_ShowTileInfo == SHOW_TILE_DECIMAL, &Off, 0, "Do not show tile information"))
if(pEditor->DoButton_ButtonDec(&s_ButtonOff, "Off", pEditor->m_ShowTileInfo == SHOW_TILE_OFF, &Off, 0, "Do not show tile information"))
{
pEditor->m_ShowTileInfo = SHOW_TILE_DECIMAL;
pEditor->m_ShowTileInfo = SHOW_TILE_OFF;
pEditor->m_ShowEnvelopePreview = SHOWENV_NONE;
}
if(pEditor->DoButton_Ex(&s_ButtonDec, "Dec", pEditor->m_ShowTileInfo == SHOW_TILE_DECIMAL , &Dec, 0, "[ctrl+i] Show tile information", IGraphics::CORNER_NONE))
@ -303,9 +303,9 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect
pEditor->m_ShowTileInfo = SHOW_TILE_DECIMAL;
pEditor->m_ShowEnvelopePreview = SHOWENV_NONE;
}
if(pEditor->DoButton_ButtonInc(&s_ButtonHex, "Hex", pEditor->m_ShowTileInfo == SHOW_TILE_DECIMAL, &Hex, 0, "[ctrl+shift+i] Show tile information in hexadecimal"))
if(pEditor->DoButton_ButtonInc(&s_ButtonHex, "Hex", pEditor->m_ShowTileInfo == SHOW_TILE_HEXADECIMAL, &Hex, 0, "[ctrl+shift+i] Show tile information in hexadecimal"))
{
pEditor->m_ShowTileInfo = SHOW_TILE_DECIMAL;
pEditor->m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
pEditor->m_ShowEnvelopePreview = SHOWENV_NONE;
}
}