Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ef4357d

Browse files
authored
Update hoi4statemapgenerator.py
1 parent de3a40a commit ef4357d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

‎python3/hoi4statemapgenerator.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,30 @@
3737
###
3838
### HoI 4 State IDs Map Generator by Yard1, originally for Equestria at War mod
3939
### Written in Python 3.6
40-
### Requires pillow and numpy pip packages to be installed. More info on installing packages: https://docs.python.org/3/installing/index.html
40+
### Requires p_tqdm, pillow and numpy pip packages to be installed. More info on installing packages: https://docs.python.org/3/installing/index.html
4141
###
4242
### Copyright (c) 2018 Antoni Baum (Yard1)
4343
### Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4444
### The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
4545
### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4646
###
47-
### usage: hoi4statemapgenerator.py [-h] [-c COLORS] [-nid]
48-
### provinces definition states output
49-
###
47+
### usage: hoi4statemapgenerator.py [-h] [-c COLORS] [-f FONT] [-nid]
48+
### mode provinces definition states output
49+
###
5050
### Given valid provinces.bmp, definition.csv files and a folder of state history
5151
### files (or strategic region files), generate an image containing a map of
5252
### states with their IDs.
53-
###
53+
###
5454
### positional arguments:
55+
### mode Mode: 0 - states, 1 - population per pixel, 2 -
56+
### political, 3 - total factories, 4 - civ factories, 5 -
57+
### mil factories, 6 - infra, 7 - nav factories
5558
### provinces Path to provinces.bmp file
5659
### definition Path to definition.csv file
5760
### states Path to 'history/states' or 'map/strategicregions'
5861
### folder
5962
### output Name of output file
60-
###
63+
###
6164
### optional arguments:
6265
### -h, --help show this help message and exit
6366
### -c COLORS, --colors COLORS
@@ -69,6 +72,7 @@
6972
#############################
7073

7174
BLUE_RBG = (68, 107, 163)
75+
MANPOWER_STEPS = 10
7276

7377
def readable_dir(prospective_dir):
7478
if not os.path.isdir(prospective_dir):
@@ -402,8 +406,6 @@ def generate_legend_and_colors(steps, data_list, title_str, mode, palette="Reds"
402406
mode = int(args.mode)
403407
if mode < 0 or mode > 7:
404408
sys.exit("Wrong mode - must be between 0 and 7")
405-
manpower_steps = 10
406-
factories_steps = 10
407409

408410
try:
409411
dir = readable_dir(args.states)
@@ -425,7 +427,7 @@ def generate_legend_and_colors(steps, data_list, title_str, mode, palette="Reds"
425427
if mode == 1:
426428
print("Mode %d - Population per pixel" % mode)
427429
manpower_list = get_manpower_list(states_dict)
428-
lc = generate_legend_and_colors(manpower_steps, manpower_list, "Population per pixel/7.114km^2", mode)
430+
lc = generate_legend_and_colors(MANPOWER_STEPS, manpower_list, "Population per pixel/7.114km^2", mode)
429431
colors = lc[0]
430432
space = lc[1]
431433
elif mode == 2:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /