Periapsises / gm_html_loader

Custom HTML loader for DHTML Panels
3 stars 2 forks source link

Add a navigation bar to the HTML that to open other pages #1

Open obscurefreeman opened 8 months ago

obscurefreeman commented 8 months ago

I want to add a navigation bar in Gmod's DHTML to open other HTML files, is this possible?

Periapsises commented 8 months ago

There is GMod's builtin DHTMLControls panel for a navigation bar if that's what you mean? But it doesn't handle looking through local files like :OpenFile() does. I'll look into it and see if I can patch it.

obscurefreeman commented 8 months ago

Thanks for your reply.

That's not what I meant.

For example, I have to add a DTree to open other HTML files:

20240204225414_1

local proppaneldocument = vgui.Create( "DTree", paneldocumentbackground )
proppaneldocument:Dock(LEFT)
proppaneldocument:SetWidth(200)

local node1 = proppaneldocument:AddNode( "#ofminigame.documenthome","icon16/house.png" )
node1.DoClick = function()
    ofmgm_opendocument("README")
end

If I can add a sidebar inside the HTML file, I can click links on the sidebar to open another file. So is that possible?