@pma-network/redm 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PMA.d.ts +6 -6
- package/PMA.js +10 -8
- package/package.json +1 -1
package/PMA.d.ts
CHANGED
|
@@ -3,27 +3,27 @@ export type OnJobChange = (pmaThis: PMAWrapper, job: PlayerJob) => void;
|
|
|
3
3
|
export type OnPlayerLoaded = (pmaThis: PMAWrapper) => void;
|
|
4
4
|
declare class PMAWrapper {
|
|
5
5
|
#private;
|
|
6
|
-
|
|
6
|
+
HasPlayerLoaded: Promise<boolean>;
|
|
7
7
|
constructor();
|
|
8
8
|
/**
|
|
9
|
-
* WARNING: this expects you to have waited for {@link
|
|
9
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
10
10
|
*/
|
|
11
11
|
get Job(): PlayerJob;
|
|
12
12
|
/**
|
|
13
|
-
* WARNING: this expects you to have waited for {@link
|
|
13
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
14
14
|
* @returns 1 if the players character is male, or 0 if the players character is female
|
|
15
15
|
*/
|
|
16
16
|
get Gender(): number;
|
|
17
17
|
/**
|
|
18
|
-
* WARNING: this expects you to have waited for {@link
|
|
18
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
19
19
|
*/
|
|
20
20
|
get UniqueId(): number;
|
|
21
21
|
/**
|
|
22
|
-
* WARNING: this expects you to have waited for {@link
|
|
22
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
23
23
|
*/
|
|
24
24
|
get CharacterName(): string;
|
|
25
25
|
/**
|
|
26
|
-
* WARNING: this expects you to have waited for {@link
|
|
26
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
27
27
|
*/
|
|
28
28
|
get Height(): number;
|
|
29
29
|
/**
|
package/PMA.js
CHANGED
|
@@ -10,7 +10,7 @@ class PMAWrapper {
|
|
|
10
10
|
#uid;
|
|
11
11
|
#char_name;
|
|
12
12
|
#height;
|
|
13
|
-
|
|
13
|
+
HasPlayerLoaded;
|
|
14
14
|
#has_loaded_resolve;
|
|
15
15
|
#job_change_cb = [];
|
|
16
16
|
#player_loaded_cb = [];
|
|
@@ -19,43 +19,45 @@ class PMAWrapper {
|
|
|
19
19
|
this.#has_loaded_resolve(true);
|
|
20
20
|
}
|
|
21
21
|
#setup_has_loaded() {
|
|
22
|
-
this.
|
|
22
|
+
this.HasPlayerLoaded = new Promise((res) => {
|
|
23
23
|
this.#has_loaded_resolve = res;
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
constructor() {
|
|
27
27
|
this.#setup_has_loaded();
|
|
28
28
|
if (LocalPlayer.state.has_loaded) {
|
|
29
|
-
|
|
29
|
+
setImmediate(() => {
|
|
30
|
+
this.on_player_loaded();
|
|
31
|
+
});
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
|
-
* WARNING: this expects you to have waited for {@link
|
|
35
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
34
36
|
*/
|
|
35
37
|
get Job() {
|
|
36
38
|
return this.#job;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
|
-
* WARNING: this expects you to have waited for {@link
|
|
41
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
40
42
|
* @returns 1 if the players character is male, or 0 if the players character is female
|
|
41
43
|
*/
|
|
42
44
|
get Gender() {
|
|
43
45
|
return this.#gender;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
|
-
* WARNING: this expects you to have waited for {@link
|
|
48
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
47
49
|
*/
|
|
48
50
|
get UniqueId() {
|
|
49
51
|
return this.#uid;
|
|
50
52
|
}
|
|
51
53
|
/**
|
|
52
|
-
* WARNING: this expects you to have waited for {@link
|
|
54
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
53
55
|
*/
|
|
54
56
|
get CharacterName() {
|
|
55
57
|
return this.#char_name;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
|
-
* WARNING: this expects you to have waited for {@link
|
|
60
|
+
* WARNING: this expects you to have waited for {@link HasPlayerLoaded} to be called before trying to call it!
|
|
59
61
|
*/
|
|
60
62
|
get Height() {
|
|
61
63
|
return this.#height;
|