75 lines
1.6 KiB
C
75 lines
1.6 KiB
C
#include "application.h"
|
|
|
|
#include "defs.h"
|
|
#include "style.h"
|
|
#include <SDL3/SDL.h>
|
|
|
|
static inline
|
|
void DiceContainer() {
|
|
CLAY({ .id = CLAY_ID("DiceContainer"),
|
|
.layout = {
|
|
.sizing = { CLAY_SIZING_GROW(0), CLAY_SIZING_PERCENT(0.2) },
|
|
.padding = CLAY_PADDING_ALL(16),
|
|
},
|
|
.backgroundColor = containerColors[0],
|
|
.cornerRadius = CLAY_CORNER_RADIUS(cornerRadius)
|
|
}) {
|
|
CLAY_TEXT(CLAY_STRING("Text data"), CLAY_TEXT_CONFIG({
|
|
.textColor = textColors[0],
|
|
.fontId = FONT_DEFAULT,
|
|
.fontSize = 24,
|
|
}));
|
|
}
|
|
}
|
|
|
|
static inline
|
|
void DiceLogContainer() {
|
|
CLAY({ .id = CLAY_ID("LogContainer"),
|
|
.layout = {
|
|
.sizing = layoutExpand,
|
|
.padding = CLAY_PADDING_ALL(16),
|
|
},
|
|
.backgroundColor = containerColors[0],
|
|
.cornerRadius = cornerRadiusAll
|
|
}) {}
|
|
}
|
|
|
|
static inline
|
|
void InitiativeListContainer() {
|
|
CLAY({ .id = CLAY_ID("InitiativeListContainer"),
|
|
.layout = {
|
|
.sizing = layoutExpand,
|
|
.padding = CLAY_PADDING_ALL(16),
|
|
},
|
|
.backgroundColor = containerColors[0],
|
|
.cornerRadius = cornerRadiusAll,
|
|
}) {}
|
|
}
|
|
|
|
Clay_RenderCommandArray RenderApplication() {
|
|
Clay_BeginLayout();
|
|
CLAY({ .id = CLAY_ID("OuterContainer"),
|
|
.layout = {
|
|
.layoutDirection = CLAY_TOP_TO_BOTTOM,
|
|
.sizing = layoutExpand,
|
|
.padding = CLAY_PADDING_ALL(windowPadding),
|
|
.childGap = containerGap
|
|
}
|
|
}) {
|
|
DiceContainer();
|
|
CLAY({ .id = CLAY_ID("LowerSplitContainer"),
|
|
.layout = {
|
|
.sizing = layoutExpand,
|
|
.childGap = containerGap
|
|
},
|
|
}) {
|
|
DiceLogContainer();
|
|
InitiativeListContainer();
|
|
}
|
|
}
|
|
return Clay_EndLayout();
|
|
}
|
|
|
|
void HandleEvent(SDL_Event event) {
|
|
}
|