Skip to content

Commit

Permalink
Add fake sites warning card
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Jul 7, 2023
1 parent d0521cd commit 7ba5703
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
VencordInstaller
VencordInstaller.exe

*.syso

nsis/nsis-installer.exe
VencordInstallerCli
*.exe
*.syso
2 changes: 1 addition & 1 deletion constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
DiscordGreen = color.RGBA{R: 0x2D, G: 0x7C, B: 0x46, A: 0xFF}
DiscordRed = color.RGBA{R: 0xEC, G: 0x41, B: 0x44, A: 0xFF}
DiscordBlue = color.RGBA{R: 0x58, G: 0x65, B: 0xF2, A: 0xFF}
DiscordYellow = color.RGBA{R: 0xf0, G: 0xb2, B: 0x32, A: 0xff}
DiscordYellow = color.RGBA{R: 0xfe, G: 0xe7, B: 0x5c, A: 0xff}
)

var LinuxDiscordNames = []string{
Expand Down
20 changes: 15 additions & 5 deletions gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,17 @@ func renderInstaller() g.Widget {
g.Separator(),
g.Dummy(0, 5),

g.Style().SetFontSize(20).To(
renderErrorCard(
DiscordYellow,
"**Github** and **vencord.dev** are the only official places to get Vencord. Any other site claiming to be us is malicious.\n"+
"If you downloaded from any other source, you should delete / uninstall everything immediately, run a malware scan and change your Discord password.",
90,
),
),

g.Dummy(0, 5),

g.Style().SetFontSize(30).To(
g.Label("Please select an install to patch"),
),
Expand Down Expand Up @@ -505,15 +516,15 @@ func renderInstaller() g.Widget {
return layout
}

func renderErrorCard(col color.Color, message string) g.Widget {
func renderErrorCard(col color.Color, message string, height float32) g.Widget {
return g.Style().
SetColor(g.StyleColorChildBg, col).
SetStyleFloat(g.StyleVarAlpha, 0.9).
SetStyle(g.StyleVarWindowPadding, 10, 10).
SetStyleFloat(g.StyleVarChildRounding, 5).
To(
g.Child().
Size(g.Auto, 40).
Size(g.Auto, height).
Layout(
g.Row(
g.Style().SetColor(g.StyleColorText, color.Black).To(
Expand Down Expand Up @@ -548,7 +559,6 @@ func loop() {
),

g.Dummy(0, 20),

g.Style().SetFontSize(20).To(
g.Row(
g.Label(Ternary(IsDevInstall, "Dev Install: ", "Files will be downloaded to: ")+FilesDir),
Expand All @@ -575,13 +585,13 @@ func loop() {
}
return g.Label("Latest Vencord Version: " + LatestHash)
}, func() g.Widget {
return renderErrorCard(DiscordRed, "Failed to fetch Info from GitHub: "+GithubError.Error())
return renderErrorCard(DiscordRed, "Failed to fetch Info from GitHub: "+GithubError.Error(), 40)
},
},
&CondWidget{
IsInstallerOutdated,
func() g.Widget {
return renderErrorCard(DiscordYellow, "This Installer is outdated!"+GetInstallerDownloadMarkdown())
return renderErrorCard(DiscordYellow, "This Installer is outdated!"+GetInstallerDownloadMarkdown(), 40)
},
nil,
},
Expand Down

0 comments on commit 7ba5703

Please sign in to comment.