Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated link to docs, jumps to relevant section per tool. #62

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lua/wire/cpulib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
CPULib.ErrorCallback = errorCallback

-- Run the timer
timer.Create("cpulib_compile",1/60,0,CPULib.OnCompileTimer)

Check warning on line 79 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
CPULib.Compiling = true
end

Expand All @@ -85,14 +85,14 @@
function CPULib.SelectTab(editor,fileName)
if not editor then return end
local editorType = string.lower(editor.EditorType)
local fullFileName = editorType.."chip\\"..fileName

Check warning on line 88 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 88 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

if string.sub(fileName,1,7) == editorType.."chip" then

Check warning on line 90 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
fullFileName = fileName
end

local sourceTab
for tab=1,editor:GetNumTabs() do

Check warning on line 95 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
if editor:GetEditor(tab).chosenfile == fullFileName then
sourceTab = tab
end
Expand All @@ -114,9 +114,9 @@
CPULib.Compile(source,fileName,
function(warnings)
if #warnings > 0 then
editor.C.Val:Update(nil,warnings," "..#warnings.." Warnings, with "..(HCOMP.WritePointer or "?").." bytes compiled.", Color(163, 130, 64, 255))

Check warning on line 117 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 117 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 117 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 117 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
else
editor.C.Val:Update(nil, nil, " Success, "..(HCOMP.WritePointer or "?").." bytes compiled.", Color(50, 128, 20))

Check warning on line 119 in lua/wire/cpulib.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
end
end,
function(error,errorPos)
Expand Down Expand Up @@ -434,8 +434,12 @@
------------------------------------------------------------------------------
-- Show ZCPU/ZGPU documentation
CPULib.HandbookWindow = nil

function CPULib.ShowDocumentation(platform)
-- Platform bookmarks, it'll automatically jump to this section when opening.
local bookmarks = {
ZGPU="#zgpu",
ZSPU="#zspu"
}
function CPULib.ShowDocumentation(bookmark)
local w = ScrW() * 2/3
local h = ScrH() * 2/3
local browserWindow = vgui.Create("DFrame")
Expand All @@ -448,7 +452,7 @@
browser:SetPos(10, 25)
browser:SetSize(w - 20, h - 35)

browser:OpenURL("http://wiki.wiremod.com/wiki/Category:ZCPU_Handbook")
browser:OpenURL("https://wiremod.github.io/Miscellaneous/zcpudoc.html"..bookmarks[bookmark] or "")
end
end

Expand Down
Loading