diff --git a/data/scene_schema.json b/data/scene_schema.json index 589c3af..9860114 100644 --- a/data/scene_schema.json +++ b/data/scene_schema.json @@ -52,6 +52,7 @@ "position": { "$ref": "#/definitions/vector3" }, "fill_color" : { "type": "string" }, "selected_fill_color" : { "type": "string" }, + "hex_line_color" : { "type": "string" }, "hexlib_orientation" : { "type": "string" }, "hex_size" : { "type": "number" }, "grid_type" : { "type": "string" }, @@ -61,6 +62,7 @@ "position", "fill_color", "selected_fill_color", + "hex_line_color", "hexlib_orientation", "hex_size", "grid_type", diff --git a/data/test_scene.json b/data/test_scene.json index d2d4d3d..c75c8ab 100644 --- a/data/test_scene.json +++ b/data/test_scene.json @@ -26,6 +26,7 @@ "hex_size" : 10, "fill_color" : "0x565656FF", "selected_fill_color": "0xF46000FF", + "hex_line_color": "0x00000000", "hexlib_orientation" : "layout_flat", "grid_type" : "hexagon", "hex_radius" : 20 diff --git a/src/hexgrid.h b/src/hexgrid.h index 1230774..63cba90 100644 --- a/src/hexgrid.h +++ b/src/hexgrid.h @@ -46,8 +46,9 @@ struct hexgrid v3f position = v3f(0, 0, 0); uint hex_size = 10; uint hex_radius = 0; - uint32 fill_color = 0x565656FF; - uint32 selected_fill_color = 0xF46000FF; + uint32 fill_color = 0xFFFFFFFF; + uint32 selected_fill_color = 0xFFFFFFFF; + uint32 hex_line_color = 0xFFFFFFFF; std::vector* hex_array = nullptr; hex_info* start_hex = nullptr; diff --git a/src/scene_loader.cpp b/src/scene_loader.cpp index ddcfec1..a943d3a 100644 --- a/src/scene_loader.cpp +++ b/src/scene_loader.cpp @@ -135,6 +135,8 @@ slParseHexGrid(slSceneDoc* sd, hexgrid& hg) hg.fill_color = std::stoul(fill_color_str, nullptr, 16); std::string selected_fill_color_str = json_grid["selected_fill_color"].GetString(); hg.selected_fill_color = std::stoul(selected_fill_color_str, nullptr, 16); + std::string hex_line_color_str = json_grid["hex_line_color"].GetString(); + hg.hex_line_color = std::stoul(hex_line_color_str, nullptr, 16); std::string orientation_str = json_grid["hexlib_orientation"].GetString(); hg.hexlib_orientation = (orientation_str == "layout_flat") ? layout_flat : layout_pointy; Layout lo(hg.hexlib_orientation, Point(hg.hex_size, hg.hex_size), Point(hg.position.x, hg.position.y));