Lots of localization setup, added controller BBCode stuff also.
This commit is contained in:
@@ -25,31 +25,30 @@ func _enter_tree() -> void:
|
||||
assert(false, "Missing item type: " + Item.Type.find_key(itemType))
|
||||
|
||||
|
||||
static func isStackable(itemType:Item.Type) -> bool:
|
||||
func isStackable(itemType:Item.Type) -> bool:
|
||||
if not ITEM_MAP.has(itemType):
|
||||
return false
|
||||
|
||||
var item:Item = ITEM_MAP[itemType]
|
||||
return item.stackable
|
||||
|
||||
static func getItemName(itemType:Item.Type, count:int = 1) -> String:
|
||||
func getItemName(itemType:Item.Type, count:int = 1) -> String:
|
||||
if not ITEM_MAP.has(itemType):
|
||||
return ""
|
||||
|
||||
|
||||
var item:Item = ITEM_MAP[itemType]
|
||||
if count > 1:
|
||||
return str(count) + "x " + item.title
|
||||
else:
|
||||
return item.title
|
||||
return tr_n(item.title, item.title + "_plural", count).format({
|
||||
"count": count
|
||||
})
|
||||
|
||||
static func getItemDescription(itemType:Item.Type) -> String:
|
||||
func getItemDescription(itemType:Item.Type) -> String:
|
||||
if not ITEM_MAP.has(itemType):
|
||||
return ""
|
||||
|
||||
var item:Item = ITEM_MAP[itemType]
|
||||
return item.description_text
|
||||
|
||||
static func getItemCategory(itemType:Item.Type) -> Item.Category:
|
||||
func getItemCategory(itemType:Item.Type) -> Item.Category:
|
||||
if not ITEM_MAP.has(itemType):
|
||||
return Item.Category.INGREDIENT
|
||||
|
||||
|
Reference in New Issue
Block a user