settings.rs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /* This file is part of DarkFi (https://dark.fi)
  2. *
  3. * Copyright (C) 2020-2026 Dyne.org foundation
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Affero General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. use crate::{
  19. mesh::Color,
  20. ui::{ShapeVertex, VectorShape},
  21. };
  22. pub fn create_settings(color: Color) -> VectorShape {
  23. VectorShape {
  24. verts: vec![
  25. ShapeVertex::from_xy(-0.282843, 0.0, color),
  26. ShapeVertex::from_xy(0.0, 0.282843, color),
  27. ShapeVertex::from_xy(-0.0, -0.282843, color),
  28. ShapeVertex::from_xy(0.282843, -0.0, color),
  29. ShapeVertex::from_xy(-0.05, 1.0, color),
  30. ShapeVertex::from_xy(0.05, 0.9, color),
  31. ShapeVertex::from_xy(-0.05, -0.9, color),
  32. ShapeVertex::from_xy(0.05, -1.0, color),
  33. ShapeVertex::from_xy(-0.05, -0.335, color),
  34. ShapeVertex::from_xy(0.05, -0.335, color),
  35. ShapeVertex::from_xy(0.0, 0.95, color),
  36. ShapeVertex::from_xy(-0.0, -0.95, color),
  37. ShapeVertex::from_xy(-0.0, -0.385, color),
  38. ShapeVertex::from_xy(-0.05, 0.3315, color),
  39. ShapeVertex::from_xy(0.05, 0.3315, color),
  40. ShapeVertex::from_xy(0.0, 0.3815, color),
  41. ShapeVertex::from_xy(-0.982843, 0.45, color),
  42. ShapeVertex::from_xy(-0.7, 0.732843, color),
  43. ShapeVertex::from_xy(-0.7, 0.167157, color),
  44. ShapeVertex::from_xy(-0.417157, 0.45, color),
  45. ShapeVertex::from_xy(-0.75, 1.0, color),
  46. ShapeVertex::from_xy(-0.65, 0.9, color),
  47. ShapeVertex::from_xy(-0.75, -0.9, color),
  48. ShapeVertex::from_xy(-0.65, -1.0, color),
  49. ShapeVertex::from_xy(-0.75, 0.115, color),
  50. ShapeVertex::from_xy(-0.65, 0.115, color),
  51. ShapeVertex::from_xy(-0.7, 0.95, color),
  52. ShapeVertex::from_xy(-0.7, -0.95, color),
  53. ShapeVertex::from_xy(-0.7, 0.065, color),
  54. ShapeVertex::from_xy(-0.75, 0.7815, color),
  55. ShapeVertex::from_xy(-0.65, 0.7815, color),
  56. ShapeVertex::from_xy(-0.7, 0.8315, color),
  57. ShapeVertex::from_xy(0.417157, -0.45, color),
  58. ShapeVertex::from_xy(0.7, -0.167157, color),
  59. ShapeVertex::from_xy(0.7, -0.732843, color),
  60. ShapeVertex::from_xy(0.982843, -0.45, color),
  61. ShapeVertex::from_xy(0.65, 1.0, color),
  62. ShapeVertex::from_xy(0.75, 0.9, color),
  63. ShapeVertex::from_xy(0.65, -0.9, color),
  64. ShapeVertex::from_xy(0.75, -1.0, color),
  65. ShapeVertex::from_xy(0.65, -0.785, color),
  66. ShapeVertex::from_xy(0.75, -0.785, color),
  67. ShapeVertex::from_xy(0.7, 0.95, color),
  68. ShapeVertex::from_xy(0.7, -0.95, color),
  69. ShapeVertex::from_xy(0.7, -0.835, color),
  70. ShapeVertex::from_xy(0.65, -0.1185, color),
  71. ShapeVertex::from_xy(0.75, -0.1185, color),
  72. ShapeVertex::from_xy(0.7, -0.0685, color),
  73. ShapeVertex::from_xy(-0.869706, 0.45, color),
  74. ShapeVertex::from_xy(-0.7, 0.619706, color),
  75. ShapeVertex::from_xy(-0.7, 0.280294, color),
  76. ShapeVertex::from_xy(-0.530294, 0.45, color),
  77. ShapeVertex::from_xy(0.530294, -0.45, color),
  78. ShapeVertex::from_xy(0.7, -0.280294, color),
  79. ShapeVertex::from_xy(0.7, -0.619706, color),
  80. ShapeVertex::from_xy(0.869706, -0.45, color),
  81. ShapeVertex::from_xy(-0.169706, 0.0, color),
  82. ShapeVertex::from_xy(0.0, 0.169706, color),
  83. ShapeVertex::from_xy(-0.0, -0.169706, color),
  84. ShapeVertex::from_xy(0.169706, -0.0, color),
  85. ],
  86. indices: vec![
  87. 0, 58, 2, 9, 11, 12, 12, 6, 8, 10, 13, 4, 5, 15, 10, 18, 48, 50, 28, 23, 27, 28, 22,
  88. 24, 26, 29, 20, 21, 31, 26, 33, 52, 32, 41, 43, 44, 44, 38, 40, 36, 47, 45, 37, 47, 42,
  89. 3, 57, 1, 9, 7, 11, 12, 11, 6, 10, 15, 13, 5, 14, 15, 19, 49, 17, 28, 25, 23, 28, 27,
  90. 22, 26, 31, 29, 21, 30, 31, 34, 55, 35, 41, 39, 43, 44, 43, 38, 36, 42, 47, 37, 46, 47,
  91. 18, 51, 19, 17, 48, 16, 33, 55, 53, 32, 54, 34, 2, 59, 3, 1, 56, 0, 0, 56, 58, 18, 16,
  92. 48, 33, 53, 52, 3, 59, 57, 19, 51, 49, 34, 54, 55, 18, 50, 51, 17, 49, 48, 33, 35, 55,
  93. 32, 52, 54, 2, 58, 59, 1, 57, 56,
  94. ],
  95. }
  96. }
  97. pub fn create_right_border(color: Color) -> VectorShape {
  98. VectorShape {
  99. verts: vec![
  100. ShapeVertex::from_xy(-0.4, 1.0, color),
  101. ShapeVertex::from_xy(0.5, 0.0, color),
  102. ShapeVertex::from_xy(-0.4, -1.0, color),
  103. ShapeVertex::from_xy(-0.5, 1.0, color),
  104. ShapeVertex::from_xy(-0.5, 0.0, color),
  105. ShapeVertex::from_xy(-0.5, -1.0, color),
  106. ShapeVertex::from_xy(0.1, 1.0, color),
  107. ShapeVertex::from_xy(1.0, 0.0, color),
  108. ShapeVertex::from_xy(0.1, -1.0, color),
  109. ShapeVertex::from_xy(-0.1, 1.0, color),
  110. ShapeVertex::from_xy(0.8, 0.0, color),
  111. ShapeVertex::from_xy(-0.1, -1.0, color),
  112. ],
  113. indices: vec![2, 4, 1, 0, 4, 3, 2, 5, 4, 0, 1, 4, 8, 10, 7, 6, 10, 9, 8, 11, 10, 6, 7, 10],
  114. }
  115. }