diff --git a/README.md b/README.md index 79fefe407b530bfff20a436f55cf8c42b80ef16d..59cc41821dd5bd27f702204c554278c13a9fd0f0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ player can run their own client and connect to the same server in the same local ## 2 Compile Instructions This project only works on UNIX systems (Linux / macOS). We thus only explain the how to compile the game on these -systems. The following description was tested on Ubuntu 20.04 and on macOS Sequoia. +systems. The following description was tested on Ubuntu 22.04 and on macOS Sequoia. ### 2.1 Prepare OS Environment @@ -44,7 +44,7 @@ running `git clone https://gitlab.ethz.ch/beckermar/wizard.git` (clone with HTTP Cloning the game as a first step also makes provided scripts for preparing the OS environment and for compiling the code available. -#### 2.1.1 Ubuntu 20.04 +#### 2.1.1 Ubuntu 22.04 The necessary packages and software can either be installed manually or by running the provided script. @@ -53,8 +53,9 @@ To use the provided script, run `bash scripts/prepare_ubuntu.sh` inside the **wi To manually prepare Ubuntu, execute the following commands: 1. `sudo apt-get update` (update package list) 2. `sudo apt-get install build-essential` (install software to build from source) -3. `sudo apt-get install libwxgtk3.0-gtk3-dev` (install wxwidgets, use libwxgtk3.2-dev on Ubuntu 24.04) +3. `sudo apt-get install libwxgtk3.2-dev` (install wxwidgets, use libwxgtk3.0-gtk3-dev on Ubuntu 20.04) 4. `sudo apt-get install cmake` (install cmake) +5. `sudo reboot` (reboot system) #### 2.1.2 macOS Sequoia @@ -71,7 +72,7 @@ To manually prepare macOS, execute the following commands: Compiling the code creates executables for the client (Wizard-client) and for the server (Wizard-server). -#### 2.2.1 Ubuntu 20.04 +#### 2.2.1 Ubuntu 22.04 Compiling the code can be done by running the provided script. diff --git a/scripts/compile_macos.sh b/scripts/compile_macos.sh index a92f667e6b1155fe45d80745d01b2c9b9a27a478..aa56848913b7cb8ba23dafb153d7d8a66b778198 100644 --- a/scripts/compile_macos.sh +++ b/scripts/compile_macos.sh @@ -6,9 +6,7 @@ FONT_NAME1="JunicodeBold.ttf" FONT_NAME2="MagicSchoolOne.ttf" # path to the system fonts directory -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - FONT_DIR="$HOME/.fonts" -elif [[ "$OSTYPE" == "darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then FONT_DIR="$HOME/Library/Fonts" else echo "Unsupported operating system. Exiting." diff --git a/scripts/compile_ubuntu.sh b/scripts/compile_ubuntu.sh index 9c10f128dd6520d8bb8c1af9b832264a3d4117e0..162a3e9d83bcb70ab5c70b7755d50f36967a7b32 100644 --- a/scripts/compile_ubuntu.sh +++ b/scripts/compile_ubuntu.sh @@ -5,35 +5,19 @@ ASSETS_DIR="./assets" FONT_NAME1="JunicodeBold.ttf" FONT_NAME2="MagicSchoolOne.ttf" -# path to the system fonts directory -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - FONT_DIR="$HOME/.fonts" -elif [[ "$OSTYPE" == "darwin"* ]]; then - FONT_DIR="$HOME/Library/Fonts" +# create new directory for wizard fonts if it doesn't exist yet +if [ ! -d "~/.local/share/fonts" ]; then + echo "Directory ~/.local/share/fonts does not exist. Creating it now..." + mkdir ~/.local/share/fonts + echo "Directory ~/.local/share/fonts created successfully." else - echo "Unsupported operating system. Exiting." - exit 1 + echo "Directory ~/.local/share/fonts already exists." fi -# check if the .ttf files exists -if [[ ! -f "$ASSETS_DIR/$FONT_NAME1" ]]; then - echo "Font file $FONT_NAME1 not found in $ASSETS_DIR. Exiting." - exit 1 -fi -if [[ ! -f "$ASSETS_DIR/$FONT_NAME2" ]]; then - echo "Font file $FONT_NAME2 not found in $ASSETS_DIR. Exiting." - exit 1 -fi +# copy the fonts into the new directory +cp $ASSETS_DIR/$FONT_NAME1 ~/.local/share/fonts +cp $ASSETS_DIR/$FONT_NAME2 ~/.local/share/fonts -# copy font 1 -cp "$ASSETS_DIR/$FONT_NAME1" "$FONT_DIR" -# refresh cache -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - fc-cache -f -v -fi - -# copy font 2 -cp "$ASSETS_DIR/$FONT_NAME2" "$FONT_DIR" # refresh cache if [[ "$OSTYPE" == "linux-gnu"* ]]; then fc-cache -f -v @@ -49,4 +33,4 @@ cd ../.. mkdir cmake-build-debug cd cmake-build-debug || exit cmake .. -make \ No newline at end of file +make diff --git a/scripts/prepare_ubuntu.sh b/scripts/prepare_ubuntu.sh index c398c5643585e56ef82bdd07961b86d23583407d..550ef73564bd3dcfced2ecf97c0a3f9ec3727276 100644 --- a/scripts/prepare_ubuntu.sh +++ b/scripts/prepare_ubuntu.sh @@ -1,5 +1,6 @@ #!/bin/bash sudo apt-get update sudo apt-get install build-essential -sudo apt-get install libwxgtk3.0-gtk3-dev -sudo apt-get install cmake \ No newline at end of file +sudo apt-get install libwxgtk3.2-dev +sudo apt-get install cmake +sudo reboot \ No newline at end of file