@@ -22,23 +22,23 @@ export class CoreHotbarFlagsForm extends FormApplication {
22
22
23
23
getData ( ) {
24
24
let data = {
25
- chbPrimaryColor : game . settings . get ( "custom-hotbar" , "chbPrimaryColor " ) ,
26
- chbBorderColor : game . settings . get ( "custom-hotbar" , "chbBorderColor " ) ,
27
- chbBorderColorActive : game . settings . get ( "custom-hotbar" , "chbBorderColorActive " ) ,
28
- chbBorderColorInactive : game . settings . get ( "custom-hotbar" , "chbBorderColorInactive " ) ,
25
+ corePrimaryColor : game . user . getFlag ( "custom-hotbar" , "corePrimaryColor " ) ,
26
+ coreBorderColor : game . user . getFlag ( "custom-hotbar" , "coreBorderColor " ) ,
27
+ coreBorderColorActive : game . user . getFlag ( "custom-hotbar" , "coreBorderColorActive " ) ,
28
+ coreBorderColorInactive : game . user . getFlag ( "custom-hotbar" , "coreBorderColorInactive " ) ,
29
29
30
- chbXPos : game . settings . get ( "custom-hotbar" , "chbXPos " ) ,
31
- chbYPos : game . settings . get ( "custom-hotbar" , "chbYPos " )
30
+ coreXPos : game . user . getFlag ( "custom-hotbar" , "coreXPos " ) ,
31
+ coreYPos : game . user . getFlag ( "custom-hotbar" , "coreYPos " )
32
32
} ;
33
33
if ( this . reset == true ) {
34
34
data = {
35
- chbPrimaryColor : game . settings . settings . get ( "custom-hotbar.chbPrimaryColor " ) . default ,
36
- chbBorderColor : game . settings . settings . get ( "custom-hotbar.chbBorderColor " ) . default ,
37
- chbBorderColorActive : game . settings . settings . get ( "custom-hotbar.chbBorderColorActive " ) . default ,
38
- chbBorderColorInactive : game . settings . settings . get ( "custom-hotbar.chbBorderColorInactive " ) . default ,
35
+ corePrimaryColor : game . settings . settings . get ( "custom-hotbar.corePrimaryColor " ) . default ,
36
+ coreBorderColor : game . settings . settings . get ( "custom-hotbar.coreBorderColor " ) . default ,
37
+ coreBorderColorActive : game . settings . settings . get ( "custom-hotbar.coreBorderColorActive " ) . default ,
38
+ coreBorderColorInactive : game . settings . settings . get ( "custom-hotbar.coreBorderColorInactive " ) . default ,
39
39
40
- chbXPos : game . settings . settings . get ( "custom-hotbar.chbXPos " ) . default ,
41
- chbYPos : game . settings . settings . get ( "custom-hotbar.chbYPos " ) . default
40
+ coreXPos : game . settings . settings . get ( "custom-hotbar.coreXPos " ) . default ,
41
+ coreYPos : game . settings . settings . get ( "custom-hotbar.coreYPos " ) . default
42
42
} ;
43
43
}
44
44
this . render ;
@@ -57,24 +57,33 @@ export class CoreHotbarFlagsForm extends FormApplication {
57
57
*/
58
58
//this is currently defined for an onload not a submit...
59
59
async _updateObject ( e , d ) {
60
+ game . user . unsetFlag ( "custom-hotbar" , "corePrimaryColor" ) ,
61
+ game . user . unsetFlag ( "custom-hotbar" , "coreBorderColor" ) ,
62
+ game . user . unsetFlag ( "custom-hotbar" , "coreBorderColorActive" ) ,
63
+ game . user . unsetFlag ( "custom-hotbar" , "coreBorderColorInactive" ) ,
64
+
65
+ game . user . unsetFlag ( "custom-hotbar" , "coreXPos" ) ,
66
+ game . user . unsetFlag ( "custom-hotbar" , "coreYPos" )
67
+
68
+
60
69
console . debug ( "Custom Hotbar | Attempting to update settings with form values..." ) ;
61
- game . settings . set ( "custom-hotbar" , "chbPrimaryColor " , d . chbPrimaryColor ) ;
62
- game . settings . set ( "custom-hotbar" , "chbBorderColor " , d . chbBorderColor ) ;
63
- game . settings . set ( "custom-hotbar" , "chbBorderColorActive " , d . chbBorderColorActive ) ;
64
- game . settings . set ( "custom-hotbar" , "chbBorderColorInactive " , d . chbBorderColorInactive ) ;
65
- game . settings . set ( "custom-hotbar" , "chbXPos " , d . chbXPos ) ;
66
- game . settings . set ( "custom-hotbar" , "chbYPos " , d . chbYPos ) ;
70
+ game . user . setFlag ( "custom-hotbar" , "corePrimaryColor " , d . corePrimaryColor ) ;
71
+ game . user . setFlag ( "custom-hotbar" , "coreBorderColor " , d . coreBorderColor ) ;
72
+ game . user . setFlag ( "custom-hotbar" , "coreBorderColorActive " , d . coreBorderColorActive ) ;
73
+ game . user . setFlag ( "custom-hotbar" , "coreBorderColorInactive " , d . coreBorderColorInactive ) ;
74
+ game . user . setFlag ( "custom-hotbar" , "coreXPos " , d . coreXPos ) ;
75
+ game . user . setFlag ( "custom-hotbar" , "coreYPos " , d . coreYPos ) ;
67
76
this . render ( ) ;
68
77
}
69
78
70
79
onReset ( ) {
71
- console . debug ( "Custom Hotbar | Attempting to reset chbSettingsForm to defaults" ) ;
80
+ console . debug ( "Custom Hotbar | Attempting to reset coreSettingsForm to defaults" ) ;
72
81
this . reset = true ;
73
82
this . render ( ) ;
74
83
}
75
84
76
85
activateListeners ( html ) {
77
- console . debug ( "Custom Hotbar | Attempting to activate CHB Settings Form listeners" ) ;
86
+ console . debug ( "Custom Hotbar | Attempting to activate core Settings Form listeners" ) ;
78
87
super . activateListeners ( html ) ;
79
88
html . find ( 'button[name="reset"]' ) . click ( this . onReset . bind ( this ) ) ;
80
89
this . reset = false ;
0 commit comments