-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
96 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
docs/source/02-游戏管理员手册-GM-Manual/01-传送坐标汇总-Teleport/常用传送命令.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.. _常用传送GM命令: | ||
|
||
常用传送GM命令 | ||
------------------------------------------------------------------------------ | ||
.. jinja:: doc_data | ||
|
||
{{ doc_data.lt_list_common_gsp().render() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .common import lt_list_common_gsp | ||
from .main_city import lt_list_main_city_gps_and_label_and_image | ||
from .class_skill_trainer import lt_list_class_trainer_gsp | ||
from .trade_skill_trainer import lt_list_trade_skill_trainer_gsp | ||
from .zone import ( | ||
lt_list_east_map_gps, | ||
lt_list_kali_map_gps, | ||
lt_list_tbc_map_gps, | ||
lt_list_wlk_map_gps, | ||
) | ||
from .main_city import lt_list_main_city_gps | ||
from .class_skill_trainer import lt_list_class_trainer_gsp | ||
from .trade_skill_trainer import lt_list_trade_skill_trainer_gsp | ||
from .instance import list_of_lt_list_instance_gps | ||
) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,67 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
import typing as T | ||
import polars as pl | ||
|
||
""" | ||
try: | ||
from .helper import ( | ||
remove_go_cmd_construct_teleport, | ||
disaggregate_df_transform_to_list_table, | ||
) | ||
except: | ||
from wotlkdoc.docs.gps.helper import ( | ||
remove_go_cmd_construct_teleport, | ||
disaggregate_df_transform_to_list_table, | ||
from ..importer import ( | ||
TsvGzReader, | ||
dataframe_to_list_table, | ||
) | ||
from ..images import image_by_map | ||
from .go_cmd import with_teleport_command | ||
|
||
if T.TYPE_CHECKING: | ||
from rstobj import Image, ListTable | ||
|
||
|
||
def _lt_list_zone_gps_and_label_and_image( | ||
filename: str, | ||
) -> T.List[T.Tuple["ListTable", str, "Image"]]: | ||
reader = TsvGzReader(__file__) | ||
df = reader.read_df(filename) | ||
df = ( | ||
df.select( | ||
[ | ||
pl.col("zone").alias("地图"), | ||
pl.col("loc").alias("地点"), | ||
pl.col("detail").alias("位置"), | ||
pl.col("description").alias("描述"), | ||
pl.col("go_cmd").alias("go_cmd"), | ||
] | ||
) | ||
.fill_null("") | ||
.filter(pl.col("go_cmd") != "") | ||
) | ||
from wotlkdoc.compressed_tsv import make_gzip, read_compressed_tsv | ||
df = with_teleport_command(df, go_cmd_col="go_cmd") | ||
lst = list() | ||
for map in df["地图"].unique(maintain_order=True): | ||
sub_df = df.filter(df["地图"] == map) | ||
image = image_by_map(map) | ||
image.height = 480 | ||
lst.append( | ||
( | ||
dataframe_to_list_table( | ||
sub_df, | ||
title=f"{map} 传送GM命令", | ||
), | ||
map, | ||
image, | ||
) | ||
) | ||
return lst | ||
|
||
|
||
def lt_list_east_map_gps(): | ||
return _lt_list_zone_gps_and_label_and_image("zone-1-a-vanilla-eastern-kingdom.tsv") | ||
|
||
zone_gps_columns = "地图,地点,位置,描述,gm_cmd".split(",") | ||
""" | ||
各个地图的 GM 传送命令一定都有这么5列. | ||
""" | ||
|
||
def lt_list_kali_map_gps(): | ||
return _lt_list_zone_gps_and_label_and_image("zone-1-b-vanilla-kalimdor.tsv.gz") | ||
|
||
def read_data_and_derive_df_list(tsv_filename): | ||
make_gzip(this_file=__file__, filename=tsv_filename) | ||
df = read_compressed_tsv(this_file=__file__, filename=tsv_filename + ".gz") | ||
df.columns = zone_gps_columns | ||
df = remove_go_cmd_construct_teleport(df) | ||
lt_list = disaggregate_df_transform_to_list_table(df, "地图") | ||
return lt_list | ||
|
||
def lt_list_tbc_map_gps(): | ||
return _lt_list_zone_gps_and_label_and_image("zone-2-tbc.tsv.gz") | ||
|
||
lt_list_east_map_gps = read_data_and_derive_df_list("vanilla-eastern-kingdom-gps.tsv") | ||
lt_list_kali_map_gps = read_data_and_derive_df_list("vanilla-kalimdor-gps.tsv") | ||
lt_list_tbc_map_gps = read_data_and_derive_df_list("tbc-map-gps.tsv") | ||
lt_list_wlk_map_gps = read_data_and_derive_df_list("wlk-map-gps.tsv") | ||
|
||
if __name__ == "__main__": | ||
print(lt_list_east_map_gps[0][1].render()) | ||
def lt_list_wlk_map_gps(): | ||
return _lt_list_zone_gps_and_label_and_image("zone-3-wlk.tsv.gz") |