Welcome to Area Forum
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Home
Help
Search
Calendar
Login
Register
November 23, 2024, 05:47:10 AM
Area Forum
-->
Cardfight!! Vanguard
-->
Request
Suggestion : A clear deck screenshot save
« previous
next »
Print
Pages: [
1
]
Author
Topic: Suggestion : A clear deck screenshot save (Read 4890 times)
0 Members and 1 Guest are viewing this topic.
moudianzi
Newbie
Posts: 5
Karma: 0
Suggestion : A clear deck screenshot save
«
on:
November 20, 2017, 07:50:03 AM »
I am one of the person work for the CFA chinese patch updata. I think the deck screenshot can be better with the below code.(the F9 screenshot is not good enough)
[put the code into an object's step event in the deck edit room]
______________________________________________________________
if(keyboard_check(vk_shift) and keyboard_check_pressed(vk_space)){
var _sf;
_sf = surface_create(600, 88*7);
surface_set_target(_sf);
draw_clear_alpha(c_white, 0);
var _listEx, _listG3, _listG2, _listG1, _listG0;
_listEx = ds_list_create();
_listG3 = ds_list_create();
_listG2 = ds_list_create();
_listG1 = ds_list_create();
_listG0 = ds_list_create();
ds_list_copy(_listEx, global.DefaultDeckEx)
ds_list_sort(_listEx, 1);
var _n;
_n = ds_list_size(_listEx);
var _i;
for(_i=0; _i<_n; _i+=1){
var _cardNumber;
_cardNumber = ds_list_find_value(_listEx, _i);
if(global.CardLoadMini[_cardNumber] == 1){
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_i mod 10), 43+88*(_i div 10));
}else{
global.SpriteUseMini[_cardNumber] = sprite_add('CardSpriteMini/n'+string(_cardNumber)+'.jpg', 1, 0, 0, 30, 43);
global.CardLoadMini[_cardNumber] = 1;
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_i mod 10), 43+88*(_i div 10));
}
}
var _n;
_n = ds_list_size(global.DefaultDeck);
var _i;
for(_i=0; _i<_n; _i+=1){
var _cardNumber;
_cardNumber = ds_list_find_value(global.DefaultDeck, _i);
if(global.UnitGrade[_cardNumber] == 3){
ds_list_add(_listG3, _cardNumber);
}else if(global.UnitGrade[_cardNumber] == 2){
ds_list_add(_listG2, _cardNumber);
}else if(global.UnitGrade[_cardNumber] == 1){
ds_list_add(_listG1, _cardNumber);
}else if(global.UnitGrade[_cardNumber] == 0){
ds_list_add(_listG0, _cardNumber);
}
}
ds_list_sort(_listG3, 1);
ds_list_sort(_listG2, 1);
ds_list_sort(_listG1, 1);
ds_list_sort(_listG0, 1);
var _ex;
_ex = ds_list_size(global.DefaultDeckEx);
var _count;
_count = 0;
// G3
var _n;
_n = ds_list_size(_listG3);
var _i;
for(_i=0; _i<_n; _i+=1){
var _cardNumber;
_cardNumber = ds_list_find_value(_listG3, _i);
if(global.CardLoadMini[_cardNumber] == 1){
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}else{
global.SpriteUseMini[_cardNumber] = sprite_add('CardSpriteMini/n'+string(_cardNumber)+'.jpg', 1, 0, 0, 30, 43);
global.CardLoadMini[_cardNumber] = 1;
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}
_count += 1;
}
// G2
var _n;
_n = ds_list_size(_listG2);
var _i;
for(_i=0; _i<_n; _i+=1){
var _cardNumber;
_cardNumber = ds_list_find_value(_listG2, _i);
if(global.CardLoadMini[_cardNumber] == 1){
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}else{
global.SpriteUseMini[_cardNumber] = sprite_add('CardSpriteMini/n'+string(_cardNumber)+'.jpg', 1, 0, 0, 30, 43);
global.CardLoadMini[_cardNumber] = 1;
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}
_count += 1;
}
// G1
var _n;
_n = ds_list_size(_listG1);
var _i;
for(_i=0; _i<_n; _i+=1){
var _cardNumber;
_cardNumber = ds_list_find_value(_listG1, _i);
if(global.CardLoadMini[_cardNumber] == 1){
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}else{
global.SpriteUseMini[_cardNumber] = sprite_add('CardSpriteMini/n'+string(_cardNumber)+'.jpg', 1, 0, 0, 30, 43);
global.CardLoadMini[_cardNumber] = 1;
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}
_count += 1;
}
// G0
var _n;
_n = ds_list_size(_listG0);
var _i;
for(_i=0; _i<_n; _i+=1){
var _cardNumber;
_cardNumber = ds_list_find_value(_listG0, _i);
if(global.CardLoadMini[_cardNumber] == 1){
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}else{
global.SpriteUseMini[_cardNumber] = sprite_add('CardSpriteMini/n'+string(_cardNumber)+'.jpg', 1, 0, 0, 30, 43);
global.CardLoadMini[_cardNumber] = 1;
draw_sprite(global.SpriteUseMini[_cardNumber], 0, 30+60*(_count mod 10), 43+88*(_count div 10)+88*ceil(_ex/10));
}
_count += 1;
}
ds_list_destroy(_listEx);
ds_list_destroy(_listG3);
ds_list_destroy(_listG2);
ds_list_destroy(_listG1);
ds_list_destroy(_listG0);
surface_save(_sf, string(date_get_year(date_current_datetime()))+string(date_get_month(date_current_datetime()))+string(date_get_day(date_current_datetime()))+string(date_get_hour(date_current_datetime()))+string(date_get_minute(date_current_datetime()))+string(date_get_second(date_current_datetime()))+'.png');
surface_reset_target();
surface_free(_sf);
}
______________________________________________________________
Then, Cfa player can pressed [shift + space] to get a deck screenshot picture with only 16 Exdeck cards and 50 Deck cards by sorting. I think it would be useful, if player want to get a deck screenshot picture for communication.
[The code is a sample ]
Logged
41024
Administrator
Already Interested User
Posts: 158
Karma: 21
Re: Suggestion : A clear deck screenshot save
«
Reply #1 on:
November 20, 2017, 10:12:05 AM »
nice function, I added it to our CFA client.
Although I changed the control button, now it works when you press "S". (like old "deck list" function)
So now in next .exe you can press S and save decklist + screen.
I attached updated .exe file so you can test it. If everything will be okay, this functon will be added in next update.
http://cardfight-wiki.ru/areafor/index.php?action=dlattach;topic=3329.0;attach=4816
«
Last Edit: November 20, 2017, 10:34:10 AM by 41024
»
Logged
Print
Pages: [
1
]
« previous
next »
Area Forum
-->
Cardfight!! Vanguard
-->
Request
Suggestion : A clear deck screenshot save
Join!!