mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
add names field to mods thingy
This commit is contained in:
parent
5663b1ec04
commit
69f4eb30a2
3 changed files with 22 additions and 2 deletions
|
@ -229,7 +229,7 @@ impl Globals {
|
||||||
let platform = 0x1221bc0 as *mut Platform;
|
let platform = 0x1221bc0 as *mut Platform;
|
||||||
let filenames = 0x1207bd4 as *mut StdVec<StdString>;
|
let filenames = 0x1207bd4 as *mut StdVec<StdString>;
|
||||||
let inventory = 0x12224f0 as *mut Inventory;
|
let inventory = 0x12224f0 as *mut Inventory;
|
||||||
let mods = 0x1207e9c as *mut Mods;
|
let mods = 0x1207e90 as *mut Mods;
|
||||||
Self {
|
Self {
|
||||||
world_seed,
|
world_seed,
|
||||||
new_game_count,
|
new_game_count,
|
||||||
|
|
|
@ -174,6 +174,25 @@ impl Debug for CString {
|
||||||
f.debug_tuple("CString").field(&self.to_string()).finish()
|
f.debug_tuple("CString").field(&self.to_string()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct CStr<const N: usize>(pub [u8; N]);
|
||||||
|
impl<const N: usize> Display for CStr<N> {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
|
let mut string = String::new();
|
||||||
|
for c in self.0 {
|
||||||
|
if c == 0 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
string.push(char::from(c));
|
||||||
|
}
|
||||||
|
write!(f, "{string}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl<const N: usize> Debug for CStr<N> {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_tuple("CStr").field(&self.to_string()).finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct StdVec<T> {
|
pub struct StdVec<T> {
|
||||||
pub start: *mut T,
|
pub start: *mut T,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::lua::LuaState;
|
use crate::lua::LuaState;
|
||||||
use crate::noita::types::{StdMap, StdString, StdVec, Vec2};
|
use crate::noita::types::{CStr, StdMap, StdString, StdVec, Vec2};
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct GlobalStatsVTable {}
|
pub struct GlobalStatsVTable {}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -95,6 +95,7 @@ pub struct Language {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct Mods {
|
pub struct Mods {
|
||||||
|
pub names: StdVec<CStr<0x28>>,
|
||||||
pub list: StdVec<Mod>,
|
pub list: StdVec<Mod>,
|
||||||
}
|
}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue