<Prefab>
  <Constants>

    <Constant Name="CancelButton.Width" BrushLayer="Default" BrushName="Popup.Cancel.Button" BrushValueType="Width" />
    <Constant Name="CancelButton.Height" BrushLayer="Default" BrushName="Popup.Cancel.Button" BrushValueType="Height" />

  </Constants>
  <Window>
    <Widget Id="ModOptionsScreen" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent">
      <Children>

        <Standard.Background/>

        <!-- Main screen section -->
        <ListPanel Id="MainSection" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" MarginTop="164">
          <Children>

            <!-- Mods list section on the left-->
            <Widget Id="ModsListSection" WidthSizePolicy="Fixed" HeightSizePolicy="StretchToParent"
                    SuggestedWidth="600" HorizontalAlignment="Left" VerticalAlignment="Top" Sprite="CharacterCreation\character_creation_panel"
                    Brush.HorizontalFlip="true">
              <Children>

                <!-- Title -->
                <RichTextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="CoverChildren" Brush="ModSettings.Title.Text" Text="Mods"
                                HorizontalAlignment="Center" VerticalAlignment="Top" MarginRight="19" PositionYOffset="-10"/>

                <!-- Mods Listing Section Inner Panel-->
                <Widget HeightSizePolicy="Fixed" WidthSizePolicy="Fixed" HorizontalAlignment="Center" VerticalAlignment="Center"
                        SuggestedWidth="495" SuggestedHeight="637" PositionXOffset="-19" PositionYOffset="31">
                  <Children>

                    <!-- Format for a list is: ScrollPanel -> Widget ClipRect -> ListPanel/Widget InnerPanel -> Items-->
                    <!-- ScrollablePanel needs: Reference to ClipRect, reference to ElementsList, reference to a scroll bar-->
                    <!-- Widget ClipRect needs width size policy to be CoverChildren and height size to be StretchToParent -->
                    <!-- ListPanel/Widget InnerPanel needs LayoutImp.LayoutMethod. Search for LayoutMethod in dnSpy for options. Size policies need to be CoverChildren -->
                    <!-- ListPanel Items needs ItemTemplate containing the screen to be used for each item. Size policies need to be CoverChildren.
                         DataSource property must be assigned using the {} braces. Example: DataSource="{DataSourcePropertyName}" -->
                    <ScrollablePanel Id="ModElementsScrollablePanel" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent"
                                     AutoHideScrollBars="true" ClipRect="ModsListClipRect" InnerPanel="ModsListClipRect\ModList"
                                     VerticalScrollbar="..\ModsScrollbar\Scrollbar" MouseScrollAxis="Vertical">
                      <Children>

                        <Widget Id="ModsListClipRect" WidthSizePolicy="CoverChildren" HeightSizePolicy="StretchToParent" ClipContents="true" HorizontalAlignment="Left">
                          <Children>

                            <ListPanel Id="ModList" DataSource="{ModSettingsList}" WidthSizePolicy="StretchToParent" HeightSizePolicy="CoverChildren"
                                       HorizontalAlightment="Left" LayoutImp.LayoutMethod="VerticalTopToBottom">
                              <ItemTemplate>
                                <ModSettingsItem />
                              </ItemTemplate>
                            </ListPanel>

                          </Children>
                        </Widget>

                      </Children>
                    </ScrollablePanel>

                    <!-- Mod list scroll bar -->
                    <Standard.VerticalScrollbar Id="ModsScrollbar" HeightSizePolicy="StretchToParent" HorizontalAlignment="Right"
                                                VerticalAlignment="Bottom" MarginLeft="2" MarginTop="1" MarginBottom="1"/>

                  </Children>
                </Widget>

                <!-- Buttons -->
                <ListPanel WidthSizePolicy="CoverChildren" HeightSizePolicy="CoverChildren" HorizontalAlignment="Center" VerticalAlignment="Bottom" MarginBottom="39"
                           MarginRight="39">
                  <Children>

                    <!-- Cancel button -->
                    <ButtonWidget Id="CancelButton" DoNotPassEventsToChildren="true" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="!CancelButton.Width" SuggestedHeight="!CancelButton.Height" Brush="Popup.Cancel.Button" Command.Click="ExecuteCancel">
                      <Children>

                        <TextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Popup.Button.Text" Text="@CancelButtonText" />

                      </Children>
                    </ButtonWidget>

                    <!--Done Button-->
                    <ButtonWidget Id="DoneButton" DoNotPassEventsToChildren="true" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed"
                                  SuggestedWidth="!CancelButton.Width" SuggestedHeight="!CancelButton.Height" Brush="Popup.Done.Button"
                                  Command.Click="ExecuteDone">
                      <Children>

                        <TextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Popup.Button.Text" Text="@DoneButtonText" />
                      </Children>
                    </ButtonWidget>

                  </Children>
                </ListPanel>

              </Children>
            </Widget>


            <!-- Selected Mod Settings Section on the right -->
            <Widget Id="ModSettingsSection" WidthSizePolicy="Fixed" HeightSizePolicy="StretchToParent" MarginLeft="40" IsVisible="@SomethingSelected"
                    SuggestedWidth="1270" HorizontalAlignment="Right" VerticalAlignment="Top" MarginRight="10" MarginBottom="10">
              <Children>

                <ListPanel WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" LayoutImp.LayoutMethod="VerticalBottomToTop">
                  <Children>
                    <!-- Title -->
                    <RichTextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="Fixed" SuggestedHeight="80" Brush="ModSettings.Title.Text" Text="@SelectedModName"
                                    HorizontalAlignment="Center" VerticalAlignment="Top" />
                    <Widget WidthSizePolicy="StretchToParent" HeightSizePolicy="Fixed" SuggestedHeight="2"  VerticalAlignment="Top" Brush="Divider.Yellow"
                            MarginLeft="15" MarginRight="15"/>

                    <Widget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" MarginRight="30" MarginLeft="30">
                      <Children>

                        <ScrollablePanel WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" ClipRect="SettingsClipRect" MarginRight="20"
                                         InnerPanel="SettingsClipRect\SettingsInnerPanel" AutoHideScrollBars="true" VerticalScrollbar="..\SettingsScrollBar\Scrollbar">
                          <Children>

                            <Widget Id="SettingsClipRect" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" ClipContents="true">
                              <Children>

                                <Widget Id="SettingsInnerPanel" WidthSizePolicy="StretchToParent" HeightSizePolicy="CoverChildren">
                                  <Children>

                                    <SettingsView DataSource="{SelectedMod}" HeightSizePolicy="CoverChildren" WidthSizePolicy="StretchToParent" />

                                  </Children>
                                </Widget>

                              </Children>
                            </Widget>

                          </Children>
                        </ScrollablePanel>

                        <Standard.VerticalScrollbar Id="SettingsScrollBar" HeightSizePolicy="StretchToParent" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                                                    MarginTop="2"/>

                      </Children>
                    </Widget>

                    <!-- Setting Hint Information Section -->
                    <ListPanel WidthSizePolicy="StretchToParent" HeightSizePolicy="Fixed" SuggestedHeight="100" VerticalAlignment="Bottom"
                               LayoutImp.LayoutMethod="VerticalBottomToTop" MarginTop="1">
                      <Children>

                        <Widget WidthSizePolicy="StretchToParent" HeightSizePolicy="Fixed" SuggestedHeight="2"  VerticalAlignment="Top" Brush="Divider.Yellow"
                                MarginLeft="15" MarginRight="15" MarginBottom="2"/>

                        <RichTextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Text="@HintText" IsVisible="@IsHintVisible"
                                    HorizontalAlignment="Left" VerticalAlignment="Center" MarginLeft="20" MarginRight="10" Brush="ModSettings.Hint.Text"/>

                      </Children>
                    </ListPanel>

                  </Children>
                </ListPanel>

              </Children>
            </Widget>

          </Children>
        </ListPanel>

        <!-- Top Banner -->
        <Standard.TopPanel Parameter.Title="@TitleLabel"/>
        
      </Children>
    </Widget>
  </Window>
</Prefab>
