core ui切换
parent
a1e321d180
commit
fb00951881
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://hp3dx7t1x0u5"
|
||||
path="res://.godot/imported/empty.png-921761ee5d222cdb2135233c91a2e1ca.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resource/ui/icon/core/empty.png"
|
||||
dest_files=["res://.godot/imported/empty.png-921761ee5d222cdb2135233c91a2e1ca.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=0
|
||||
compress/normal_map=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@ -1,4 +1,26 @@
|
||||
extends Control
|
||||
|
||||
func _process(delta):
|
||||
pass
|
||||
@onready var core_item_list = [
|
||||
$CoreItemFree/Up, $CoreItemFree/Left, $CoreItemFree/Down, $CoreItemFree/Right,
|
||||
$CoreItemLock/Up, $CoreItemLock/Left, $CoreItemLock/Down, $CoreItemLock/Right,
|
||||
]
|
||||
@onready var core_item_free = $CoreItemFree
|
||||
@onready var core_item_lock = $CoreItemLock
|
||||
|
||||
func on_core_active_list_changed(core_list):
|
||||
for i in range(len(core_list)):
|
||||
var cfg = core_list[i]
|
||||
var item = core_item_list[i] as CoreItemSub
|
||||
if cfg:
|
||||
item.set_icon(cfg.icon)
|
||||
else:
|
||||
item.set_icon(null)
|
||||
|
||||
func on_is_switch_changed(value:bool):
|
||||
visible = value
|
||||
|
||||
func on_target_changed(value:int):
|
||||
var isLock = value != 0
|
||||
core_item_free.visible = !isLock
|
||||
core_item_lock.visible = isLock
|
||||
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
extends Control
|
||||
class_name SkillItemSub
|
||||
class_name CoreItemSub
|
||||
|
||||
var icon : TextureRect
|
||||
var slot : TextureRect
|
||||
@onready var icon = $CoreIcon as TextureRect
|
||||
@onready var slot = $CoreSlot as TextureRect
|
||||
|
||||
func init(value:Texture2D):
|
||||
icon = $WeaponIcon
|
||||
slot = $WeaponSlot
|
||||
icon.texture = value
|
||||
|
||||
func update_alpha(alpha_from:float,alpha_to:float,rate:float):
|
||||
var alpha = lerp(alpha_from,alpha_to,rate)
|
||||
icon.modulate = Color(1,1,1,alpha)
|
||||
slot.modulate = Color(1,1,1,alpha)
|
||||
@onready var icon_empty = load("res://resource/ui/icon/core/empty.png")
|
||||
|
||||
func set_icon(value:Texture2D):
|
||||
if value:
|
||||
icon.texture = value
|
||||
else:
|
||||
icon.texture = icon_empty
|
||||
|
||||
Loading…
Reference in New Issue