Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #296 from rakugoteam/2.0.8
Browse files Browse the repository at this point in the history
2.0.9f1
  • Loading branch information
Jeremi360 authored Feb 26, 2020
2 parents 0a024f7 + deae26d commit b570f24
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 12 deletions.
22 changes: 11 additions & 11 deletions addons/Rakugo/nodes/button2D.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export var toggle_mode := false
export var disabled := false setget set_disabled, get_disabled

## theme (RakugoTheme), if any, will override this
export var use_theme_from_settings := true setget set_colors_from_theme, are_colors_from_theme
export var use_colors_from_theme := true setget set_colors_from_theme, are_colors_from_theme

export var idle_color : Color setget set_idle_color, get_disabled_color
export var idle_color : Color setget set_idle_color, get_idle_color
export var hover_color := Color(0.877647, 0.882353, 0.887059, 1)
export var pressed_color := Color(0, 0.6, 0.8, 1)
export var disable_color : Color setget set_disabled_color, get_disabled_color
Expand All @@ -25,7 +25,7 @@ signal pressed

func _ready() -> void:
upadate_colors()
modulate = idle_color
modulate = _idle_color
set_process_input(true)

connect_if_not("mouse_entered", self, "_on_hover")
Expand All @@ -49,10 +49,10 @@ func upadate_colors() -> void:
))

var rt := t as RakugoTheme
idle_color = rt.idle_node_color
_idle_color = rt.idle_node_color
hover_color = rt.hover_node_color
pressed_color = rt.pressed_node_color
disable_color = rt.disable_node_color
_disable_color = rt.disable_node_color


func set_colors_from_theme(value: bool) -> void:
Expand All @@ -71,22 +71,22 @@ func are_colors_from_theme() -> bool:

func _on_idle() -> void:
_mouse_in = false
modulate = idle_color
print("idle")
modulate = _idle_color
# print("idle")


func _on_hover() -> void:
_mouse_in = true
modulate = hover_color
print("hover")
# print("hover")


func _on_pressed() -> void:
if toggle_mode:
return

modulate = pressed_color
print("pressed")
# print("pressed")

_on_hover()

Expand All @@ -104,9 +104,9 @@ func set_disabled(value: bool) -> void:
_disabled = value

if _disabled:
modulate = disable_color
modulate = _disable_color
else:
modulate = idle_color
modulate = _idle_color


func get_disabled() -> bool:
Expand Down
2 changes: 1 addition & 1 deletion addons/Rakugo/nodes/rakugo_base_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export var color_node := true
export var node_to_change_path := NodePath()

## theme (RakugoTheme), if any, will override this
export var use_theme_from_settings := true setget set_colors_from_theme, are_colors_from_theme
export var use_colors_from_theme := true setget set_colors_from_theme, are_colors_from_theme

export var idle_node_color := Color(0.533333, 0.533333, 0.533333, 1)
export var focus_node_color := Color(0, 0.506836, 0.675781, 1)
Expand Down
Binary file added game/City.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions game/City.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/City.png-f2e0899b2fe253835ec0575710f4be12.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://game/City.png"
dest_files=[ "res://.import/City.png-f2e0899b2fe253835ec0575710f4be12.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
9 changes: 9 additions & 0 deletions game/Map.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node2D

func _ready():
Rakugo.connect("begin", Rakugo, "hide", ["Dialog"])
pass

func _on_ParkBtn_pressed():
print("park")
pass
35 changes: 35 additions & 0 deletions game/Map.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://addons/Rakugo/nodes/button2D.gd" type="Script" id=1]
[ext_resource path="res://game/City.png" type="Texture" id=2]
[ext_resource path="res://game/Map.gd" type="Script" id=3]

[node name="Map" type="Node2D"]
z_index = -10
script = ExtResource( 3 )

[node name="City" type="Sprite" parent="."]
position = Vector2( 509.936, 299.991 )
scale = Vector2( 1.68471, 2.04677 )
texture = ExtResource( 2 )

[node name="ParkBtn" type="Area2D" parent="."]
position = Vector2( 744.626, 149.227 )
script = ExtResource( 1 )
use_colors_from_theme = false
idle_color = Color( 1, 1, 1, 0 )
hover_color = Color( 0.160784, 0.572549, 0.980392, 0.690196 )
pressed_color = Color( 0.0431373, 0.184314, 0.231373, 0.698039 )
disable_color = Color( 0.0470588, 0.0470588, 0.0470588, 0.466667 )

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ParkBtn"]
position = Vector2( -1.99023, -6.63422 )
polygon = PoolVector2Array( -11.1022, -88.2991, -188.236, 18.5116, -1.15094, 133.283, 174.656, 25.8092 )

[node name="Polygon2D" type="Polygon2D" parent="ParkBtn"]
modulate = Color( 0.992157, 0.972549, 0.972549, 1 )
show_behind_parent = true
position = Vector2( -1.99023, -6.63422 )
color = Color( 0.988235, 0.952941, 0.952941, 1 )
polygon = PoolVector2Array( -11.1022, -88.2991, -188.236, 18.5116, -1.15094, 133.283, 174.656, 25.8092 )
[connection signal="pressed" from="ParkBtn" to="." method="_on_ParkBtn_pressed"]

0 comments on commit b570f24

Please sign in to comment.