This commit is contained in:
2023-08-19 19:21:17 +08:00
parent 36dfa79e0d
commit 76b7abf06b
111 changed files with 12062 additions and 867 deletions

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_1.tex" /><Elements><Element name="mark_1.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_10.tex" /><Elements><Element name="mark_10.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_11.tex" /><Elements><Element name="mark_11.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_12.tex" /><Elements><Element name="mark_12.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_13.tex" /><Elements><Element name="mark_13.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_14.tex" /><Elements><Element name="mark_14.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_15.tex" /><Elements><Element name="mark_15.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_16.tex" /><Elements><Element name="mark_16.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_17.tex" /><Elements><Element name="mark_17.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_18.tex" /><Elements><Element name="mark_18.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_19.tex" /><Elements><Element name="mark_19.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_2.tex" /><Elements><Element name="mark_2.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_20.tex" /><Elements><Element name="mark_20.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_21.tex" /><Elements><Element name="mark_21.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_22.tex" /><Elements><Element name="mark_22.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_3.tex" /><Elements><Element name="mark_3.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_4.tex" /><Elements><Element name="mark_4.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_5.tex" /><Elements><Element name="mark_5.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_6.tex" /><Elements><Element name="mark_6.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_7.tex" /><Elements><Element name="mark_7.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_8.tex" /><Elements><Element name="mark_8.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_9.tex" /><Elements><Element name="mark_9.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="wormhole_marks.tex" /><Elements><Element name="wormhole_marks.tex" u1="0.00390625" u2="0.99609375" v1="0.00390625" v2="0.99609375" /></Elements></Atlas>

View File

@@ -0,0 +1,37 @@
name = "Wormhole Marks"
description = ""
author = "_Q_"
version = "1.4.5"
forumthread = ""
api_version = 10
configuration_options =
{
{
name = "Draw over FoW",
options =
{
{description = "Disabled", data = "disabled"},
{description = "Enabled", data = "enabled"},
},
default = "disabled",
},
}
--This lets the clients know that they need to download the mod before they can join a server that is using it.
all_clients_require_mod = true
--This let's the game know that this mod doesn't need to be listed in the server's mod listing
client_only_mod = false
--Let the mod system know that this mod is functional with Don't Starve Together
dst_compatible = true
--These tags allow the server running this mod to be found with filters from the server listing screen
server_filter_tags = {"wormhole marks"}
icon_atlas = "modicon.xml"
icon = "wormhole_marks.tex"

View File

@@ -0,0 +1,78 @@
Assets =
{
Asset("ATLAS", "images/mark_1.xml"),
Asset("ATLAS", "images/mark_2.xml"),
Asset("ATLAS", "images/mark_3.xml"),
Asset("ATLAS", "images/mark_4.xml"),
Asset("ATLAS", "images/mark_5.xml"),
Asset("ATLAS", "images/mark_6.xml"),
Asset("ATLAS", "images/mark_7.xml"),
Asset("ATLAS", "images/mark_8.xml"),
Asset("ATLAS", "images/mark_9.xml"),
Asset("ATLAS", "images/mark_10.xml"),
Asset("ATLAS", "images/mark_11.xml"),
Asset("ATLAS", "images/mark_12.xml"),
Asset("ATLAS", "images/mark_13.xml"),
Asset("ATLAS", "images/mark_14.xml"),
Asset("ATLAS", "images/mark_15.xml"),
Asset("ATLAS", "images/mark_16.xml"),
Asset("ATLAS", "images/mark_17.xml"),
Asset("ATLAS", "images/mark_18.xml"),
Asset("ATLAS", "images/mark_19.xml"),
Asset("ATLAS", "images/mark_20.xml"),
Asset("ATLAS", "images/mark_21.xml"),
Asset("ATLAS", "images/mark_22.xml"),
}
AddMinimapAtlas("images/mark_1.xml")
AddMinimapAtlas("images/mark_2.xml")
AddMinimapAtlas("images/mark_3.xml")
AddMinimapAtlas("images/mark_4.xml")
AddMinimapAtlas("images/mark_5.xml")
AddMinimapAtlas("images/mark_6.xml")
AddMinimapAtlas("images/mark_7.xml")
AddMinimapAtlas("images/mark_8.xml")
AddMinimapAtlas("images/mark_9.xml")
AddMinimapAtlas("images/mark_10.xml")
AddMinimapAtlas("images/mark_11.xml")
AddMinimapAtlas("images/mark_12.xml")
AddMinimapAtlas("images/mark_13.xml")
AddMinimapAtlas("images/mark_14.xml")
AddMinimapAtlas("images/mark_15.xml")
AddMinimapAtlas("images/mark_16.xml")
AddMinimapAtlas("images/mark_17.xml")
AddMinimapAtlas("images/mark_18.xml")
AddMinimapAtlas("images/mark_19.xml")
AddMinimapAtlas("images/mark_20.xml")
AddMinimapAtlas("images/mark_21.xml")
AddMinimapAtlas("images/mark_22.xml")
local function Mark(inst)
if not inst.components.wormhole_marks:CheckMark() then
inst.components.wormhole_marks:MarkEntrance()
end
local other = inst.components.teleporter.targetTeleporter
if not other.components.wormhole_marks:CheckMark() then
other.components.wormhole_marks:MarkExit()
end
end
function WormholePrefabPostInit(inst)
if not inst.components.wormhole_marks then
inst:AddComponent("wormhole_marks")
end
inst:ListenForEvent("starttravelsound", Mark)
end
AddPrefabPostInit("wormhole", WormholePrefabPostInit)
function WorldPrefabPostInit(inst)
if inst:HasTag("forest") then
inst:AddComponent("wormhole_counter")
end
end
if GLOBAL.TheNet:GetIsServer() or GLOBAL.TheNet:IsDedicated() then
AddPrefabPostInit("world", WorldPrefabPostInit)
end

View File

@@ -0,0 +1,30 @@
return Class(function(self, inst)
assert(TheWorld.ismastersim, "Wormhole_Counter should not exist on client")
self.inst = inst
self.wormhole_count = 1
function self:Set()
self.wormhole_count = self.wormhole_count + 1
end
function self:Get()
return self.wormhole_count
end
function self:OnSave()
local data = {}
data.wormhole_count = self.wormhole_count
return data
end
function self:OnLoad(data)
if data then
self.wormhole_count = data.wormhole_count
else
self.wormhole_count = 1
end
end
end)

View File

@@ -0,0 +1,65 @@
local modname = KnownModIndex:GetModActualName("Wormhole Marks")
local fow_setting = GetModConfigData("Draw over FoW", modname)
local Wormhole_Marks = Class(function(self, inst)
self.inst = inst
self.marked = false
self.wormhole_number = nil
end)
function Wormhole_Marks:MarkEntrance()
self:GetNumber()
if self.wormhole_number <= 22 then
self.marked = true
if fow_setting == "enabled" then
self.inst.MiniMapEntity:SetDrawOverFogOfWar(true)
end
self.inst.MiniMapEntity:SetIcon("mark_"..self.wormhole_number..".tex")
end
end
function Wormhole_Marks:MarkExit()
self:GetNumber()
if self.wormhole_number <= 22 then
self.marked = true
if fow_setting == "enabled" then
self.inst.MiniMapEntity:SetDrawOverFogOfWar(true)
end
self.inst.MiniMapEntity:SetIcon("mark_"..self.wormhole_number..".tex")
TheWorld.components.wormhole_counter:Set()
end
end
function Wormhole_Marks:GetNumber()
self.wormhole_number = TheWorld.components.wormhole_counter:Get()
end
function Wormhole_Marks:CheckMark()
return self.marked
end
function Wormhole_Marks:OnSave()
local data = {}
data.marked = self.marked
data.wormhole_number = self.wormhole_number
return data
end
function Wormhole_Marks:OnLoad(data)
if data then
self.marked = data.marked
self.wormhole_number = data.wormhole_number
if self.marked and self.wormhole_number then
self.inst.entity:AddMiniMapEntity()
self.inst.MiniMapEntity:SetIcon("mark_"..self.wormhole_number..".tex")
if fow_setting == "enabled" then
self.inst.MiniMapEntity:SetDrawOverFogOfWar(true)
end
end
else
self.marked = false
self.wormhole_number = 0
end
end
return Wormhole_Marks

Binary file not shown.