Skip to content

Commit cfa3540

Browse files
committed
updated about tab
1 parent 223aafe commit cfa3540

15 files changed

Lines changed: 445 additions & 48 deletions

File tree

backend/i18n/i18n.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ func (i *I18N) GetLanguages() ([]map[string]string, error) {
8383
name = langName
8484
}
8585

86+
author := ""
87+
if auth, ok := jsonMap["author"].(string); ok {
88+
author = auth
89+
}
90+
8691
langs = append(langs, map[string]string{
87-
"code": code,
88-
"name": name,
92+
"code": code,
93+
"name": name,
94+
"author": author,
8995
})
9096
}
9197

backend/utils/launch.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package utils
22

33
import (
4+
"encoding/json"
45
"fmt"
6+
"lce/backend/version"
7+
"net/http"
58
"os"
69
"os/exec"
710
"path/filepath"
@@ -105,3 +108,37 @@ func (g *Utils) OpenFile(path string) error {
105108
}
106109
return nil
107110
}
111+
112+
func (g *Utils) GetAppVersion() string {
113+
return version.App.Version
114+
}
115+
116+
func (g *Utils) OpenURL(url string) error {
117+
cmd := exec.Command("cmd", "/C", "start", "", url)
118+
return cmd.Start()
119+
}
120+
121+
type DiscordInvite struct {
122+
ApproximatePresenceCount int `json:"approximate_presence_count"`
123+
ApproximateMemberCount int `json:"approximate_member_count"`
124+
}
125+
126+
func (g *Utils) GetDiscordStats(inviteCode string) (*DiscordInvite, error) {
127+
url := fmt.Sprintf("https://discord.com/api/v9/invites/%s?with_counts=true", inviteCode)
128+
resp, err := http.Get(url)
129+
if err != nil {
130+
return nil, err
131+
}
132+
defer resp.Body.Close()
133+
134+
if resp.StatusCode != http.StatusOK {
135+
return nil, fmt.Errorf("discord api returned status: %d", resp.StatusCode)
136+
}
137+
138+
var invite DiscordInvite
139+
if err := json.NewDecoder(resp.Body).Decode(&invite); err != nil {
140+
return nil, err
141+
}
142+
143+
return &invite, nil
144+
}

build/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ info:
1111
description: "Legend of DotA Config Editor" # The application description
1212
copyright: "(c) 2025, phphacker" # Copyright text
1313
comments: "LoD Config Editor" # Comments
14-
version: "0.9.6" # The application version
14+
version: "0.9.7" # The application version
1515

1616
# iOS build configuration (uncomment to customise iOS project generation)
1717
# Note: Keys under `ios` OVERRIDE values under `info` when set.
@@ -21,7 +21,7 @@ info:
2121
# # The display name shown under the app icon (CFBundleDisplayName/CFBundleName)
2222
# displayName: "My Product"
2323
# # The app version to embed in Info.plist (CFBundleShortVersionString/CFBundleVersion)
24-
# version: "0.0.1"
24+
# version: "0.9.7"
2525
# # The company/organisation name for templates and project settings
2626
# company: "My Company"
2727
# # Additional comments to embed in Info.plist metadata

build/windows/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
},
55
"info": {
66
"0000": {
7-
"ProductVersion": "0.9.6.0",
7+
"ProductVersion": "0.9.7.0",
88
"CompanyName": "phphacker",
99
"FileDescription": "Legend of DotA Config Editor",
1010
"LegalCopyright": "© 2025, phphacker",

build/windows/wails.exe.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
3-
<assemblyIdentity type="win32" name="com.phphacker.lodconfigeditor" version="0.9.6.0" processorArchitecture="*"/>
3+
<assemblyIdentity type="win32" name="com.phphacker.lodconfigeditor" version="0.9.7.0" processorArchitecture="*"/>
44
<dependency>
55
<dependentAssembly>
66
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>

frontend/bindings/lce/backend/utils/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ import * as Utils from "./utils.js";
66
export {
77
Utils
88
};
9+
10+
export {
11+
DiscordInvite
12+
} from "./models.js";
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @ts-check
2+
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
3+
// This file is automatically generated. DO NOT EDIT
4+
5+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
6+
// @ts-ignore: Unused imports
7+
import { Create as $Create } from "@wailsio/runtime";
8+
9+
export class DiscordInvite {
10+
/**
11+
* Creates a new DiscordInvite instance.
12+
* @param {Partial<DiscordInvite>} [$$source = {}] - The source object to create the DiscordInvite.
13+
*/
14+
constructor($$source = {}) {
15+
if (!("approximate_presence_count" in $$source)) {
16+
/**
17+
* @member
18+
* @type {number}
19+
*/
20+
this["approximate_presence_count"] = 0;
21+
}
22+
if (!("approximate_member_count" in $$source)) {
23+
/**
24+
* @member
25+
* @type {number}
26+
*/
27+
this["approximate_member_count"] = 0;
28+
}
29+
30+
Object.assign(this, $$source);
31+
}
32+
33+
/**
34+
* Creates a new DiscordInvite instance from a string or object.
35+
* @param {any} [$$source = {}]
36+
* @returns {DiscordInvite}
37+
*/
38+
static createFrom($$source = {}) {
39+
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
40+
return new DiscordInvite(/** @type {Partial<DiscordInvite>} */($$parsedSource));
41+
}
42+
}

frontend/bindings/lce/backend/utils/utils.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@
66
// @ts-ignore: Unused imports
77
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
88

9+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
10+
// @ts-ignore: Unused imports
11+
import * as $models from "./models.js";
12+
13+
/**
14+
* @returns {$CancellablePromise<string>}
15+
*/
16+
export function GetAppVersion() {
17+
return $Call.ByID(287003546);
18+
}
19+
20+
/**
21+
* @param {string} inviteCode
22+
* @returns {$CancellablePromise<$models.DiscordInvite | null>}
23+
*/
24+
export function GetDiscordStats(inviteCode) {
25+
return $Call.ByID(1690288880, inviteCode).then(/** @type {($result: any) => any} */(($result) => {
26+
return $$createType1($result);
27+
}));
28+
}
29+
930
/**
1031
* Запуск игры с аргументами
1132
* @param {string} path
@@ -32,3 +53,15 @@ export function OpenFile(path) {
3253
export function OpenFolderInExplorer(path) {
3354
return $Call.ByID(3950432153, path);
3455
}
56+
57+
/**
58+
* @param {string} url
59+
* @returns {$CancellablePromise<void>}
60+
*/
61+
export function OpenURL(url) {
62+
return $Call.ByID(3202016086, url);
63+
}
64+
65+
// Private type creation functions
66+
const $$createType0 = $models.DiscordInvite.createFrom;
67+
const $$createType1 = $Create.Nullable($$createType0);

0 commit comments

Comments
 (0)