added auto game tile placer for hookthrough

This commit is contained in:
Tim Schumacher 2016-05-01 17:44:02 +02:00
parent faa576e73d
commit e61456f381
2 changed files with 8 additions and 4 deletions

View file

@ -619,6 +619,8 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
case 9: case 9:
Result = TILE_TELECHECKINEVIL; Result = TILE_TELECHECKINEVIL;
break; break;
case 10:
Result = TILE_THROUGH_CUT;
default: default:
break; break;
} }
@ -632,8 +634,10 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
int h = min(gl->m_Height, m_Height); int h = min(gl->m_Height, m_Height);
for(int y = 0; y < h; y++) for(int y = 0; y < h; y++)
for(int x = 0; x < w; x++) for(int x = 0; x < w; x++)
if(m_pTiles[y*m_Width+x].m_Index) if(GetTile(x, y).m_Index) {
gl->m_pTiles[y*gl->m_Width+x].m_Index = TILE_AIR+Result; CTile result_tile = {(unsigned char)Result};
gl->SetTile(x, y, result_tile);
}
} }
else if (m_pEditor->m_Map.m_pTeleLayer) else if (m_pEditor->m_Map.m_pTeleLayer)
{ {

View file

@ -1303,7 +1303,7 @@ static int s_GametileOpSelected = -1;
int CEditor::PopupSelectGametileOp(CEditor *pEditor, CUIRect View) int CEditor::PopupSelectGametileOp(CEditor *pEditor, CUIRect View)
{ {
static const char *s_pButtonNames[] = { "Clear", "Collision", "Death", "Unhookable", "Freeze", "Unfreeze", "Deep Freeze", "Deep Unfreeze", "Check-Tele From", "Evil Check-Tele From" }; static const char *s_pButtonNames[] = { "Clear", "Collision", "Death", "Unhookable", "Freeze", "Unfreeze", "Deep Freeze", "Deep Unfreeze", "Check-Tele From", "Evil Check-Tele From", "Hookthrough" };
static unsigned s_NumButtons = sizeof(s_pButtonNames) / sizeof(char*); static unsigned s_NumButtons = sizeof(s_pButtonNames) / sizeof(char*);
CUIRect Button; CUIRect Button;
@ -1322,7 +1322,7 @@ void CEditor::PopupSelectGametileOpInvoke(float x, float y)
{ {
static int s_SelectGametileOpPopupId = 0; static int s_SelectGametileOpPopupId = 0;
s_GametileOpSelected = -1; s_GametileOpSelected = -1;
UiInvokePopupMenu(&s_SelectGametileOpPopupId, 0, x, y, 120.0f, 150.0f, PopupSelectGametileOp); UiInvokePopupMenu(&s_SelectGametileOpPopupId, 0, x, y, 120.0f, 165.0f, PopupSelectGametileOp);
} }
int CEditor::PopupSelectGameTileOpResult() int CEditor::PopupSelectGameTileOpResult()