From 7c23013cfb4e348fbfd55124b9c8a7b10fe7894f Mon Sep 17 00:00:00 2001 From: bacon Date: Sun, 3 Sep 2023 00:13:22 +0300 Subject: [PATCH] mask encyclopedia --- .../ui/encyclopedia/chapters/wpeturrets.lua | 40 +++++++++++++++++++ .../_player/ui/encyclopedia/contents.lua | 1 + .../_player/ui/encyclopedia/encyclopedia.lua | 17 ++++++++ 3 files changed, 58 insertions(+) create mode 100644 data/scripts/_player/ui/encyclopedia/chapters/wpeturrets.lua create mode 100644 data/scripts/_player/ui/encyclopedia/contents.lua create mode 100644 data/scripts/_player/ui/encyclopedia/encyclopedia.lua diff --git a/data/scripts/_player/ui/encyclopedia/chapters/wpeturrets.lua b/data/scripts/_player/ui/encyclopedia/chapters/wpeturrets.lua new file mode 100644 index 0000000..70039b9 --- /dev/null +++ b/data/scripts/_player/ui/encyclopedia/chapters/wpeturrets.lua @@ -0,0 +1,40 @@ + +Categories = Categories or {} +category = {} + +table.insert(Categories, category) + +category.title = "WPE Turrets"%_t +category.chapters = +{ + { + title = "Intro"%_t, + picture = "data/textures/slide/thumb.png", + text = "In this part of the encyclopedia you will find a description of the turrets from the Weapon Pack Extended mod.\n\nI recommend using turret models from the collection in the workshop."%_t, + }, + + { + title = "Smartcannon"%_t, + picture = "data/textures/slide/3.png", + text = "A lightweight version of the classic cannon.\n\nCompared to conventional cannons:\n+ Increased rate of fire (x2)\n+ Increased projectile speed (x1.5)\n+ A little more damage on the shield (10% - 15%)\n+ Can be equipped with homing missiles.\n- Less damage (x0.75)\n- Shorter damage range (x0.8)"%_t, + }, + + { + title = "Heavy Cannon"%_t, + picture = "data/textures/slide/4.png", + text = "The cannon of the main caliber. It shoots with heavy explosive shells, the hit of which can displace the enemy ship.\n\n+ High damage\n+ High projectile speed\n+ When hit, push the opponent\n+ Also can have a penetration\n- Low rate of fire\n- Occupies many slots\n- Big size\n- Requires more crew"%_t, + }, + + { + title = "Energy diffuser"%_t, + picture = "data/textures/slide/1.png", + text = "Short range combat weapon. Does not cause damage to the hull, but extremely effectively destroys shields. Requires civil slots.\n\nShield Damage x20"%_t, + }, + + { + title = "Hookgun"%_t, + picture = "data/textures/slide/1.png", + text = "Short range combat weapon. Does not cause damage to the shield, but extremely effectively to attrac. Requires 2 gunners slots.\n May have penetration\n"%_t, + }, + +} diff --git a/data/scripts/_player/ui/encyclopedia/contents.lua b/data/scripts/_player/ui/encyclopedia/contents.lua new file mode 100644 index 0000000..5ece614 --- /dev/null +++ b/data/scripts/_player/ui/encyclopedia/contents.lua @@ -0,0 +1 @@ +contents = {} diff --git a/data/scripts/_player/ui/encyclopedia/encyclopedia.lua b/data/scripts/_player/ui/encyclopedia/encyclopedia.lua new file mode 100644 index 0000000..46914af --- /dev/null +++ b/data/scripts/_player/ui/encyclopedia/encyclopedia.lua @@ -0,0 +1,17 @@ +Encyclopedia._fillTree = Encyclopedia.fillTree + +function Encyclopedia.fillTree() + + include("chapters/wpeturrets") + + Encyclopedia._fillTree() + + local searchText = string.trim(self.searchTextBox.text) + + if searchText == "" then + Encyclopedia.fillTreeCompletely() + else + Encyclopedia.fillTreeFiltered(searchText) + end + +end