Compare commits

..

No commits in common. "652bd5fe1a03eb26a8ba8ad7169a5b078e51a06b" and "88221039bb0d2aabbb1c23c216422f2f7046d9e3" have entirely different histories.

2 changed files with 10 additions and 11 deletions

View File

@ -32,18 +32,15 @@ void RefreshBlocks() {
auto pluginmaptype = cast<CGameEditorPluginMapMapType>(cast<CGameCtnEditorFree>(GetApp().Editor).PluginMapType); auto pluginmaptype = cast<CGameEditorPluginMapMapType>(cast<CGameCtnEditorFree>(GetApp().Editor).PluginMapType);
for(uint i = 0; i < blocks.Length; i++) { for(uint i = 0; i < blocks.Length; i++) {
string blockname = blocks[i].BlockModel.IdName; int idifexist = -1;
int fallbacksize = 0; string blockname;
bool isofficial = true; bool isofficial = true;
blockname = blocks[i].BlockModel.IdName;
if (blockname.ToLower().SubStr(blockname.Length - 22, 22) == ".block.gbx_customblock") { if (blockname.ToLower().SubStr(blockname.Length - 22, 22) == ".block.gbx_customblock") {
isofficial = false; isofficial = false;
blockname = blockname.SubStr(0, blockname.Length - 12); blockname = blockname.SubStr(0, blockname.Length - 12);
auto article = cast<CGameCtnArticle>(blocks[i].BlockInfo.ArticlePtr);
fallbacksize = article.BlockItem_ItemModelArticle.CollectorFid.ByteSize;
} }
if (include_default_objects || blockname.ToLower().SubStr(blockname.Length - 10, 10) == ".block.gbx") { if (include_default_objects || blockname.ToLower().SubStr(blockname.Length - 10, 10) == ".block.gbx") {
vec3 pos; vec3 pos;
if (blocks[i].CoordX != 4294967295 && blocks[i].CoordZ != 4294967295) { // Not placed in free mapping if (blocks[i].CoordX != 4294967295 && blocks[i].CoordZ != 4294967295) { // Not placed in free mapping
@ -70,7 +67,7 @@ void RefreshBlocks() {
objects[index].positions.InsertLast(pos); objects[index].positions.InsertLast(pos);
} else { } else {
int trigger = blocks[i].BlockModel.EdWaypointType; int trigger = blocks[i].BlockModel.EdWaypointType;
AddNewObject(blockname, trigger, "Block", pos, fallbacksize, isofficial); AddNewObject(blockname, trigger, "Block", pos, 0, isofficial);
objectsindex.InsertLast(blockname); objectsindex.InsertLast(blockname);
} }
} }
@ -87,6 +84,7 @@ void RefreshItems() {
// Items // Items
auto items = map.AnchoredObjects; auto items = map.AnchoredObjects;
for(uint i = 0; i < items.Length; i++) { for(uint i = 0; i < items.Length; i++) {
int idifexist = -1;
string itemname = items[i].ItemModel.IdName; string itemname = items[i].ItemModel.IdName;
int fallbacksize = 0; int fallbacksize = 0;
bool isofficial = true; bool isofficial = true;
@ -96,9 +94,10 @@ void RefreshItems() {
auto article = cast<CGameCtnArticle>(items[i].ItemModel.ArticlePtr); auto article = cast<CGameCtnArticle>(items[i].ItemModel.ArticlePtr);
if (article !is null) { if (article !is null) {
itemname = string(article.PageName) + string(article.Name) + ".Item.Gbx"; itemname = string(article.PageName) + string(article.Name) + ".Item.Gbx";
} else {
auto fid = cast<CSystemFidFile@>(GetFidFromNod(items[i].ItemModel));
fallbacksize = fid.ByteSize;
} }
auto fid = cast<CSystemFidFile@>(GetFidFromNod(items[i].ItemModel));
fallbacksize = fid.ByteSize;
} }
if (include_default_objects || itemname.ToLower().SubStr(itemname.Length - 9, 9) == ".item.gbx") { if (include_default_objects || itemname.ToLower().SubStr(itemname.Length - 9, 9) == ".item.gbx") {
@ -195,4 +194,4 @@ bool FocusCam(const string &in objectname) {
return true; return true;
} }
return false; return false;
} }

View File

@ -3,5 +3,5 @@ name = "Blocks & Items Counter"
author = "Beu" author = "Beu"
category = "Map Editor" category = "Map Editor"
siteid = 97 siteid = 97
version = "1.7" version = "1.6"
blocks = [ "Plugin_Blocks&ItemsCounter" ] blocks = [ "Plugin_Blocks&ItemsCounter" ]