Added ability to separate words by underscore in generated names

This commit is contained in:
Aruki 2018-02-18 12:16:55 -07:00
parent 366c4cd3ff
commit 6719b82077
7 changed files with 697 additions and 859 deletions

View File

@ -1,42 +1,24 @@
a a
aa
aaa
aac
aaliyah
aaron
ab
aba
abandon abandon
abandoned abandoned
abatement abandoning
abba abbreivate
abbey abbreviated
abbott
abbreviation abbreviation
abbreviations abbreviations
abby
abc
abdominal abdominal
abdul
abe
aberdeen
abi
abide
abigail
abilities abilities
ability ability
abit
able able
abn
abnormal abnormal
abnormalities abnormalities
aboard aboard
aboriginal abort
aborted
aborting
abortion abortion
about about
above above
abraham
abramoff
abroad abroad
abs abs
absence absence
@ -48,29 +30,28 @@ absorbed
absorbing absorbing
absorption absorption
abstract abstract
abstracted
abstracting
abstraction abstraction
abstracts abstracts
absurd absurd
abt abt
abu
abundance abundance
abundant abundant
abundantly
abuse abuse
abused abused
abuses abuses
abusive abusive
ac
aca
acad
academia academia
academic academic
academics academics
academies academies
academy academy
acapulco accel
acc
accelerate accelerate
accelerated accelerated
accelerating
acceleration acceleration
accelerator accelerator
accent accent
@ -98,10 +79,13 @@ acclaim
acclaimed acclaimed
accolades accolades
accommodate accommodate
accommodates
accommodating
accommodation accommodation
accommodations accommodations
accomodation accomodation
accompanied accompanied
accompanies
accompany accompany
accompanying accompanying
accomplish accomplish
@ -123,6 +107,7 @@ accounting
accounts accounts
accreditation accreditation
accredited accredited
accrue
accrued accrued
acct acct
accumulate accumulate
@ -133,8 +118,6 @@ accurate
accurately accurately
accused accused
accustomed accustomed
acdbentity
acdbline
ace ace
acer acer
aces aces
@ -147,22 +130,18 @@ achieves
achieving achieving
acid acid
acids acids
ack
acknowledge acknowledge
acknowledged acknowledged
acknowledgement acknowledgement
acknowledgements acknowledgements
acknowledges acknowledges
acknowledging
acknowledgments acknowledgments
acl
aclu
acm
acme acme
acne acne
acorn acorn
acoustic acoustic
acoustics acoustics
acp
acquire acquire
acquired acquired
acquires acquires
@ -177,9 +156,7 @@ acronym
acronyms acronyms
across across
acrylic acrylic
acs
act act
acta
acted acted
acting acting
action action
@ -189,38 +166,23 @@ activated
activation activation
active active
actively actively
activex
activism
activist
activists
activities activities
activity activity
actor actor
actors actors
actress
actresses
acts acts
actual actual
actually actually
actuarial
acupuncture
acura acura
acute acute
acxiom acxiom
ad ad
ada
adam
adams
adapt adapt
adaptation adaptation
adaptec
adapted adapted
adapter adapter
adapters adapters
adaptive adaptive
adaptor
adaptors
adc
add add
added added
addendum addendum
@ -229,7 +191,6 @@ addicted
addiction addiction
addictive addictive
adding adding
addison
addition addition
additional additional
additionally additionally
@ -242,19 +203,14 @@ addressed
addresses addresses
addressing addressing
adds adds
adelaide
adequacy adequacy
adequate adequate
adequately adequately
adhd
adhere adhere
adherence adherence
adhesion adhesion
adhesive adhesive
adhesives adhesives
adidas
adipex
adj
adjacent adjacent
adjoining adjoining
adjourned adjourned
@ -265,8 +221,6 @@ adjusted
adjusting adjusting
adjustment adjustment
adjustments adjustments
adler
adm
admin admin
administer administer
administered administered
@ -291,13 +245,8 @@ adopted
adopting adopting
adoption adoption
adorable adorable
adp
adr
adrenaline adrenaline
adrian
ads ads
adsense
adsl
adult adult
adults adults
adv adv
@ -336,22 +285,13 @@ advisory
advocacy advocacy
advocate advocate
advocates advocates
adware
ae
aerial aerial
aero aero
aerobic aerobic
aerosmith
aerosol aerosol
aerospace aerospace
aes
aest
aesthetic aesthetic
aesthetics aesthetics
af
afb
afc
aff
affair affair
affairs affairs
affect affect
@ -372,22 +312,12 @@ affirmed
afford afford
affordable affordable
afforded afforded
afghan
afghanistan
afl
aforementioned aforementioned
afp
afraid afraid
africa
african
afro
aft
after after
aftermarket
aftermath aftermath
afternoon afternoon
afterwards afterwards
ag
again again
against against
age age
@ -408,28 +338,17 @@ aggressive
agile agile
agility agility
aging aging
agnes
ago ago
agp
agree agree
agreed agreed
agreeing agreeing
agreement agreement
agreements agreements
agrees agrees
agri
agricultural
agriculture
aguilera
ah
ahead ahead
ahmad
ahmed
ai ai
aid aid
aide
aided aided
aides
aids aids
aim aim
aimed aimed
@ -440,106 +359,39 @@ airborne
aircraft aircraft
aired aired
aires aires
airfare
airfares
airline
airlines
airmail
airplane airplane
airplanes airplanes
airport airway
airports
airsoft
airways airways
aisle aisle
aix
aj
ajax
ak
aka
akin akin
akon
akron
al
ala ala
alabama
aladdin
alain
alameda
alamo
alan
alarm alarm
alarms alarms
alas alas
alaska
alaskan
alba
albania
albanian
albany
albeit
albert
alberta
alberto
albion
album album
albums albums
albuquerque
alcatel
alchemy alchemy
alcohol
alcoholic
alcoholism
ale
alec
alert alert
alerts alerts
alex
alexa
alexander
alexandra
alexandre
alexandria
alexis
alfa
alfred
algae algae
algebra algebra
algebraic algebraic
algeria
algorithm algorithm
algorithms algorithms
ali
alias alias
aliases aliases
alibaba
alibris
alicante
alice
alicia
alien alien
aliens aliens
alienware
align align
aligned aligned
aligning
alignment alignment
aligns
alike alike
alison
alito
alive alive
alkaline
all all
alla
allah
allan
alle
allegations
alleged
allegedly
allegiance allegiance
allegra
allegro
allen
allergic allergic
allergies allergies
allergy allergy
@ -549,7 +401,6 @@ alliance
alliances alliances
allied allied
allies allies
allison
allocate allocate
allocated allocated
allocation allocation
@ -564,34 +415,23 @@ allows
alloy alloy
alloys alloys
ally ally
alma
almanac
almighty almighty
almond
almost almost
aloe
aloha
alone alone
along along
alongside alongside
alot
aloud aloud
alpha alpha
alphabet alphabet
alphabetical alphabetical
alphabetically alphabetically
alpine alpine
alprazolam
alps alps
alr
already already
alright alright
als
also also
alt alt
alta
altar altar
altavista
alter alter
alteration alteration
alterations alterations
@ -602,62 +442,28 @@ alternating
alternative alternative
alternatively alternatively
alternatives alternatives
although
altitude altitude
alto
altogether altogether
alton
aluminium
aluminum aluminum
alumni
alvin
always always
alzheimer
am am
ama
amanda
amarillo
amateur amateur
amateurs amateurs
amatuer
amature
amazed
amazing
amazingly
amazon
ambassador ambassador
amber amber
ambien
ambient ambient
ambiguous ambiguous
ambition ambition
ambitious ambitious
ambulance ambulance
amc
amd
amelia
amen
amend amend
amended amended
amending amending
amendment amendment
amendments amendments
amenities amenities
amer
america
american
americana
americans
americas
ames
amethyst amethyst
amex
amg
amherst
ami
amid amid
amiga
amino
ammo ammo
ammonia ammonia
ammunition ammunition
@ -3534,6 +3340,7 @@ colonies
colony colony
color color
colorado colorado
coloration
colored colored
colorful colorful
coloring coloring
@ -20005,6 +19812,7 @@ zz
7 7
8 8
9 9
accel
anim anim
annihilate annihilate
annihilator annihilator
@ -20017,9 +19825,13 @@ collide
collusion collusion
commando commando
contraption contraption
dampen
dampened
dampening
darkburst darkburst
deactivate deactivate
deactivated deactivated
despawn
diddy diddy
entangler entangler
fursuit fursuit
@ -20035,6 +19847,7 @@ lightburst
looped looped
looping looping
mech mech
melee
metaree metaree
metroid metroid
missle missle
@ -20070,6 +19883,9 @@ trooper
toad toad
turret turret
typedef typedef
undampen
undampened
undampening
unsorted unsorted
wasp wasp
wisp wisp

View File

@ -130,6 +130,11 @@ void CPropertyNameGenerator::Generate(const SPropertyNameGenerationParameters& r
for (; RecalcIndex < WordCache.size(); RecalcIndex++) for (; RecalcIndex < WordCache.size(); RecalcIndex++)
{ {
int Index = WordCache[RecalcIndex].WordIndex; int Index = WordCache[RecalcIndex].WordIndex;
// Add an underscore if needed
if (RecalcIndex > 0 && rkParams.UseUnderscores)
LastValidHash.Hash("_");
LastValidHash.Hash( *mWords[Index].Word ); LastValidHash.Hash( *mWords[Index].Word );
WordCache[RecalcIndex].Hash = LastValidHash; WordCache[RecalcIndex].Hash = LastValidHash;
} }
@ -156,6 +161,12 @@ void CPropertyNameGenerator::Generate(const SPropertyNameGenerationParameters& r
for (int WordIdx = 0; WordIdx < WordCache.size(); WordIdx++) for (int WordIdx = 0; WordIdx < WordCache.size(); WordIdx++)
{ {
int Index = WordCache[WordIdx].WordIndex; int Index = WordCache[WordIdx].WordIndex;
if (WordIdx > 0 && rkParams.UseUnderscores)
{
PropertyName.Name += "_";
}
PropertyName.Name += mWords[Index].Word; PropertyName.Name += mWords[Index].Word;
} }

View File

@ -19,6 +19,9 @@ struct SPropertyNameGenerationParameters
/** List of valid type suffixes */ /** List of valid type suffixes */
std::vector<TString> TypeNames; std::vector<TString> TypeNames;
/** Whether to separate words with underscores */
bool UseUnderscores;
/** Whether to print the output from the generation process to the log */ /** Whether to print the output from the generation process to the log */
bool PrintToLog; bool PrintToLog;
}; };

View File

@ -311,7 +311,7 @@ const char* HashablePropTypeName(EPropertyType Prop)
case eBoolProperty: return "bool"; case eBoolProperty: return "bool";
case eLongProperty: return "int"; case eLongProperty: return "int";
case eEnumProperty: return "enum"; case eEnumProperty: return "enum";
case eBitfieldProperty: return "bitfield"; case eBitfieldProperty: return "Flags";
case eFloatProperty: return "float"; case eFloatProperty: return "float";
case eStringProperty: return "string"; case eStringProperty: return "string";
case eColorProperty: return "Color"; case eColorProperty: return "Color";

View File

@ -100,6 +100,7 @@ void CGeneratePropertyNamesDialog::StartGeneration()
Params.MaxWords = mpUI->NumWordsSpinBox->value(); Params.MaxWords = mpUI->NumWordsSpinBox->value();
Params.Prefix = TO_TSTRING( mpUI->PrefixLineEdit->text() ); Params.Prefix = TO_TSTRING( mpUI->PrefixLineEdit->text() );
Params.Suffix = TO_TSTRING( mpUI->SuffixLineEdit->text() ); Params.Suffix = TO_TSTRING( mpUI->SuffixLineEdit->text() );
Params.UseUnderscores = mpUI->UseUnderscoresCheckBox->isChecked();
Params.PrintToLog = mpUI->LogOutputCheckBox->isChecked(); Params.PrintToLog = mpUI->LogOutputCheckBox->isChecked();
// Run the task and configure ourselves so we can update correctly // Run the task and configure ourselves so we can update correctly

View File

@ -68,6 +68,13 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QCheckBox" name="UseUnderscoresCheckBox">
<property name="text">
<string>Use underscores</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="LogOutputCheckBox"> <widget class="QCheckBox" name="LogOutputCheckBox">
<property name="text"> <property name="text">

File diff suppressed because it is too large Load Diff