From 85346708bfa5dc28bdd88bcad78b0eaf48682bd3 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 16 Oct 2016 22:12:27 +1100 Subject: [PATCH] spjspj - Shorten names of buttons. (#2472) * spjspj - Do a count for supertypes and subtypes of all implemented cards. --- .../java/mage/client/cards/DragCardGrid.java | 4 +- Utils/gen_types_list.pl | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 Utils/gen_types_list.pl diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index 9c82a0915d4..58c30543a97 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -744,8 +744,8 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg sortButton = new JButton("Sort"); filterButton = new JButton("Filter"); visibilityButton = new JButton("Visibility"); - selectByButton = new JButton("Select By .."); - analyseButton = new JButton("Analyse Mana"); + selectByButton = new JButton("Select By"); + analyseButton = new JButton("Mana"); // Name and count label deckNameAndCountLabel = new JLabel(); diff --git a/Utils/gen_types_list.pl b/Utils/gen_types_list.pl new file mode 100644 index 00000000000..c85d86a94c8 --- /dev/null +++ b/Utils/gen_types_list.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl -w + +## +# File: gen_types_list.pl +# Author: spjspj +# Purpose: To open all card java files and count all subtypes/supertypes +# Purpose: Ones with unique spellings are possibly incorrect! +## + +use strict; +use Scalar::Util qw(looks_like_number); + +my $dir_listing = "dir \/a \/b \/s ..\\Mage.Sets\\ | find \".java\" |"; + +open (DIR_LISTING, "$dir_listing"); +my %types; +my %types_files; + +while () +{ + chomp; + my $file = $_; + + my $name = ""; + my $cardNum = ""; + + open (JAVA_FILE, "$file"); + + while () + { + chomp; + + # Eg: this.subtype.add("Human"); + my $line = $_; + if ($line =~ m/this.subtype.add.*"([^"]*)".;/) + { + $types{$1}++; + $types_files{$1} .= $file . ",,,"; + } + if ($line =~ m/this.supertype.add.*"([^"]*)"/) + { + $types{$1}++; + $types_files{$1} .= $file . ",,,"; + } + } + + close (JAVA_FILE); +} +my $key; +foreach $key (sort keys (%types)) +{ + print ("$types{$key} = $key .... "); + if ($types{$key} < 10) + { + print (" In files:$types_files{$key}"); + } + print ("\n"); +}