Added nat 20 and crit misses.
Removed Segoe unicode, added an svg instead.
Added margin borders.
This commit is contained in:
Zoey 2024-01-19 21:09:49 +01:00
parent c7f57e5256
commit 119a42f331
9 changed files with 130 additions and 139 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,7 +1,10 @@
[gd_scene load_steps=3 format=3 uid="uid://bqfs1qd83w4sh"] [gd_scene load_steps=4 format=3 uid="uid://bqfs1qd83w4sh"]
[ext_resource type="Script" path="res://Scripts/Main.gd" id="1_fwdg7"] [ext_resource type="Script" path="res://Scripts/Main.gd" id="1_fwdg7"]
[ext_resource type="FontFile" uid="uid://ctfankgpf8gap" path="res://segoeuisymbol.tres" id="3_chv3g"] [ext_resource type="Texture2D" uid="uid://dasghro404eac" path="res://arrowplain.svg" id="2_ojvli"]
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_dgaib"]
load_path = "res://.godot/imported/arrowplain.svg-98c9aea580f2aed60d85c7874b0d5f14.ctex"
[node name="Main" type="Control"] [node name="Main" type="Control"]
layout_mode = 3 layout_mode = 3
@ -31,6 +34,13 @@ color = Color(0.0859693, 0.0859693, 0.133364, 1)
[node name="VBoxContainer" type="VBoxContainer" parent="MainMC"] [node name="VBoxContainer" type="VBoxContainer" parent="MainMC"]
layout_mode = 2 layout_mode = 2
[node name="TM" type="ColorRect" parent="MainMC/VBoxContainer"]
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_vertical = 2
size_flags_stretch_ratio = 0.3
color = Color(0.0859693, 0.0859693, 0.133364, 1)
[node name="Die" type="MarginContainer" parent="MainMC/VBoxContainer"] [node name="Die" type="MarginContainer" parent="MainMC/VBoxContainer"]
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
@ -40,7 +50,7 @@ size_flags_stretch_ratio = 10.0
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 12.0 size_flags_stretch_ratio = 12.0
color = Color(0.0862745, 0.0862745, 0.133333, 1) color = Color(0.0859693, 0.0859693, 0.133364, 1)
[node name="DieLB" type="Label" parent="MainMC/VBoxContainer/Die/DiceCR"] [node name="DieLB" type="Label" parent="MainMC/VBoxContainer/Die/DiceCR"]
layout_mode = 1 layout_mode = 1
@ -49,11 +59,25 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_override_font_sizes/font_size = 200 theme_override_font_sizes/font_size = 500
text = "crickets" text = "32"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="LM" type="ColorRect" parent="MainMC/VBoxContainer/Die"]
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_horizontal = 0
size_flags_stretch_ratio = 3.0
color = Color(0.0859693, 0.0859693, 0.133364, 1)
[node name="RM" type="ColorRect" parent="MainMC/VBoxContainer/Die"]
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
size_flags_horizontal = 8
size_flags_stretch_ratio = 3.0
color = Color(0.0859693, 0.0859693, 0.133364, 1)
[node name="EnumMC" type="MarginContainer" parent="MainMC/VBoxContainer"] [node name="EnumMC" type="MarginContainer" parent="MainMC/VBoxContainer"]
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
@ -83,19 +107,16 @@ layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
color = Color(0.0703441, 0.0703441, 0.0703441, 1) color = Color(0.0703441, 0.0703441, 0.0703441, 1)
[node name="UPMultiplierRect" type="Label" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPUP"] [node name="UPMultiplierRect" type="TextureRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPUP"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 1 texture = ExtResource("2_ojvli")
theme_override_fonts/font = ExtResource("3_chv3g") expand_mode = 3
theme_override_font_sizes/font_size = 150 stretch_mode = 5
text = "⮝"
horizontal_alignment = 1
vertical_alignment = 1
[node name="MPLB" type="ColorRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer"] [node name="MPLB" type="ColorRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer"]
layout_mode = 2 layout_mode = 2
@ -119,19 +140,17 @@ layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
color = Color(0.0703441, 0.0703441, 0.0703441, 1) color = Color(0.0703441, 0.0703441, 0.0703441, 1)
[node name="DWMultiplierRect" type="Label" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPDW"] [node name="UPMultiplierRect" type="TextureRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPDW"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_override_constants/outline_size = 0 texture = SubResource("CompressedTexture2D_dgaib")
theme_override_fonts/font = ExtResource("3_chv3g") expand_mode = 3
theme_override_font_sizes/font_size = 150 stretch_mode = 5
text = "⮟" flip_v = true
horizontal_alignment = 1
vertical_alignment = 1
[node name="VBoxContainer2" type="VBoxContainer" parent="MainMC/VBoxContainer/EnumMC/EnumHB"] [node name="VBoxContainer2" type="VBoxContainer" parent="MainMC/VBoxContainer/EnumMC/EnumHB"]
layout_mode = 2 layout_mode = 2
@ -142,18 +161,16 @@ layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
color = Color(0.0703441, 0.0703441, 0.0703441, 1) color = Color(0.0703441, 0.0703441, 0.0703441, 1)
[node name="UPDieTypeRect" type="Label" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/UPDT"] [node name="UPMultiplierRect" type="TextureRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/UPDT"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_override_fonts/font = ExtResource("3_chv3g") texture = ExtResource("2_ojvli")
theme_override_font_sizes/font_size = 150 expand_mode = 3
text = "⮝" stretch_mode = 5
horizontal_alignment = 1
vertical_alignment = 1
[node name="DTTP" type="ColorRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2"] [node name="DTTP" type="ColorRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2"]
layout_mode = 2 layout_mode = 2
@ -177,18 +194,17 @@ layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
color = Color(0.0703441, 0.0703441, 0.0703441, 1) color = Color(0.0703441, 0.0703441, 0.0703441, 1)
[node name="DWDieTypeRect" type="Label" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/DWDT"] [node name="UPMultiplierRect" type="TextureRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/DWDT"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_override_fonts/font = ExtResource("3_chv3g") texture = SubResource("CompressedTexture2D_dgaib")
theme_override_font_sizes/font_size = 150 expand_mode = 3
text = "⮟" stretch_mode = 5
horizontal_alignment = 1 flip_v = true
vertical_alignment = 1
[node name="RM" type="ColorRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB"] [node name="RM" type="ColorRect" parent="MainMC/VBoxContainer/EnumMC/EnumHB"]
layout_mode = 2 layout_mode = 2
@ -260,6 +276,12 @@ text = "Dwenny by LibreBun Touch 2024"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="LM" type="ColorRect" parent="MainMC/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.05
color = Color(0.0859693, 0.0859693, 0.133364, 1)
[connection signal="gui_input" from="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPUP" to="." method="_on_mpup_gui_input"] [connection signal="gui_input" from="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPUP" to="." method="_on_mpup_gui_input"]
[connection signal="gui_input" from="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPDW" to="." method="_on_mpdw_gui_input"] [connection signal="gui_input" from="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPDW" to="." method="_on_mpdw_gui_input"]
[connection signal="gui_input" from="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/UPDT" to="." method="_on_updt_gui_input"] [connection signal="gui_input" from="MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/UPDT" to="." method="_on_updt_gui_input"]

View file

@ -3,11 +3,18 @@ extends Control
@onready var MultiplierLB = $MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPLB/MultiplierLB @onready var MultiplierLB = $MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer/MPLB/MultiplierLB
@onready var DieTypeLB = $MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/DTTP/DieTypeLB @onready var DieTypeLB = $MainMC/VBoxContainer/EnumMC/EnumHB/VBoxContainer2/DTTP/DieTypeLB
@onready var DieLB = $MainMC/VBoxContainer/Die/DiceCR/DieLB @onready var DieLB = $MainMC/VBoxContainer/Die/DiceCR/DieLB
@onready var topBG = $MainMC/VBoxContainer/Die/DiceCR
var Multiplier : int = 1 var Multiplier : int = 1
var ChosenDie : int = 20 var ChosenDie : int = 20
var topBGdef = Color8(22, 22, 32, 255)
var topBGnat = Color8(0, 112, 57, 255)
var topBGcrit = Color8(136, 16, 0, 255)
func _ready(): func _ready():
topBG.color = topBGdef
pass pass
func _process(_delta): func _process(_delta):
@ -16,7 +23,10 @@ func _process(_delta):
func Die(): func Die():
var result = ChosenDie * Multiplier var result = ChosenDie * Multiplier
return randi() % result + 1 var randomNumber = randi() % result + 1
if randomNumber != 20 and randf_range(0, 1) < 0.05:
randomNumber = 20
return randomNumber
var dice_values = [4, 6, 8, 10, 12, 20] var dice_values = [4, 6, 8, 10, 12, 20]
func _on_updt_gui_input(event): func _on_updt_gui_input(event):
@ -41,5 +51,11 @@ func _on_mpdw_gui_input(event):
func _on_roll_rect_gui_input(event:InputEvent): func _on_roll_rect_gui_input(event:InputEvent):
if event is InputEventScreenTouch and event.is_pressed(): if event is InputEventScreenTouch and event.is_pressed():
Die(); var roll = Die();
DieLB.text = str(Die()); DieLB.text = str(roll);
if roll == 20:
topBG.set_color(topBGnat)
if roll == 1:
topBG.set_color(topBGcrit)
if roll != 20 and roll != 1:
topBG.set_color(topBGdef)

Binary file not shown.

View file

@ -1,33 +0,0 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://copl4he4fryos"
path="res://.godot/imported/Segoe-UI-Symbol.ttf-bb1730ab9a905e5832754624e69a00aa.fontdata"
[deps]
source_file="res://Segoe-UI-Symbol.ttf"
dest_files=["res://.godot/imported/Segoe-UI-Symbol.ttf-bb1730ab9a905e5832754624e69a00aa.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

21
arrowplain.svg Normal file
View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<g
id="layer1">
<path
id="path1"
style="fill:#ffffff;fill-opacity:1;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0"
d="M 116.10925,110.61076 H 19.357418 L 67.733331,24.855909 Z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 589 B

37
arrowplain.svg.import Normal file
View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dasghro404eac"
path="res://.godot/imported/arrowplain.svg-98c9aea580f2aed60d85c7874b0d5f14.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://arrowplain.svg"
dest_files=["res://.godot/imported/arrowplain.svg-98c9aea580f2aed60d85c7874b0d5f14.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

File diff suppressed because one or more lines are too long