Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e7b4a75c8 | ||
|
|
f5954446d1 | ||
|
|
e6bdba1137 | ||
|
|
9716157e3b | ||
|
|
6e35123b5d | ||
|
|
38e3a39782 |
No files matched your search
+19
-1
@@ -2,6 +2,22 @@
|
||||
|
||||
## [Unreleased] - ReleaseDate
|
||||
|
||||
## [0.2.2] - 2025-10-29
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix version file
|
||||
|
||||
## [0.2.1] - 2025-10-28
|
||||
|
||||
### Added
|
||||
|
||||
- Add stub for `TakeScreenshot` api function
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix crash caused by missing `SetForeground` api function
|
||||
|
||||
## [0.2.0] - 2025-10-28
|
||||
|
||||
### Added
|
||||
@@ -46,8 +62,10 @@
|
||||
- First release
|
||||
|
||||
<!-- next-url -->
|
||||
[Unreleased]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.0...HEAD
|
||||
[Unreleased]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.2...HEAD
|
||||
|
||||
[0.2.2]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.1...v0.2.2
|
||||
[0.2.1]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.0...v0.2.1
|
||||
[0.2.0]: https://github.com/meehl/rusty-path-of-building/compare/v0.1.2...v0.2.0
|
||||
[0.1.2]: https://github.com/meehl/rusty-path-of-building/compare/v0.1.1...v0.1.2
|
||||
[0.1.1]: https://github.com/meehl/rusty-path-of-building/compare/v0.1.0...v0.1.1
|
||||
|
||||
Generated
+1
-1
@@ -2519,7 +2519,7 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
||||
|
||||
[[package]]
|
||||
name = "rusty-path-of-building"
|
||||
version = "0.2.0"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"anyhow",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ authors = ["meehl"]
|
||||
description = "Cross-platform runtime for Path of Building"
|
||||
repository = "https://github.com/meehl/rusty-path-of-building"
|
||||
license = "MIT"
|
||||
version = "0.2.0"
|
||||
version = "0.2.2"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Rusty Path of Building is a cross-platform runtime for [Path of Building](https://github.com/PathOfBuildingCommunity/PathOfBuilding) and [Path of Building 2](https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2). Like the [official runtime](https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic), it serves as a host environment for PoB by implementing the API used by the application's Lua logic, as well as rendering, window management, and input handling.
|
||||
|
||||
This project was primarily created to allow Path of Building to run natively on Linux. It is written in Rust (in case you couldn't already tell from the unimaginative name) and is designed to work across all platforms, though only Linux has been tested so far.
|
||||
This project was primarily created to allow Path of Building to run natively on Linux. It is written in Rust (in case you couldn't already tell from the unimaginative name) and should run on all platforms, though only Linux has been tested so far.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -10,8 +10,6 @@ This project was primarily created to allow Path of Building to run natively on
|
||||
rusty-path-of-building [poe1|poe2]
|
||||
```
|
||||
|
||||
NOTE: The first run takes a bit longer because Path of Building's assets need to be downloaded.
|
||||
|
||||
## Installation
|
||||
|
||||
### Arch (AUR)
|
||||
@@ -34,6 +32,7 @@ Path of Building's Lua code requires the following C libraries:
|
||||
|
||||
- [Lua-cURLv3](https://github.com/Lua-cURL/Lua-cURLv3)
|
||||
- [luautf8](https://github.com/starwing/luautf8)
|
||||
- [luasocket](https://github.com/lunarmodules/luasocket)
|
||||
- `lzip` - The source is included in this repo under `lua/libs/lzip` and requires [zlib](https://www.zlib.net/) to compile. Build it with `make LUA_IMPL=luajit`.
|
||||
|
||||
Please refer to the [Lua documentation](https://www.lua.org/manual/5.1/manual.html#pdf-package.cpath) to see how it locates libraries.
|
||||
|
||||
+5
-1
@@ -13,7 +13,7 @@ use crate::{
|
||||
},
|
||||
rendering::PoBString,
|
||||
search_handle::new_search_handle,
|
||||
window::{get_screen_scale, get_screen_size, set_window_title},
|
||||
window::{get_screen_scale, get_screen_size, set_foreground, set_window_title},
|
||||
},
|
||||
lua::ContextSocket,
|
||||
};
|
||||
@@ -62,6 +62,9 @@ pub fn register_globals(lua: &Lua) -> LuaResult<()> {
|
||||
globals.set("OpenURL", lua.create_function(open_url)?)?;
|
||||
globals.set("RenderInit", lua.create_function(render_init)?)?;
|
||||
|
||||
let take_screenshot = |_: &Lua, ()| -> LuaResult<()> { Ok(()) }; // stub
|
||||
globals.set("TakeScreenshot", lua.create_function(take_screenshot)?)?;
|
||||
|
||||
// compression
|
||||
globals.set("Inflate", lua.create_function(inflate)?)?;
|
||||
globals.set("Deflate", lua.create_function(deflate)?)?;
|
||||
@@ -84,6 +87,7 @@ pub fn register_globals(lua: &Lua) -> LuaResult<()> {
|
||||
globals.set("GetScreenSize", lua.create_function(get_screen_size)?)?;
|
||||
globals.set("GetScreenScale", lua.create_function(get_screen_scale)?)?;
|
||||
globals.set("SetWindowTitle", lua.create_function(set_window_title)?)?;
|
||||
globals.set("SetForeground", lua.create_function(set_foreground)?)?;
|
||||
|
||||
// lua
|
||||
globals.set("PCall", lua.create_function(protected_call)?)?;
|
||||
|
||||
@@ -26,3 +26,9 @@ pub fn set_window_title(l: &Lua, title: String) -> LuaResult<()> {
|
||||
socket.window().set_window_title(&title);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_foreground(l: &Lua, _: ()) -> LuaResult<()> {
|
||||
let socket = l.app_data_ref::<&'static ContextSocket>().unwrap();
|
||||
socket.window().focus();
|
||||
Ok(())
|
||||
}
|
||||
+10
-4
@@ -12,7 +12,7 @@ use flate2::read::GzDecoder;
|
||||
use regex::Regex;
|
||||
use std::{
|
||||
fs::{self},
|
||||
io::{Write, copy},
|
||||
io::copy,
|
||||
path::{Path, PathBuf},
|
||||
sync::mpsc::{self, Receiver, TryRecvError},
|
||||
thread,
|
||||
@@ -158,6 +158,14 @@ fn install<P: AsRef<Path>>(
|
||||
// Skip installation if version file exists
|
||||
let version_file_path = target_dir.as_ref().join("rpob.version");
|
||||
if version_file_path.exists() {
|
||||
let old_version = fs::read_to_string(&version_file_path).unwrap();
|
||||
let current_version = env!("CARGO_PKG_VERSION");
|
||||
|
||||
if old_version != current_version {
|
||||
log::info!("New version detected: {old_version} -> {current_version}");
|
||||
fs::write(&version_file_path, current_version).unwrap();
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -166,9 +174,7 @@ fn install<P: AsRef<Path>>(
|
||||
set_branch_and_platform(&target_dir)?;
|
||||
|
||||
// write version file
|
||||
let mut version_file = fs::File::create(version_file_path)?;
|
||||
let pkg_version = env!("CARGO_PKG_VERSION");
|
||||
version_file.write_all(pkg_version.as_bytes())?;
|
||||
fs::write(&version_file_path, env!("CARGO_PKG_VERSION")).unwrap();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -42,4 +42,10 @@ impl WindowState {
|
||||
pub fn logical_size(&self) -> LogicalSize<u32> {
|
||||
self.size.to_logical(self.scale_factor)
|
||||
}
|
||||
|
||||
pub fn focus(&self) {
|
||||
if let Some(ref window) = self.window {
|
||||
window.focus_window();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user