mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
make clippy happy(nightly)
This commit is contained in:
parent
79c4a9a15e
commit
5c1dafb239
10 changed files with 267 additions and 296 deletions
|
@ -162,20 +162,18 @@ impl EntityID {
|
||||||
&& self.check_all_phys_init().unwrap_or(false)
|
&& self.check_all_phys_init().unwrap_or(false)
|
||||||
{
|
{
|
||||||
let body_id = self.get_physics_body_ids().unwrap_or_default();
|
let body_id = self.get_physics_body_ids().unwrap_or_default();
|
||||||
if !body_id.is_empty() {
|
if !body_id.is_empty()
|
||||||
if let Ok(iter) = EntityID::get_with_tag("ew_peer") {
|
&& let Ok(iter) = EntityID::get_with_tag("ew_peer")
|
||||||
for com in iter
|
{
|
||||||
.filter_map(|e| {
|
for com in iter
|
||||||
e.try_get_first_component_including_disabled::<TelekinesisComponent>(
|
.filter_map(|e| {
|
||||||
None,
|
e.try_get_first_component_including_disabled::<TelekinesisComponent>(None)
|
||||||
)
|
|
||||||
.ok()
|
.ok()
|
||||||
})
|
})
|
||||||
.flatten()
|
.flatten()
|
||||||
{
|
{
|
||||||
if body_id.contains(&com.get_body_id()) {
|
if body_id.contains(&com.get_body_id()) {
|
||||||
let _ = com.set_m_state(0);
|
let _ = com.set_m_state(0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,10 +365,10 @@ impl EntityID {
|
||||||
let name = effect.effect()?;
|
let name = effect.effect()?;
|
||||||
match name {
|
match name {
|
||||||
GameEffectEnum::Custom => {
|
GameEffectEnum::Custom => {
|
||||||
if let Ok(file) = ent.filename() {
|
if let Ok(file) = ent.filename()
|
||||||
if !file.is_empty() {
|
&& !file.is_empty()
|
||||||
effects.push((GameEffectData::Custom(file.to_string()), ent))
|
{
|
||||||
}
|
effects.push((GameEffectData::Custom(file.to_string()), ent))
|
||||||
} /* else if let Ok(data) = serialize::serialize_entity(ent) {
|
} /* else if let Ok(data) = serialize::serialize_entity(ent) {
|
||||||
let n = ent.filename().unwrap_or(String::new());
|
let n = ent.filename().unwrap_or(String::new());
|
||||||
effects.push((GameEffectData::Projectile((n, data)), ent))
|
effects.push((GameEffectData::Projectile((n, data)), ent))
|
||||||
|
@ -399,31 +397,28 @@ impl EntityID {
|
||||||
fn set_frames(ent: EntityID) -> eyre::Result<()> {
|
fn set_frames(ent: EntityID) -> eyre::Result<()> {
|
||||||
if let Some(effect) =
|
if let Some(effect) =
|
||||||
ent.try_get_first_component_including_disabled::<GameEffectComponent>(None)?
|
ent.try_get_first_component_including_disabled::<GameEffectComponent>(None)?
|
||||||
|
&& effect.frames()? >= 0
|
||||||
{
|
{
|
||||||
if effect.frames()? >= 0 {
|
effect.set_frames(i32::MAX)?;
|
||||||
effect.set_frames(i32::MAX)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if let Some(life) =
|
if let Some(life) =
|
||||||
ent.try_get_first_component_including_disabled::<LifetimeComponent>(None)?
|
ent.try_get_first_component_including_disabled::<LifetimeComponent>(None)?
|
||||||
|
&& life.lifetime()? >= 0
|
||||||
{
|
{
|
||||||
if life.lifetime()? >= 0 {
|
life.set_lifetime(i32::MAX)?;
|
||||||
life.set_lifetime(i32::MAX)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
let local_effects = self.get_game_effects()?;
|
let local_effects = self.get_game_effects()?;
|
||||||
for (i, (e1, ent)) in local_effects.iter().enumerate() {
|
for (i, (e1, ent)) in local_effects.iter().enumerate() {
|
||||||
if let GameEffectData::Normal(e1) = e1 {
|
if let GameEffectData::Normal(e1) = e1
|
||||||
if *e1 == GameEffectEnum::Polymorph
|
&& (*e1 == GameEffectEnum::Polymorph
|
||||||
|| *e1 == GameEffectEnum::PolymorphRandom
|
|| *e1 == GameEffectEnum::PolymorphRandom
|
||||||
|| *e1 == GameEffectEnum::PolymorphUnstable
|
|| *e1 == GameEffectEnum::PolymorphUnstable
|
||||||
|| *e1 == GameEffectEnum::PolymorphCessation
|
|| *e1 == GameEffectEnum::PolymorphCessation)
|
||||||
{
|
{
|
||||||
ent.kill();
|
ent.kill();
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (j, (e2, _)) in local_effects.iter().enumerate() {
|
for (j, (e2, _)) in local_effects.iter().enumerate() {
|
||||||
if i < j && e1 == e2 {
|
if i < j && e1 == e2 {
|
||||||
|
@ -1610,11 +1605,10 @@ impl EntityManager {
|
||||||
[const { CachedComponent::from_component::<C>() as usize }]
|
[const { CachedComponent::from_component::<C>() as usize }]
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|c| c.id == id)
|
.find(|c| c.id == id)
|
||||||
|
&& n.enabled != enabled
|
||||||
{
|
{
|
||||||
if n.enabled != enabled {
|
n.enabled = enabled;
|
||||||
n.enabled = enabled;
|
self.current_entity.set_component_enabled(id, enabled)?;
|
||||||
self.current_entity.set_component_enabled(id, enabled)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,10 +229,10 @@ fn netmanager_recv(_lua: LuaState) -> eyre::Result<Option<RawString>> {
|
||||||
NoitaInbound::Ready { .. } => bail!("Unexpected Ready message"),
|
NoitaInbound::Ready { .. } => bail!("Unexpected Ready message"),
|
||||||
NoitaInbound::ProxyToDes(proxy_to_des) => ExtState::with_global(|state| {
|
NoitaInbound::ProxyToDes(proxy_to_des) => ExtState::with_global(|state| {
|
||||||
let _lock = IN_MODULE_LOCK.lock().unwrap();
|
let _lock = IN_MODULE_LOCK.lock().unwrap();
|
||||||
if let Some(entity_sync) = &mut state.modules.entity_sync {
|
if let Some(entity_sync) = &mut state.modules.entity_sync
|
||||||
if let Err(e) = entity_sync.handle_proxytodes(proxy_to_des) {
|
&& let Err(e) = entity_sync.handle_proxytodes(proxy_to_des)
|
||||||
let _ = print_error(e);
|
{
|
||||||
}
|
let _ = print_error(e);
|
||||||
}
|
}
|
||||||
})?,
|
})?,
|
||||||
NoitaInbound::RemoteMessage {
|
NoitaInbound::RemoteMessage {
|
||||||
|
|
|
@ -566,13 +566,11 @@ impl Module for EntitySync {
|
||||||
if let Some(cost) = self
|
if let Some(cost) = self
|
||||||
.entity_manager
|
.entity_manager
|
||||||
.try_get_first_component::<ItemCostComponent>(ComponentTag::None)
|
.try_get_first_component::<ItemCostComponent>(ComponentTag::None)
|
||||||
|
&& cost.stealable()?
|
||||||
{
|
{
|
||||||
if cost.stealable()? {
|
cost.set_stealable(false)?;
|
||||||
cost.set_stealable(false)?;
|
self.entity_manager
|
||||||
self.entity_manager.get_var_or_default(
|
.get_var_or_default(const { VarName::from_str("ew_was_stealable") })?;
|
||||||
const { VarName::from_str("ew_was_stealable") },
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if let Some(vel) = self
|
if let Some(vel) = self
|
||||||
.entity_manager
|
.entity_manager
|
||||||
|
@ -706,15 +704,14 @@ impl Module for EntitySync {
|
||||||
let data = proj
|
let data = proj
|
||||||
.drain(..)
|
.drain(..)
|
||||||
.map(|(ent, mut proj)| {
|
.map(|(ent, mut proj)| {
|
||||||
if ent.is_alive() {
|
if ent.is_alive()
|
||||||
if let Ok(Some(vel)) = ent
|
&& let Ok(Some(vel)) = ent
|
||||||
.try_get_first_component_including_disabled::<VelocityComponent>(
|
.try_get_first_component_including_disabled::<VelocityComponent>(
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
proj.vel = vel.m_velocity().ok()
|
proj.vel = vel.m_velocity().ok()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
proj
|
proj
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
|
@ -142,25 +142,24 @@ impl LocalDiffModel {
|
||||||
gid,
|
gid,
|
||||||
last,
|
last,
|
||||||
}) = self.entity_entries.get(&lid)
|
}) = self.entity_entries.get(&lid)
|
||||||
|
&& !self.dont_upload.contains(&lid)
|
||||||
{
|
{
|
||||||
if !self.dont_upload.contains(&lid) {
|
if last.is_some() {
|
||||||
if last.is_some() {
|
res.push(UpdateOrUpload::Upload(FullEntityData {
|
||||||
res.push(UpdateOrUpload::Upload(FullEntityData {
|
gid: *gid,
|
||||||
gid: *gid,
|
pos: WorldPos::from_f32(current.x, current.y),
|
||||||
pos: WorldPos::from_f32(current.x, current.y),
|
data: current.spawn_info.clone(),
|
||||||
data: current.spawn_info.clone(),
|
wand: current.wand.clone().map(|(_, w, _)| w),
|
||||||
wand: current.wand.clone().map(|(_, w, _)| w),
|
//rotation: entry_pair.current.r,
|
||||||
//rotation: entry_pair.current.r,
|
drops_gold: current.drops_gold,
|
||||||
drops_gold: current.drops_gold,
|
is_charmed: current.is_charmed(),
|
||||||
is_charmed: current.is_charmed(),
|
hp: current.hp,
|
||||||
hp: current.hp,
|
counter: current.counter,
|
||||||
counter: current.counter,
|
phys: current.phys.clone(),
|
||||||
phys: current.phys.clone(),
|
synced_var: current.synced_var.clone(),
|
||||||
synced_var: current.synced_var.clone(),
|
}));
|
||||||
}));
|
} else {
|
||||||
} else {
|
self.upload.insert(lid);
|
||||||
self.upload.insert(lid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -407,18 +406,17 @@ impl LocalDiffModelTracker {
|
||||||
(info.vx, info.vy) = vel.m_velocity()?;
|
(info.vx, info.vy) = vel.m_velocity()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if entity_manager.has_tag(const { CachedTag::from_tag("card_action") }) {
|
if entity_manager.has_tag(const { CachedTag::from_tag("card_action") })
|
||||||
if let Some(vel) =
|
&& let Some(vel) =
|
||||||
entity_manager.try_get_first_component::<VelocityComponent>(ComponentTag::None)
|
entity_manager.try_get_first_component::<VelocityComponent>(ComponentTag::None)
|
||||||
{
|
{
|
||||||
let (cx, cy) = entity_manager.camera_pos();
|
let (cx, cy) = entity_manager.camera_pos();
|
||||||
if ((cx - x) as f32).powi(2) + ((cy - y) as f32).powi(2) > 512.0 * 512.0 {
|
if ((cx - x) as f32).powi(2) + ((cy - y) as f32).powi(2) > 512.0 * 512.0 {
|
||||||
vel.set_gravity_y(0.0)?;
|
vel.set_gravity_y(0.0)?;
|
||||||
vel.set_air_friction(10.0)?;
|
vel.set_air_friction(10.0)?;
|
||||||
} else {
|
} else {
|
||||||
vel.set_gravity_y(400.0)?;
|
vel.set_gravity_y(400.0)?;
|
||||||
vel.set_air_friction(0.55)?;
|
vel.set_air_friction(0.55)?;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -559,25 +557,25 @@ impl LocalDiffModelTracker {
|
||||||
.collect();
|
.collect();
|
||||||
if let Some(ai) =
|
if let Some(ai) =
|
||||||
entity_manager.try_get_first_component::<AnimalAIComponent>(ComponentTag::None)
|
entity_manager.try_get_first_component::<AnimalAIComponent>(ComponentTag::None)
|
||||||
|
&& ai.attack_ranged_use_laser_sight()?
|
||||||
|
&& !ai.is_static_turret()?
|
||||||
{
|
{
|
||||||
if ai.attack_ranged_use_laser_sight()? && !ai.is_static_turret()? {
|
info.laser = if let Some(target) = ai.m_greatest_prey()? {
|
||||||
info.laser = if let Some(target) = ai.m_greatest_prey()? {
|
if ![15, 16].contains(&ai.ai_state()?) {
|
||||||
if ![15, 16].contains(&ai.ai_state()?) {
|
Target::None
|
||||||
Target::None
|
} else if let Some(peer) = ctx.player_map.get_by_right(&target) {
|
||||||
} else if let Some(peer) = ctx.player_map.get_by_right(&target) {
|
Target::Peer(*peer)
|
||||||
Target::Peer(*peer)
|
} else if let Some(var) = target.get_var("ew_gid_lid") {
|
||||||
} else if let Some(var) = target.get_var("ew_gid_lid") {
|
if var.value_bool()? {
|
||||||
if var.value_bool()? {
|
Target::Gid(Gid(var.value_string()?.parse::<u64>()?))
|
||||||
Target::Gid(Gid(var.value_string()?.parse::<u64>()?))
|
|
||||||
} else {
|
|
||||||
Target::None
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Target::None
|
Target::None
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Target::None
|
Target::None
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Target::None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
entity_manager.files = files;
|
entity_manager.files = files;
|
||||||
|
@ -851,16 +849,13 @@ impl LocalDiffModel {
|
||||||
|
|
||||||
let (x, y) = entity.position()?;
|
let (x, y) = entity.position()?;
|
||||||
|
|
||||||
if entity_manager.has_tag(const { CachedTag::from_tag("card_action") }) {
|
if entity_manager.has_tag(const { CachedTag::from_tag("card_action") })
|
||||||
if let Some(cost) =
|
&& let Some(cost) =
|
||||||
entity_manager.try_get_first_component::<ItemCostComponent>(ComponentTag::None)
|
entity_manager.try_get_first_component::<ItemCostComponent>(ComponentTag::None)
|
||||||
{
|
&& cost.stealable()?
|
||||||
if cost.stealable()? {
|
{
|
||||||
cost.set_stealable(false)?;
|
cost.set_stealable(false)?;
|
||||||
entity_manager
|
entity_manager.get_var_or_default(const { VarName::from_str("ew_was_stealable") })?;
|
||||||
.get_var_or_default(const { VarName::from_str("ew_was_stealable") })?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let entity_kind = classify_entity(entity)?;
|
let entity_kind = classify_entity(entity)?;
|
||||||
|
@ -888,13 +883,12 @@ impl LocalDiffModel {
|
||||||
var.set_value_int(i32::from_le_bytes(lid.0.to_le_bytes()))?;
|
var.set_value_int(i32::from_le_bytes(lid.0.to_le_bytes()))?;
|
||||||
var.set_value_bool(true)?;
|
var.set_value_bool(true)?;
|
||||||
|
|
||||||
if entity_manager.has_tag(const { CachedTag::from_tag("card_action") }) {
|
if entity_manager.has_tag(const { CachedTag::from_tag("card_action") })
|
||||||
if let Some(vel) =
|
&& let Some(vel) =
|
||||||
entity_manager.try_get_first_component::<VelocityComponent>(ComponentTag::None)
|
entity_manager.try_get_first_component::<VelocityComponent>(ComponentTag::None)
|
||||||
{
|
{
|
||||||
vel.set_gravity_y(0.0)?;
|
vel.set_gravity_y(0.0)?;
|
||||||
vel.set_air_friction(10.0)?;
|
vel.set_air_friction(10.0)?;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if entity_manager
|
if entity_manager
|
||||||
|
@ -1081,19 +1075,18 @@ impl LocalDiffModel {
|
||||||
|
|
||||||
mom(entity_manager, entity_data.counter, None)?;
|
mom(entity_manager, entity_data.counter, None)?;
|
||||||
sun(entity_manager, entity_data.counter)?;
|
sun(entity_manager, entity_data.counter)?;
|
||||||
if entity_data.hp != -1.0 {
|
if entity_data.hp != -1.0
|
||||||
if let Some(damage) = entity_manager
|
&& let Some(damage) = entity_manager
|
||||||
.try_get_first_component::<DamageModelComponent>(ComponentTag::None)
|
.try_get_first_component::<DamageModelComponent>(ComponentTag::None)
|
||||||
{
|
{
|
||||||
noita_api::print(format!("a {:?} {:?}", entity, damage.0));
|
noita_api::print(format!("a {:?} {:?}", entity, damage.0));
|
||||||
if entity_data.hp > damage.max_hp_cap()? as f32 {
|
if entity_data.hp > damage.max_hp_cap()? as f32 {
|
||||||
damage.set_max_hp_cap(entity_data.hp as f64)?;
|
damage.set_max_hp_cap(entity_data.hp as f64)?;
|
||||||
}
|
|
||||||
if entity_data.hp > damage.max_hp()? as f32 {
|
|
||||||
damage.set_max_hp(entity_data.hp as f64)?;
|
|
||||||
}
|
|
||||||
damage.set_hp(entity_data.hp as f64)?;
|
|
||||||
}
|
}
|
||||||
|
if entity_data.hp > damage.max_hp()? as f32 {
|
||||||
|
damage.set_max_hp(entity_data.hp as f64)?;
|
||||||
|
}
|
||||||
|
damage.set_hp(entity_data.hp as f64)?;
|
||||||
}
|
}
|
||||||
if !entity_data.drops_gold {
|
if !entity_data.drops_gold {
|
||||||
let n = entity_manager
|
let n = entity_manager
|
||||||
|
@ -1563,11 +1556,11 @@ impl RemoteDiffModel {
|
||||||
ent_data = self.entity_infos.get_mut(&lid).unwrap_or(empty_data);
|
ent_data = self.entity_infos.get_mut(&lid).unwrap_or(empty_data);
|
||||||
}
|
}
|
||||||
EntityUpdate::LocalizeEntity(lid, peer_id) => {
|
EntityUpdate::LocalizeEntity(lid, peer_id) => {
|
||||||
if let Some((_, entity)) = self.tracked.remove_by_left(&lid) {
|
if let Some((_, entity)) = self.tracked.remove_by_left(&lid)
|
||||||
if peer_id != my_peer_id() {
|
&& peer_id != my_peer_id()
|
||||||
entity_manager.set_current_entity(entity)?;
|
{
|
||||||
safe_entitykill(entity_manager);
|
entity_manager.set_current_entity(entity)?;
|
||||||
}
|
safe_entitykill(entity_manager);
|
||||||
}
|
}
|
||||||
self.entity_infos.remove(&lid);
|
self.entity_infos.remove(&lid);
|
||||||
ent_data = empty_data;
|
ent_data = empty_data;
|
||||||
|
@ -2051,10 +2044,10 @@ impl RemoteDiffModel {
|
||||||
end = Some(i);
|
end = Some(i);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if let Some(gid) = self.lid_to_gid.get(lid) {
|
if let Some(gid) = self.lid_to_gid.get(lid)
|
||||||
if ctx.dont_spawn.contains(gid) {
|
&& ctx.dont_spawn.contains(gid)
|
||||||
continue;
|
{
|
||||||
}
|
continue;
|
||||||
}
|
}
|
||||||
let entity = spawn_entity_by_data(
|
let entity = spawn_entity_by_data(
|
||||||
&entity_info.spawn_info,
|
&entity_info.spawn_info,
|
||||||
|
@ -2170,10 +2163,10 @@ impl RemoteDiffModel {
|
||||||
projectile.target.1 as f64,
|
projectile.target.1 as f64,
|
||||||
deserialized,
|
deserialized,
|
||||||
);
|
);
|
||||||
if let Ok(Some(vel)) = deserialized.try_get_first_component::<VelocityComponent>(None) {
|
if let Ok(Some(vel)) = deserialized.try_get_first_component::<VelocityComponent>(None)
|
||||||
if let Some((vx, vy)) = projectile.vel {
|
&& let Some((vx, vy)) = projectile.vel
|
||||||
let _ = vel.set_m_velocity((vx, vy));
|
{
|
||||||
}
|
let _ = vel.set_m_velocity((vx, vy));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2255,13 +2248,12 @@ pub fn init_remote_entity(
|
||||||
}
|
}
|
||||||
entity_manager.add_tag(const { CachedTag::from_tag(DES_TAG) })?;
|
entity_manager.add_tag(const { CachedTag::from_tag(DES_TAG) })?;
|
||||||
entity_manager.add_tag(const { CachedTag::from_tag("polymorphable_NOT") })?;
|
entity_manager.add_tag(const { CachedTag::from_tag("polymorphable_NOT") })?;
|
||||||
if lid.is_some() {
|
if lid.is_some()
|
||||||
if let Some(damage) =
|
&& let Some(damage) =
|
||||||
entity_manager.try_get_first_component::<DamageModelComponent>(ComponentTag::None)
|
entity_manager.try_get_first_component::<DamageModelComponent>(ComponentTag::None)
|
||||||
{
|
{
|
||||||
damage.set_wait_for_kill_flag_on_death(true)?;
|
damage.set_wait_for_kill_flag_on_death(true)?;
|
||||||
damage.set_physics_objects_damage(false)?;
|
damage.set_physics_objects_damage(false)?;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for pb2 in
|
for pb2 in
|
||||||
|
@ -2342,10 +2334,10 @@ pub fn init_remote_entity(
|
||||||
immortal.set_script_damage_about_to_be_received(
|
immortal.set_script_damage_about_to_be_received(
|
||||||
"mods/quant.ew/files/system/entity_sync_helper/immortal.lua".into(),
|
"mods/quant.ew/files/system/entity_sync_helper/immortal.lua".into(),
|
||||||
)?;
|
)?;
|
||||||
if let Some(var) = entity_manager.get_var(const { VarName::from_str("ghost_id") }) {
|
if let Some(var) = entity_manager.get_var(const { VarName::from_str("ghost_id") })
|
||||||
if let Ok(ent) = EntityID::try_from(var.value_int()? as isize) {
|
&& let Ok(ent) = EntityID::try_from(var.value_int()? as isize)
|
||||||
ent.kill()
|
{
|
||||||
}
|
ent.kill()
|
||||||
}
|
}
|
||||||
if entity_manager.has_tag(const { CachedTag::from_tag("boss_dragon") }) && drops_gold {
|
if entity_manager.has_tag(const { CachedTag::from_tag("boss_dragon") }) && drops_gold {
|
||||||
let lua = entity_manager.add_component::<LuaComponent>()?;
|
let lua = entity_manager.add_component::<LuaComponent>()?;
|
||||||
|
@ -2370,18 +2362,17 @@ pub fn init_remote_entity(
|
||||||
ghost.set_die_if_no_home(false)?;
|
ghost.set_die_if_no_home(false)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if entity_manager.has_tag(const { CachedTag::from_tag("egg_item") }) {
|
if entity_manager.has_tag(const { CachedTag::from_tag("egg_item") })
|
||||||
if let Some(explosion) = entity_manager
|
&& let Some(explosion) = entity_manager
|
||||||
.try_get_first_component_including_disabled::<ExplodeOnDamageComponent>(
|
.try_get_first_component_including_disabled::<ExplodeOnDamageComponent>(
|
||||||
ComponentTag::None,
|
ComponentTag::None,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
explosion.object_set_value::<Cow<'_, str>>(
|
explosion.object_set_value::<Cow<'_, str>>(
|
||||||
"config_explosion",
|
"config_explosion",
|
||||||
"load_this_entity",
|
"load_this_entity",
|
||||||
"".into(),
|
"".into(),
|
||||||
)?
|
)?
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(var) = entity_manager.get_var(const { VarName::from_str("ew_gid_lid") }) {
|
if let Some(var) = entity_manager.get_var(const { VarName::from_str("ew_gid_lid") }) {
|
||||||
|
@ -2679,29 +2670,27 @@ fn give_wand(
|
||||||
fn mom(entity: &mut EntityManager, counter: u8, cost: Option<i32>) -> eyre::Result<()> {
|
fn mom(entity: &mut EntityManager, counter: u8, cost: Option<i32>) -> eyre::Result<()> {
|
||||||
if entity.has_tag(const { CachedTag::from_tag("boss_wizard") }) {
|
if entity.has_tag(const { CachedTag::from_tag("boss_wizard") }) {
|
||||||
for ent in entity.entity().children(None) {
|
for ent in entity.entity().children(None) {
|
||||||
if ent.has_tag("touchmagic_immunity") {
|
if ent.has_tag("touchmagic_immunity")
|
||||||
if let Ok(var) = ent
|
&& let Ok(var) = ent
|
||||||
.get_first_component_including_disabled::<VariableStorageComponent>(Some(
|
.get_first_component_including_disabled::<VariableStorageComponent>(Some(
|
||||||
"wizard_orb_id".into(),
|
"wizard_orb_id".into(),
|
||||||
))
|
))
|
||||||
|
{
|
||||||
|
if let Ok(n) = var.value_int() {
|
||||||
|
if (counter & (1 << (n as u8))) == 0 {
|
||||||
|
ent.kill()
|
||||||
|
} else if let Ok(damage) = ent.get_first_component::<DamageModelComponent>(None)
|
||||||
|
{
|
||||||
|
noita_api::print(format!("c {:?} {:?}", entity.entity(), damage.0));
|
||||||
|
damage.set_wait_for_kill_flag_on_death(true)?;
|
||||||
|
damage.set_hp(damage.max_hp()?)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Some(cost) = cost
|
||||||
|
&& let Ok(v) = ent.get_var_or_default("ew_frame_num")
|
||||||
{
|
{
|
||||||
if let Ok(n) = var.value_int() {
|
let _ = v.add_tag("ew_frame_num");
|
||||||
if (counter & (1 << (n as u8))) == 0 {
|
let _ = v.set_value_int(cost);
|
||||||
ent.kill()
|
|
||||||
} else if let Ok(damage) =
|
|
||||||
ent.get_first_component::<DamageModelComponent>(None)
|
|
||||||
{
|
|
||||||
noita_api::print(format!("c {:?} {:?}", entity.entity(), damage.0));
|
|
||||||
damage.set_wait_for_kill_flag_on_death(true)?;
|
|
||||||
damage.set_hp(damage.max_hp()?)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if let Some(cost) = cost {
|
|
||||||
if let Ok(v) = ent.get_var_or_default("ew_frame_num") {
|
|
||||||
let _ = v.add_tag("ew_frame_num");
|
|
||||||
let _ = v.set_value_int(cost);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ impl NoitaLauncher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn launch_token(&mut self) -> LaunchTokenResult {
|
pub fn launch_token(&mut self) -> LaunchTokenResult<'_> {
|
||||||
if self.check_if_noita_running() {
|
if self.check_if_noita_running() {
|
||||||
return LaunchTokenResult::AlreadyStarted;
|
return LaunchTokenResult::AlreadyStarted;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1200,14 +1200,14 @@ impl ImageMap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let tile_size = self.zoom * 128.0;
|
let tile_size = self.zoom * 128.0;
|
||||||
if let Some(peer) = self.centered_on {
|
if let Some(peer) = self.centered_on
|
||||||
if let Some((Some(pos), _, _, _)) = self.players.get(&peer) {
|
&& let Some((Some(pos), _, _, _)) = self.players.get(&peer)
|
||||||
self.offset = Vec2::new(ui.available_width() / 2.0, ui.available_height() / 2.0)
|
{
|
||||||
- Vec2::new(
|
self.offset = Vec2::new(ui.available_width() / 2.0, ui.available_height() / 2.0)
|
||||||
pos.x as f32 * tile_size / 128.0,
|
- Vec2::new(
|
||||||
(pos.y - 12) as f32 * tile_size / 128.0,
|
pos.x as f32 * tile_size / 128.0,
|
||||||
)
|
(pos.y - 12) as f32 * tile_size / 128.0,
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
let painter = ui.painter();
|
let painter = ui.painter();
|
||||||
for (coord, tex) in &self.textures {
|
for (coord, tex) in &self.textures {
|
||||||
|
@ -1240,15 +1240,15 @@ impl ImageMap {
|
||||||
Vec2::new(7.0 * tile_size / 128.0, 16.0 * tile_size / 128.0),
|
Vec2::new(7.0 * tile_size / 128.0, 16.0 * tile_size / 128.0),
|
||||||
);
|
);
|
||||||
if *is_dead {
|
if *is_dead {
|
||||||
if let Some(tex) = &self.notplayer {
|
if let Some(tex) = &self.notplayer
|
||||||
if let Some(id) = tex.texture_id() {
|
&& let Some(id) = tex.texture_id()
|
||||||
painter.image(
|
{
|
||||||
id,
|
painter.image(
|
||||||
rect,
|
id,
|
||||||
Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)),
|
rect,
|
||||||
Color32::WHITE,
|
Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)),
|
||||||
);
|
Color32::WHITE,
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
painter.image(
|
painter.image(
|
||||||
|
@ -1524,10 +1524,10 @@ impl App {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
let mut my_nickname = self.app_saved_state.nickname.clone().or(steam_nickname);
|
let mut my_nickname = self.app_saved_state.nickname.clone().or(steam_nickname);
|
||||||
if let Some(n) = &my_nickname {
|
if let Some(n) = &my_nickname
|
||||||
if n.trim().is_empty() {
|
&& n.trim().is_empty()
|
||||||
my_nickname = None;
|
{
|
||||||
}
|
my_nickname = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
my_nickname.unwrap_or(default)
|
my_nickname.unwrap_or(default)
|
||||||
|
@ -1963,11 +1963,11 @@ impl App {
|
||||||
let addr = addr.or(addr2);
|
let addr = addr.or(addr2);
|
||||||
|
|
||||||
ui.add_enabled_ui(addr.is_ok(), |ui| {
|
ui.add_enabled_ui(addr.is_ok(), |ui| {
|
||||||
if ui.button(tr("ip_connect")).clicked() {
|
if ui.button(tr("ip_connect")).clicked()
|
||||||
if let Ok(addr) = addr {
|
&& let Ok(addr) = addr
|
||||||
self.set_settings();
|
{
|
||||||
self.start_connect(addr);
|
self.set_settings();
|
||||||
}
|
self.start_connect(addr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -2220,8 +2220,8 @@ impl App {
|
||||||
}
|
}
|
||||||
ui.separator();
|
ui.separator();
|
||||||
}
|
}
|
||||||
if let Some(game) = self.modmanager_settings.game_exe_path.parent() {
|
if let Some(game) = self.modmanager_settings.game_exe_path.parent()
|
||||||
if let Ok(s) = fs::read_to_string(game.join("logger.txt")) {
|
&& let Ok(s) = fs::read_to_string(game.join("logger.txt")) {
|
||||||
let l = self.noitalog.len();
|
let l = self.noitalog.len();
|
||||||
if l != 0 && s.len() >= self.noitalog[l - 1].len() {
|
if l != 0 && s.len() >= self.noitalog[l - 1].len() {
|
||||||
if s.len() != self.noitalog[l - 1].len() {
|
if s.len() != self.noitalog[l - 1].len() {
|
||||||
|
@ -2232,7 +2232,6 @@ impl App {
|
||||||
self.noitalog.push(s);
|
self.noitalog.push(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
match self.connected_menu {
|
match self.connected_menu {
|
||||||
ConnectedMenu::Normal => {
|
ConnectedMenu::Normal => {
|
||||||
if netman.peer.is_steam() {
|
if netman.peer.is_steam() {
|
||||||
|
@ -2412,11 +2411,10 @@ impl App {
|
||||||
if l > 1 {
|
if l > 1 {
|
||||||
ui.add(Slider::new(&mut self.noitalog_number, 0..=l - 1));
|
ui.add(Slider::new(&mut self.noitalog_number, 0..=l - 1));
|
||||||
}
|
}
|
||||||
if let Some(clipboard) = self.clipboard.as_mut() {
|
if let Some(clipboard) = self.clipboard.as_mut()
|
||||||
if ui.button("save to clipboard").clicked() {
|
&& ui.button("save to clipboard").clicked() {
|
||||||
let _ = clipboard.set_text(&s);
|
let _ = clipboard.set_text(&s);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
ScrollArea::vertical()
|
ScrollArea::vertical()
|
||||||
.auto_shrink([false; 2])
|
.auto_shrink([false; 2])
|
||||||
|
@ -2436,11 +2434,10 @@ impl App {
|
||||||
path.parent().unwrap().join("ew_log.txt")
|
path.parent().unwrap().join("ew_log.txt")
|
||||||
} else {
|
} else {
|
||||||
"ew_log.txt".into()
|
"ew_log.txt".into()
|
||||||
}) {
|
})
|
||||||
if s.len() > self.proxylog.len() {
|
&& s.len() > self.proxylog.len() {
|
||||||
self.proxylog = s
|
self.proxylog = s
|
||||||
}
|
}
|
||||||
}
|
|
||||||
let mut s = self.proxylog.clone() + "\n";
|
let mut s = self.proxylog.clone() + "\n";
|
||||||
ScrollArea::vertical()
|
ScrollArea::vertical()
|
||||||
.auto_shrink([false; 2])
|
.auto_shrink([false; 2])
|
||||||
|
|
|
@ -91,13 +91,13 @@ pub(crate) struct NetInnerState {
|
||||||
|
|
||||||
impl NetInnerState {
|
impl NetInnerState {
|
||||||
pub(crate) fn try_ms_write(&mut self, data: &NoitaInbound) {
|
pub(crate) fn try_ms_write(&mut self, data: &NoitaInbound) {
|
||||||
if let Some(ws) = &mut self.ms {
|
if let Some(ws) = &mut self.ms
|
||||||
if let Err(err) = ws.write(data) {
|
&& let Err(err) = ws.write(data)
|
||||||
error!("Error occured while sending to websocket: {}", err);
|
{
|
||||||
self.ms = None;
|
error!("Error occured while sending to websocket: {}", err);
|
||||||
self.had_a_disconnect = true;
|
self.ms = None;
|
||||||
};
|
self.had_a_disconnect = true;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
pub(crate) fn try_ws_write_option(&mut self, key: &str, value: impl ProxyOpt) {
|
pub(crate) fn try_ws_write_option(&mut self, key: &str, value: impl ProxyOpt) {
|
||||||
let mut buf = Vec::new();
|
let mut buf = Vec::new();
|
||||||
|
@ -430,12 +430,12 @@ impl NetManager {
|
||||||
);
|
);
|
||||||
|
|
||||||
while self.continue_running.load(Ordering::Relaxed) {
|
while self.continue_running.load(Ordering::Relaxed) {
|
||||||
if let Some(k) = kind {
|
if let Some(k) = kind
|
||||||
if let Some(n) = self.peer.lobby_id() {
|
&& let Some(n) = self.peer.lobby_id()
|
||||||
let c = crate::lobby_code::LobbyCode { kind: k, code: n };
|
{
|
||||||
info!("Lobby ID: {}", c.serialize());
|
let c = crate::lobby_code::LobbyCode { kind: k, code: n };
|
||||||
kind = None
|
info!("Lobby ID: {}", c.serialize());
|
||||||
}
|
kind = None
|
||||||
}
|
}
|
||||||
if self.end_run.load(Ordering::Relaxed) {
|
if self.end_run.load(Ordering::Relaxed) {
|
||||||
for id in self.peer.iter_peer_ids() {
|
for id in self.peer.iter_peer_ids() {
|
||||||
|
@ -461,10 +461,10 @@ impl NetManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(ws) = &mut state.ms {
|
if let Some(ws) = &mut state.ms
|
||||||
if let Err(err) = ws.flush() {
|
&& let Err(err) = ws.flush()
|
||||||
warn!("Websocket flush not ok: {err}");
|
{
|
||||||
}
|
warn!("Websocket flush not ok: {err}");
|
||||||
}
|
}
|
||||||
let mut to_kick = self.kick_list.lock().unwrap();
|
let mut to_kick = self.kick_list.lock().unwrap();
|
||||||
let mut dont_kick = self.dont_kick.lock().unwrap();
|
let mut dont_kick = self.dont_kick.lock().unwrap();
|
||||||
|
@ -810,19 +810,19 @@ impl NetManager {
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.insert(src, get_player_skin(player_image.clone(), rgb));
|
.insert(src, get_player_skin(player_image.clone(), rgb));
|
||||||
if let Some(id) = pong {
|
if let Some(id) = pong
|
||||||
if id != self.peer.my_id() {
|
&& id != self.peer.my_id()
|
||||||
self.send(
|
{
|
||||||
id,
|
self.send(
|
||||||
&NetMsg::PlayerColor(
|
id,
|
||||||
self.init_settings.player_png_desc,
|
&NetMsg::PlayerColor(
|
||||||
self.is_host(),
|
self.init_settings.player_png_desc,
|
||||||
None,
|
self.is_host(),
|
||||||
self.init_settings.my_nickname.clone(),
|
None,
|
||||||
),
|
self.init_settings.my_nickname.clone(),
|
||||||
Reliability::Reliable,
|
),
|
||||||
);
|
Reliability::Reliable,
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NetMsg::Kick => self.back_out.store(true, Ordering::Relaxed),
|
NetMsg::Kick => self.back_out.store(true, Ordering::Relaxed),
|
||||||
|
|
|
@ -163,10 +163,9 @@ impl AudioManager {
|
||||||
if let Ok(len) = encoder.encode_float(
|
if let Ok(len) = encoder.encode_float(
|
||||||
&resamp.process(&[&extra[..FRAME_SIZE]], None).unwrap()[0],
|
&resamp.process(&[&extra[..FRAME_SIZE]], None).unwrap()[0],
|
||||||
&mut compressed,
|
&mut compressed,
|
||||||
) {
|
) && len != 0
|
||||||
if len != 0 {
|
{
|
||||||
v.push(compressed[..len].to_vec())
|
v.push(compressed[..len].to_vec())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
extra.drain(..FRAME_SIZE);
|
extra.drain(..FRAME_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -254,18 +253,17 @@ impl AudioManager {
|
||||||
sound_pos: (i32, i32),
|
sound_pos: (i32, i32),
|
||||||
iv: f32,
|
iv: f32,
|
||||||
) {
|
) {
|
||||||
if let std::collections::hash_map::Entry::Vacant(e) = self.per_player.entry(src) {
|
if let std::collections::hash_map::Entry::Vacant(e) = self.per_player.entry(src)
|
||||||
if let Some(stream_handle) = &self.stream_handle {
|
&& let Some(stream_handle) = &self.stream_handle
|
||||||
if let Ok(s) = Sink::try_new(&stream_handle.1) {
|
&& let Ok(s) = Sink::try_new(&stream_handle.1)
|
||||||
//let (pitch_control, dsp) = make_dsp();
|
{
|
||||||
e.insert(PlayerInfo {
|
//let (pitch_control, dsp) = make_dsp();
|
||||||
sink: s,
|
e.insert(PlayerInfo {
|
||||||
//tracker: VelocityTracker::default(),
|
sink: s,
|
||||||
//pitch_control,
|
//tracker: VelocityTracker::default(),
|
||||||
//dsp,
|
//pitch_control,
|
||||||
});
|
//dsp,
|
||||||
}
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
self.per_player.entry(src).and_modify(|player_info| {
|
self.per_player.entry(src).and_modify(|player_info| {
|
||||||
/*player_info
|
/*player_info
|
||||||
|
@ -294,10 +292,10 @@ impl AudioManager {
|
||||||
let mut dec: Vec<f32> = Vec::new();
|
let mut dec: Vec<f32> = Vec::new();
|
||||||
for data in data {
|
for data in data {
|
||||||
let mut out = vec![0f32; FRAME_SIZE];
|
let mut out = vec![0f32; FRAME_SIZE];
|
||||||
if let Ok(len) = self.decoder.decode_float(&data, &mut out, false) {
|
if let Ok(len) = self.decoder.decode_float(&data, &mut out, false)
|
||||||
if len != 0 {
|
&& len != 0
|
||||||
dec.extend(&out[..len])
|
{
|
||||||
}
|
dec.extend(&out[..len])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !dec.is_empty() {
|
if !dec.is_empty() {
|
||||||
|
|
|
@ -148,10 +148,10 @@ impl Connections {
|
||||||
}
|
}
|
||||||
fn flush(&self) {
|
fn flush(&self) {
|
||||||
for i in &self.peers {
|
for i in &self.peers {
|
||||||
if let Some(c) = i.connection() {
|
if let Some(c) = i.connection()
|
||||||
if let Err(err) = c.flush_messages() {
|
&& let Err(err) = c.flush_messages()
|
||||||
warn!("Error while flushing a message: {err:?}")
|
{
|
||||||
}
|
warn!("Error while flushing a message: {err:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -894,13 +894,13 @@ impl WorldManager {
|
||||||
if world_num != self.world_num {
|
if world_num != self.world_num {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if let Some(state) = self.authority_map.get(&chunk) {
|
if let Some(state) = self.authority_map.get(&chunk)
|
||||||
if state.0 != source {
|
&& state.0 != source
|
||||||
debug!(
|
{
|
||||||
"{source} sent RelinquishAuthority for {chunk:?}, but isn't currently an authority"
|
debug!(
|
||||||
);
|
"{source} sent RelinquishAuthority for {chunk:?}, but isn't currently an authority"
|
||||||
return;
|
);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
self.authority_map.remove(&chunk);
|
self.authority_map.remove(&chunk);
|
||||||
if let Some(chunk_data) = chunk_data {
|
if let Some(chunk_data) = chunk_data {
|
||||||
|
@ -1743,32 +1743,28 @@ impl WorldManager {
|
||||||
self.is_storage_recent.insert(entry.0);
|
self.is_storage_recent.insert(entry.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some((coord, rays)) = entry.unloaded {
|
if let Some((coord, rays)) = entry.unloaded
|
||||||
if self.nice_terraforming {
|
&& self.nice_terraforming
|
||||||
exists = true;
|
{
|
||||||
let lst = rays
|
exists = true;
|
||||||
.iter()
|
let lst = rays
|
||||||
.filter_map(|i| {
|
.iter()
|
||||||
if raydata[*i] == 0 {
|
.filter_map(|i| {
|
||||||
None
|
if raydata[*i] == 0 {
|
||||||
} else if let Some(n) = data.get(i) {
|
None
|
||||||
Some(*n)
|
} else if let Some(n) = data.get(i) {
|
||||||
} else {
|
Some(*n)
|
||||||
let n = self.explosion_data.len();
|
} else {
|
||||||
self.explosion_data.push((
|
let n = self.explosion_data.len();
|
||||||
m,
|
self.explosion_data
|
||||||
*i,
|
.push((m, *i, ExTarget::Ray(raydata[*i]), 0));
|
||||||
ExTarget::Ray(raydata[*i]),
|
data.insert(*i, n);
|
||||||
0,
|
Some(n)
|
||||||
));
|
}
|
||||||
data.insert(*i, n);
|
})
|
||||||
Some(n)
|
.collect::<Vec<usize>>();
|
||||||
}
|
if !lst.is_empty() {
|
||||||
})
|
self.explosion_pointer.entry(coord).or_default().extend(lst)
|
||||||
.collect::<Vec<usize>>();
|
|
||||||
if !lst.is_empty() {
|
|
||||||
self.explosion_pointer.entry(coord).or_default().extend(lst)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2382,14 +2378,14 @@ fn create_image(chunk: ChunkData, materials: &FxHashMap<u16, u32>) -> RgbaImage
|
||||||
let y = i / w as usize;
|
let y = i / w as usize;
|
||||||
let p = y * CHUNK_SIZE + x;
|
let p = y * CHUNK_SIZE + x;
|
||||||
let m = working_chunk.pixel(p);
|
let m = working_chunk.pixel(p);
|
||||||
if m.flags != PixelFlags::Unknown {
|
if m.flags != PixelFlags::Unknown
|
||||||
if let Some(c) = materials.get(&m.material) {
|
&& let Some(c) = materials.get(&m.material)
|
||||||
let a = (c >> 24) & 0xFFu32;
|
{
|
||||||
let r = (c >> 16) & 0xFFu32;
|
let a = (c >> 24) & 0xFFu32;
|
||||||
let g = (c >> 8) & 0xFFu32;
|
let r = (c >> 16) & 0xFFu32;
|
||||||
let b = c & 0xFF;
|
let g = (c >> 8) & 0xFFu32;
|
||||||
*px = image::Rgba([r as u8, g as u8, b as u8, a as u8])
|
let b = c & 0xFF;
|
||||||
}
|
*px = image::Rgba([r as u8, g as u8, b as u8, a as u8])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image
|
image
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue