Build tools and some fixes
This commit is contained in:
parent
d15dc4ff37
commit
6e1a8738e0
|
@ -0,0 +1 @@
|
|||
icon.png
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
exec $APPDIR/usr/bin/learn-hieroglyph
|
Binary file not shown.
After Width: | Height: | Size: 889 B |
|
@ -0,0 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Learn Hieroglyph
|
||||
Exec=learn-hieroglyph
|
||||
Icon=icon
|
||||
Categories=Utility;
|
Binary file not shown.
Binary file not shown.
4
build.rs
4
build.rs
|
@ -30,6 +30,10 @@ fn main() {
|
|||
.arg(&path)
|
||||
.spawn()
|
||||
.expect("failed to copy schema to dest. dir");
|
||||
Command::new("glib-compile-schemas")
|
||||
.arg("resources")
|
||||
.spawn()
|
||||
.expect("Could not compile glib schemas. Probably you don't have glib build tools on your system.");
|
||||
Command::new("glib-compile-schemas")
|
||||
.arg(path)
|
||||
.spawn()
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
#This script is intended to help with building for windows systems. Everyting was
|
||||
#snatched from https://martinber.github.io/gtk-rs.github.io/docs-src/tutorial/cross.
|
||||
#Before executing, you need to install some libraries.
|
||||
#Arch linux: yay -S mingw-w64-gtk4
|
||||
#Other distros: Feeling pity for u :)
|
||||
#Useful: https://web.archive.org/web/20180719181100/http://win32builder.gnome.org/
|
||||
|
||||
if [[ $1 == "" ]]; then
|
||||
echo "[WARNING] PKG_CONFIG_PATH as a first argument was not defined. Using default value '/usr/i686-w64-mingw32/lib/pkgconfig'"
|
||||
export PKG_CONFIG_PATH=/usr/i686-w64-mingw32/lib/pkgconfig
|
||||
else
|
||||
echo "[INFO] Setting PKG_CONFIG_PATH to '$1'"
|
||||
export PKG_CONFIG_PATH=$1
|
||||
fi
|
||||
export PKG_CONFIG_ALLOW_CROSS=1
|
||||
cargo build --target=x86_64-pc-windows-gnu --release
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
if ! command -v appimagetool &> /dev/null
|
||||
then
|
||||
echo "No appimage tool installed. Please, install it."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cargo build --release
|
||||
|
||||
mkdir -p AppImage/usr/bin
|
||||
mkdir -p AppImage/usr/share/glib-2.0/schemas
|
||||
cp resources/gschemas.compiled AppImage/usr/share/glib-2.0/schemas/ # Copy settings
|
||||
cp target/release/learn-hieroglyph AppImage/usr/bin
|
||||
|
||||
chmod +x AppImage/AppRun
|
||||
ARCH=x86_64 appimagetool AppImage learn-hieroglyph.AppImage
|
|
@ -1,7 +1,4 @@
|
|||
/*
|
||||
TODOS:
|
||||
4. With incorrect answerd card, it shows hieroglyp, reading ant its translation
|
||||
*/
|
||||
#![windows_subsystem = "windows"]
|
||||
|
||||
mod db;
|
||||
mod game;
|
||||
|
|
|
@ -70,8 +70,6 @@ impl ObjectImpl for MemoryCardsGameScene {
|
|||
e.set_text("");
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
impl MemoryCardsGameScene {
|
||||
|
@ -83,8 +81,8 @@ impl MemoryCardsGameScene {
|
|||
self.card_display.set_reading(card.reading());
|
||||
self.card_display.set_translation(card.translation());
|
||||
self.card_display.update_file_for_image();
|
||||
},
|
||||
None => { self.obj().show_no_cards_msg() }
|
||||
}
|
||||
None => self.obj().show_no_cards_msg(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +112,12 @@ fn generate_card() -> Option<CardDisplay> {
|
|||
None => return None,
|
||||
};
|
||||
let generated_card = CardDisplay::new(
|
||||
&(get_images_store_path() + "/" + &random_card.image_path().unwrap()),
|
||||
&(get_images_store_path()
|
||||
+ "/"
|
||||
+ match &random_card.image_path() {
|
||||
Some(path) => &path[..],
|
||||
None => return None,
|
||||
}),
|
||||
&random_card.hieroglyph().unwrap(),
|
||||
Some(&random_card.reading().unwrap()),
|
||||
&random_card.translation().unwrap(),
|
||||
|
|
Loading…
Reference in New Issue