From f6192407df6ae4a644354249e72ada3fc8ceab81 Mon Sep 17 00:00:00 2001 From: Martin Prokoph Date: Mon, 28 Apr 2025 12:16:12 +0200 Subject: [PATCH] feat: add difficulty labels & other utils --- src/components/BlurryDivider.astro | 21 ++++++++++++ src/components/ChapterButtons.astro | 53 +++++++++++++++++++++++++++++ src/components/Difficulty.astro | 31 +++++++++++++++++ src/pages/wiki/betterleaves.mdx | 11 +++--- 4 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 src/components/BlurryDivider.astro create mode 100644 src/components/ChapterButtons.astro create mode 100644 src/components/Difficulty.astro diff --git a/src/components/BlurryDivider.astro b/src/components/BlurryDivider.astro new file mode 100644 index 0000000..33b8e45 --- /dev/null +++ b/src/components/BlurryDivider.astro @@ -0,0 +1,21 @@ +--- +interface Props { + vertical?: boolean +} +const { vertical = false } = Astro.props +// Inspired by: https://tw-elements.com/docs/standard/content-styles/dividers/ +--- + +{!vertical ? +
+ : +
+ +

Left

+
+
+ +

Right

+
+
+} diff --git a/src/components/ChapterButtons.astro b/src/components/ChapterButtons.astro new file mode 100644 index 0000000..ea22aa7 --- /dev/null +++ b/src/components/ChapterButtons.astro @@ -0,0 +1,53 @@ +--- +interface Props { + previous?: { + name: string + url: string + label?: string + icon?: string + } + next?: { + name: string + url: string + label?: string + icon?: string + } +} +const { previous, next } = Astro.props +import { Icon } from 'astro-icon/components' +import BlurryDivider from './BlurryDivider.astro' +--- +
+ +
\ No newline at end of file diff --git a/src/components/Difficulty.astro b/src/components/Difficulty.astro new file mode 100644 index 0000000..5cf00f3 --- /dev/null +++ b/src/components/Difficulty.astro @@ -0,0 +1,31 @@ +--- + +export default interface Props { + difficulty: 'easy' | 'medium' | 'advanced' | 'hard' +} +enum DifficultyName { + easy = "Easy", + medium = "Medium", + advanced = "Advanced", + hard = "Hard" +} +const { difficulty } = Astro.props +--- + + { DifficultyName[difficulty] } + + + \ No newline at end of file diff --git a/src/pages/wiki/betterleaves.mdx b/src/pages/wiki/betterleaves.mdx index 48132ed..9458765 100644 --- a/src/pages/wiki/betterleaves.mdx +++ b/src/pages/wiki/betterleaves.mdx @@ -8,6 +8,7 @@ import { Image } from 'astro:assets'; import { Icon } from 'astro-icon/components' import { Notification } from 'accessible-astro-components' import CustomTabs from "../../components/CustomTabs.astro" +import Difficulty from "../../components/Difficulty.astro" import pythonCodeImage from '../../assets/betterleaves/script.png'; import ingameImage from '../../assets/betterleaves/ingame.png'; @@ -22,7 +23,7 @@ This documentation aims to help you create your own flavour for any texturepack A screenshot of the Better Leaves resourcepack in action -## Getting Started +## Getting Started First of all, you need to download the contents of the GitHub repository. To do so, you can either download the [zip file](https://github.com/TeamMidnightDust/BetterLeavesLite/archive/refs/heads/main.zip), or just execute ```bash @@ -30,7 +31,7 @@ git clone https://github.com/TeamMidnightDust/BetterLeavesLite.git ``` in a terminal window. -## Texturepacks +## Texturepacks You can easily create a build for any texturepack. Just add the pack (as a .zip file or folder) to the input/texturepacks/ folder. After that, follow the Building section to get your flavour! @@ -38,14 +39,14 @@ After that, follow the Building section to get your flav
An overview of the input folder

The input folder is all you have to worry about

-## Mods +## Mods In simple cases, it is enough to put the mod file in the /input/mods folder and continue with the Building section.
An overview of the input/mods folder, showing the automatic unpacking process

Put the .jar file into input/mods, and the script will take care of extracting all textures with "leaves" in their name.
The _temp folder is purely symbolic here, it will only exist for a few milliseconds during the extraction process.

-## Building +## Building To build your flavour of the pack, you need to have Python installed on your system. You can get it on any modern operating system. @@ -102,7 +103,7 @@ python3 gen_pack.py 1.0 Your Edition Replace "1.0" with your desired version number and "Your Edition" with the name you'd like to appear in the resourcepack description ingame. And in no time, the script will generate a ready-to-use zip file with your desired content. -## (Advanced) Irregularities and Missing Textures +## Irregularities and Missing Textures If you see missing textures when trying your freshly-built pack, the mod you're adding support for has a more complicated asset structure. In these cases, you unfortunately have to manually configure exceptions in the /input/overrides.json file. ```json