* Fixes to ingame editor
* Fixes to editor window. It's now possible to resize, move and press buttonsdev-ui
parent
209c6412ae
commit
6f64770714
|
@ -682,11 +682,13 @@ void CText::DrawCharAndAdjustPos(UTF8Char ch, FontType font, float size, Math::P
|
|||
|
||||
int width = 1;
|
||||
if (ch.c1 > 0 && ch.c1 < 32) { // FIXME add support for chars with code 9 10 23
|
||||
ch.c1 = ' ';
|
||||
if (ch.c1 == '\t') {
|
||||
ch.c1 = ':';
|
||||
} else {
|
||||
ch.c1 = ' ';
|
||||
}
|
||||
ch.c2 = 0;
|
||||
ch.c3 = 0;
|
||||
if (ch.c1 == '\t')
|
||||
width = 4;
|
||||
}
|
||||
|
||||
auto it = cf->cache.find(ch);
|
||||
|
|
|
@ -255,7 +255,7 @@ bool CBrain::EventProcess(const Event &event)
|
|||
if ( m_object->GetSelect() && // robot selected?
|
||||
m_studio != 0 ) // current issue?
|
||||
{
|
||||
// m_studio->EventProcess(event);
|
||||
m_studio->EventProcess(event);
|
||||
|
||||
if ( action == EVENT_OBJECT_PROGRUN )
|
||||
{
|
||||
|
|
|
@ -3346,7 +3346,6 @@ void CScript::ColorizeScript(Ui::CEdit* edit)
|
|||
|
||||
cursor1 = bt->GetStart();
|
||||
cursor2 = bt->GetEnd();
|
||||
|
||||
color = Gfx::FONT_HIGHLIGHT_NONE;
|
||||
if ( type >= TokenKeyWord && type < TokenKeyWord+100 )
|
||||
{
|
||||
|
@ -3376,7 +3375,7 @@ void CScript::ColorizeScript(Ui::CEdit* edit)
|
|||
color =Gfx::FONT_HIGHLIGHT_CONST;
|
||||
}
|
||||
|
||||
if ( cursor1 < cursor2 && color != 0 )
|
||||
if ( cursor1 < cursor2 && color != Gfx::FONT_HIGHLIGHT_NONE )
|
||||
{
|
||||
edit->SetFormat(cursor1, cursor2, color);
|
||||
}
|
||||
|
|
|
@ -935,10 +935,10 @@ void CEdit::Draw()
|
|||
pos.x = m_pos.x+(10.0f/640.0f);
|
||||
if ( m_bAutoIndent )
|
||||
{
|
||||
const char *s = "\t"; // line | dotted
|
||||
for ( j=0 ; j<m_lineIndent[i] ; j++ )
|
||||
{
|
||||
char s = '\t'; // line | dotted
|
||||
m_engine->GetText()->DrawText(&s, m_fontType, m_fontSize, pos, 1.0f, Gfx::TEXT_ALIGN_LEFT, 0);
|
||||
m_engine->GetText()->DrawText(s, m_fontType, m_fontSize, pos, 1.0f, Gfx::TEXT_ALIGN_LEFT, 0);
|
||||
pos.x += indentLength;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ bool CStudio::EventProcess(const Event &event)
|
|||
if ( pw == nullptr ) return false;
|
||||
|
||||
edit = static_cast<CEdit*>(pw->SearchControl(EVENT_STUDIO_EDIT));
|
||||
if ( edit == 0 ) return false;
|
||||
if ( edit == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() )
|
||||
{
|
||||
|
@ -692,7 +692,7 @@ void CStudio::AdjustEditScript()
|
|||
dim.x = wdim.x-0.02f;
|
||||
dim.y = wdim.y-0.22f-hList;
|
||||
edit = static_cast< CEdit* >(pw->SearchControl(EVENT_STUDIO_EDIT));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
edit->SetPos(pos);
|
||||
edit->SetDim(dim);
|
||||
|
@ -703,7 +703,7 @@ void CStudio::AdjustEditScript()
|
|||
dim.x = wdim.x-0.02f;
|
||||
dim.y = hList;
|
||||
list = static_cast< CList* >(pw->SearchControl(EVENT_STUDIO_LIST));
|
||||
if ( list != 0 )
|
||||
if ( list != nullptr )
|
||||
{
|
||||
list->SetPos(pos);
|
||||
list->SetDim(dim);
|
||||
|
@ -716,56 +716,56 @@ void CStudio::AdjustEditScript()
|
|||
pos.y = wpos.y+wdim.y-dim.y-0.06f;
|
||||
pos.x = wpos.x+0.01f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_NEW));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.05f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_OPEN));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.09f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_SAVE));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.14f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_UNDO));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.19f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_CUT));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.23f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_COPY));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.27f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_PASTE));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.32f;
|
||||
slider = static_cast< CSlider* >(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider != 0 )
|
||||
if ( slider != nullptr )
|
||||
{
|
||||
ppos = pos;
|
||||
ddim.x = dim.x*0.7f;
|
||||
|
@ -777,21 +777,21 @@ void CStudio::AdjustEditScript()
|
|||
}
|
||||
pos.x = wpos.x+0.36f;
|
||||
group = static_cast< CGroup* >(pw->SearchControl(EVENT_LABEL1));
|
||||
if ( group != 0 )
|
||||
if ( group != nullptr )
|
||||
{
|
||||
group->SetPos(pos);
|
||||
group->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.40f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_TOOL));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.44f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_HELP));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -802,14 +802,14 @@ void CStudio::AdjustEditScript()
|
|||
dim.x = 80.0f/640.0f;
|
||||
dim.y = 25.0f/480.0f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_OK));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.14f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_CANCEL));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -817,28 +817,28 @@ void CStudio::AdjustEditScript()
|
|||
pos.x = wpos.x+0.28f;
|
||||
dim.x = dim.y*0.75f;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_COMPILE));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.28f+dim.x*1;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_RUN));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.28f+dim.x*2;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_REALTIME));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x = wpos.x+0.28f+dim.x*3;
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_STEP));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
|
Loading…
Reference in New Issue