Compare commits

..

85 Commits

Author SHA1 Message Date
a17901d473 v1.4.0 valve maps 2024-01-12 11:34:09 -08:00
b88c6b899a commands for valve maps 2024-01-12 11:32:12 -08:00
835d4bbecd add valve map deps 2024-01-12 11:32:12 -08:00
b756dc979c move main to top 2024-01-12 11:32:12 -08:00
1e888ebb01 tabs 2024-01-09 01:36:14 -08:00
b9dccb1af5 update deps 2023-11-18 16:13:24 -08:00
c6d293cc6b write "Ref" attribute based on internal roblox part id 2023-11-18 15:53:37 -08:00
a386f90f51 switch to lazy_regex 2023-11-18 15:47:54 -08:00
43115cbac6 mesh downloader 2023-11-09 15:51:23 -08:00
35b5aff9a7 stop being cringe 2023-11-09 15:51:11 -08:00
36419af870 update deps 2023-10-27 18:10:11 -07:00
a7518bef46 print full path 2023-10-27 18:10:05 -07:00
6df1f41599 not a bug 2023-10-19 03:00:30 -07:00
422d0a160d print special message for roblox xml 2023-10-19 03:00:30 -07:00
1727f9213c it's actually jfif 2023-10-19 03:00:30 -07:00
afa9e7447d print fourcc on unrecognized image format 2023-10-19 03:00:30 -07:00
ff85efa54f add unzip-all command 2023-10-19 03:00:30 -07:00
fa69c53cfc JPEG support 2023-10-19 03:00:30 -07:00
a57c228580 styling 2023-10-19 03:00:30 -07:00
5dc69db885 extremely fancy code to transparently handle gzip 2023-10-19 03:00:30 -07:00
e54400a436 alphabetize for no reason 2023-10-19 03:00:30 -07:00
e2a5edf8df Fill in placeholder values
Nobody told me I was chilling with placeholder values in my license
2023-10-02 03:46:17 -04:00
d6dd1b8abd drop Jeftai Error, convert errors to anyhow 2023-10-01 20:08:43 -07:00
a2b793fcd3 add anyhow dep 2023-10-01 20:07:11 -07:00
9cb34f14c8 fixme 2023-09-30 03:38:34 -07:00
bd2e3aa2d3 v1.3.0 srgb textures + non mod 4 images export to uncompressed + rbxmx support 2023-09-30 03:15:57 -07:00
07f6053839 multiplex roblox format 2023-09-30 03:14:06 -07:00
0d5b918ea1 add rbx_xml dep 2023-09-30 03:14:05 -07:00
20a568220a use plain format if image is not the right shape 2023-09-29 18:30:01 -07:00
d670d4129e use srgb 2023-09-29 13:27:23 -07:00
de7b0bd5cc stop failing when maps are corrupted while downloading textures 2023-09-29 03:14:29 -07:00
01524146c7 fixme 2023-09-29 02:58:49 -07:00
45e8e415d0 v1.2.0 convert-textures
gzip no workie yet
some pngs upset the decoder lib
2023-09-29 02:58:49 -07:00
4417bafc5c naive multithreaded convert downloaded textures to dds 2023-09-29 02:58:32 -07:00
8553625738 change texture download path 2023-09-28 22:05:25 -07:00
3a3749eaeb add deps image, gzip (flate2), image_dds 2023-09-28 22:05:00 -07:00
53539f290b print map file 2023-09-23 13:07:52 -07:00
479dd37f53 v1.1.0 download-textures 2023-09-22 14:27:06 -07:00
34b6a869f0 add download textures command 2023-09-22 14:24:28 -07:00
19a455ee5e print wget exit status 2023-09-22 14:23:29 -07:00
9904b7a044 switch extract to pathbuf 2023-09-22 14:22:44 -07:00
6efa811eb6 generalize recursive_collect 2023-09-22 14:21:22 -07:00
81e4a201bd add delete to interactive upload 2023-09-15 17:10:33 -07:00
8fd5618af2 tweak prompt 2023-09-14 17:05:22 -07:00
54c26d6e1e ARE YOU STUPID 2023-09-14 16:23:53 -07:00
110ec94a08 v1.0.0 map tool implements some subset of operations at every step the map verification process from start to finish 2023-09-14 16:23:53 -07:00
980da5a6a7 write approximate code for uploading new asset 2023-09-14 16:22:15 -07:00
1cd77984d4 wait for downloads before exiting 2023-09-14 14:32:25 -07:00
b0fe231388 Merge pull request 'stop macro from returning' (#2) from Jeftaei/map-tool:master into master
Reviewed-on: StrafesNET/map-tool#2
2023-09-14 17:19:01 -04:00
5a4a39ab75 add upload action + wait for status code 2023-09-14 14:17:00 -07:00
Jeft
1b2324deeb stop macro from returning 2023-09-14 16:15:39 -05:00
4c485e76e4 implement upload 2023-09-14 13:54:08 -07:00
7bbb9ca24f have to write the model ref to make a valid model file 2023-09-14 13:53:52 -07:00
eff55af1b4 models are rbxm 2023-09-14 12:06:02 -07:00
0d05cc9996 comment on laziness 2023-09-13 21:22:28 -07:00
2a55ef90df don't replace std Result 2023-09-13 21:04:33 -07:00
1a6202ae66 Merge pull request 'Nice looking errors' (#1) from Jeftaei/map-tool:master into master
Reviewed-on: StrafesNET/map-tool#1
2023-09-13 16:51:24 -04:00
Jeft
742f7b4ec0 we Love errors 2023-09-13 09:13:23 -05:00
2cb346f49a re-prompt action 2023-09-13 00:28:59 -07:00
e5cca9ed04 common location 2023-09-12 19:29:51 -07:00
52d911a25a implement Exit/Delete 2023-09-12 19:29:51 -07:00
7ab20f36a7 fix parse 2023-09-12 19:05:01 -07:00
a7554da1c5 flush prompt 2023-09-12 19:05:01 -07:00
37f0dad7a1 ref cannot refer to object in another dom 2023-09-12 19:05:01 -07:00
e309f15cb8 implement extract 2023-09-12 19:04:46 -07:00
29374e4ff5 write edited file and report how many scripts were replaced 2023-09-12 19:04:46 -07:00
b7d04d1f40 this is wrong 2023-09-12 18:17:04 -07:00
432ec11ea6 fix write_dom 2023-09-12 18:17:04 -07:00
01449b1850 fix int parsing 2023-09-12 18:17:04 -07:00
327d0a4992 print map script stats on completion 2023-09-12 18:17:04 -07:00
420dbaa022 implement blocked in interactive 2023-09-12 18:17:04 -07:00
cad29af4bb panic lol 2023-09-12 18:17:04 -07:00
e0e8744bfd interactive mode v1 2023-09-12 18:17:04 -07:00
b434dce0f6 helper funcs 2023-09-12 18:17:04 -07:00
6ef8fd2f69 get_full_name 2023-09-12 18:17:04 -07:00
7234065bd8 fail better 2023-09-12 18:17:04 -07:00
41d8e700c5 Commands::Interactive 2023-09-12 18:17:04 -07:00
4ca3d56f0f upload comments 2023-09-12 18:17:04 -07:00
593b6902fd Scan::Flagged 2023-09-12 18:17:04 -07:00
7523c4313a scan enum, Source property missing if fatal 2023-09-12 18:17:04 -07:00
694440bd29 use wget to download maps 2023-09-12 18:17:04 -07:00
755e1d4d5b optimize release binary size 2023-09-12 18:17:04 -07:00
4334a6f330 v2 with clap 2023-09-12 18:17:04 -07:00
553ad2cca5 add clap dep 2023-09-12 18:17:03 -07:00
3f15d2f5a8 delete recursive function 2023-09-12 18:16:45 -07:00
9 changed files with 2777 additions and 13582 deletions

1573
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,28 @@
[package] [package]
name = "map-tool" name = "map-tool"
version = "0.1.0" version = "1.4.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
anyhow = "1.0.75"
clap = { version = "4.4.2", features = ["derive"] }
flate2 = "1.0.27"
image = "0.24.7"
image_dds = "0.1.1"
lazy-regex = "3.1.0"
rbx_binary = "0.7.1" rbx_binary = "0.7.1"
rbx_dom_weak = "2.5.0" rbx_dom_weak = "2.5.0"
rbx_reflection_database = "0.2.7" rbx_reflection_database = "0.2.7"
rbx_xml = "0.13.1"
vbsp = "0.5.0"
vmdl = "0.1.1"
vmt-parser = "0.1.1"
vpk = "0.2.0"
vtf = "0.2.1"
#[profile.release]
#lto = true
#strip = true
#codegen-units = 1

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) <year> <copyright holders> Copyright (c) 2023 StrafesNET Map Tool Developers
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Binary file not shown.

View File

@ -1,126 +0,0 @@
--local Model=game:GetService'InsertService':LoadAsset(1079831188):GetChildren()[1] Model:SetModelCFrame(CFrame.new(0,Model:GetModelSize().y/2,0))
--[[ Load ID list
local ids={5692157375}
local ServerStorage=game:GetService'ServerStorage'
local function load(id)
local Model=game:GetObjects("rbxassetid://"..id)[1]
Model.Parent=workspace
Model:MoveTo(Vector3.new(0,Model:GetExtentsSize().y/2,0))
wait()
Model.Parent=ServerStorage
end
for i=1,#ids do
local succ,err=ypcall(load,ids[i])
if not succ then
print(ids[i],"error",err)
end
end
--]]
--[[ Format map names
local c=game:GetService'ServerStorage':GetChildren()
for i=1,#c do
local le_name=c[i].Name:gsub("%s+","_"):lower()
c[i].Name=le_name
local DisplayName=c[i]:FindFirstChild("DisplayName",true)
if DisplayName and DisplayName.ClassName=="StringValue" then
local dn=DisplayName.Value
local ndn={}
for w in dn:gmatch'%S+' do
ndn[#ndn+1]=w:sub(1,1):upper()..w:sub(2)
end
if table.concat(ndn," ")~=dn then
print("Fix name:",le_name)
end
end
end
--]]
--[[ Duplicate script labeler
local IsA=game.IsA
local ID=0
local SourceHash={}
local SourceHashCount={}
local NameHash={}
local IDHash={}
local c=game:GetService'ServerStorage':GetDescendants()
for i=1,#c do
local s=c[i]
if IsA(s,"LuaSourceContainer") then
local src=s.Source
NameHash[s]=s.Name
local id=SourceHash[src]
if id then
s.Name="copy "..id
SourceHashCount[id]=SourceHashCount[id]+1
else
ID=ID+1
IDHash[ID]=s
SourceHash[src]=ID
SourceHashCount[ID]=1
if src:find'getfenv' or src:find'require' then
s.Name="flagged "..ID
else
s.Name="unique "..ID
end
end
end
end
for i=1,ID do
local s=IDHash[i]
local hc=SourceHashCount[i]
s.Name=s.Name..(hc==1 and " (1 copy)" or " ("..hc.." copies)")
end
_G.NameHash=NameHash
--]]
--[[ Undo labeler
local NameHash=_G.NameHash
for s,n in next,NameHash do
s.Name=n
end
--]]
local IsA=workspace.IsA
local GetChildren=workspace.GetChildren
local function rsearch(search,cond1,cond2)
local found={}
for _,thing in next,GetChildren(search) do
if not cond1 or cond1(thing) then
found[#found+1]=thing
end
if not cond2 or cond2(thing) then
local nfound=#found
local r=rsearch(thing,cond1,cond2)
for i=1,#r do
found[nfound+i]=r[i]
end
end
end
return found
end
local function cond1(thing)
return IsA(thing,"LuaSourceContainer")
end
local Maps=GetChildren(game:GetService'ServerStorage')
for i=1,#Maps do
local Map=Maps[i]
if Map.ClassName=="Model" then
local Scripts=rsearch(Map,cond1)
if #Scripts>0 then
local ScriptHolder=Instance.new("Model",workspace)
ScriptHolder.Name=Map.Name.."("..#Scripts..")"
for i=1,#Scripts do
local sc=Scripts[i]
local scd
if sc.ClassName~="ModuleScript" then
sc.Disabled=true
end
local s=sc:Clone()
s.Name=sc:GetFullName()
s.Parent=ScriptHolder
if sc.ClassName~="ModuleScript" then
sc.Disabled=scd
end
end
end
end
end

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,126 +0,0 @@
--local Model=game:GetService'InsertService':LoadAsset(1079831188):GetChildren()[1] Model:SetModelCFrame(CFrame.new(0,Model:GetModelSize().y/2,0))
--[[ Load ID list
local ids={5692157375}
local ServerStorage=game:GetService'ServerStorage'
local function load(id)
local Model=game:GetObjects("rbxassetid://"..id)[1]
Model.Parent=workspace
Model:MoveTo(Vector3.new(0,Model:GetExtentsSize().y/2,0))
wait()
Model.Parent=ServerStorage
end
for i=1,#ids do
local succ,err=ypcall(load,ids[i])
if not succ then
print(ids[i],"error",err)
end
end
--]]
--[[ Format map names
local c=game:GetService'ServerStorage':GetChildren()
for i=1,#c do
local le_name=c[i].Name:gsub("%s+","_"):lower()
c[i].Name=le_name
local DisplayName=c[i]:FindFirstChild("DisplayName",true)
if DisplayName and DisplayName.ClassName=="StringValue" then
local dn=DisplayName.Value
local ndn={}
for w in dn:gmatch'%S+' do
ndn[#ndn+1]=w:sub(1,1):upper()..w:sub(2)
end
if table.concat(ndn," ")~=dn then
print("Fix name:",le_name)
end
end
end
--]]
--[[ Duplicate script labeler
local IsA=game.IsA
local ID=0
local SourceHash={}
local SourceHashCount={}
local NameHash={}
local IDHash={}
local c=game:GetService'ServerStorage':GetDescendants()
for i=1,#c do
local s=c[i]
if IsA(s,"LuaSourceContainer") then
local src=s.Source
NameHash[s]=s.Name
local id=SourceHash[src]
if id then
s.Name="copy "..id
SourceHashCount[id]=SourceHashCount[id]+1
else
ID=ID+1
IDHash[ID]=s
SourceHash[src]=ID
SourceHashCount[ID]=1
if src:find'getfenv' or src:find'require' then
s.Name="flagged "..ID
else
s.Name="unique "..ID
end
end
end
end
for i=1,ID do
local s=IDHash[i]
local hc=SourceHashCount[i]
s.Name=s.Name..(hc==1 and " (1 copy)" or " ("..hc.." copies)")
end
_G.NameHash=NameHash
--]]
--[[ Undo labeler
local NameHash=_G.NameHash
for s,n in next,NameHash do
s.Name=n
end
--]]
local IsA=workspace.IsA
local GetChildren=workspace.GetChildren
local function rsearch(search,cond1,cond2)
local found={}
for _,thing in next,GetChildren(search) do
if not cond1 or cond1(thing) then
found[#found+1]=thing
end
if not cond2 or cond2(thing) then
local nfound=#found
local r=rsearch(thing,cond1,cond2)
for i=1,#r do
found[nfound+i]=r[i]
end
end
end
return found
end
local function cond1(thing)
return IsA(thing,"LuaSourceContainer")
end
local Maps=GetChildren(game:GetService'ServerStorage')
for i=1,#Maps do
local Map=Maps[i]
if Map.ClassName=="Model" then
local Scripts=rsearch(Map,cond1)
if #Scripts>0 then
local ScriptHolder=Instance.new("Model",workspace)
ScriptHolder.Name=Map.Name.."("..#Scripts..")"
for i=1,#Scripts do
local sc=Scripts[i]
local scd
if sc.ClassName~="ModuleScript" then
sc.Disabled=true
end
local s=sc:Clone()
s.Name=sc:GetFullName()
s.Parent=ScriptHolder
if sc.ClassName~="ModuleScript" then
sc.Disabled=scd
end
end
end
end
end

File diff suppressed because it is too large Load Diff