Skip to content

Commit

Permalink
feat: hud弓箭顯示當前要發射的箭 #13
Browse files Browse the repository at this point in the history
  • Loading branch information
MintCoolMC committed Jan 29, 2024
1 parent 99cb1e5 commit 6f024b1
Showing 1 changed file with 276 additions and 13 deletions.
289 changes: 276 additions & 13 deletions ui/RainbowPieUI/module/hud_bow_helper.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,276 @@
{
"namespace": "rainbowpie_module_hud_bow_helper",

"arrow_slot": {
"type": "panel",
"size": [ "100%c", "100%" ],
"controls": [
{
"item_count_stack_panel": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [ "100%c", "100%" ],
"controls": [
{
"item_renderer@rainbowpie_ui_common.item_renderer": {
"size": [ "100%y", "100%" ],
"bindings": [
{
"binding_type": "collection",
"binding_name": "#item_id_aux",
"binding_collection_name": "hotbar_items"
}
]
}
},
{
"padding_0": {
"type": "panel",
"size": [ 2, 2 ]
}
},
{
"count_text_panel": {
"type": "panel",
"size": [ "100%c", "100%" ],
"controls": [
{
"count_text@rainbowpie_ui_common.text_label": {
"text": "#inventory_stack_count_str",
"bindings": [
{
"binding_name": "#inventory_stack_count",
"binding_type": "collection",
"binding_collection_name": "hotbar_items"
},
{
"binding_type": "view",
"source_property_name": "(#inventory_stack_count = 0)",
"target_property_name": "#is_single_item"
},
{
"binding_type": "view",
"source_property_name": "('x' + ((#is_single_item * 1) + #inventory_stack_count))",
"target_property_name": "#inventory_stack_count_str"
}
]
}
}
]
}
}
]
}
}
],
"bindings": [
{
"binding_name": "#item_id_aux",
"binding_type": "collection",
"binding_collection_name": "hotbar_items"
},
{
"binding_type": "view",
"source_property_name": "('aux' + #item_id_aux + ',')",
"target_property_name": "#item_id_aux_str"
},
{
"binding_type": "view",
"source_property_name": "(not (($rainbowpie_ui_moduleflag_hud_bow_helper_arrowids - #item_id_aux_str) = $rainbowpie_ui_moduleflag_hud_bow_helper_arrowids))",
"target_property_name": "#visible"
}
]
},

"arrow_slot_panel": {
"type": "stack_panel",
"collection_name": "hotbar_items",
"size": [ "100%cm", "100%" ],
"clips_children": true,
"controls": [
{
"arrow_slot_0@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 0
}
},
{
"arrow_slot_1@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 1
}
},
{
"arrow_slot_2@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 2
}
},
{
"arrow_slot_3@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 3
}
},
{
"arrow_slot_4@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 4
}
},
{
"arrow_slot_5@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 5
}
},
{
"arrow_slot_6@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 6
}
},
{
"arrow_slot_7@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 7
}
},
{
"arrow_slot_8@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 8
}
},
{
"arrow_slot_9@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 9
}
},
{
"arrow_slot_10@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 10
}
},
{
"arrow_slot_11@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 11
}
},
{
"arrow_slot_12@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 12
}
},
{
"arrow_slot_13@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 13
}
},
{
"arrow_slot_14@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 14
}
},
{
"arrow_slot_15@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 15
}
},
{
"arrow_slot_16@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 16
}
},
{
"arrow_slot_17@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 17
}
},
{
"arrow_slot_18@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 18
}
},
{
"arrow_slot_19@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 19
}
},
{
"arrow_slot_20@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 20
}
},
{
"arrow_slot_21@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 21
}
},
{
"arrow_slot_22@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 22
}
},
{
"arrow_slot_23@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 23
}
},
{
"arrow_slot_24@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 24
}
},
{
"arrow_slot_25@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 25
}
},
{
"arrow_slot_26@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 26
}
},
{
"arrow_slot_27@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 27
}
},
{
"arrow_slot_28@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 28
}
},
{
"arrow_slot_29@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 29
}
},
{
"arrow_slot_30@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 30
}
},
{
"arrow_slot_31@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 31
}
},
{
"arrow_slot_32@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 32
}
},
{
"arrow_slot_33@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 33
}
},
{
"arrow_slot_34@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 34
}
},
{
"arrow_slot_35@rainbowpie_module_hud_bow_helper.arrow_slot": {
"collection_index": 35
}
}
]
},

"hud_bow_helper": {
"type": "panel",
"ignored": "(not $rainbowpie_ui_module_hud_bow_helper)",
Expand Down Expand Up @@ -35,40 +305,33 @@
"stack_panel": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [ "100%c", 10 ],
"size": [ "100%c", 12 ],
"controls": [
{
"count_title_panel": {
"type": "panel",
"size": [ "100%c", 10 ],
"size": [ "100%c", 12 ],
"controls": [
{
"count_title@rainbowpie_ui_common.text_label": {
"text": "rainbowpie.ui.hud.bow_helper.arrow_count"
}
"arrow_panel@rainbowpie_module_hud_bow_helper.arrow_slot_panel": {}
}
]
}
},
{
"padding_0": {
"type": "panel",
"size": [ 2, 2 ]
}
},
{
"count_text_panel": {
"type": "panel",
"size": [ "100%c", 10 ],
"size": [ "100%c", "100%" ],
"controls": [
{
"count_text@rainbowpie_ui_common.text_label": {
"text": "#arrow_item_total_count_str",
"color": [ 0.7, 0.7, 0.7 ],
"bindings": [
{
"binding_type": "view",
"source_control_name": "arrow_count",
"source_property_name": "('§§' + #inventory_target_item_total_count_int)",
"source_property_name": "('|x' + #inventory_target_item_total_count_int)",
"target_property_name": "#arrow_item_total_count_str"
}
]
Expand Down

0 comments on commit 6f024b1

Please sign in to comment.