File tree Expand file tree Collapse file tree 4 files changed +50
-8
lines changed Expand file tree Collapse file tree 4 files changed +50
-8
lines changed Original file line number Diff line number Diff line change 1
1
# UnderScript Changelog
2
2
3
- ## Version 0.45.0 (2021-06-06 )
3
+ ## Version 0.45.0 (2021-06-16 )
4
4
### New Features
5
5
1 . Added ability to buy multiple packs
6
6
1 . Added confirmation for buying packs with UCP
7
7
1 . Added a setting to switch minigame controls to WASD (disabled by default)
8
8
1 . Added a random avatar button
9
9
1 . Added setting to prefer shiny on import (enabled by default)
10
10
1 . Added "fill deck" button
11
+ 1 . Added confirmation for buying cosmetics
11
12
### Fixes
12
13
1 . Fixed bug with base card skin setting
13
14
### Plugins
Original file line number Diff line number Diff line change @@ -48,18 +48,20 @@ wrap(() => {
48
48
type,
49
49
gold : ! cost ,
50
50
} ;
51
- if ( cost ) {
51
+ if ( cost && ! e . shiftKey ) {
52
52
global ( 'BootstrapDialog' ) . show ( {
53
53
title : 'Buy packs with UCP?' ,
54
- message : `You are about to buy ${ count } pack${ count > 1 ? 's' : '' } with UCP, continue?` ,
54
+ message : $ . i18n ( `Buy ${ count } pack${ count > 1 ? 's' : '' } for {{ UCP: ${ count * 10 } }} UCP?` ) ,
55
55
buttons : [ {
56
- label : `Continue` ,
56
+ label : $ . i18n ( 'dialog-continue' ) ,
57
+ cssClass : 'btn-success' ,
57
58
action ( diag ) {
58
59
buyPacks ( data ) ;
59
60
diag . close ( ) ;
60
61
} ,
61
62
} , {
62
- label : 'Cancel' ,
63
+ label : $ . i18n ( 'dialog-cancel' ) ,
64
+ cssClass : 'btn-danger' ,
63
65
action ( diag ) {
64
66
diag . close ( ) ;
65
67
} ,
@@ -69,7 +71,7 @@ wrap(() => {
69
71
buyPacks ( data ) ;
70
72
}
71
73
} ) ;
72
- hover . new ( ' CTRL: Buy MAX packs<br>ALT: Buy (up to) 10 packs' , el ) ;
74
+ hover . new ( ` CTRL: Buy MAX packs<br>ALT: Buy (up to) 10 packs${ cost ? '<br>SHIFT: Bypass confirmation' : '' } ` , el ) ;
73
75
} ) ;
74
76
} ) ;
75
77
} ) ;
Original file line number Diff line number Diff line change
1
+ wrap ( ( ) => {
2
+ onPage ( 'CosmeticsShop' , ( ) => {
3
+ eventManager . on ( ':loaded' , ( ) => {
4
+ $ ( 'form[action=CosmeticsShop] button' )
5
+ . hover ( hover . show ( 'Shift: Bypass confirmation' ) , hover . hide )
6
+ . click ( function click ( e ) {
7
+ if ( e . shiftKey ) return ;
8
+ e . preventDefault ( ) ;
9
+ const form = $ ( e . currentTarget ) . parent ( ) ;
10
+ const parent = $ ( form . parents ( 'table.table-condensed, div' ) [ 0 ] ) ;
11
+ const image = parent . find ( 'img' ) [ 0 ] . outerHTML ;
12
+ const cost = parent . find ( 'span[class=ucp]:first' ) . text ( ) ;
13
+ global ( 'BootstrapDialog' ) . show ( {
14
+ title : 'Buy with UCP?' ,
15
+ message : `<div style="overflow: hidden;">${ image } </div>${ $ . i18n ( ` Buy for {{UCP:${ cost } }} UCP?` ) } ` ,
16
+ buttons : [ {
17
+ label : $ . i18n ( 'dialog-continue' ) ,
18
+ cssClass : 'btn-success' ,
19
+ action ( diag ) {
20
+ form . submit ( ) ;
21
+ diag . close ( ) ;
22
+ } ,
23
+ } , {
24
+ label : $ . i18n ( 'dialog-cancel' ) ,
25
+ cssClass : 'btn-danger' ,
26
+ action ( diag ) {
27
+ diag . close ( ) ;
28
+ } ,
29
+ } ] ,
30
+ } ) ;
31
+ } ) ;
32
+ } ) ;
33
+ } ) ;
34
+ } ) ;
Original file line number Diff line number Diff line change @@ -473,9 +473,14 @@ const settings = wrap(() => {
473
473
474
474
function importSettings ( string ) {
475
475
try {
476
- // TODO
476
+ // TODO: Call setting events?
477
+ const parsed = JSON . parse ( atob ( string ) ) ;
478
+ fn . each ( parsed , ( val , key ) => {
479
+ console . log ( key , val ) ;
480
+ localStorage . setItem ( key , val ) ;
481
+ } ) ;
477
482
} catch ( e ) {
478
- // TODO
483
+ console . error ( e ) ;
479
484
}
480
485
}
481
486
You can’t perform that action at this time.
0 commit comments