From b68215a71035693cd0353cfa20c6421f6111f1b2 Mon Sep 17 00:00:00 2001 From: 2ndbeam <166764593+2ndbeam@users.noreply.github.com> Date: Thu, 23 May 2024 01:47:18 +0300 Subject: [PATCH] New translation lines --- menus/Base Menu/BuySell/menu_buy_sell.tres | 31 ++++++++++++++++-- ...nu_sell.tres => menu_buy_sell_amount.tres} | 0 scripts/Base/Menu/send_message.gd | 4 ++- scripts/Base/actions_menu.gd | 3 +- scripts/Ship/player_ship.gd | 2 ++ translations/base_dialogue.csv | 8 +++-- translations/base_dialogue.en.translation | Bin 1174 -> 1442 bytes translations/base_dialogue.ru.translation | Bin 1565 -> 1897 bytes 8 files changed, 41 insertions(+), 7 deletions(-) rename menus/Base Menu/BuySell/{menu_sell.tres => menu_buy_sell_amount.tres} (100%) 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 d51b3688021e54bd04acf2562d86a231a915d522..d48b6daf00f7d14ac210ee3a73889da323627c77 100644 GIT binary patch delta 587 zcmbQnxrlp%G$U(TvSDTZWCcd2R22pWhW}8Y1!NmQ`DRes0Z6+6u@96FQW}KB2JvH{ zd{!W>0K{oP%m~G=tYtYoCm&~2XPi0tJ)^jl3{XNFC}#x3%uqF7XUsVZWHRUju`Li+ z%PCB01FACzvMqqvNiFh;G1FuNCNV`}pfD#;hzE#aR&Zu>EZPg?fSj*2*`LW=G6=}y z2J(23RPF7{dV72Fd?s-xcc3g2PzHoyW@zSJRd^2Mm;%K>UWds=FW&Yf7AUR>6a(QE zcbVN}m?mFfl2QV>&IO1?GP}Z-18EZ=wgzH0AeIMWQ>Mv0%rhr1XLg$Wnz^OkskBm| zIx#oDG_Rz#qB^rAH8(ylF*mhVL8H1Pza%jyzMv>GIki@k;XhlnlYgkYM+n2eY8Kt- zfPb~W{#ENU>Hdr7WXbu@SQ~5jFC>ZcUv{fhu%O#&vG{-XhW8l$F$AaPz7gEfhoXaB1%fJrw7AVAmf`gm^7_6vv delta 321 zcmZ3)J&kjNG$U)4L5@+;WCcd2R0ReGhW|)F4a(Pn(q=%~22G6<8s7uTX9dyoy$ zVw~bY<(xnvp2_7*=8R#J*E5M5-3Rh5pcrP&y~FZ`-arn>NSLu8xfOSr-4YomD=& GLCyfo0$I-h diff --git a/translations/base_dialogue.ru.translation b/translations/base_dialogue.ru.translation index be371f871adeb273a82f811e9b350eeaf44a23c2..3d5c12fc905a0d7ebaebfd5a87692d4530fada93 100644 GIT binary patch delta 667 zcmbQs^OA3aG$U(vd0tleWCg~+dKCr+hW}8Y1!NmQ`DRes0Z6+6u@96FQW}KB2JvH{ zd{!W>0K{oP%m~G=tYtYSGBGeH0r?;dWP;^pN<3ed$G|Z810yeEz~q07;#M9&DR-bO z2s1-feVsAqERe|nR0+n_atc#8fs(#JJ_tLhMLv1QJlUQ}Oi>l6T^T3@!Z6D@vpE)p z0hOBo#Y`s0F_}wl2C4#i8H8b~_V#7HeLHy_lekkqP!@>bjs&UD%)6@4g=8g29wZ*U zc-xcfK#mcR4Zt9*93MZ+AXpvo1DY*neTi#iolr3e}0Z`K5U!wH4KwC8@dbd5O8HwF(;5CHWSdA#m=3SU_VFINtU{sj=omCA0T(Rkb delta 336 zcmaFKH