Skip to content

Commit

Permalink
Bump version to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cohaereo committed Mar 27, 2024
1 parent 9dba76c commit 336fa53
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 24 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can add additional user facing information if it's a major breaking change.
```
Change types:
- `✨ Major Features` for version-defining changes.
- `✨ Major Changes` for version-defining changes.
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
Expand All @@ -30,7 +30,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)

## Unreleased / Rolling Release

### ✨ Major Features
## 0.4.1 - 2024-03-27

### ✨ Major Changes
- ⚠ Alkahest is no longer compatible with Avvy's Alkgui. The features provided by Alkgui are now available in Alkahest itself.
- Reworked the map loading mechanism to allow for maps to be loaded individually by @cohaereo
- Added a map and activity browser by @cohaereo
- Added a game installation detector by @cohaereo
Expand Down
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tiger-parse = { version = "0.1.3", git = "https://github.com/v4nguard/tiger-pars
] }

destiny-havok = { path = "./crates/destiny-havok" }
destiny-pkg = "0.9.8"
destiny-pkg = "0.9.9"

anyhow = { version = "1.0.71" }
winit = { version = "0.28" }
Expand Down Expand Up @@ -89,12 +89,14 @@ build-time = "0.1.3"
rustc-hash = "1.1.0"
once_cell = "1.19.0"
directories = "5.0.1"
game-detector = "0.1.1"
game-detector = "0.1.3"
tracing-log = "0.2.0"

[features]
default = ["discord_rpc"]
tracy = []
# Ensures all TFX opcodes are interpreted
# Disable sorting the map list
keep_map_order = []
# TODO(cohae): This should be a runtime configuration setting?
discord_rpc = ["dep:discord-rpc-client"]

Expand Down
2 changes: 1 addition & 1 deletion crates/alkahest-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
alkahest-pm = { path = "../alkahest-pm" }
binrw = "0.13.3"
destiny-pkg = "0.9.8"
destiny-pkg = "0.9.9"
glam = { version = "0.25" }
tiger-parse = { version = "0.1.3", git = "https://github.com/v4nguard/tiger-parse", features = [
"check_types",
Expand Down
2 changes: 1 addition & 1 deletion crates/alkahest-pm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
anyhow = "1.0.79"
destiny-pkg = "0.9.8"
destiny-pkg = "0.9.9"

lazy_static = "1.4.0"
parking_lot = "0.12.1"
43 changes: 31 additions & 12 deletions src/game_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ use winit::{
dpi::PhysicalSize,
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
platform::run_return::EventLoopExtRunReturn,
platform::{run_return::EventLoopExtRunReturn, windows::WindowBuilderExtWindows},
};

use crate::{
icons::{ICON_CONTROLLER, ICON_MICROSOFT, ICON_STEAM},
icons::{ICON_CONTROLLER, ICON_FOLDER_OPEN, ICON_MICROSOFT, ICON_STEAM},
overlays::{
big_button::BigButton,
gui::{GuiManager, PreDrawResult},
Expand All @@ -29,11 +29,16 @@ use crate::{

/// Creates a temporary window with egui to select a game installation
/// This function should not be called in another render loop, as it will hang until this function completes
pub fn select_game_installation(event_loop: &mut EventLoop<()>) -> anyhow::Result<String> {
pub fn select_game_installation(
event_loop: &mut EventLoop<()>,
icon: &winit::window::Icon,
) -> anyhow::Result<String> {
let window = winit::window::WindowBuilder::new()
.with_title("Alkahest")
.with_inner_size(PhysicalSize::new(320, 320))
.with_min_inner_size(PhysicalSize::new(320, 480))
.with_window_icon(Some(icon.clone()))
.with_taskbar_icon(Some(icon.clone()))
.build(event_loop)?;

let window = Arc::new(window);
Expand Down Expand Up @@ -124,15 +129,29 @@ pub fn select_game_installation(event_loop: &mut EventLoop<()>) -> anyhow::Resul
}
}

// if BigButton::new(ICON_FOLDER_OPEN, "Browse")
// .full_width()
// .ui(ui)
// .clicked()
// {
// let dialog = native_dialog::FileDialog::new()
// .set_title("Select Destiny 2 packages directory")
// .show_open_single_dir()?;
// }
if BigButton::new(ICON_FOLDER_OPEN, "Browse")
.full_width()
.ui(ui)
.clicked()
{
if let Ok(Some(path)) = native_dialog::FileDialog::new()
.set_title("Select Destiny 2 packages directory")
.show_open_single_dir() {
if path.ends_with("packages") {
selected_path = Ok(path.parent().unwrap().to_string_lossy().to_string());
*control_flow = ControlFlow::Exit;
} else if path.ends_with("Destiny 2") {
// cohae: Idiot-proofing this a bit
selected_path = Ok(path.to_string_lossy().to_string());
*control_flow = ControlFlow::Exit;
} else {
native_dialog::MessageDialog::new()
.set_title("Invalid directory")
.set_text("The selected directory is not a packages directory. Please select the packages directory of your game installation.")
.show_alert().ok();
}
}
}
});

PreDrawResult::Continue
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use technique::Technique;
use text::GlobalStringmap;
use tiger_parse::PackageManagerExt;
use tracing::level_filters::LevelFilter;
use tracing_log::LogTracer;
use tracing_subscriber::{layer::SubscriberExt, EnvFilter, Layer};
use windows::Win32::{
Foundation::DXGI_STATUS_OCCLUDED,
Expand Down Expand Up @@ -197,6 +198,7 @@ pub async fn main() -> anyhow::Result<()> {
None
};

LogTracer::init()?;
tracing::subscriber::set_global_default(
tracing_subscriber::registry()
.with(tracy_layer)
Expand Down Expand Up @@ -227,7 +229,7 @@ pub async fn main() -> anyhow::Result<()> {
PathBuf::from_str(&p).context("Invalid package directory")?
} else {
let path = PathBuf::from_str(
&game_selector::select_game_installation(&mut event_loop)
&game_selector::select_game_installation(&mut event_loop, &icon)
.context("No game installation selected")?,
)
.unwrap();
Expand Down
3 changes: 3 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ impl MapList {
})
.collect();

#[cfg(not(feature = "keep_map_order"))]
self.maps.sort_by_key(|m| m.name.clone());

self.updated = true;
self.current_map = 0;
self.previous_map = 0;
Expand Down
17 changes: 17 additions & 0 deletions src/overlays/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ impl Overlay for MenuBar {

ui.separator();

if ui
.button("Change package directory")
.on_hover_text("Will restart Alkahest")
.clicked()
{
config::with_mut(|c| c.packages_directory = None);
config::persist();

// Spawn the new process
std::process::Command::new(std::env::current_exe().unwrap())
.args(std::env::args().skip(1))
.spawn()
.expect("Failed to spawn the new alkahest process");

std::process::exit(0);
}

if ui.button("Changelog").clicked() {
self.changelog_open = true;
ui.close_menu();
Expand Down

0 comments on commit 336fa53

Please sign in to comment.