Files
James Vecellio-Grant c68c914444 ui: tree dialog widget (#1493)
* param to control stock vs sp ui

* init styles

* SP Toggles

* Lint

* optimizations

* sp raylib preview

* fix callback

* fix ui preview

* dialog txt

* compare vs what used to be done before InputDialog

* merge origin raylib toggles

* tree dialog

* less trees for the planet

* the heck

* save the trees we got icons

* Update process.py

* Remove 'sunnypilot_ui' 

Removed 'sunnypilot_ui' parameter from params_keys.h

* Update raylib_screenshots.py

Removed the parameter setting for 'sunnypilot_ui' in the test.

* ui: fuzzy search helper

* better tree. fully dynamic and stuff

* rm

* more indent

* only show if fav_param is used in the call

* conditional for mypy

* sunny's new x,y makes this even easier!

* loathing loathing, unadulterated loathing, i loathe it all

* more changes!

* more changes!

* Update BUTTON_DISABLED_BG_COLOR to a lighter shade

* Update tree_dialog.py

* final

---------

Co-authored-by: nayan <nayan8teen@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-11-30 01:21:15 -05:00

27 lines
776 B
Python

"""
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
This file is part of sunnypilot and is licensed under the MIT License.
See the LICENSE.md file in the root directory for more details.
"""
import math
import pyray as rl
def draw_star(center_x, center_y, radius, is_filled, color):
center = rl.Vector2(center_x, center_y)
points = []
for i in range(10):
angle = -(i * 36 + 18) * math.pi / 180
r = radius if i % 2 == 0 else radius / 2
x = center_x + r * math.cos(angle)
y = center_y + r * math.sin(angle)
points.append(rl.Vector2(x, y))
for i in range(10):
if is_filled:
rl.draw_triangle(center, points[i], points[(i + 1) % 10], color)
rl.draw_line_ex(points[i], points[(i + 1) % 10], 2, color)