diff --git a/menus/Base Menu/BuySell/menu_buy_sell.tres b/menus/Base Menu/BuySell/menu_buy_sell.tres index 3d27b90..1f43860 100644 --- a/menus/Base Menu/BuySell/menu_buy_sell.tres +++ b/menus/Base Menu/BuySell/menu_buy_sell.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" script_class="Menu" load_steps=4 format=3 uid="uid://cbvax7aprnrig"] +[gd_resource type="Resource" script_class="Menu" load_steps=11 format=3 uid="uid://cbvax7aprnrig"] [ext_resource type="Script" path="res://scripts/Classes/Menu/combo_menu_resource.gd" id="1_erxhv"] +[ext_resource type="Script" path="res://scripts/Classes/Menu/menu_menu_resource.gd" id="2_j0wms"] [ext_resource type="Script" path="res://scripts/Classes/Menu/menu.gd" id="2_ppqjr"] [sub_resource type="Resource" id="Resource_5pmle"] @@ -8,8 +9,32 @@ script = ExtResource("1_erxhv") item_script = &"res://scripts/Base/Menu/send_message.gd" item_menu = &"res://menus/Base Menu/root_menu.tres" +[sub_resource type="Resource" id="Resource_nld04"] +script = ExtResource("2_j0wms") +item = &"res://menus/Base Menu/BuySell/menu_buy_sell_amount.tres" + +[sub_resource type="Resource" id="Resource_skkl2"] +script = ExtResource("2_j0wms") +item = &"res://menus/Base Menu/BuySell/menu_buy_sell_amount.tres" + +[sub_resource type="Resource" id="Resource_mavao"] +script = ExtResource("2_j0wms") +item = &"res://menus/Base Menu/BuySell/menu_buy_sell_amount.tres" + +[sub_resource type="Resource" id="Resource_h23aj"] +script = ExtResource("2_j0wms") +item = &"res://menus/Base Menu/BuySell/menu_buy_sell_amount.tres" + +[sub_resource type="Resource" id="Resource_ncvbu"] +script = ExtResource("2_j0wms") +item = &"res://menus/Base Menu/BuySell/menu_buy_sell_amount.tres" + +[sub_resource type="Resource" id="Resource_n2hk8"] +script = ExtResource("2_j0wms") +item = &"res://menus/Base Menu/BuySell/menu_buy_sell_amount.tres" + [resource] script = ExtResource("2_ppqjr") item_ids = Array[String](["BASE_FETCH_BUY_SELL_CANCEL", "BASE_BUY_SELL", "BASE_BUY_SELL", "BASE_BUY_SELL", "BASE_BUY_SELL", "BASE_BUY_SELL", "BASE_BUY_SELL", "BASE_BUY_SELL_NEXT"]) -item_actions = Array[int]([3, 0, 0, 0, 0, 0, 0, 0]) -item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_5pmle"), null, null, null, null, null, null, null]) +item_actions = Array[int]([3, 1, 1, 1, 1, 1, 1, 0]) +item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_5pmle"), SubResource("Resource_nld04"), SubResource("Resource_skkl2"), SubResource("Resource_mavao"), SubResource("Resource_h23aj"), SubResource("Resource_ncvbu"), SubResource("Resource_n2hk8"), null]) diff --git a/menus/Base Menu/BuySell/menu_sell.tres b/menus/Base Menu/BuySell/menu_buy_sell_amount.tres similarity index 100% rename from menus/Base Menu/BuySell/menu_sell.tres rename to menus/Base Menu/BuySell/menu_buy_sell_amount.tres diff --git a/scripts/Base/Menu/send_message.gd b/scripts/Base/Menu/send_message.gd index d6f3dd4..8333ee8 100644 --- a/scripts/Base/Menu/send_message.gd +++ b/scripts/Base/Menu/send_message.gd @@ -5,12 +5,14 @@ class_name MessageSenderAction var dialogue ## Message which will be send on click var msg: Message +## Additional formatting which can be applied by menu +var format = {} ## Gets message and translates it on display. ## Shown message should end with _LOCAL func _ready(): var item_id = get_parent().menu.item_ids[id] - msg = Message.create(item_id, tr(item_id + "_LOCAL")) + msg = Message.create(item_id, tr(item_id + "_LOCAL").format(format)) text = msg.shown super._ready() diff --git a/scripts/Base/actions_menu.gd b/scripts/Base/actions_menu.gd index 38dcae7..114f211 100644 --- a/scripts/Base/actions_menu.gd +++ b/scripts/Base/actions_menu.gd @@ -52,7 +52,6 @@ func load_menu(): format["item_id"] = i + buy_sell_tab * 6 format["item_name"] = tr(list[i - 1 + buy_sell_tab * 6].name) menu.item_ids[i] = BUY_SELL_ITEM - # disconnect previous action if actions[i] is TransitButton: actions[i].button_up.disconnect(transit_menu) @@ -69,6 +68,8 @@ func load_menu(): actions[i].set_script(menu.item_data[i].load_script()) Menu.Action.ComboAction: actions[i].set_script(menu.item_data[i].load_script()) + if "format" in actions[i]: + actions[i].format = format if "id" in actions[i]: actions[i].id = i if "dialogue" in actions[i]: diff --git a/scripts/Ship/player_ship.gd b/scripts/Ship/player_ship.gd index 8205d9d..ca84b9e 100644 --- a/scripts/Ship/player_ship.gd +++ b/scripts/Ship/player_ship.gd @@ -15,6 +15,8 @@ var money: float = 1000.0 ## Base which was requested to dock last var docking_base: Base = null +var cargo = {} + func destroy(): super.destroy() if docking_base != null: diff --git a/translations/base_dialogue.csv b/translations/base_dialogue.csv index 6517067..c154061 100644 --- a/translations/base_dialogue.csv +++ b/translations/base_dialogue.csv @@ -3,14 +3,18 @@ DIALOGUE_ENTRY_POINT,Entering chat with {race}...\nLogged in as {profile_name}.\ BASE_TEST_MESSAGE_LOCAL,Greet,Поприветствовать BASE_TEST_MESSAGE_RECEIVED,"Hello, gryadki!\nBye, ponos!\n> ","Хеллоу, грядки!\nБай, понос!\n> " BASE_FETCH_BUY_LOCAL,"Ask, what they sell","Спросить, что они продают" -BASE_FETCH_BUY_RECEIVED,I would like to buy something\nWe are selling:\n[ol]{sell_list}[/ol]\n> ,Я бы хотел что-нибудь купить\nМы продаём:\n[ol]{sell_list}[/ol]\n> +BASE_FETCH_BUY_RECEIVED,I would like to buy something\nWe are selling:\n[ol]{sell_list}[/ol]\n,Я бы хотел что-нибудь купить\nМы продаём:\n[ol]{sell_list}[/ol]\n BASE_FETCH_SELL_LOCAL,"Ask, what they buy","Спросить, что они покупают" -BASE_FETCH_SELL_RECEIVED,I have some items to sell\nWe can buy:\n[ol]{buy_list}[/ol]\n> ,У меня есть кое-что на продажу\nМы готовы купить:\n[ol]{buy_list}[/ol]\n> +BASE_FETCH_SELL_RECEIVED,I have some items to sell\nWe can buy:\n[ol]{buy_list}[/ol]\n,У меня есть кое-что на продажу\nМы готовы купить:\n[ol]{buy_list}[/ol]\n BASE_FETCH_PRICE_ITEM,[img=26x26]{item_img}[/img]{item_name} — {item_price},[img=26x26]{item_img}[/img]{item_name} — {item_price} BASE_FETCH_BUY_SELL_CANCEL_LOCAL,Buy nothing,Ничего не покупать BASE_FETCH_BUY_SELL_CANCEL_RECEIVED,I changed my mind\nErm...Fine...\nAnything else?\n> ,Я передумал\nЧто ж...Ладно...\nЧто-то ещё?\n> BASE_BUY_SELL, , BASE_BUY_SELL_NEXT,Next tab,Следующая вкладка BASE_BUY_SELL_PREV,Previous tab,Предыдущая вкладка +BASE_BUY_ITEM_LOCAL,Buy {amount}x{item_name} ({total_price}),Купить {amount}x{item_name} ({total_price}) +BASE_BUY_ITEM_RECEIVED,"[BOUGHT {amount}x{item_name}]\nThanks, anything else?\n> ","[КУПЛЕНО {amount}x{item_name}]\nСпасибо, что-то ещё?\n> " +BASE_SELL_ITEM_LOCAL,Sell {amount}x{item_name} ({total_price}),Продать {amount}x{item_name} ({total_price}) +BASE_SELL_ITEM_RECEIVED,"[SOLD {amount}x{item_name}]\nThanks, anything else?\n> ","[ПРОДАНО {amount}x{item_name}]\nСпасибо, что-то ещё?\n> " BUY_SELL_ITEM,{item_id}. {item_name},{item_id}. {item_name} NULL, , \ No newline at end of file diff --git a/translations/base_dialogue.en.translation b/translations/base_dialogue.en.translation index d51b368..d48b6da 100644 Binary files a/translations/base_dialogue.en.translation and b/translations/base_dialogue.en.translation differ diff --git a/translations/base_dialogue.ru.translation b/translations/base_dialogue.ru.translation index be371f8..3d5c12f 100644 Binary files a/translations/base_dialogue.ru.translation and b/translations/base_dialogue.ru.translation differ