2025-12-01
This commit is contained in:
@@ -18,10 +18,6 @@
|
||||
|
||||
import bpy
|
||||
|
||||
from ..modules.poliigon_core.api_remote_control_params import (
|
||||
KEY_TAB_IMPORTED,
|
||||
KEY_TAB_MY_ASSETS,
|
||||
KEY_TAB_ONLINE)
|
||||
from ..modules.poliigon_core.multilingual import _t
|
||||
|
||||
|
||||
@@ -88,52 +84,60 @@ def build_areas(cTB):
|
||||
cTB.logger_ui.debug("build_areas")
|
||||
cTB.initial_view_screen()
|
||||
|
||||
row = cTB.vBase.row(align=True)
|
||||
row.scale_x = 1.1
|
||||
row.scale_y = 1.1
|
||||
row = cTB.vBase.row()
|
||||
label_column = row.column(align=True)
|
||||
label_column.alignment = "LEFT"
|
||||
|
||||
_add_asset_tab(
|
||||
cTB,
|
||||
row,
|
||||
tab=KEY_TAB_ONLINE,
|
||||
mode="area_poliigon",
|
||||
icon="HOME",
|
||||
tooltip=_t("Show Poliigon Assets"))
|
||||
_add_asset_tab(
|
||||
cTB,
|
||||
row,
|
||||
tab=KEY_TAB_MY_ASSETS,
|
||||
mode="area_my_assets",
|
||||
icon_value=cTB.ui_icons["ICON_myassets"].icon_id,
|
||||
tooltip=_t("Show My Assets"))
|
||||
_add_asset_tab(
|
||||
cTB,
|
||||
row,
|
||||
tab=KEY_TAB_IMPORTED,
|
||||
mode="area_imported",
|
||||
icon="OUTLINER_OB_GROUP_INSTANCE",
|
||||
tooltip=_t("Show Imported Assets"))
|
||||
icon = 0
|
||||
label_txt = _t("Browse Assets")
|
||||
if cTB.is_unlimited_user():
|
||||
icon = cTB.ui_icons["LOGO_unlimited"].icon_id
|
||||
label_txt = _t("Pro Unlimited")
|
||||
elif not cTB.is_free_user():
|
||||
icon = cTB.ui_icons["ICON_asset_balance"].icon_id
|
||||
if cTB.is_paused_subscription() and cTB.get_user_credits() <= 0:
|
||||
icon = cTB.ui_icons["ICON_subscription_paused"].icon_id
|
||||
label_txt = _t("Downloads")
|
||||
label_txt = f"{cTB.get_user_credits()} {label_txt}"
|
||||
|
||||
op = row.operator(
|
||||
if not cTB.settings["show_user"]:
|
||||
label_column.label(text=label_txt, icon_value=icon)
|
||||
else:
|
||||
back_button = label_column.operator(
|
||||
"poliigon.poliigon_setting",
|
||||
text=_t("Back"),
|
||||
icon="BACK"
|
||||
)
|
||||
back_button.mode = "show_user"
|
||||
|
||||
row_right = row.row(align=True)
|
||||
row_right.alignment = "RIGHT"
|
||||
|
||||
op = row_right.operator(
|
||||
"poliigon.poliigon_setting",
|
||||
text="",
|
||||
icon_value=cTB.ui_icons["ICON_poliigon"].icon_id,
|
||||
icon="COMMUNITY",
|
||||
depress=cTB.settings["show_user"],
|
||||
)
|
||||
op.mode = "my_account"
|
||||
op.mode = "show_user"
|
||||
op.tooltip = _t("Show Your Account Details")
|
||||
|
||||
row.separator()
|
||||
op = row_right.operator(
|
||||
"poliigon.poliigon_link",
|
||||
text="",
|
||||
icon="HELP"
|
||||
)
|
||||
op.confirm_popup = True
|
||||
op.mode = "help"
|
||||
op.tooltip = _t("Addon help")
|
||||
|
||||
row_prefs = row.row(align=True)
|
||||
row_prefs.alignment = "RIGHT"
|
||||
|
||||
_draw_asset_balance(cTB, row=row_prefs)
|
||||
|
||||
_ = row_prefs.operator(
|
||||
_ = row_right.operator(
|
||||
"poliigon.open_preferences",
|
||||
text="",
|
||||
icon="PREFERENCES",
|
||||
).set_focus = "all"
|
||||
)
|
||||
|
||||
# TODO(Joao): Check if this operator should be moved somewhere else
|
||||
# _draw_asset_balance(cTB, row=row_prefs)
|
||||
|
||||
cTB.vBase.separator()
|
||||
|
||||
Reference in New Issue
Block a user