mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-22 13:33:13 +00:00
Text under frames and TimelineSeconds color change on different themes
This commit is contained in:
parent
bfd64a6b84
commit
1f2d8406c2
6 changed files with 17 additions and 8 deletions
|
@ -13,8 +13,8 @@
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Misc/Color defaults.png" type="Texture" id=11]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Misc/Color defaults.png" type="Texture" id=11]
|
||||||
[ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=12]
|
[ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=12]
|
||||||
[ext_resource path="res://Themes & Styles/Dark Theme/DarkRulerStyle.tres" type="StyleBox" id=13]
|
[ext_resource path="res://Themes & Styles/Dark Theme/DarkRulerStyle.tres" type="StyleBox" id=13]
|
||||||
[ext_resource path="res://Scripts/HorizontalRuler.gd" type="Script" id=14]
|
[ext_resource path="res://Scripts/Rulers/HorizontalRuler.gd" type="Script" id=14]
|
||||||
[ext_resource path="res://Scripts/VerticalRuler.gd" type="Script" id=15]
|
[ext_resource path="res://Scripts/Rulers/VerticalRuler.gd" type="Script" id=15]
|
||||||
[ext_resource path="res://Prefabs/Canvas.tscn" type="PackedScene" id=16]
|
[ext_resource path="res://Prefabs/Canvas.tscn" type="PackedScene" id=16]
|
||||||
[ext_resource path="res://Scripts/CameraMovement.gd" type="Script" id=17]
|
[ext_resource path="res://Scripts/CameraMovement.gd" type="Script" id=17]
|
||||||
[ext_resource path="res://Scripts/SelectionRectangle.gd" type="Script" id=18]
|
[ext_resource path="res://Scripts/SelectionRectangle.gd" type="Script" id=18]
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame.png" type="Texture" id=31]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame.png" type="Texture" id=31]
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame_Hover.png" type="Texture" id=32]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame_Hover.png" type="Texture" id=32]
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Loop_None.png" type="Texture" id=33]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Loop_None.png" type="Texture" id=33]
|
||||||
[ext_resource path="res://Scripts/TimelineSeconds.gd" type="Script" id=34]
|
[ext_resource path="res://Scripts/Rulers/TimelineSeconds.gd" type="Script" id=34]
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame.png" type="Texture" id=35]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame.png" type="Texture" id=35]
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame_Hover.png" type="Texture" id=36]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame_Hover.png" type="Texture" id=36]
|
||||||
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette.png" type="Texture" id=37]
|
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette.png" type="Texture" id=37]
|
||||||
|
|
|
@ -410,8 +410,11 @@ func frame_changed(value : int) -> void:
|
||||||
canvas.generate_layer_panels()
|
canvas.generate_layer_panels()
|
||||||
#Make all frame buttons unpressed
|
#Make all frame buttons unpressed
|
||||||
for c in canvases:
|
for c in canvases:
|
||||||
|
var text_color := Color.white
|
||||||
|
if theme_type == "Gold" || theme_type == "Light":
|
||||||
|
text_color = Color.black
|
||||||
c.frame_button.get_node("FrameButton").pressed = false
|
c.frame_button.get_node("FrameButton").pressed = false
|
||||||
c.frame_button.get_node("FrameID").add_color_override("font_color", Color.white)
|
c.frame_button.get_node("FrameID").add_color_override("font_color", text_color)
|
||||||
#Make only the current frame button pressed
|
#Make only the current frame button pressed
|
||||||
canvas.frame_button.get_node("FrameButton").pressed = true
|
canvas.frame_button.get_node("FrameButton").pressed = true
|
||||||
canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75"))
|
canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75"))
|
||||||
|
|
|
@ -93,6 +93,9 @@ func change_theme(ID : int) -> void:
|
||||||
var disabled_file_name = button.texture_disabled.resource_path.get_file()
|
var disabled_file_name = button.texture_disabled.resource_path.get_file()
|
||||||
button.texture_disabled = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, disabled_file_name])
|
button.texture_disabled = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, disabled_file_name])
|
||||||
|
|
||||||
|
# Make sure the frame text gets updated
|
||||||
|
Global.current_frame = Global.current_frame
|
||||||
|
|
||||||
func _on_GridWidthValue_value_changed(value : float) -> void:
|
func _on_GridWidthValue_value_changed(value : float) -> void:
|
||||||
Global.grid_width = value
|
Global.grid_width = value
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@ func _process(delta : float) -> void:
|
||||||
|
|
||||||
#Code taken and modified from Godot's source code
|
#Code taken and modified from Godot's source code
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
|
var color := Color.white
|
||||||
|
if Global.theme_type == "Gold" || Global.theme_type == "Light":
|
||||||
|
color = Color.black
|
||||||
var transform := Transform2D()
|
var transform := Transform2D()
|
||||||
var ruler_transform := Transform2D()
|
var ruler_transform := Transform2D()
|
||||||
var major_subdivide := Transform2D()
|
var major_subdivide := Transform2D()
|
||||||
|
@ -43,12 +46,12 @@ func _draw() -> void:
|
||||||
for i in range(ceil(first.x), last.x):
|
for i in range(ceil(first.x), last.x):
|
||||||
var position : Vector2 = (transform * ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(i, 0))
|
var position : Vector2 = (transform * ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(i, 0))
|
||||||
if i % (major_subdivision * minor_subdivision) == 0:
|
if i % (major_subdivision * minor_subdivision) == 0:
|
||||||
draw_line(Vector2(position.x + RULER_WIDTH, 0), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), Color.white)
|
draw_line(Vector2(position.x + RULER_WIDTH, 0), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), color)
|
||||||
var val = (ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(i, 0)).x / 100
|
var val = (ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(i, 0)).x / 100
|
||||||
val = stepify(val, 0.01)
|
val = stepify(val, 0.01)
|
||||||
draw_string(font, Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 6), "%ss" % str(val))
|
draw_string(font, Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 6), "%ss" % str(val), color)
|
||||||
else:
|
else:
|
||||||
if i % minor_subdivision == 0:
|
if i % minor_subdivision == 0:
|
||||||
draw_line(Vector2(position.x + RULER_WIDTH, RULER_WIDTH * 0.33), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), Color.white)
|
draw_line(Vector2(position.x + RULER_WIDTH, RULER_WIDTH * 0.33), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), color)
|
||||||
else:
|
else:
|
||||||
draw_line(Vector2(position.x + RULER_WIDTH, RULER_WIDTH * 0.66), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), Color.white)
|
draw_line(Vector2(position.x + RULER_WIDTH, RULER_WIDTH * 0.66), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), color)
|
Loading…
Add table
Reference in a new issue