-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the option to display ascii art in item description #37598
Changes from 6 commits
c6e0edb
34c60ed
4f80683
35f0e59
334f183
2e60cf9
140c245
888621c
f420421
953b3a5
565b34a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,6 +414,18 @@ void Item_factory::finalize_post( itype &obj ) | |
} | ||
} | ||
} | ||
|
||
if( !obj.ascii_picture.empty() ) { | ||
std::vector<std::string> tmp_ascii_pic; | ||
for( std::string line : obj.ascii_picture ) { | ||
Fris0uman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if( line.length() > 42 ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't really use neither
|
||
line = line.substr( 0, 42 ); | ||
debugmsg( "ascii_picture in %s contains a line too long to be displayed (>42 char).", obj.id ); | ||
} | ||
tmp_ascii_pic.emplace_back( line ); | ||
Fris0uman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
obj.ascii_picture = tmp_ascii_pic; | ||
} | ||
} | ||
|
||
void Item_factory::finalize() | ||
|
@@ -2082,6 +2094,8 @@ void Item_factory::load_basic_info( const JsonObject &jo, itype &def, const std: | |
assign( jo, "magazine_well", def.magazine_well ); | ||
assign( jo, "explode_in_fire", def.explode_in_fire ); | ||
assign( jo, "insulation", def.insulation_factor ); | ||
assign( jo, "ascii_picture", def.ascii_picture ); | ||
|
||
|
||
if( jo.has_member( "thrown_damage" ) ) { | ||
def.thrown_damage = load_damage_instance( jo.get_array( "thrown_damage" ) ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While an example is good, I definitely think we want to mention what the typical line widths are in the common interfaces so that artists don't have to guess at whether or not their design will fit.