N3OW/N3OW/gui/window_factions.gui
2025-10-30 11:25:16 +00:00

913 lines
23 KiB
Text

######################################################
##################### FACTIONS #######################
######################################################
window = {
name = "factions_window"
parentanchor = top|right
layer = windows_layer
movable = no
using = Window_Size_MainTab
# Tabs setup
oncreate = "[BindTabsContext]"
state = {
name = _show
using = Animation_FadeIn_Quick
using = Sound_WindowShow_Standard
using = Window_Position_MainTab
on_start = "[PdxGuiTabs.RemoveTab( 'targeting_factions' )]"
on_start = "[PdxGuiTabs.RemoveTab( 'my_factions' )]"
on_start = "[PdxGuiTabs.AddTabIf( 'targeting_factions', Not( And( FactionsWindow.IsPrimaryTitleTitular, Not( GetPlayer.IsIndependentRuler ) ) ) )]"
on_start = "[PdxGuiTabs.AddTabIf( 'my_factions', Not( And( GetPlayer.IsIndependentRuler, Not( FactionsWindow.IsInAnyFaction ) ) ) )]"
}
state = {
name = _hide
using = Animation_FadeOut_Quick
using = Sound_WindowHide_Standard
using = Window_Position_MainTab_Hide
}
margin_widget = {
size = { 100% 100% }
margin_top = 30
margin_bottom = 25
margin_right = 13
widget = {
size = { 100% 100% }
vbox = {
using = Window_Margins
header_pattern = {
layoutpolicy_horizontal = expanding
blockoverride "header_text"
{
text = "FACTIONS_WINDOW"
}
blockoverride "button_close"
{
onclick = "[FactionsWindow.Close]"
}
}
### Tabs header
hbox_tab_buttons = {
name = "factions_panel_tab_buttons" #tutorial uses this
blockoverride "tab_name"
{
text = "[PdxGuiTabItem.LocalizeTab( 'factions_tab' )]"
}
}
vbox = {
layoutpolicy_horizontal = expanding
layoutpolicy_vertical = expanding
background = {
texture = "gfx/interface/skinned/illustrations/faction_bg.dds"
fittype = end
alpha = 0.7
framesize = { 1200 848 }
using = Mask_Rough_Edges
modify_texture = {
texture = "gfx/interface/component_masks/mask_fade_vertical.dds"
blend_mode = alphamultiply
mirror = vertical
}
}
# Outer container for factions against player character
scrollbox = {
name = "against_you"
visible = "[PdxGuiTabs.IsTabSet( 'targeting_factions' )]"
layoutpolicy_horizontal = expanding
layoutpolicy_vertical = expanding
using = Animation_Tab_Switch
blockoverride "scrollbox_margins" {}
blockoverride "scrollbox_content"
{
vbox = {
layoutpolicy_horizontal = expanding
margin_bottom = 12
spacing = 10
margin_top = 12
text_label_center = {
visible = "[GetPlayer.IsIndependentRuler]"
text = "FACTIONS_WINDOW_TARGETING_FACTIONS"
}
## Factions against Me
vbox = {
name = "targeting_factions"
layoutpolicy_horizontal = expanding
spacing = 5
vbox = {
name = "targeting_factions_grid"
datamodel = "[FactionsWindow.GetTargetingFactions]"
visible = "[FactionsWindow.HasTargetingFactions]"
layoutpolicy_horizontal = expanding
spacing = 5
item = {
vbox_faction_item = {
layoutpolicy_horizontal = expanding
}
}
}
text_multi = {
name = "no_factions_against_me"
visible = "[Not(FactionsWindow.HasTargetingFactions)]"
layoutpolicy_horizontal = expanding
minimumsize = { 0 110 }
text = "FACTIONS_WINDOW_NOT_FACTION_AGAINST"
default_format = "#low;italic"
align = center
background = {
using = Background_Area
}
}
vbox = {
layoutpolicy_horizontal = expanding
margin = { 10 5 }
spacing = 10
background = {
using = Background_Area_With_Header
}
text_single = {
text = "FACTIONS_WINDOW_CASSALC_CANT_CREATE_JOIN"
}
dynamicgridbox = {
name = "cant_join_creater_members_grid"
datamodel = "[FactionsWindow.GetCantCreateOrJoinFactionVassals]"
datamodel_wrap = 4
flipdirection = yes
item = {
container = {
datacontext = "[CantCreateOrJoinFactionVassal.GetVassal]"
portrait_head = {
blockoverride "portrait_button_template_tooltip" {
tooltip = "[CantCreateOrJoinFactionVassal.GetTooltip]"
}
}
icon = {
size = { 32 32 }
parentanchor = top|right
position = { -6 6 }
texture = "gfx/interface/icons/faction_type/claimant_faction.dds"
visible = "[CantCreateOrJoinFactionVassal.IsSoftBlock]"
modify_texture = {
texture = "gfx/interface/colors/colors_textured.dds"
blend_mode = add
framesize = { 96 96 }
block "master_color_frame" {
frame = 5
}
}
}
}
}
}
text_multi = {
text = "FACTIONS_WINDOW_CREATE_JOIN_EXPLANATION"
autoresize = yes
max_width = 500
default_format = "#weak"
margin = { 15 10 }
margin_top = 0
}
}
}
}
}
}
# Outer container for factions against players liege
scrollbox = {
name = "against_liege"
visible = "[Or( PdxGuiTabs.IsTabSet( 'my_factions' ), FactionsWindow.IsPrimaryTitleTitular ) ]"
layoutpolicy_horizontal = expanding
layoutpolicy_vertical = expanding
using = Animation_Tab_Switch
blockoverride "scrollbox_margins" {}
blockoverride "scrollbox_content"
{
spacing = 20
vbox = {
layoutpolicy_horizontal = expanding
spacing = 5
margin_top = 10
text_label_center = {
text = "FACTION_WINDOW_JOINED_FACTIONS"
}
vbox = {
name = "joined_factions"
datamodel = "[FactionsWindow.GetJoinedFactions]"
visible = "[FactionsWindow.IsInAnyFaction]"
layoutpolicy_horizontal = expanding
item = {
vbox_faction_item = {
layoutpolicy_horizontal = expanding
}
}
expand = {}
}
text_multi = {
name = "not_in_factions"
visible = "[Not(FactionsWindow.IsInAnyFaction)]"
layoutpolicy_horizontal = expanding
minimumsize = { 0 110 }
text = "FACTIONS_WINDOW_NOT_IN_FACTION"
default_format = "#low;italic"
align = center
background = {
using = Background_Area
}
}
text_label_center = {
text = "FACTION_WINDOW_OTHER_FACTIONS"
}
# Factions to Join
vbox = {
name = "joinable_factions"
visible = "[FactionsWindow.CanJoinAnyFaction]"
datamodel = "[FactionsWindow.GetJoinableFactions]"
layoutpolicy_horizontal = expanding
item = {
vbox_faction_item = {
layoutpolicy_horizontal = expanding
}
}
}
# Joined Factions
text_multi = {
name = "joined"
visible = "[Not(FactionsWindow.CanJoinAnyFaction)]"
layoutpolicy_horizontal = expanding
minimumsize = { 0 110 }
text = "FACTIONS_WINDOW_NOT_JOINABLE_FACTION"
default_format = "#low;italic"
align = center
background = {
using = Background_Area
}
}
}
# Potential factions
vbox = {
name = "potential_factions"
layoutpolicy_horizontal = expanding
spacing = 5
text_label_center = {
text = "FACTION_WINDOW_FACTIONS_TO_CREATE"
default_format = "#low"
}
vbox = {
name = "creatable_factions"
widgetid = "faction_panel_potential_factions" #tutorial uses this
datamodel = "[FactionsWindow.GetCreateFactionItems]"
visible = "[FactionsWindow.CanCreateAnyFaction]"
layoutpolicy_horizontal = growing
spacing = 3
margin = { 20 0 }
item = {
button_standard = {
layoutpolicy_horizontal = growing
name = "create_faction"
visible = "[CreateFactionItem.IsShown]"
enabled = "[CreateFactionItem.CanPlayerCreateFaction]"
text = "[CreateFactionItem.GetCreateFactionText]"
tooltip = "[CreateFactionItem.BuildCreateFactionTooltip]"
onclick = "[CreateFactionItem.CreateFaction]"
}
}
}
text_multi = {
name = "not_creatable_factions"
visible = "[Not(FactionsWindow.CanCreateAnyFaction)]"
layoutpolicy_horizontal = expanding
minimumsize = { 0 110 }
text = "FACTIONS_WINDOW_NOT_CREATABLE_FACTION"
default_format = "#low;italic"
align = center
background = {
using = Background_Area
}
}
}
}
}
}
}
}
}
}
######################################################
################ TYPES AND TEMPLATES #################
######################################################
types FactionWindow
{
type vbox_faction_item = vbox {
name = "faction_item"
datacontext = "[FactionItem.GetFaction]"
layoutpolicy_horizontal = expanding
margin_top = 3
background = {
using = Background_Area_With_Header
}
background = {
visible = "[And(Faction.IsDangerous, Not(FactionItem.IsPlayerMember))]"
texture = "gfx/interface/colors/red.dds"
alpha = 0.2
using = Mask_Rough_Edges
margin_top = -30
modify_texture = {
name = "mask"
texture = "gfx/interface/component_masks/mask_fade_horizontal_right.dds"
blend_mode = alphamultiply
}
}
hbox = {
layoutpolicy_horizontal = expanding
expand = {}
text_single = {
text = "[Faction.GetName|E]"
using = Font_Size_Medium
align = center|nobaseline
using = tooltip_nw
max_width = 350
}
icon = {
name = "cannot_join"
visible = "[FactionItem.ShowCannotJoin]"
alwaystransparent = yes
size = { 36 30 }
texture = "gfx/interface/icons/symbols/icon_cross.dds"
tooltip = "PLAYER_CANNOT_JOIN_FACTION_OF_THIS_TYPE"
}
expand = {}
}
hbox = {
layoutpolicy_horizontal = expanding
layoutpolicy_vertical = expanding
margin_top = 5
# Faction Leader / Claimant
vbox = {
layoutpolicy_vertical = expanding
allow_outside = yes
spacing = -4
background = {
using = Background_Area_Dark
margin = { 0 2 }
}
widget = {
size = { 100 100 }
name = "leader"
allow_outside = yes
icon_flat_standard = {
visible = "[Not( Faction.HasSpecialCharacter )]"
size = { 76 76 }
texture = "[Faction.GetIcon]"
parentanchor = center
}
portrait_head_small = {
datacontext = "[Faction.GetSpecialCharacter]"
visible = "[Faction.HasSpecialCharacter]"
parentanchor = center
blockoverride "opinion_box" {}
blockoverride "status_icons" {}
}
icon = {
visible = "[And(Faction.IsDangerous, Not(FactionItem.IsPlayerMember))]"
size = { 32 32 }
position = { -6 -4 }
texture = "gfx/interface/icons/symbols/icon_warning.dds"
parentanchor = bottom|right
tooltip = "FACTION_WINDOW_IS_DANGEROUS"
icon = {
size = { 100% 100% }
alwaystransparent = yes
texture = "gfx/interface/icons/symbols/icon_warning.dds"
modify_texture = {
texture = "gfx/interface/icons/focuses/hud_icon_mask.dds"
blend_mode = alphamultiply
}
modify_texture = {
texture = "gfx/interface/colors/red.dds"
blend_mode = colordodge
}
state = {
name = a
next = b
alpha = 0
trigger_on_create = yes
duration = 1.2
using = Animation_Curve_Default
}
state = {
name = b
next = a
alpha = 0.8
duration = 0.6
using = Animation_Curve_Default
}
}
}
}
text_multi = {
visible = "[Faction.HasSpecialCharacter]"
max_width = 100
min_width = 100
align = center|nobaseline
autoresize = yes
text = "[Faction.GetSpecialCharacterTitle]"
}
expand = {}
}
vbox = {
layoutpolicy_horizontal = expanding
margin_top = 2
margin_left = 2
hbox = {
layoutpolicy_horizontal = expanding
spacing = 8
coa_title_tiny = {
datacontext = "[Faction.GetSpecialTitle]"
visible = "[And( Faction.ShouldShowSpecialTitle, Faction.HasSpecialTitle )]"
}
text_single = {
layoutpolicy_horizontal = expanding
text = "[Faction.GetShortEffectDescription]"
autoresize = no
}
}
### Discontent and power // Not at war
vbox = {
visible = "[Not(Faction.IsAtWar)]"
layoutpolicy_horizontal = expanding
layoutpolicy_vertical = expanding
margin_right = 20
spacing = 5
hbox = {
layoutpolicy_horizontal = expanding
spacing = 8
text_single = {
text = "FACTIONS_WINDOW_POWER"
using = Font_Size_Small
}
text_single = {
text = "[FactionItem.GetPower|%0V]"
default_format = "#high"
}
expand = {}
}
### Power
widget = {
name = "power_widget"
size = { 0 28 }
layoutpolicy_horizontal = expanding
tooltip = "[FactionItem.GetPowerTooltip]"
widget = {
name = "progressbar_power_holder"
size = { 100% 28 }
position = { -2 4 }
progressbar_red = {
visible = "[And( FactionItem.IsPowerThresholdVisible, Not(FactionItem.HasEnoughPower))]"
size = { 100% 25 }
position = { 0 1 }
max = 1
value = "[FactionItem.GetPowerPushPercentage]"
noprogresstexture = "gfx/interface/progressbars/progress_transparent_bg.dds"
}
progressbar_red = {
visible = "[Or( Not( FactionItem.IsPowerThresholdVisible), FactionItem.HasEnoughPower )]"
size = { 100% 25 }
position = { 0 1 }
max = 1
value = "[FactionItem.GetPowerPushPercentage]"
noprogresstexture = "gfx/interface/progressbars/progress_transparent_bg.dds"
}
container = {
visible = "[FactionItem.IsPowerThresholdVisible]"
widgetanchor = top|hcenter
position = "[FactionItem.GetPowerThresholdPosition]"
alwaystransparent = yes
icon = {
parentanchor = top|hcenter
alwaystransparent = yes
texture = "gfx/interface/window_factions/faction_progress_threshold.dds"
}
}
}
}
# Discontent
vbox = {
layoutpolicy_horizontal = expanding
hbox = {
layoutpolicy_horizontal = expanding
vbox = {
layoutpolicy_horizontal = expanding
hbox = {
name = "discontent_widget"
layoutpolicy_horizontal = expanding
tooltip = "[FactionItem.GetDiscontentTooltip]"
text_single = {
text = "FACTIONS_WINDOW_DISCONTENT"
using = Font_Size_Small
}
icon = {
visible = "[FactionItem.IsDiscontentIncreasing]"
texture = "gfx/interface/icons/icon_trend_arrow.dds"
framesize = { 22 22 }
frame = 1
}
icon = {
visible = "[FactionItem.IsDiscontentDecreasing]"
texture = "gfx/interface/icons/icon_trend_arrow.dds"
framesize = { 22 22 }
frame = 2
}
expand = {}
}
text_single = {
visible = "[FactionItem.IsDiscontentIncreasing]"
layoutpolicy_horizontal = expanding
text = "FACTIONS_WINDOW_DISCONTENT_INCREASING"
}
text_single = {
visible = "[FactionItem.IsDiscontentAtMax]"
layoutpolicy_horizontal = expanding
text = "FACTIONS_WINDOW_DISCONTENT_CAN_SEND"
}
text_single = {
visible = "[Not( Or( FactionItem.IsDiscontentAtMax, FactionItem.IsDiscontentIncreasing) )]"
layoutpolicy_horizontal = expanding
text = "FACTIONS_WINDOW_DISCONTENT_TO_WEAK"
}
}
expand = {}
vbox = {
margin_top = 10
button_standard = {
visible = "[And( FactionItem.IsPlayerLeader, Not( Faction.IsAtWar ) )]"
name = "press_demands_button"
enabled = "[FactionItem.CanPressDemands]"
text = "FACTION_WINDOW_PRESS_DEMANDS"
tooltip = "[FactionItem.BuildPressDemandsTooltip]"
onclick = "[FactionItem.PressDemmands]"
}
button_standard = {
visible = "[And(And( FactionItem.IsPlayerMember, Not( FactionItem.IsPlayerLeader)), Not( Faction.IsAtWar ) )]"
name = "press_demands_button_disabled"
enabled = no
text = "FACTION_WINDOW_PRESS_DEMANDS"
tooltip = "FACTION_WINDOW_PRESS_DEMANDS_CANNOT_LEADER"
}
button_standard = {
name = "join"
visible = "[FactionItem.ShowJoinButton]"
enabled = "[FactionItem.CanJoinFaction]"
onclick = "[FactionItem.JoinFaction]"
text = "FACTION_WINDOW_JOIN"
tooltip = "[FactionItem.BuildJoinFactionTooltip]"
}
button_standard = {
name = "show_members_tageting_factions"
visible = "[And(PdxGuiTabs.IsTabSet('targeting_factions'), Not(FactionItem.ShowCannotJoin))]"
onclick = "[FactionItem.ShowHideMembersFrame]"
button_expand = {
name = "show_members_tageting_factions_2"
frame = "[FactionItem.GetShowMembersFrame]"
parentanchor = left|vcenter
position = { 8 0 }
alwaystransparent = yes
using = tooltip_ws
tooltip = "[FactionItem.GetShowHideMembersTooltip]"
}
text_single = {
text = "[FactionItem.GetMembersString]"
align = nobaseline
parentanchor = left|vcenter
position = { 32 0 }
}
}
button_standard = {
name = "show_members_against_liege"
visible = "[And(PdxGuiTabs.IsTabSet('my_factions'), FactionItem.ShowCannotJoin)]"
onclick = "[FactionItem.ShowHideMembersFrame]"
button_expand = {
name = "show_members_against_liege_2"
frame = "[FactionItem.GetShowMembersFrame]"
parentanchor = left|vcenter
position = { 8 0 }
alwaystransparent = yes
using = tooltip_ws
tooltip = "[FactionItem.GetShowHideMembersTooltip]"
}
text_single = {
text = "[FactionItem.GetMembersString]"
align = nobaseline
parentanchor = left|vcenter
position = { 32 0 }
}
}
}
}
}
}
### Faction at war
hbox = {
layoutpolicy_horizontal = expanding
vbox = {
name = "faction_in_war"
visible = "[Faction.IsAtWar]"
margin_top = 10
spacing = -2
icon = {
texture = "gfx/interface/icons/character_interactions/icon_coax_to_war.dds"
size = { 64 64 }
}
text_single = {
text = "FACTIONS_WINDOW_FACTION_AT_WAR"
align = center
using = Font_Size_Medium
}
}
expand = {}
}
}
}
### Faction members
# Member buttons
hbox = {
name = "faction_buttons"
layoutpolicy_horizontal = expanding
margin_right = 20
margin_top = 10
margin_bottom = 8
spacing = 10
expand = {}
button_standard = {
name = "leave"
visible = "[FactionItem.IsPlayerMember]"
text = "FACTION_WINDOW_LEAVE"
onclick = "[FactionItem.LeaveFaction]"
enabled = "[FactionItem.CanLeaveFaction]"
tooltip = "[FactionItem.BuildLeaveFactionTooltip]"
}
button_standard = {
name = "add_member"
visible = "[FactionItem.IsPlayerMember]"
onclick = "[FactionItem.ShowPotentialMembers]"
text = "FACTION_ADD_MEMBER"
tooltip = "FACTION_ADD_MEMBER_TT"
}
button_standard = {
name = "show_members"
visible = "[And(PdxGuiTabs.IsTabSet('my_factions'), Not(FactionItem.ShowCannotJoin))]"
onclick = "[FactionItem.ShowHideMembersFrame]"
button_expand = {
name = "show_members_2"
frame = "[FactionItem.GetShowMembersFrame]"
parentanchor = left|vcenter
position = { 8 0 }
alwaystransparent = yes
using = tooltip_ws
tooltip = "[FactionItem.GetShowHideMembersTooltip]"
}
text_single = {
text = "[FactionItem.GetMembersString]"
align = nobaseline
parentanchor = left|vcenter
position = { 32 0 }
}
}
}
# Members
vbox = {
name = "faction_members"
visible = "[FactionItem.AreMembersVisible]"
layoutpolicy_horizontal = expanding
margin = { 0 10 }
background = {
using = Background_Area
margin_bottom = 5
}
fixedgridbox = {
name = "character_member_grid"
visible = "[FactionItem.HasCharacterMembers]"
addcolumn = 80
addrow = 90
datamodel = "[FactionItem.GetCharacterMembers]"
datamodel_wrap = 6
flipdirection = yes
item = {
container = {
datacontext = "[FactionCharacterMember.GetMember]"
portrait_head_small = {
position = { 0 -0 }
parentanchor = top|left
blockoverride "portrait_button_template_tooltip"
{
tooltip = "FACTION_WINDOW_MEMBER_TOOLTIP"
}
}
warning_icon = {
name = "portrait_opinion_bg"
visible = "[FactionCharacterMember.IsAtWarAgainstTarget]"
parentanchor = top|left
position = { -5 15 }
size = { 25 25 }
}
}
}
}
fixedgridbox = {
name = "title_member_grid"
datamodel = "[FactionItem.GetCountyMembers]"
visible = "[FactionItem.HasCountyMembers]"
addcolumn = 75
addrow = 70
datamodel_wrap = 6
flipdirection = yes
item = {
container = {
datacontext = "[FactionCountyMember.GetMember]"
tooltip = "FACTION_WINDOW_COUNTY_MEMBER_TT"
button_icon = {
name = "county_faction_member"
size = { 54 54 }
onclick = "[Title.SelectTitle]"
parentanchor = right
using = State_Title_MouseEntry
texture = "gfx/interface/icons/faction_type/peasants.dds"
}
widget = {
name = "opinion"
position = { 20 2 }
size = { 35 26 }
parentanchor = bottom
tooltip = "FACTIONS_WINDOW_COUNTY_OPINION_TOOLTIP"
text_single = {
position = { 10 -10 }
parentanchor = center
text = "FACTIONS_WINDOW_COUNTY_OPINION"
background = {
using = Background_Area_Dark
}
}
}
coa_title_tiny = {
position = { 0 32 }
}
}
}
}
}
}
}