Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9716157e3b | ||
|
|
6e35123b5d | ||
|
|
38e3a39782 |
No files matched your search
+12
-1
@@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
## [Unreleased] - ReleaseDate
|
## [Unreleased] - ReleaseDate
|
||||||
|
|
||||||
|
## [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
|
## [0.2.0] - 2025-10-28
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -46,8 +56,9 @@
|
|||||||
- First release
|
- First release
|
||||||
|
|
||||||
<!-- next-url -->
|
<!-- 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.1...HEAD
|
||||||
|
|
||||||
|
[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.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.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
|
[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]]
|
[[package]]
|
||||||
name = "rusty-path-of-building"
|
name = "rusty-path-of-building"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ authors = ["meehl"]
|
|||||||
description = "Cross-platform runtime for Path of Building"
|
description = "Cross-platform runtime for Path of Building"
|
||||||
repository = "https://github.com/meehl/rusty-path-of-building"
|
repository = "https://github.com/meehl/rusty-path-of-building"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -13,7 +13,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
rendering::PoBString,
|
rendering::PoBString,
|
||||||
search_handle::new_search_handle,
|
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,
|
lua::ContextSocket,
|
||||||
};
|
};
|
||||||
@@ -62,6 +62,9 @@ pub fn register_globals(lua: &Lua) -> LuaResult<()> {
|
|||||||
globals.set("OpenURL", lua.create_function(open_url)?)?;
|
globals.set("OpenURL", lua.create_function(open_url)?)?;
|
||||||
globals.set("RenderInit", lua.create_function(render_init)?)?;
|
globals.set("RenderInit", lua.create_function(render_init)?)?;
|
||||||
|
|
||||||
|
let take_screenshot = |_: &Lua, ()| -> LuaResult<()> { Ok(()) }; // stub
|
||||||
|
globals.set("TakeScreenshot", lua.create_function(take_screenshot)?)?;
|
||||||
|
|
||||||
// compression
|
// compression
|
||||||
globals.set("Inflate", lua.create_function(inflate)?)?;
|
globals.set("Inflate", lua.create_function(inflate)?)?;
|
||||||
globals.set("Deflate", lua.create_function(deflate)?)?;
|
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("GetScreenSize", lua.create_function(get_screen_size)?)?;
|
||||||
globals.set("GetScreenScale", lua.create_function(get_screen_scale)?)?;
|
globals.set("GetScreenScale", lua.create_function(get_screen_scale)?)?;
|
||||||
globals.set("SetWindowTitle", lua.create_function(set_window_title)?)?;
|
globals.set("SetWindowTitle", lua.create_function(set_window_title)?)?;
|
||||||
|
globals.set("SetForeground", lua.create_function(set_foreground)?)?;
|
||||||
|
|
||||||
// lua
|
// lua
|
||||||
globals.set("PCall", lua.create_function(protected_call)?)?;
|
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);
|
socket.window().set_window_title(&title);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_foreground(l: &Lua, _: ()) -> LuaResult<()> {
|
||||||
|
let socket = l.app_data_ref::<&'static ContextSocket>().unwrap();
|
||||||
|
socket.window().focus();
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -42,4 +42,10 @@ impl WindowState {
|
|||||||
pub fn logical_size(&self) -> LogicalSize<u32> {
|
pub fn logical_size(&self) -> LogicalSize<u32> {
|
||||||
self.size.to_logical(self.scale_factor)
|
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