|
|
|
@ -22,6 +22,11 @@ typedef struct EditorContextStruct {
|
|
|
|
|
uint32_t last_clicked_region;
|
|
|
|
|
uint32_t last_clicked_hex;
|
|
|
|
|
uint32_t last_clicked_vertex;
|
|
|
|
|
|
|
|
|
|
vec4 saved_colors[12];
|
|
|
|
|
vec4 current_color;
|
|
|
|
|
vec4 color_string;
|
|
|
|
|
bool selecting_color;
|
|
|
|
|
} EditorContext;
|
|
|
|
|
|
|
|
|
|
typedef struct ClientContextStruct {
|
|
|
|
@ -99,9 +104,9 @@ uint32_t add_hex_region(ClientContext* context) {
|
|
|
|
|
VkResult color_ui(ClientContext* context) {
|
|
|
|
|
GPUString strings[] = {
|
|
|
|
|
{
|
|
|
|
|
.pos = {-2, 168},
|
|
|
|
|
.pos = {2, 150},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.size = 32,
|
|
|
|
|
.size = 16,
|
|
|
|
|
.offset = 0,
|
|
|
|
|
.length = 9,
|
|
|
|
|
.font = 0,
|
|
|
|
@ -111,7 +116,7 @@ VkResult color_ui(ClientContext* context) {
|
|
|
|
|
GPUDrawable drawables[] = {
|
|
|
|
|
{
|
|
|
|
|
.pos = {0, 0},
|
|
|
|
|
.size = {178, 168},
|
|
|
|
|
.size = {190, 150},
|
|
|
|
|
.color = {0.4, 0.4, 0.4, 0.4},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -121,88 +126,94 @@ VkResult color_ui(ClientContext* context) {
|
|
|
|
|
.id = 0x01,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {36, 136},
|
|
|
|
|
.size = {140, 30},
|
|
|
|
|
.color = {0, 0, 1, 0.4},
|
|
|
|
|
.pos = {134, 2},
|
|
|
|
|
.size = {10, 130},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x02,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {134, 2},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.pos = {20, 134},
|
|
|
|
|
.size = {95, 15},
|
|
|
|
|
.color = {0, 0, 1, 0},
|
|
|
|
|
.id = 0x03,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {156, 2},
|
|
|
|
|
.pos = {146, 2},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x04,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {134, 24},
|
|
|
|
|
.pos = {168, 2},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x05,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {156, 24},
|
|
|
|
|
.pos = {146, 24},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x06,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {134, 46},
|
|
|
|
|
.pos = {168, 24},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x07,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {156, 46},
|
|
|
|
|
.pos = {146, 46},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x08,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {134, 68},
|
|
|
|
|
.pos = {168, 46},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x09,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {156, 68},
|
|
|
|
|
.pos = {146, 68},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x0A,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {134, 90},
|
|
|
|
|
.pos = {168, 68},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x0B,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {156, 90},
|
|
|
|
|
.pos = {146, 90},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x0C,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {134, 112},
|
|
|
|
|
.pos = {168, 90},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x0D,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {156, 112},
|
|
|
|
|
.pos = {146, 112},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x0E,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {168, 112},
|
|
|
|
|
.size = {20, 20},
|
|
|
|
|
.color = {1, 1, 1, 1},
|
|
|
|
|
.id = 0x0F,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
uint32_t codes[9];
|
|
|
|
|
VkResult result;
|
|
|
|
|
VK_RESULT(map_string("#FFFFFFFF", codes, 0, 0, context->ui));
|
|
|
|
|
VK_RESULT(map_string("#00000000", codes, 0, 0, context->ui));
|
|
|
|
|
|
|
|
|
|
LayerInput layer = {
|
|
|
|
|
.strings = strings,
|
|
|
|
@ -219,7 +230,7 @@ VkResult color_ui(ClientContext* context) {
|
|
|
|
|
.anchor = ANCHOR_BOTTOM_LEFT,
|
|
|
|
|
.id = 0x03,
|
|
|
|
|
.offset = {0, 0},
|
|
|
|
|
.size = {178, 168},
|
|
|
|
|
.size = {190, 150},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return create_container(&container, context->render, context->ui);
|
|
|
|
|