Refactor: Move more stuff around.

This commit is contained in:
IQuant 2024-08-07 17:21:25 +03:00
parent 8bef8fefa9
commit f25ae3b2c5
21 changed files with 18 additions and 18 deletions

View file

@ -408,7 +408,7 @@ function player_fns.spawn_player_for(peer_id, x, y, existing_playerdata)
util.print_traceback()
end
GamePrint("Spawning player for "..peer_id)
local new = EntityLoad("mods/quant.ew/files/entities/client.xml", x, y)
local new = EntityLoad("mods/quant.ew/files/resource/entities/client.xml", x, y)
local new_playerdata = existing_playerdata or player_fns.make_playerdata_for(new, peer_id)
new_playerdata.entity = new
-- util.tpcall(nickname.addLabel, new, new_playerdata.name, "data/fonts/font_pixel_white.xml", 1)

View file

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 557 B

Before After
Before After

View file

@ -38,7 +38,7 @@
<Entity name="chunk_loader">
<Base file="mods/quant.ew/files/entities/chunk_loader.xml">
<Base file="mods/quant.ew/files/resource/entities/chunk_loader.xml">
</Base>
</Entity>
@ -51,7 +51,7 @@
<Entity name="cursor">
<SpriteComponent
alpha="1"
image_file="mods/quant.ew/files/sprites/cursor.png"
image_file="mods/quant.ew/files/resource/sprites/cursor.png"
next_rect_animation=""
offset_x="6.5"
offset_y="6.5"

View file

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 198 B

Before After
Before After

View file

@ -117,7 +117,7 @@ function module.on_client_spawned(peer_id, playerdata)
if ctx.is_host then
EntityAddComponent2(playerdata.entity, "LuaComponent", {script_damage_received = "mods/quant.ew/files/system/damage/cbs/send_damage_to_client.lua"})
else
EntityAddComponent2(playerdata.entity, "LuaComponent", {script_damage_about_to_be_received = "mods/quant.ew/files/cbs/immortal.lua"})
EntityAddComponent2(playerdata.entity, "LuaComponent", {script_damage_about_to_be_received = "mods/quant.ew/files/resource/cbs/immortal.lua"})
end
end

View file

@ -29,8 +29,8 @@ function module.on_local_player_spawn(my_player)
-- Meat biome
-- EntitySetTransform(player_entity, 7328, 9263)
-- util.load_ephemerial("mods/quant.ew/files/entities/client.xml", 512*3+20, 512*3+10)
-- EntityLoad("mods/quant.ew/files/entities/client.xml", 512*3+20, 512*3+10)
-- util.load_ephemerial("mods/quant.ew/files/resource/entities/client.xml", 512*3+20, 512*3+10)
-- EntityLoad("mods/quant.ew/files/resource/entities/client.xml", 512*3+20, 512*3+10)
ctx.cap.health.set_max_health(1000)
ctx.cap.health.set_health(1000)

View file

@ -78,7 +78,7 @@ function enemy_sync.host_upload_entities()
if has_hp then
util.ensure_component_present(enemy_id, "LuaComponent", "ew_death_notify", {
script_death = "mods/quant.ew/files/cbs/death_notify.lua"
script_death = "mods/quant.ew/files/resource/cbs/death_notify.lua"
})
end
@ -207,7 +207,7 @@ function rpc.handle_enemy_data(enemy_data)
local enemy_id = util.load_ephemerial(filename, x, y)
EntityAddTag(enemy_id, "ew_replicated")
EntityAddTag(enemy_id, "polymorphable_NOT")
EntityAddComponent2(enemy_id, "LuaComponent", {_tags="ew_immortal", script_damage_about_to_be_received = "mods/quant.ew/files/cbs/immortal.lua"})
EntityAddComponent2(enemy_id, "LuaComponent", {_tags="ew_immortal", script_damage_about_to_be_received = "mods/quant.ew/files/resource/cbs/immortal.lua"})
local damage_component = EntityGetFirstComponentIncludingDisabled(enemy_id, "DamageModelComponent")
if damage_component and damage_component ~= 0 then
ComponentSetValue2(damage_component, "wait_for_kill_flag_on_death", true)

View file

@ -18,9 +18,9 @@ function item_sync.ensure_notify_component(ent)
if notify == nil then
EntityAddComponent2(ent, "LuaComponent", {
_tags = "enabled_in_world,enabled_in_hand,enabled_in_inventory,ew_notify_component",
script_throw_item = "mods/quant.ew/files/cbs/item_notify.lua",
script_item_picked_up = "mods/quant.ew/files/cbs/item_notify.lua",
-- script_kick = "mods/quant.ew/files/cbs/item_notify.lua",
script_throw_item = "mods/quant.ew/files/resource/cbs/item_notify.lua",
script_item_picked_up = "mods/quant.ew/files/resource/cbs/item_notify.lua",
-- script_kick = "mods/quant.ew/files/resource/cbs/item_notify.lua",
})
end
end

View file

@ -49,7 +49,7 @@ function module.on_client_spawned(peer_id, playerdata)
if ctx.is_host then
EntityAddComponent2(playerdata.entity, "LuaComponent", {script_damage_received = "mods/quant.ew/files/system/damage/cbs/send_damage_to_client.lua"})
else
EntityAddComponent2(playerdata.entity, "LuaComponent", {script_damage_about_to_be_received = "mods/quant.ew/files/cbs/immortal.lua"})
EntityAddComponent2(playerdata.entity, "LuaComponent", {script_damage_about_to_be_received = "mods/quant.ew/files/resource/cbs/immortal.lua"})
end
end

View file

@ -88,7 +88,7 @@ function rpc.change_entity(seri_ent)
if seri_ent ~= nil then
local ent = EntityCreateNew()
np.DeserializeEntity(ent, seri_ent)
EntityAddComponent2(ent, "LuaComponent", {script_damage_about_to_be_received = "mods/quant.ew/files/cbs/immortal.lua"})
EntityAddComponent2(ent, "LuaComponent", {script_damage_about_to_be_received = "mods/quant.ew/files/resource/cbs/immortal.lua"})
EntityAddTag(ent, "ew_no_enemy_sync")
-- Remove all poly-like effects to prevent spawn of another player character when it runs out

View file

@ -43,7 +43,7 @@ function world_sync.on_world_update()
local area = world.encode_area(chunk_map, crect.left, crect.top, crect.right, crect.bottom, encoded_area)
if area ~= nil then
if ctx.proxy_opt.debug then
GameCreateSpriteForXFrames("mods/quant.ew/files/debug/box_128x128.png", crect.left+64, crect.top + 64, true, 0, 0, 11, true)
GameCreateSpriteForXFrames("mods/quant.ew/files/resource/debug/box_128x128.png", crect.left+64, crect.top + 64, true, 0, 0, 11, true)
end
local str = ffi.string(area, world.encoded_size(area))
net.proxy_bin_send(KEY_WORLD_FRAME, str)

View file

@ -22,8 +22,8 @@ print("Noita EW version: "..version)
dofile_once("data/scripts/lib/coroutines.lua")
ModLuaFileAppend("data/scripts/gun/gun.lua", "mods/quant.ew/files/append/gun.lua")
ModLuaFileAppend("data/scripts/gun/gun_actions.lua", "mods/quant.ew/files/append/action_fix.lua")
ModLuaFileAppend("data/scripts/gun/gun.lua", "mods/quant.ew/files/resource/append/gun.lua")
ModLuaFileAppend("data/scripts/gun/gun_actions.lua", "mods/quant.ew/files/resource/append/action_fix.lua")
ModMagicNumbersFileAdd("mods/quant.ew/files/magic.xml")
@ -174,7 +174,7 @@ function OnPlayerSpawned( player_entity ) -- This runs when player entity has be
EntityAddTag(player_entity, "ew_current_player") -- TODO maybe remove and replace uses with player_unit tag
EntityAddTag(player_entity, "ew_peer")
EntityAddComponent2(player_entity, "LuaComponent", {script_wand_fired = "mods/quant.ew/files/cbs/count_times_wand_fired.lua"})
EntityAddComponent2(player_entity, "LuaComponent", {script_wand_fired = "mods/quant.ew/files/resource/cbs/count_times_wand_fired.lua"})
net.send_welcome()

View file

@ -5,7 +5,7 @@ local function early_init()
-- Early init stuff, called before main "mod" is loaded. Meaning we can append to data/scripts/init.lua
end
ModLuaFileAppend("data/scripts/init.lua", "mods/quant.ew/files/append/no_default_death_handling.lua")
ModLuaFileAppend("data/scripts/init.lua", "mods/quant.ew/files/resource/append/no_default_death_handling.lua")
end