Closed NoobDoesMC closed 5 years ago
So a couple of things here. Looks like there's a bug with the default namespace color if it's not set which I can fix in pxt-core, but there's a workaround.
Add the following in libs/ns.ts
//% color=190
namespace test {
}
@samelhusseini that workaround didn't work?
Unless it isn't meant to work yet? I guess I can update my local pxt
before pxt update
will.
The issue is only for inverted toolboxes, so you could also just change:
"invertedToolbox": false,
to false in pxtarget.json until the fix is propagated.
@samelhusseini how did you get your card
and lights
categories to display properly?
Removing the invertedToolbox
line from pxtarget.json
stops the crashing, but the color, icon, and weight are all still wrong.
@samelhusseini but I still get the problem? The category is always grey with the puzzle icon.
Sorry that was auto closed from pushing the PR. I think you still need to set the colour over in libs/ns.ts. Have you tried that?
@samelhusseini Yeah.
/libs/ns.ts
//% color=190
namespace pxsim.blocks {
}
and inside of /sim/api.ts
I added
//% color=190 weight=100 icon="\uf1ec" block="Blocks"
namespace pxsim.blocks {
//% blockId=gargle block="set block"
export function setBlock(): void {
return;
}
}
Your issue is that you added the namespace pxsim.blocks in ns.ts.
The namespace blocks
underlibs
is mapped to pxsim.blocks
under sim/
and vice versa, so you should try setting the colour on the blocks
namespace in libs/ns.ts
. ie:
//% color=190
namespace blocks {
}
@samelhusseini that also doesn't work, it fails in the same way.
Oh, I just added it to libs/core/ns.ts
and it seems to work now.
Great!
Remove
hideCategories
line frompxtarget.json
Try adding
to
sim/api.ts
and thenpxt serve
.It makes a new grey category that crashes the toolbar when it is clicked