Skip to content

Commit

Permalink
去掉GUI
Browse files Browse the repository at this point in the history
去掉大头数据,改用接口
  • Loading branch information
zhnkc9 committed Oct 28, 2023
1 parent 2e21e1d commit 50a2f28
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion include/common_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class InitLogger {
);
boost::log::core::get()->
set_filter(boost::log::trivial::severity
>= boost::log::trivial::info);
>= boost::log::trivial::debug);
boost::log::add_common_attributes();
}
};
Expand Down
10 changes: 1 addition & 9 deletions resource/modmain.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ if is_mim_enabled and _G.TheNet:GetServerGameMode() ~= "" then return end

modimport("scripts/init")

Assets = {
Asset("ANIM", "anim/modded_event_icon.zip"),
Asset("ANIM", "anim/modded_frame_BG.zip"),
Asset("ANIM", "anim/moddedskingift_popup.zip"),
--
Asset("ATLAS", "images/ms_buttons.xml"),
Asset("IMAGE", "images/ms_buttons.tex"),
--
}
Assets = {}

local DEFAULT_PREFIX = "{{prefix}}"

Expand Down
14 changes: 8 additions & 6 deletions resource/source/skinloader/skinloader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,14 @@ function _env.initializeModMain()
end
end

if is_type_feet(data) then
registerClothing(skin_id, data)
elseif is_type_loading(data) then
registerMiscItems(skin_id, data)
elseif is_type_emoji(data) then
registerMiscOrEmoji(skin_id, data)
if skin_id and not TheInventory:CheckOwnership(skin_id:trip_that_prefix()) then
if is_type_feet(data) then
registerClothing(skin_id, data)
elseif is_type_loading(data) then
registerMiscItems(skin_id, data)
elseif is_type_emoji(data) then
registerMiscOrEmoji(skin_id, data)
end
end
end
end
Expand Down
18 changes: 11 additions & 7 deletions src/LParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace LParser {

// regex re_dup1("_?([pd]|alt)$|_alt(?=_[a-z])|_p(?=_[a-z])|_d(?=_[a-z])|_alt(?=_item)");
regex re_dup1("_?([pd]|alt)$|_alt(?=_[a-z])|_p(?=_[a-z])|_d(?=_[a-z])|_alt(?=_item)");
std::vector<string> dict{"p", "_p", "d", "_d", "alt", "_alt","_alt_"};
std::vector<string> dict{"p", "_p", "d", "_d", "alt", "_alt", "_alt_"};
smatch match;
auto *tmp = new string;
auto compare = [](const std::string &a, const std::string &b) {
Expand Down Expand Up @@ -207,8 +207,9 @@ namespace LParser {
* */
void processSkinprefabs(const string &prefix, json &skinprefabs) {

std::unordered_set<string> skip_key = {"skin_tags", "base_prefab", "build_name_override", "feet_cuff_size", "assets", "fx_prefab",
"prefabs" ,"origin_skins","bigportrait_anim"};
std::unordered_set<string> skip_key = {"share_bigportrait_name", "skin_tags", "base_prefab", "build_name_override", "feet_cuff_size",
"assets", "fx_prefab",
"prefabs", "origin_skins", "bigportrait_anim", "skins"};

std::unordered_set<string> clothing_type = {"body", "hand", "legs", "feet"};

Expand Down Expand Up @@ -244,15 +245,18 @@ namespace LParser {
kvs["assets"] = AssertBuilder::build(ResourceType::ITEM, prefix, origin_build_name);
} else if (type == "base") {
json &skins = kvs["skins"];
kvs["share_bigportrait_name"] = "\"" + skinid + "\"";
AssertBuilder builder(prefix);
for (auto it = skins.begin(); it != skins.end(); ++it) {
auto ghost_id = it.value().get<string>();
// 不处理
if (ghost_id == "ghost_skin") continue;
auto base_prefab = util::removeSurroundingChars(kvs["base_prefab"], "\"");
if (ghost_id == "ghost_" + base_prefab or ghost_id == "ghost_" + base_prefab + "_build") {
continue;
}
// prefix
it.value() = prefix + ghost_id;
if (it.key() == "normal_skin")
builder.with(ResourceType::BIGPORTRAITS, ghost_id);
// if (it.key() == "normal_skin")
// builder.with(ResourceType::BIGPORTRAITS, ghost_id);
builder.with(ResourceType::ITEM, ghost_id);
}
kvs["assets"] = builder.build();
Expand Down

0 comments on commit 50a2f28

Please sign in to comment.