feat: added the knife
This commit is contained in:
@@ -16,6 +16,7 @@ var name_edit: LineEdit
|
||||
var primary1_opt: OptionButton
|
||||
var primary2_opt: OptionButton
|
||||
var special_opt: OptionButton
|
||||
var melee_opt: OptionButton
|
||||
var save_loadout_btn: Button
|
||||
var back_to_main_btn: Button
|
||||
var editing_index: int = -1
|
||||
@@ -191,6 +192,12 @@ func _build_ui() -> void:
|
||||
special_opt = OptionButton.new()
|
||||
edit_vbox.add_child(special_opt)
|
||||
|
||||
var melee_lbl = Label.new()
|
||||
melee_lbl.text = "Melee"
|
||||
edit_vbox.add_child(melee_lbl)
|
||||
melee_opt = OptionButton.new()
|
||||
edit_vbox.add_child(melee_opt)
|
||||
|
||||
save_loadout_btn = Button.new()
|
||||
save_loadout_btn.text = "Save Loadout"
|
||||
save_loadout_btn.custom_minimum_size = Vector2(0, 40)
|
||||
@@ -756,6 +763,8 @@ func _edit_loadout(idx: int) -> void:
|
||||
_populate_options(primary1_opt, "primary", l["primary_1"])
|
||||
_populate_options(primary2_opt, "primary", l["primary_2"])
|
||||
_populate_options(special_opt, "special", l["special"])
|
||||
if l.has("melee"):
|
||||
_populate_options(melee_opt, "melee", l["melee"])
|
||||
|
||||
edit_panel.visible = true
|
||||
|
||||
@@ -788,6 +797,7 @@ func _save_current_loadout() -> void:
|
||||
l["primary_1"] = primary1_opt.get_item_metadata(primary1_opt.get_selected_id())
|
||||
l["primary_2"] = primary2_opt.get_item_metadata(primary2_opt.get_selected_id())
|
||||
l["special"] = special_opt.get_item_metadata(special_opt.get_selected_id())
|
||||
l["melee"] = melee_opt.get_item_metadata(melee_opt.get_selected_id())
|
||||
LoadoutManager.save_loadouts()
|
||||
_populate_loadout_list()
|
||||
edit_panel.visible = false
|
||||
|
||||
Reference in New Issue
Block a user