News:

Welcome to World of Banished!

Main Menu

How to put your new mod in the Community Toolbar !

Started by RedKetchup, February 12, 2017, 09:31:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

scoutae4

Thanks for this @RedKetchup - I understand this in theory, but I'm still very green to coding so it's not obvious to me how you build out the subcategories.

I have a Personal Toolbar set up and working with all my categories like housing, roads, etc, and some extras I may never use (just to be future safe) but I'm pretty sure I'm going to need subcategories too. Problem is, if I wait until I need them to take care of it, it looks like it would be a monumental pain in the butt to reverse include them. And as you say, a problem for anyone I've shared the originals with.

I think I understand your first code example as what you put in your personal toolbar .rsc file in the Game folder (so for me, this is "Game>ScoutToolbar.rsc") In your example you're calling from your UI folder, I have this set up in Dialog - I guess that doesn't matter so long as the called files are where they are supposed to be?

This snippet:

int _sortPriority = ???

...this is how your prioritize the order of your icons in the menu (I assume). Your categories jump by 100s to leave room for the future in case you want to add other categories in between OR is this number the parent for subcategories (so like a subcategory for Housing that is Small Homes would be 101 or 110?)






If my personal toolbar is established like so:

Toolbar base
{
StringTable _stringTable = "Dialog/ScoutToolbarStringTable.rsc";
SpriteSheet _spriteSheet = "Dialog/ScoutToolbarSpriteSheet.rsc";
}


Then does a subcategory look like this:

Toolbar main
{
StringTable _stringTable = "Dialog/ScoutToolbarStringTable.rsc";
SpriteSheet _spriteSheet = "Dialog/ScoutToolbarSpriteSheet.rsc";
}


and is it included in the existing Personal Toolbar files or do I create new files?






If my category for housing looks like this:

Toolbar ScoutHousing : "base"
{
Toolbar _parent = "Game/ScoutToolbar.rsc:ScoutToolbar";
int _sortPriority = 100;

String _toolTip = "ScoutHousingTip";
String _image = "ScoutToolbarHousing";
Action _action = ShowGroup;

bool _autoHotKey = true;
}


Then does a subcategory for say, Small Homes, look like this:

Toolbar ScoutHousing : "main"
{
Toolbar _parent = "Game/ScoutToolbar.rsc:ScoutToolbarHousing";
int _sortPriority = 110;

String _toolTip = "ScoutSmallHomesTip";
String _image = "ScoutToolbarSmallHomes";
Action _action = ShowGroup;

bool _autoHotKey = true;
}


AND if so, is this just added into the existing existing Personal Toolbar files (at the end?) or do I create a new file?

Maybe I am overthinking everything.

kid1293



Let's see if this works out. :)

One house on its mod menu

Quote
Toolbar base
{
   StringTable _stringTable = "UI/HillsideStringTable.rsc";
   SpriteSheet _spriteSheet = "UI/HillsideSpriteSheet.rsc";
}

ExternalList resource
{
   External _resources
   [
      "HillsideHouseGround",
      ...

   ]
}

Toolbar Hillside : "base"
{   
   Toolbar _parent = "Game/KIDToolbar.rsc:KIDThemed";
   int _sortPriority = 500;

   String _toolTip = "HillsideTip";   
   String _image = "BuildHillside";
   Action _action = ShowGroup;

   bool _autoHotKey = true;
}

Toolbar HillsideHouseGround
{   
   Toolbar _parent = "KidHillsideVillage.rsc:Hillside";
   int _sortPriority = 100;

   Action _action = Tool;
   ComponentDescription _tool = "Template/HillsideHouseGround.rsc";

   bool _autoHotKey = true;
}

One house in a submenu on the mod menu

Quote

Toolbar base
{
   StringTable _stringTable = "UI/HillsideStringTable.rsc";
   SpriteSheet _spriteSheet = "UI/HillsideSpriteSheet.rsc";
}

ExternalList resource
{
   External _resources
   [
      "HillsideHouseGround",
      ...

   ]
}

Toolbar Hillside : "base"
{   
   Toolbar _parent = "Game/KIDToolbar.rsc:KIDThemed";
   int _sortPriority = 500;

   String _toolTip = "HillsideTip";   
   String _image = "BuildHillside";
   Action _action = ShowGroup;

   bool _autoHotKey = true;
}

Toolbar HillsideHouse : "base"
{   
   Toolbar _parent = "KidHillsideVillage.rsc:Hillside";
   int _sortPriority = 100;

   String _toolTip = "HillsideHouseTip";   
   String _image = "BuildHillsideHouse";
   Action _action = ShowGroup;

   bool _autoHotKey = true;
}

Toolbar HillsideHouseGround
{   
   Toolbar _parent = "KidHillsideVillage.rsc:HillsideHouse";
   int _sortPriority = 100;

   Action _action = Tool;
   ComponentDescription _tool = "Template/HillsideHouseGround.rsc";

   bool _autoHotKey = true;
}


RedKetchup

i  am sorry i ll try to answer tomm
(i did started yesterday but got brain dead due confusion..... i did stop and saved the text i did so far.)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

scoutae4

I really appreciate that @RedKetchup ! No rush, it's the holidays :)

@kid1293 this code will be very helpful when I need categories on top of categories! 21 beers! For now I need to take baby steps. My head is spinning  ;D

Merry Christmas!!

kralyerg

Quote from: scoutae4 on December 21, 2023, 09:13:11 AM
This snippet:

int _sortPriority = ???

...this is how your prioritize the order of your icons in the menu (I assume). Your categories jump by 100s to leave room for the future in case you want to add other categories in between OR is this number the parent for subcategories (so like a subcategory for Housing that is Small Homes would be 101 or 110?)

Yes, this is how you prioritize the order the icons come in the menu.  It doesn't matter if you go 1, 2, 3 or 100, 200, 300.  In the modkit files, Luke had done 100, 200, 300.., so many people kept that numbering system, but you can number them however you like.

It's not related to any parent or sub categories.  Each level gets their own distinct ordering system. 

scoutae4

Thanks for the clarity @kralyerg :) I'm going to take another stab at this after the holidays. I caught a humdinger of a cold and my head is loopy. It's going to be a pajama and stupid movies Christmas - which doesn't sound too bad actually...

I hope you all have a wonderful holiday!!  ;D

catty-cb

Thanks for the community toolbar, have been playing around with modding over at simtropolis and have turned a mushroom into a blacksmith along with adding myself into the community toolbar   :)