rename ui 'event' -> 'report'
This commit is contained in:
parent
0819655322
commit
2014f2474b
@ -1954,10 +1954,10 @@ void PP_UpdateUser(void)
|
|||||||
{
|
{
|
||||||
Vec2 size = VEC2(400, 500);
|
Vec2 size = VEC2(400, 500);
|
||||||
|
|
||||||
UI_Event ev = UI_EventFromKey(g->lister_key);
|
UI_Report rep = UI_ReportFromKey(g->lister_key);
|
||||||
if (ev.flags & UI_EventFlag_Active)
|
if (rep.flags & UI_ReportFlag_Active)
|
||||||
{
|
{
|
||||||
g->lister_pos = SubVec2(g->ui_cursor, ev.activation_offset);
|
g->lister_pos = SubVec2(g->ui_cursor, rep.activation_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_Push(BackgroundColor, Rgba32F(0.075, 0.075, 0.075, 0.99));
|
UI_Push(BackgroundColor, Rgba32F(0.075, 0.075, 0.075, 0.99));
|
||||||
|
|||||||
@ -464,7 +464,7 @@ UI_Box *UI_BuildBox(String seed)
|
|||||||
/* Persist data from back box */
|
/* Persist data from back box */
|
||||||
if (back_box != 0)
|
if (back_box != 0)
|
||||||
{
|
{
|
||||||
box->event = back_box->event;
|
box->report = back_box->report;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pull from style stack */
|
/* Pull from style stack */
|
||||||
@ -528,17 +528,17 @@ b32 UI_IsPointInBox(UI_Box *box, Vec2 point)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Event
|
//~ Report
|
||||||
|
|
||||||
UI_Event UI_EventFromKey(UI_Key key)
|
UI_Report UI_ReportFromKey(UI_Key key)
|
||||||
{
|
{
|
||||||
UI_SharedState *g = &UI_shared_state;
|
UI_SharedState *g = &UI_shared_state;
|
||||||
UI_Event result = ZI;
|
UI_Report result = ZI;
|
||||||
|
|
||||||
UI_Box *back_box = UI_BackBoxFromKey(key);
|
UI_Box *back_box = UI_BackBoxFromKey(key);
|
||||||
if (back_box)
|
if (back_box)
|
||||||
{
|
{
|
||||||
result = back_box->event;
|
result = back_box->report;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -564,11 +564,11 @@ void UI_BeginBuild(ControllerEventsArray controller_events, UI_BuildFlag build_f
|
|||||||
for (u64 pre_index = g->boxes_count; pre_index-- > 0;)
|
for (u64 pre_index = g->boxes_count; pre_index-- > 0;)
|
||||||
{
|
{
|
||||||
UI_Box *box = g->boxes_pre[pre_index];
|
UI_Box *box = g->boxes_pre[pre_index];
|
||||||
if (hovered_box == 0 && box->event.flags & UI_EventFlag_Hovered)
|
if (hovered_box == 0 && box->report.flags & UI_ReportFlag_Hovered)
|
||||||
{
|
{
|
||||||
hovered_box = box;
|
hovered_box = box;
|
||||||
}
|
}
|
||||||
if (active_box == 0 && box->event.flags & UI_EventFlag_Active)
|
if (active_box == 0 && box->report.flags & UI_ReportFlag_Active)
|
||||||
{
|
{
|
||||||
active_box = box;
|
active_box = box;
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ void UI_BeginBuild(ControllerEventsArray controller_events, UI_BuildFlag build_f
|
|||||||
g->cursor_pos = MulXformV2(screen_to_ui_xf, Vec2FromFields(cev.cursor_pos));
|
g->cursor_pos = MulXformV2(screen_to_ui_xf, Vec2FromFields(cev.cursor_pos));
|
||||||
if (hovered_box)
|
if (hovered_box)
|
||||||
{
|
{
|
||||||
hovered_box->event.flags &= ~UI_EventFlag_Hovered;
|
hovered_box->report.flags &= ~UI_ReportFlag_Hovered;
|
||||||
hovered_box = 0;
|
hovered_box = 0;
|
||||||
}
|
}
|
||||||
/* Iterate boxes in reverse render order */
|
/* Iterate boxes in reverse render order */
|
||||||
@ -599,7 +599,7 @@ void UI_BeginBuild(ControllerEventsArray controller_events, UI_BuildFlag build_f
|
|||||||
{
|
{
|
||||||
if (UI_IsPointInBox(box, g->cursor_pos))
|
if (UI_IsPointInBox(box, g->cursor_pos))
|
||||||
{
|
{
|
||||||
box->event.flags |= UI_EventFlag_Hovered;
|
box->report.flags |= UI_ReportFlag_Hovered;
|
||||||
hovered_box = box;
|
hovered_box = box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -613,8 +613,8 @@ void UI_BeginBuild(ControllerEventsArray controller_events, UI_BuildFlag build_f
|
|||||||
UI_Box *box = hovered_box;
|
UI_Box *box = hovered_box;
|
||||||
if (box)
|
if (box)
|
||||||
{
|
{
|
||||||
box->event.flags |= UI_EventFlag_Active;
|
box->report.flags |= UI_ReportFlag_Active;
|
||||||
box->event.activation_offset = SubVec2(g->cursor_pos, box->p0);
|
box->report.activation_offset = SubVec2(g->cursor_pos, box->p0);
|
||||||
active_box = box;
|
active_box = box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -627,7 +627,7 @@ void UI_BeginBuild(ControllerEventsArray controller_events, UI_BuildFlag build_f
|
|||||||
UI_Box *box = active_box;
|
UI_Box *box = active_box;
|
||||||
if (box)
|
if (box)
|
||||||
{
|
{
|
||||||
box->event.flags &= ~UI_EventFlag_Active;
|
box->report.flags &= ~UI_ReportFlag_Active;
|
||||||
active_box = 0;
|
active_box = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,18 +169,18 @@ Struct(UI_Stack)
|
|||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Event types
|
//~ Report types
|
||||||
|
|
||||||
Enum(UI_EventFlag)
|
Enum(UI_ReportFlag)
|
||||||
{
|
{
|
||||||
UI_EventFlag_None = 0,
|
UI_ReportFlag_None = 0,
|
||||||
UI_EventFlag_Active = (1 << 0),
|
UI_ReportFlag_Active = (1 << 0),
|
||||||
UI_EventFlag_Hovered = (1 << 1),
|
UI_ReportFlag_Hovered = (1 << 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(UI_Event)
|
Struct(UI_Report)
|
||||||
{
|
{
|
||||||
UI_EventFlag flags;
|
UI_ReportFlag flags;
|
||||||
Vec2 activation_offset;
|
Vec2 activation_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ Struct(UI_Box)
|
|||||||
|
|
||||||
//- Persistent data
|
//- Persistent data
|
||||||
UI_Key key;
|
UI_Key key;
|
||||||
UI_Event event;
|
UI_Report report;
|
||||||
|
|
||||||
//- Per-build data
|
//- Per-build data
|
||||||
UI_BoxFlag flags;
|
UI_BoxFlag flags;
|
||||||
@ -380,9 +380,9 @@ void UI_SetBackgroundTexture(UI_Box *box, GPU_Resource *texture, Vec2 uv0, Vec2
|
|||||||
b32 UI_IsPointInBox(UI_Box *box, Vec2 point);
|
b32 UI_IsPointInBox(UI_Box *box, Vec2 point);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Event
|
//~ Report
|
||||||
|
|
||||||
UI_Event UI_EventFromKey(UI_Key key);
|
UI_Report UI_ReportFromKey(UI_Key key);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Begin build
|
//~ Begin build
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user