begin adding tweak vars
This commit is contained in:
parent
d1fe4593da
commit
4f00af6044
@ -5,6 +5,7 @@
|
|||||||
//- Api
|
//- Api
|
||||||
#include "base.cgh"
|
#include "base.cgh"
|
||||||
#if IsLanguageC
|
#if IsLanguageC
|
||||||
|
#include "base_tweak.h"
|
||||||
#include "base_intrinsics.h"
|
#include "base_intrinsics.h"
|
||||||
#include "base_memory.h"
|
#include "base_memory.h"
|
||||||
#include "base_arena.h"
|
#include "base_arena.h"
|
||||||
@ -33,6 +34,7 @@
|
|||||||
|
|
||||||
//- Impl
|
//- Impl
|
||||||
#if IsLanguageC
|
#if IsLanguageC
|
||||||
|
#include "base_tweak.c"
|
||||||
#include "base_memory.c"
|
#include "base_memory.c"
|
||||||
#include "base_arena.c"
|
#include "base_arena.c"
|
||||||
#include "base_sync.c"
|
#include "base_sync.c"
|
||||||
@ -49,6 +51,7 @@
|
|||||||
#include "base_controller.c"
|
#include "base_controller.c"
|
||||||
#include "base_async.c"
|
#include "base_async.c"
|
||||||
#include "base_state.c"
|
#include "base_state.c"
|
||||||
|
#else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//- Include base_win32
|
//- Include base_win32
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Global context
|
//~ Global state
|
||||||
|
|
||||||
Struct(BaseCtx)
|
Struct(BaseCtx)
|
||||||
{
|
{
|
||||||
@ -7,12 +7,13 @@ Struct(BaseCtx)
|
|||||||
ResourceCtx resource;
|
ResourceCtx resource;
|
||||||
GstatCtx gstat;
|
GstatCtx gstat;
|
||||||
AsyncCtx async;
|
AsyncCtx async;
|
||||||
|
TweakVarsCtx tweak;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern BaseCtx Base;
|
extern BaseCtx Base;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Thread-local context
|
//~ Thread-local state
|
||||||
|
|
||||||
Struct(BaseThreadLocalCtx)
|
Struct(BaseThreadLocalCtx)
|
||||||
{
|
{
|
||||||
|
|||||||
39
src/base/base_tweak.c
Normal file
39
src/base/base_tweak.c
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//~ Tweak var get/set
|
||||||
|
|
||||||
|
//- Auto-generated functions
|
||||||
|
|
||||||
|
#define X(name, type, default_value) \
|
||||||
|
type GetTweak_##name(void) \
|
||||||
|
{ \
|
||||||
|
type result = Zi; \
|
||||||
|
LockTicketMutex(&Base.tweak.mutex); \
|
||||||
|
{ \
|
||||||
|
result = Base.tweak.shared_vars.##name; \
|
||||||
|
} \
|
||||||
|
UnlockTicketMutex(&Base.tweak.mutex); \
|
||||||
|
return result; \
|
||||||
|
} \
|
||||||
|
void SetTweak_##name(type v) \
|
||||||
|
{ \
|
||||||
|
LockTicketMutex(&Base.tweak.mutex); \
|
||||||
|
{ \
|
||||||
|
Base.tweak.shared_vars.name = v; \
|
||||||
|
} \
|
||||||
|
UnlockTicketMutex(&Base.tweak.mutex); \
|
||||||
|
}
|
||||||
|
TweakVarsXMacro(X);
|
||||||
|
#undef X
|
||||||
|
|
||||||
|
//- Helpers
|
||||||
|
|
||||||
|
TweakVars GetAllTweakVars(void)
|
||||||
|
{
|
||||||
|
TweakVars result;
|
||||||
|
LockTicketMutex(&Base.tweak.mutex);
|
||||||
|
{
|
||||||
|
result = Base.tweak.shared_vars;
|
||||||
|
}
|
||||||
|
UnlockTicketMutex(&Base.tweak.mutex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
43
src/base/base_tweak.h
Normal file
43
src/base/base_tweak.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//~ Tweak var types
|
||||||
|
|
||||||
|
Enum(TweakVarType)
|
||||||
|
{
|
||||||
|
TweakVarType_b32,
|
||||||
|
};
|
||||||
|
|
||||||
|
Enum(TweakVarKind)
|
||||||
|
{
|
||||||
|
#define X(name, ...) TweakVarKind_##name,
|
||||||
|
TweakVarsXMacro(X)
|
||||||
|
#undef X
|
||||||
|
TweakVarKind_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
Struct(TweakVars)
|
||||||
|
{
|
||||||
|
#define X(name, type, ...) type name;
|
||||||
|
TweakVarsXMacro(X)
|
||||||
|
#undef X
|
||||||
|
i32 __; // Prevent empty struct
|
||||||
|
};
|
||||||
|
|
||||||
|
Struct(TweakVarsCtx)
|
||||||
|
{
|
||||||
|
TicketMutex mutex;
|
||||||
|
TweakVars shared_vars;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//~ Tweak var operations
|
||||||
|
|
||||||
|
//- Auto-generated functions
|
||||||
|
#define X(name, type, ...) \
|
||||||
|
type GetTweak_##name(void); \
|
||||||
|
void SetTweak_##name(type v);
|
||||||
|
#undef X
|
||||||
|
|
||||||
|
//- Helpers
|
||||||
|
TweakVars GetAllTweakVars(void);
|
||||||
|
#define GetTweak(name) GetTweak_##name()
|
||||||
|
#define SetTweak(name, v) SetTweak_##name((v))
|
||||||
10
src/config.h
10
src/config.h
@ -1,4 +1,12 @@
|
|||||||
// Project-wide configurable constants
|
////////////////////////////////////////////////////////////
|
||||||
|
//~ Debug tweak vars
|
||||||
|
|
||||||
|
#define TweakVarsXMacro(X) \
|
||||||
|
X(CeilGlyphAdvances, b32, 1) \
|
||||||
|
/* --------------------------------- */
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//~ Project-wide configurable constants
|
||||||
|
|
||||||
#define WRITE_DIR "power_play"
|
#define WRITE_DIR "power_play"
|
||||||
|
|
||||||
|
|||||||
@ -178,7 +178,16 @@ GC_Run GC_RunFromString(Arena *arena, String str, GC_FontKey font, f32 font_size
|
|||||||
{
|
{
|
||||||
GC_Glyph *glyph = ready_glyphs[glyph_idx];
|
GC_Glyph *glyph = ready_glyphs[glyph_idx];
|
||||||
GC_RunRect *rect = &result.rects[glyph_idx];
|
GC_RunRect *rect = &result.rects[glyph_idx];
|
||||||
f32 advance = glyph->advance * scale;
|
|
||||||
|
f32 advance = 0;
|
||||||
|
if (GetTweak(CeilGlyphAdvances))
|
||||||
|
{
|
||||||
|
advance = CeilF32(glyph->advance * scale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
advance = FloorF32(glyph->advance * scale);
|
||||||
|
}
|
||||||
|
|
||||||
Rng2 bounds = Zi;
|
Rng2 bounds = Zi;
|
||||||
bounds.p0 = glyph->bounds.p0;
|
bounds.p0 = glyph->bounds.p0;
|
||||||
|
|||||||
@ -101,30 +101,30 @@ void V_PushWidgetThemeStyles(V_WidgetTheme theme)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Commands widget
|
//~ Palette
|
||||||
|
|
||||||
void V_BeginCommandsWidget(V_CommandsWidget *widget)
|
void V_BeginPalette(V_Palette *widget)
|
||||||
{
|
{
|
||||||
ZeroStruct(&widget->build);
|
ZeroStruct(&widget->build);
|
||||||
widget->build.cp = UI_PushCP(UI_NilKey);
|
widget->build.cp = UI_PushCP(UI_NilKey);
|
||||||
widget->key = UI_KeyF("commands widget");
|
widget->key = UI_KeyF("commands palette");
|
||||||
UI_Push(Tag, widget->key.hash);
|
UI_Push(Tag, widget->key.hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
V_CommandsWidgetItemReport V_PushCommandsWidgetItem(V_CommandsWidget *widget, V_CommandsWidgetItemDesc desc)
|
V_PaletteItemReport V_PushPaletteItem(V_Palette *widget, V_PaletteItemDesc desc)
|
||||||
{
|
{
|
||||||
Arena *frame_arena = UI_FrameArena();
|
Arena *frame_arena = UI_FrameArena();
|
||||||
|
|
||||||
UI_Key key = UI_KeyF("btn%F", FmtSint(widget->build.num_items));
|
UI_Key key = UI_KeyF("btn%F", FmtSint(widget->build.num_items));
|
||||||
{
|
{
|
||||||
V_CommandsWidgetItem *item = PushStruct(frame_arena, V_CommandsWidgetItem);
|
V_PaletteItem *item = PushStruct(frame_arena, V_PaletteItem);
|
||||||
item->key = key;
|
item->key = key;
|
||||||
item->desc = desc;
|
item->desc = desc;
|
||||||
SllQueuePush(widget->build.first_item, widget->build.last_item, item);
|
SllQueuePush(widget->build.first_item, widget->build.last_item, item);
|
||||||
++widget->build.num_items;
|
++widget->build.num_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
V_CommandsWidgetItemReport result = Zi;
|
V_PaletteItemReport result = Zi;
|
||||||
UI_Report rep = UI_ReportFromKey(key);
|
UI_Report rep = UI_ReportFromKey(key);
|
||||||
result.ui_report = rep;
|
result.ui_report = rep;
|
||||||
result.pressed = rep.m1.presses > 0;
|
result.pressed = rep.m1.presses > 0;
|
||||||
@ -132,7 +132,7 @@ V_CommandsWidgetItemReport V_PushCommandsWidgetItem(V_CommandsWidget *widget, V_
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void V_EndCommandsWidget(V_CommandsWidget *widget)
|
void V_EndPalette(V_Palette *widget)
|
||||||
{
|
{
|
||||||
V_Frame *frame = V_CurrentFrame();
|
V_Frame *frame = V_CurrentFrame();
|
||||||
V_WidgetTheme theme = V_GetWidgetTheme();
|
V_WidgetTheme theme = V_GetWidgetTheme();
|
||||||
@ -170,7 +170,7 @@ void V_EndCommandsWidget(V_CommandsWidget *widget)
|
|||||||
UI_Push(Height, UI_SHRINK(0, 0));
|
UI_Push(Height, UI_SHRINK(0, 0));
|
||||||
UI_Push(ChildLayoutAxis, Axis_Y);
|
UI_Push(ChildLayoutAxis, Axis_Y);
|
||||||
UI_Push(FloatingPos, SubVec2(widget->pos, widget_half_dims));
|
UI_Push(FloatingPos, SubVec2(widget->pos, widget_half_dims));
|
||||||
UI_SetNext(Flags, UI_BoxFlag_Floating | (UI_BoxFlag_Selected * frame->show_command_palette));
|
UI_SetNext(Flags, UI_BoxFlag_Floating | (UI_BoxFlag_Selected * frame->show_palette));
|
||||||
UI_PushCP(UI_BuildBoxEx(widget->key));
|
UI_PushCP(UI_BuildBoxEx(widget->key));
|
||||||
{
|
{
|
||||||
// Title bar
|
// Title bar
|
||||||
@ -195,7 +195,7 @@ void V_EndCommandsWidget(V_CommandsWidget *widget)
|
|||||||
UI_SetNext(FontSize, theme.window_title_font_size);
|
UI_SetNext(FontSize, theme.window_title_font_size);
|
||||||
UI_SetNext(ChildAlignment, UI_Alignment_Center);
|
UI_SetNext(ChildAlignment, UI_Alignment_Center);
|
||||||
UI_SetNext(Width, UI_SHRINK(0, 1));
|
UI_SetNext(Width, UI_SHRINK(0, 1));
|
||||||
UI_SetNext(Text, Lit("Commands"));
|
UI_SetNext(Text, Lit("Command Palette"));
|
||||||
UI_SetNext(Flags, UI_BoxFlag_DrawText);
|
UI_SetNext(Flags, UI_BoxFlag_DrawText);
|
||||||
UI_BuildBox();
|
UI_BuildBox();
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ void V_EndCommandsWidget(V_CommandsWidget *widget)
|
|||||||
UI_SetNext(Width, UI_GROW(1, 0));
|
UI_SetNext(Width, UI_GROW(1, 0));
|
||||||
UI_PushCP(UI_BuildColumn());
|
UI_PushCP(UI_BuildColumn());
|
||||||
{
|
{
|
||||||
for (V_CommandsWidgetItem *item = widget->build.first_item; item; item = item->next)
|
for (V_PaletteItem *item = widget->build.first_item; item; item = item->next)
|
||||||
{
|
{
|
||||||
UI_BuildDivider(UI_PIX(1, 1), theme.divider_color, Axis_Y);
|
UI_BuildDivider(UI_PIX(1, 1), theme.divider_color, Axis_Y);
|
||||||
|
|
||||||
@ -441,10 +441,10 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
|
|
||||||
// Persist state
|
// Persist state
|
||||||
CopyBytes(frame->held_buttons, last_frame->held_buttons, sizeof(frame->held_buttons));
|
CopyBytes(frame->held_buttons, last_frame->held_buttons, sizeof(frame->held_buttons));
|
||||||
frame->commands_widget = last_frame->commands_widget;
|
frame->palette = last_frame->palette;
|
||||||
frame->is_editing = last_frame->is_editing;
|
frame->is_editing = last_frame->is_editing;
|
||||||
frame->ui_debug = last_frame->ui_debug;
|
frame->ui_debug = last_frame->ui_debug;
|
||||||
frame->show_command_palette = last_frame->show_command_palette;
|
frame->show_palette = last_frame->show_palette;
|
||||||
frame->show_console = last_frame->show_console;
|
frame->show_console = last_frame->show_console;
|
||||||
frame->look = last_frame->look;
|
frame->look = last_frame->look;
|
||||||
frame->edit_mode = last_frame->edit_mode;
|
frame->edit_mode = last_frame->edit_mode;
|
||||||
@ -1136,7 +1136,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
if (V.dragging_window && panel_rep.is_hovered)
|
if (V.dragging_window && panel_rep.is_hovered)
|
||||||
{
|
{
|
||||||
DrawableTab *left = 0;
|
DrawableTab *left = 0;
|
||||||
DrawableTab *right = 0;
|
DrawableTab *right = first_drawable_tab;
|
||||||
for (DrawableTab *sibling = first_drawable_tab; sibling; sibling = sibling->next)
|
for (DrawableTab *sibling = first_drawable_tab; sibling; sibling = sibling->next)
|
||||||
{
|
{
|
||||||
UI_Report sibling_rep = UI_ReportFromKey(sibling->key);
|
UI_Report sibling_rep = UI_ReportFromKey(sibling->key);
|
||||||
@ -1222,14 +1222,14 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
border_color = theme.button_active_color;
|
border_color = theme.button_active_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
bg_color = LerpSrgb(bg_color, theme.button_hot_color, tab_rep.hot);
|
bg_color = LerpSrgb(bg_color, theme.button_hot_color, tab_rep.hot * (1.0 - tab_rep.selected));
|
||||||
bg_color = LerpSrgb(bg_color, theme.button_active_color, tab_rep.active);
|
bg_color = LerpSrgb(bg_color, theme.button_active_color, tab_rep.active * is_dragging);
|
||||||
border_color = LerpSrgb(border_color, theme.button_active_color, tab_rep.hot);
|
border_color = LerpSrgb(border_color, theme.button_active_color, tab_rep.selected);
|
||||||
|
|
||||||
if (is_dragging)
|
// if (is_dragging)
|
||||||
{
|
// {
|
||||||
bg_color = Color_Blue;
|
// bg_color = Color_Blue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
String tab_name = Zi;
|
String tab_name = Zi;
|
||||||
if (window->is_tile_window)
|
if (window->is_tile_window)
|
||||||
@ -1247,7 +1247,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
UI_SetNext(Width, UI_SHRINK(0, 0));
|
UI_SetNext(Width, UI_SHRINK(0, 0));
|
||||||
UI_SetNext(Height, UI_SHRINK(0, 0));
|
UI_SetNext(Height, UI_SHRINK(0, 0));
|
||||||
UI_SetNext(ChildAlignment, UI_Alignment_Left);
|
UI_SetNext(ChildAlignment, UI_Alignment_Left);
|
||||||
UI_SetNext(Flags, UI_BoxFlag_Interactable);
|
UI_SetNext(Flags, UI_BoxFlag_Interactable | (UI_BoxFlag_Selected * (active_window == window)));
|
||||||
UI_SetNext(Text, tab_name);
|
UI_SetNext(Text, tab_name);
|
||||||
UI_PushCP(UI_BuildRowEx(tab->key));
|
UI_PushCP(UI_BuildRowEx(tab->key));
|
||||||
{
|
{
|
||||||
@ -1496,30 +1496,30 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Build command palette
|
//- Build command palette
|
||||||
|
|
||||||
// if (frame->show_command_palette)
|
|
||||||
{
|
{
|
||||||
V_BeginCommandsWidget(&frame->commands_widget);
|
V_BeginPalette(&frame->palette);
|
||||||
{
|
{
|
||||||
|
// Push cmd items to palette
|
||||||
for (u64 i = 0; i < countof(V_cmd_descs); ++i)
|
for (u64 i = 0; i < countof(V_cmd_descs); ++i)
|
||||||
{
|
{
|
||||||
V_CmdDesc desc = V_cmd_descs[i];
|
V_CmdDesc cmd_desc = V_cmd_descs[i];
|
||||||
if (!desc.flags & V_CmdDescFlag_HideFromPalette)
|
if (!cmd_desc.flags & V_CmdDescFlag_HideFromPalette)
|
||||||
{
|
{
|
||||||
V_CommandsWidgetItemDesc item_desc = Zi;
|
V_PaletteItemDesc item_desc = Zi;
|
||||||
item_desc.display_name = desc.display_name;
|
item_desc.display_name = cmd_desc.display_name;
|
||||||
// FIXME: Attach active shortcuts instead of default hotkeys
|
// FIXME: Attach active shortcuts instead of default hotkeys
|
||||||
CopyStructs(item_desc.hotkeys, desc.default_hotkeys, MinU32(countof(item_desc.hotkeys), countof(desc.default_hotkeys)));
|
CopyStructs(item_desc.hotkeys, cmd_desc.default_hotkeys, MinU32(countof(item_desc.hotkeys), countof(cmd_desc.default_hotkeys)));
|
||||||
if (V_PushCommandsWidgetItem(&frame->commands_widget, item_desc).pressed > 0)
|
if (V_PushPaletteItem(&frame->palette, item_desc).pressed > 0)
|
||||||
{
|
{
|
||||||
V_CmdNode *cmd_node = PushStruct(frame->arena, V_CmdNode);
|
V_CmdNode *cmd_node = PushStruct(frame->arena, V_CmdNode);
|
||||||
cmd_node->cmd.name = desc.name;
|
cmd_node->cmd.name = cmd_desc.name;
|
||||||
SllQueuePush(first_cmd_node, last_cmd_node, cmd_node);
|
SllQueuePush(first_cmd_node, last_cmd_node, cmd_node);
|
||||||
++cmds_count;
|
++cmds_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
V_EndCommandsWidget(&frame->commands_widget);
|
V_EndPalette(&frame->palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
@ -1761,9 +1761,9 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
SignalExit(0);
|
SignalExit(0);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case V_CmdKind_toggle_command_palette:
|
case V_CmdKind_toggle_palette:
|
||||||
{
|
{
|
||||||
frame->show_command_palette = !frame->show_command_palette;
|
frame->show_palette = !frame->show_palette;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case V_CmdKind_zoom_in:
|
case V_CmdKind_zoom_in:
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#define V_CmdsTableXMacro(X) \
|
#define V_CmdsTableXMacro(X) \
|
||||||
X(nop, NOP, V_CmdDescFlag_HideFromPalette, V_HOTKEY(0), ) \
|
X(nop, NOP, V_CmdDescFlag_HideFromPalette, V_HOTKEY(0), ) \
|
||||||
X(exit_program, Exit Program, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_Escape ) ) \
|
X(exit_program, Exit Program, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_Escape ) ) \
|
||||||
X(toggle_command_palette, Toggle Command Palette, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_P, .ctrl = 1, .shift = 1 ), ) \
|
X(toggle_palette, Toggle Command Palette, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_P, .ctrl = 1, .shift = 1 ), ) \
|
||||||
X(zoom_in, Zoom In, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_MWheelUp ), ) \
|
X(zoom_in, Zoom In, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_MWheelUp ), ) \
|
||||||
X(zoom_out, Zoom Out, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_MWheelDown ), ) \
|
X(zoom_out, Zoom Out, V_CmdDescFlag_HideFromPalette, V_HOTKEY( Button_MWheelDown ), ) \
|
||||||
X(toggle_editor, Toggle Editor, V_CmdDescFlag_None, V_HOTKEY( Button_F1 ), ) \
|
X(toggle_editor, Toggle Editor, V_CmdDescFlag_None, V_HOTKEY( Button_F1 ), ) \
|
||||||
@ -110,9 +110,9 @@ Global Readonly V_CmdDesc V_cmd_descs[V_CmdKind_COUNT] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Commands widget types
|
//~ Palette types
|
||||||
|
|
||||||
Struct(V_CommandsWidgetItemReport)
|
Struct(V_PaletteItemReport)
|
||||||
{
|
{
|
||||||
b32 pressed;
|
b32 pressed;
|
||||||
b32 hotkey_changed;
|
b32 hotkey_changed;
|
||||||
@ -120,20 +120,20 @@ Struct(V_CommandsWidgetItemReport)
|
|||||||
V_Hotkey new_hotkeys[8];
|
V_Hotkey new_hotkeys[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(V_CommandsWidgetItemDesc)
|
Struct(V_PaletteItemDesc)
|
||||||
{
|
{
|
||||||
String display_name;
|
String display_name;
|
||||||
V_Hotkey hotkeys[8];
|
V_Hotkey hotkeys[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(V_CommandsWidgetItem)
|
Struct(V_PaletteItem)
|
||||||
{
|
{
|
||||||
V_CommandsWidgetItem *next;
|
V_PaletteItem *next;
|
||||||
UI_Key key;
|
UI_Key key;
|
||||||
V_CommandsWidgetItemDesc desc;
|
V_PaletteItemDesc desc;
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(V_CommandsWidget)
|
Struct(V_Palette)
|
||||||
{
|
{
|
||||||
// Persistent state
|
// Persistent state
|
||||||
Vec2 pos;
|
Vec2 pos;
|
||||||
@ -143,8 +143,8 @@ Struct(V_CommandsWidget)
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
UI_Checkpoint cp;
|
UI_Checkpoint cp;
|
||||||
V_CommandsWidgetItem *first_item;
|
V_PaletteItem *first_item;
|
||||||
V_CommandsWidgetItem *last_item;
|
V_PaletteItem *last_item;
|
||||||
u64 num_items;
|
u64 num_items;
|
||||||
} build;
|
} build;
|
||||||
};
|
};
|
||||||
@ -213,7 +213,7 @@ Struct(V_Frame)
|
|||||||
f64 dt;
|
f64 dt;
|
||||||
|
|
||||||
Button held_buttons[Button_COUNT];
|
Button held_buttons[Button_COUNT];
|
||||||
V_CommandsWidget commands_widget;
|
V_Palette palette;
|
||||||
|
|
||||||
String window_restore;
|
String window_restore;
|
||||||
i32 zooms;
|
i32 zooms;
|
||||||
@ -224,7 +224,7 @@ Struct(V_Frame)
|
|||||||
// Modes
|
// Modes
|
||||||
b32 is_editing;
|
b32 is_editing;
|
||||||
b32 ui_debug;
|
b32 ui_debug;
|
||||||
b32 show_command_palette;
|
b32 show_palette;
|
||||||
b32 show_console;
|
b32 show_console;
|
||||||
|
|
||||||
// Editor state
|
// Editor state
|
||||||
@ -316,11 +316,11 @@ V_WidgetTheme V_GetWidgetTheme(void);
|
|||||||
void V_PushWidgetThemeStyles(V_WidgetTheme theme);
|
void V_PushWidgetThemeStyles(V_WidgetTheme theme);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Commands widget
|
//~ Palette
|
||||||
|
|
||||||
void V_BeginCommandsWidget(V_CommandsWidget *widget);
|
void V_BeginPalette(V_Palette *widget);
|
||||||
V_CommandsWidgetItemReport V_PushCommandsWidgetItem(V_CommandsWidget *widget, V_CommandsWidgetItemDesc desc);
|
V_PaletteItemReport V_PushPaletteItem(V_Palette *widget, V_PaletteItemDesc desc);
|
||||||
void V_EndCommandsWidget(V_CommandsWidget *widget);
|
void V_EndPalette(V_Palette *widget);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Vis tick
|
//~ Vis tick
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user