mirror of
https://github.com/G2-Games/lbee-utils.git
synced 2025-04-19 07:12:55 -05:00
Upgraded dependencies, reduced binary sizes
This commit is contained in:
parent
2f881ce294
commit
a7a486999d
9 changed files with 31 additions and 34 deletions
|
@ -10,9 +10,9 @@ license = "MIT"
|
|||
authors.workspace = true
|
||||
|
||||
[dependencies]
|
||||
byteorder = "1.5.0"
|
||||
log = "0.4.22"
|
||||
thiserror = "1.0.61"
|
||||
byteorder-lite = "0.1"
|
||||
log = "0.4"
|
||||
thiserror = "2.0"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use byteorder::WriteBytesExt;
|
||||
use byteorder_lite::WriteBytesExt;
|
||||
use std::io::{self, Write};
|
||||
|
||||
use crate::LE;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
pub mod entry;
|
||||
pub mod header;
|
||||
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use byteorder_lite::{LE, ReadBytesExt, WriteBytesExt};
|
||||
use header::Header;
|
||||
use log::{debug, info};
|
||||
use std::{
|
||||
|
@ -12,8 +12,6 @@ use std::{
|
|||
};
|
||||
use thiserror::Error;
|
||||
|
||||
type LE = LittleEndian;
|
||||
|
||||
use crate::{entry::Entry, header::PakFlags};
|
||||
|
||||
/// An error associated with a PAK file
|
||||
|
|
|
@ -12,12 +12,12 @@ publish = false
|
|||
[dependencies]
|
||||
colog = "1.3.0"
|
||||
cz = { path = "../cz/" }
|
||||
eframe = { version = "0.28.1", default-features = false, features = ["wayland", "x11", "accesskit", "default_fonts", "wgpu"] }
|
||||
egui_extras = "0.28.1"
|
||||
image = { version = "0.25.5", default-features = false, features = ["png"] }
|
||||
eframe = { version = "0.29", default-features = false, features = ["wayland", "x11", "accesskit", "default_fonts", "wgpu"] }
|
||||
egui_extras = "0.29"
|
||||
image = { version = "0.25", default-features = false, features = ["png"] }
|
||||
log = "0.4.22"
|
||||
luca_pak = { path = "../luca_pak/" }
|
||||
rfd = "0.14.1"
|
||||
rfd = "0.15"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||
|
||||
use colog;
|
||||
use eframe::egui::{self, ColorImage, Image, TextureFilter, TextureHandle, TextureOptions};
|
||||
use eframe::egui::{self, ColorImage, Image, TextureFilter, TextureHandle, TextureOptions, ThemePreference};
|
||||
use log::error;
|
||||
use luca_pak::{entry::EntryType, Pak};
|
||||
use std::fs;
|
||||
|
@ -13,7 +13,6 @@ fn main() -> eframe::Result {
|
|||
|
||||
let options = eframe::NativeOptions {
|
||||
viewport: egui::ViewportBuilder::default().with_inner_size([1024.0, 800.0]),
|
||||
follow_system_theme: true,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
@ -31,7 +30,6 @@ fn main() -> eframe::Result {
|
|||
struct PakExplorer {
|
||||
open_file: Option<Pak>,
|
||||
selected_entry: Option<luca_pak::entry::Entry>,
|
||||
entry_text: String,
|
||||
image_texture: Option<egui::TextureHandle>,
|
||||
hex_string: Option<Vec<String>>,
|
||||
}
|
||||
|
@ -43,7 +41,6 @@ impl Default for PakExplorer {
|
|||
selected_entry: None,
|
||||
image_texture: None,
|
||||
hex_string: None,
|
||||
entry_text: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +49,7 @@ impl eframe::App for PakExplorer {
|
|||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
ui.heading("PAK File Explorer");
|
||||
ctx.options_mut(|o| o.theme_preference = ThemePreference::System);
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
if ui.button("Open file").clicked() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "utils"
|
||||
version = "0.2.0"
|
||||
name = "lbee-utils"
|
||||
version = "0.2.1"
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later"
|
||||
authors.workspace = true
|
||||
|
@ -15,9 +15,9 @@ name = "pakutil"
|
|||
[dependencies]
|
||||
cz = { path = "../cz/" }
|
||||
luca_pak = { path = "../luca_pak/" }
|
||||
|
||||
image = { version = "0.25", default-features = false, features = ["png"] }
|
||||
clap = { version = "4.5", features = ["derive", "error-context"] }
|
||||
owo-colors = "4.1"
|
||||
|
||||
[build-dependencies]
|
||||
vergen-gix = { version = "1.0", features = ["build", "cargo", "rustc", "si"] }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use clap::{error::ErrorKind, Error, Parser, Subcommand};
|
||||
use image::ColorType;
|
||||
use lbee_utils::version;
|
||||
use std::{
|
||||
fs,
|
||||
path::{Path, PathBuf},
|
||||
|
@ -71,14 +72,7 @@ fn main() {
|
|||
let cli = Cli::parse();
|
||||
|
||||
if cli.version {
|
||||
println!(
|
||||
"{}, {} v{}-{} ({})",
|
||||
env!("CARGO_BIN_NAME"),
|
||||
env!("CARGO_PKG_NAME"),
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
&env!("VERGEN_GIT_SHA")[0..=6],
|
||||
env!("VERGEN_GIT_COMMIT_DATE"),
|
||||
);
|
||||
println!("{}", version(env!("CARGO_BIN_NAME")));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use clap::{
|
|||
Parser, Subcommand,
|
||||
};
|
||||
use luca_pak::Pak;
|
||||
use lbee_utils::version;
|
||||
use std::{fs, path::PathBuf, process::exit};
|
||||
|
||||
/// Utility to maniuplate PAK archive files from the LUCA System game engine by
|
||||
|
@ -10,6 +11,7 @@ use std::{fs, path::PathBuf, process::exit};
|
|||
#[derive(Parser)]
|
||||
#[command(name = "PAK Utility")]
|
||||
#[command(author, version, about, long_about = None, disable_version_flag = true)]
|
||||
#[command(arg_required_else_help(true))]
|
||||
struct Cli {
|
||||
/// Show program version information
|
||||
#[arg(short('V'), long)]
|
||||
|
@ -64,14 +66,7 @@ fn main() {
|
|||
let cli = Cli::parse();
|
||||
|
||||
if cli.version {
|
||||
println!(
|
||||
"{}, {} v{}-{} ({})",
|
||||
env!("CARGO_BIN_NAME"),
|
||||
env!("CARGO_PKG_NAME"),
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
&env!("VERGEN_GIT_SHA")[0..=6],
|
||||
env!("VERGEN_GIT_COMMIT_DATE"),
|
||||
);
|
||||
println!("{}", version(env!("CARGO_BIN_NAME")));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
12
utils/src/lib.rs
Normal file
12
utils/src/lib.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
use owo_colors::OwoColorize;
|
||||
|
||||
pub fn version(bin_name: &str) -> String {
|
||||
format!(
|
||||
"{}, {} v{} ({}, {})",
|
||||
bin_name,
|
||||
env!("CARGO_PKG_NAME").cyan(),
|
||||
env!("CARGO_PKG_VERSION").blue(),
|
||||
(&env!("VERGEN_GIT_SHA")[0..=6]).green(),
|
||||
env!("VERGEN_GIT_COMMIT_DATE").green(),
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue