Compare commits

..

2 Commits

Author SHA1 Message Date
c96ac0e2d2 Basic battle scene layout 2022-08-24 09:45:23 +01:00
bf15a8a824 Add support for hovering with the DiceView 2022-08-24 09:44:17 +01:00
3 changed files with 29 additions and 13 deletions

View File

@ -3,3 +3,5 @@ extends Node
func _ready(): func _ready():
$"%Battle".character = $Player $"%Battle".character = $Player
$"%CardContainer".character = $Player
$"%DiceContainer".character = $Player

View File

@ -1,11 +1,14 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=10 format=2]
[ext_resource path="res://Scenes/Battle.tscn" type="PackedScene" id=1] [ext_resource path="res://Scenes/Battle.tscn" type="PackedScene" id=1]
[ext_resource path="res://Characters/Player.tscn" type="PackedScene" id=2] [ext_resource path="res://Characters/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scenes/BattleScene.gd" type="Script" id=3] [ext_resource path="res://Scenes/BattleScene.gd" type="Script" id=3]
[ext_resource path="res://UI/CardContainer.tscn" type="PackedScene" id=4] [ext_resource path="res://UI/CardContainer.tscn" type="PackedScene" id=4]
[ext_resource path="res://UI/DiceView.tscn" type="PackedScene" id=5] [ext_resource path="res://UI/DiceContainer.tscn" type="PackedScene" id=5]
[ext_resource path="res://UI/Card.gd" type="Script" id=6]
[ext_resource path="res://Assets/CardDB/Broadsword.tres" type="Resource" id=7]
[ext_resource path="res://Management/ActiveController.tscn" type="PackedScene" id=8] [ext_resource path="res://Management/ActiveController.tscn" type="PackedScene" id=8]
[ext_resource path="res://Assets/CardDB/Poisonous apple.tres" type="Resource" id=9]
[node name="BattleScene" type="Node"] [node name="BattleScene" type="Node"]
script = ExtResource( 3 ) script = ExtResource( 3 )
@ -14,14 +17,25 @@ script = ExtResource( 3 )
[node name="Battle" parent="ActiveController" instance=ExtResource( 1 )] [node name="Battle" parent="ActiveController" instance=ExtResource( 1 )]
[node name="DiceView" parent="ActiveController" instance=ExtResource( 5 )]
unique_name_in_owner = true
margin_left = 782.0
margin_top = 375.0
[node name="CardContainer" parent="ActiveController" instance=ExtResource( 4 )] [node name="CardContainer" parent="ActiveController" instance=ExtResource( 4 )]
unique_name_in_owner = true unique_name_in_owner = true
margin_top = 351.0 margin_top = 351.0
margin_right = -425.0 margin_right = -425.0
[node name="DiceContainer" parent="ActiveController" instance=ExtResource( 5 )]
unique_name_in_owner = true
margin_left = 782.0
margin_top = 375.0
[node name="Player" parent="." instance=ExtResource( 2 )] [node name="Player" parent="." instance=ExtResource( 2 )]
[node name="Card1" type="Node" parent="Player"]
script = ExtResource( 6 )
card_info = ExtResource( 7 )
[node name="Card2" type="Node" parent="Player"]
script = ExtResource( 6 )
[node name="Card3" type="Node" parent="Player"]
script = ExtResource( 6 )
card_info = ExtResource( 9 )

View File

@ -2,16 +2,16 @@ tool
extends Control extends Control
const dice_image_string = "res://Assets/Dice/Dice%s.png" const dice_image_string = "res://Assets/Dice/Dice%s.png"
const selected_shader = preload("res://UI/RainbowOutline.tres") const hovering_shader = preload("res://UI/RainbowOutline.tres")
export (int, 0, 6) var dice_value : int = 0 export (int, 0, 6) var dice_value : int = 0
export var selected : bool setget set_selected export var hovering : bool setget set_hovering
func set_selected(new_value): func set_hovering(new_value):
selected = new_value hovering = new_value
if selected: if hovering:
self.material = selected_shader self.material = hovering_shader
else: else:
self.material = null self.material = null