Skip to content

Commit

Permalink
Merge pull request #6 from CleverRaven/master
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
I-am-Erk authored Jan 22, 2019
2 parents 9a32197 + 1bb3b27 commit 753b1ac
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 53 deletions.
2 changes: 1 addition & 1 deletion data/json/items/armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@
"id": "spearsling",
"type": "ARMOR",
"name": "spear strap",
"description": "A cloth strap tied around the torso for toting spears while keeping your hands free. You have to duck to get through doors while one's in it, though. Activate to holster/draw a weapon.",
"description": "A leather strap tied around the torso for toting spears while keeping your hands free. You have to duck to get through doors while one's in it, though. Activate to holster/draw a weapon.",
"weight": 160,
"volume": 2,
"price": 5200,
Expand Down
5 changes: 3 additions & 2 deletions data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@
"type": "TOOL",
"name": "circular saw (off)",
"name_plural": "circular saws (off)",
"description": "A lightweight handheld cordless circular saw. Spins a circular blade fast enough to cut wood, metal, zombies, or in an emergency, pizza. The blade, while effective in combat, is hard to hit with due to its small size.",
"description": "A lightweight handheld cordless circular saw. Spins a circular blade fast enough to cut wood, zombies, or in an emergency, pizza. The blade, while effective in combat, is hard to hit with due to its small size.",
"weight": 2940,
"volume": 3,
"price": 5000,
Expand All @@ -1531,6 +1531,7 @@
"type": "TOOL",
"name": "circular saw (on)",
"name_plural": "circular saws (on)",
"//": "Circular saw would be very fast but imprecise butchering tool - alas the qualities are not separate and so speed is sacrificed.",
"description": "A lightweight handheld cordless circular saw. It is currently on and the blade is spinning; use this item to turn it off.",
"weight": 2940,
"volume": 3,
Expand All @@ -1545,7 +1546,7 @@
"max_charges": 100,
"turns_per_charge": 1,
"revert_to": "circsaw_off",
"qualities": [ [ "CUT", 1 ], [ "SAW_W", 2 ], [ "SAW_M", 2 ], [ "BUTCHER", 60 ] ],
"qualities": [ [ "CUT", 1 ], [ "SAW_W", 2 ], [ "BUTCHER", -40 ] ],
"use_action": "CIRCSAW_ON",
"flags": [ "MESSY", "TRADER_AVOID", "NONCONDUCTIVE" ]
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/recipes/armor/storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
"autolearn": true,
"qualities": [ { "id": "SEW", "level": 1 } ],
"components": [
[ [ "rag", 7 ], [ "felt_patch", 7 ], [ "leather", 7 ], [ "fur", 7 ] ],
[ [ "felt_patch", 7 ], [ "leather", 7 ], [ "fur", 7 ] ],
[ [ "filament", 20, "LIST" ], [ "cordage", 2, "LIST" ] ]
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/faction_camp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ bool basecamp::handle_mission( npc &p, const std::string &miss_id, const std::st
craft_construction( p, miss_id, miss_dir, "COOK", "_faction_exp_kitchen_cooking_" );
if( miss_id == miss_dir + " (Finish) Cooking" ) {
const std::string msg = _( "returns from your kitchen with something..." );
mission_return( p, "_faction_exp_kitchen_crafting_" + miss_dir, 15_minutes,
mission_return( p, "_faction_exp_kitchen_cooking_" + miss_dir, 15_minutes,
true, msg, "cooking", 2 );
}

Expand Down
1 change: 1 addition & 0 deletions src/iuse_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ class salvage_actor : public iuse_actor
material_id( "cotton" ),
material_id( "leather" ),
material_id( "fur" ),
material_id( "faux_fur" ),
material_id( "nomex" ),
material_id( "kevlar" ),
material_id( "plastic" ),
Expand Down
7 changes: 6 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@
#include "translations.h"

#ifdef TILES
#include "sdl_wrappers.h"
# if defined(_MSC_VER) && defined(USE_VCPKG)
# include <SDL2/SDL_version.h>
# else
# include <SDL_version.h>
# endif
#endif

#ifdef __ANDROID__
#include <unistd.h>
#include <SDL_system.h>
#include <SDL_filesystem.h>
#include <SDL_keyboard.h>
Expand Down
94 changes: 47 additions & 47 deletions src/sidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void player::disp_status( const catacurses::window &w, const catacurses::window
veh = veh_pointer_or_null( g->m.veh_at( pos() ) );
}
if( veh ) {
veh->print_fuel_indicators( w, sideStyle ? 4 : 3, sideStyle ? getmaxx( w ) - 5 : 49 );
veh->print_fuel_indicators( w, sideStyle ? 5 : 3, sideStyle ? getmaxx( w ) - 5 : 49 );
nc_color col_indf1 = c_light_gray;

const float strain = veh->strain();
Expand Down Expand Up @@ -520,7 +520,7 @@ void player::disp_status( const catacurses::window &w, const catacurses::window

wprintz( w, c_white, " " );
}

wmove( w, sideStyle ? 4 : 3, getmaxx( w ) - ( sideStyle ? 14 : 12 ) );
//Vehicle direction indicator in 0-359° where 0 is north (veh->face.dir() 0° is west)
wprintz( w, c_white, "%3d°", ( veh->face.dir() + 90 ) % 360 );

Expand Down Expand Up @@ -568,57 +568,57 @@ void player::disp_status( const catacurses::window &w, const catacurses::window
//~ Movement type: "running". Max string length: one letter.
const auto str_run = pgettext( "movement-type", "R" );
wprintz( w, c_white, " %s", move_mode == "walk" ? str_walk : str_run );
}
// display power level
wmove( sideStyle ? w : g->w_HP,
sideStyle ? 4 : 21,
sideStyle ? 17 : 0 );

// display power level
wmove( sideStyle ? w : g->w_HP,
sideStyle ? spdy - 1 : 21,
sideStyle ? ( wx + dx * 4 - 1 ) : 0 );
wprintz( sideStyle ? w : g->w_HP, c_white, _( "Pwr " ) );

wprintz( sideStyle ? w : g->w_HP, c_white, _( "Pwr " ) );
if( this->max_power_level == 0 ) {
wprintz( sideStyle ? w : g->w_HP, c_light_gray, " --" );
} else {
nc_color color = c_red;
if( this->power_level >= this->max_power_level / 2 ) {
color = c_green;
} else if( this->power_level >= this->max_power_level / 3 ) {
color = c_yellow;
} else if( this->power_level >= this->max_power_level / 4 ) {
color = c_red;
}

if( this->max_power_level == 0 ) {
wprintz( sideStyle ? w : g->w_HP, c_light_gray, " --" );
} else {
nc_color color = c_red;
if( this->power_level >= this->max_power_level / 2 ) {
color = c_green;
} else if( this->power_level >= this->max_power_level / 3 ) {
color = c_yellow;
} else if( this->power_level >= this->max_power_level / 4 ) {
color = c_red;
// calc number of digits in powerlevel int
int offset = get_int_digits( this->power_level );

// case power_level > 999 display 1k instead
int display_power = this->power_level;
std::string unit = "";
if( this->power_level > 999 ) {
switch( offset ) {
case 4:
display_power /= 1000;
unit = "k";
offset = 2;
break;
case 5:
display_power /= 1000;
unit = "k";
offset = 0;
break;
}

// calc number of digits in powerlevel int
int offset = get_int_digits( this->power_level );

// case power_level > 999 display 1k instead
int display_power = this->power_level;
std::string unit = "";
if( this->power_level > 999 ) {
switch( offset ) {
case 4:
display_power /= 1000;
unit = "k";
offset = 2;
break;
case 5:
display_power /= 1000;
unit = "k";
offset = 0;
break;
}
} else {
unit = "";
}

wmove( sideStyle ? w : g->w_HP,
sideStyle ? spdy - 1 : 21,
sideStyle ? ( wx + dx * 4 + 6 ) - offset : 7 - offset );
std::string power_value = std::to_string( display_power ) + unit;
wprintz( sideStyle ? w : g->w_HP, color, power_value );
} else {
unit = "";
}
wrefresh( sideStyle ? w : g->w_HP );

wmove( sideStyle ? w : g->w_HP,
sideStyle ? 4 : 21,
sideStyle ? 17 - offset : 7 - offset );
std::string power_value = std::to_string( display_power ) + unit;
wprintz( sideStyle ? w : g->w_HP, color, power_value );
}
wrefresh( sideStyle ? w : g->w_HP );

}

int get_int_digits( const int &digits )
Expand Down

0 comments on commit 753b1ac

Please sign in to comment.