diff --git a/Northstar.Client/mod.json b/Northstar.Client/mod.json index 44937a2b0..53636ed92 100644 --- a/Northstar.Client/mod.json +++ b/Northstar.Client/mod.json @@ -23,15 +23,19 @@ }, { "Name": "filter_map", - "DefaultValue": "0" + "DefaultValue": "SWITCH_ANY" }, { "Name": "filter_gamemode", - "DefaultValue": "0" + "DefaultValue": "SWITCH_ANY" + }, + { + "Name": "filter_region", + "DefaultValue": "SWITCH_ANY" }, { "Name": "filter_mods", - "DefaultValue": "0" + "DefaultValue": "SWITCH_ANY" }, { "Name": "filter_map_hide_locked", @@ -132,12 +136,20 @@ "UICallback":{ "Before": "AddModSettingsMenu" } - }, - { + }, + { "Path": "ui/ui_mouse_capture.nut", "RunOn": "UI" }, { + "Path": "ui/menu_sb_map_select.nut", + "RunOn": "UI" + }, + { + "Path": "ui/menu_sb_mode_select.nut", + "RunOn": "UI" + }, + { "Path": "ui/atlas_auth.nut", "RunOn": "UI", "UICallback": { diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt index baceed225..cc32a97e6 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt @@ -272,7 +272,7 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a "SP_SKYWAY_V1" "The Fold Weapon" "SP_SKYWAY_V1_CLASSIC_DESC" "BT and Cooper are captured by Kuben Blisk." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Servers" "PLAYERS_COLUMN" "Players" "MAP_COLUMN" "Map" @@ -281,11 +281,19 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a "SEARCHBAR_LABEL" "Search:" "MAP_FILTER" "Map" "GAMEMODE_FILTER" "Gamemode" + "REGION_FILTER" "Filter Regions" + "MODS_FILTER" "Filter Mods" "HIDE_FULL_FILTER" "Hide Full Servers" "HIDE_EMPTY_FILTER" "Hide Empty Servers" "HIDE_PROT_FILTER" "Hide Protected Servers" + "SERVER_DESCRIPTION" "Description" + "SERVER_REQUIRED_MODS" "Required Mods" "SERVER_MODS" "Mods" + "INSTALLED_MODS" "Installed Mods" + "DISABLED_MODS" "Disabled Mods" + "OUTDATED_MODS" "Outdated Mods" + "MISSING_MODS" "Missing Mods" "CLEAR_FILTERS" "CLEAR" "JOIN_BUTTON" "JOIN" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_french.txt b/Northstar.Client/mod/resource/northstar_client_localisation_french.txt index 9444a39e3..f0db82a91 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_french.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_french.txt @@ -271,7 +271,7 @@ Choisissez Oui si vous êtes d'accord. Ce choix peut être modifié à tout inst "SP_SKYWAY_V1" "Le Distordeur" "SP_SKYWAY_V1_CLASSIC_DESC" "BT et Cooper sont capturés par Kuben Blisk." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Serveurs" "PLAYERS_COLUMN" "Joueurs" "MAP_COLUMN" "Carte" @@ -280,11 +280,19 @@ Choisissez Oui si vous êtes d'accord. Ce choix peut être modifié à tout inst "SEARCHBAR_LABEL" "Recherche :" "MAP_FILTER" "Carte" "GAMEMODE_FILTER" "Mode de jeu" + "REGION_FILTER" "Filtrer les régions" + "MODS_FILTER" "Filtrer les mods" "HIDE_FULL_FILTER" "Cacher les serveurs remplis" "HIDE_EMPTY_FILTER" "Cacher les serveurs vides" "HIDE_PROT_FILTER" "Cacher les serveurs mot de passe" + "SERVER_DESCRIPTION" "Description" + "SERVER_REQUIRED_MODS" "Mods requis" "SERVER_MODS" "Mods" + "INSTALLED_MODS" "Mods installés" + "DISABLED_MODS" "Mods désactivés" + "OUTDATED_MODS" "Mods obsolètes" + "MISSING_MODS" "Mods manquants" "CLEAR_FILTERS" "RESET" "JOIN_BUTTON" "REJOINDRE" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_german.txt b/Northstar.Client/mod/resource/northstar_client_localisation_german.txt index 996a3e2ba..c84e5eb5b 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_german.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_german.txt @@ -262,7 +262,7 @@ Drücke Ja, um zuzustimmen. Du kannst diese Entscheidung jederzeit im Modmenü "SP_SKYWAY_V1" "Die Faltwaffe" "SP_SKYWAY_V1_CLASSIC_DESC" "BT und Cooper werden von Kuben Blist gefangen genommen." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Server" "PLAYERS_COLUMN" "Spieler" "MAP_COLUMN" "Karte" @@ -271,11 +271,19 @@ Drücke Ja, um zuzustimmen. Du kannst diese Entscheidung jederzeit im Modmenü "SEARCHBAR_LABEL" "Suche:" "MAP_FILTER" "Karte" "GAMEMODE_FILTER" "Modus" + "REGION_FILTER" "Regionen filtern" + "MODS_FILTER" "Mods filtern" "HIDE_FULL_FILTER" "Volle Server verstecken" "HIDE_EMPTY_FILTER" "Leere Server verstecken" "HIDE_PROT_FILTER" "Geschützte Server verstecken" + "SERVER_DESCRIPTION" "Beschreibung" + "SERVER_REQUIRED_MODS" "Erforderliche Mods" "SERVER_MODS" "Mods" + "INSTALLED_MODS" "Installierte Mods" + "DISABLED_MODS" "Deaktivierte Mods" + "OUTDATED_MODS" "Veraltete Mods" + "MISSING_MODS" "Fehlende Mods" "CLEAR_FILTERS" "LEEREN" "JOIN_BUTTON" "JOIN" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_italian.txt b/Northstar.Client/mod/resource/northstar_client_localisation_italian.txt index 089edf35b..ec3c62e01 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_italian.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_italian.txt @@ -270,7 +270,7 @@ Premi Sì se sei d'accordo. Questa scelta può essere modificata in qualsiasi mo "SP_SKYWAY_V1" "L'Arma da Piegamento" "SP_SKYWAY_V1_CLASSIC_DESC" "BT e Cooper vengono catturati da Kuben Blisk." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Server" "PLAYERS_COLUMN" "Giocatori" "MAP_COLUMN" "Mappa" @@ -279,11 +279,19 @@ Premi Sì se sei d'accordo. Questa scelta può essere modificata in qualsiasi mo "SEARCHBAR_LABEL" "Cerca:" "MAP_FILTER" "Mappa" "GAMEMODE_FILTER" "Modalità" + "REGION_FILTER" "Filtra regioni" + "MODS_FILTER" "Filtra mod" "HIDE_FULL_FILTER" "Nascondi i server pieni" "HIDE_EMPTY_FILTER" "Nascondi i server vuoti" "HIDE_PROT_FILTER" "Nascondi i server protetti" + "SERVER_DESCRIPTION" "Descrizione" + "SERVER_REQUIRED_MODS" "Mod richiesti" "SERVER_MODS" "Mod" + "INSTALLED_MODS" "Mod installati" + "DISABLED_MODS" "Mod disabilitati" + "OUTDATED_MODS" "Mod obsoleti" + "MISSING_MODS" "Mod mancanti" "CLEAR_FILTERS" "CANC" "JOIN_BUTTON" "ENTRA" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_japanese.txt b/Northstar.Client/mod/resource/northstar_client_localisation_japanese.txt index 798d603e0..38b961e60 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_japanese.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_japanese.txt @@ -298,7 +298,7 @@ "SP_SKYWAY_V1" "フォールド・ウェポン" "SP_SKYWAY_V1_CLASSIC_DESC" "BTとクーパーがクーベン・ブリスクに捕まってしまう。" - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "サーバー" "PLAYERS_COLUMN" "プレイヤー" "MAP_COLUMN" "マップ" @@ -307,11 +307,19 @@ "SEARCHBAR_LABEL" "検索:" "MAP_FILTER" "マップ" "GAMEMODE_FILTER" "ゲームモード" + "REGION_FILTER" "地域フィルター" + "MODS_FILTER" "Modフィルター" "HIDE_FULL_FILTER" "満員のサーバーを非表示" "HIDE_EMPTY_FILTER" "参加者のいないサーバーを非表示" "HIDE_PROT_FILTER" "保護されたサーバーを非表示" + "SERVER_DESCRIPTION" "概要" + "SERVER_REQUIRED_MODS" "必要なMod" "SERVER_MODS" "Mod" + "INSTALLED_MODS" "インストール済みMod" + "DISABLED_MODS" "無効化されたMod" + "OUTDATED_MODS" "古いMod" + "MISSING_MODS" "不足しているMod" "CLEAR_FILTERS" "クリア" "JOIN_BUTTON" "参加" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_mspanish.txt b/Northstar.Client/mod/resource/northstar_client_localisation_mspanish.txt index 50d1ef17f..70128c9dd 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_mspanish.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_mspanish.txt @@ -271,7 +271,7 @@ Si estas de acuerdo con esto, presiona SI. Esta decision puede ser cambiada en e "SP_SKYWAY_V1" "El Arma moldeadora" "SP_SKYWAY_V1_CLASSIC_DESC" "Kuben Blisk captura a BT y Cooper." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Sevidores" "PLAYERS_COLUMN" "Jugadores" "MAP_COLUMN" "Mapa" @@ -280,11 +280,19 @@ Si estas de acuerdo con esto, presiona SI. Esta decision puede ser cambiada en e "SEARCHBAR_LABEL" "Buscar:" "MAP_FILTER" "Mapa" "GAMEMODE_FILTER" "Modo de juego" + "REGION_FILTER" "Filtrar regiones" + "MODS_FILTER" "Filtrar mods" "HIDE_FULL_FILTER" "Ocultar servidores llenos" "HIDE_EMPTY_FILTER" "Ocultar servidores vacios" "HIDE_PROT_FILTER" "Ocultar servidores protegidos" + "SERVER_DESCRIPTION" "Descripcion" + "SERVER_REQUIRED_MODS" "Mods requeridos" "SERVER_MODS" "Mods" + "INSTALLED_MODS" "Mods instalados" + "DISABLED_MODS" "Mods desactivados" + "OUTDATED_MODS" "Mods obsoletos" + "MISSING_MODS" "Mods faltantes" "CLEAR_FILTERS" "LIMPIAR" "JOIN_BUTTON" "UNIR" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt b/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt index 75a5faad6..abe26eb3c 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_portuguese.txt @@ -269,7 +269,7 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen "SP_SKYWAY_V1" "A Arma Quântica" "SP_SKYWAY_V1_CLASSIC_DESC" "BT e Cooper são capturados por Kuben Blisk." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Servidores" "PLAYERS_COLUMN" "Jogadores" "MAP_COLUMN" "Mapa" @@ -278,11 +278,19 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen "SEARCHBAR_LABEL" "Buscar:" "MAP_FILTER" "Mapa" "GAMEMODE_FILTER" "Modo" + "REGION_FILTER" "Filtrar regiões" + "MODS_FILTER" "Filtrar mods" "HIDE_FULL_FILTER" "Esconder servidores cheios" "HIDE_EMPTY_FILTER" "Esconder servidores vazios" "HIDE_PROT_FILTER" "Esconder servidores com senha" + "SERVER_DESCRIPTION" "Descrição" + "SERVER_REQUIRED_MODS" "Mods obrigatórios" "SERVER_MODS" "Mods" + "INSTALLED_MODS" "Mods instalados" + "DISABLED_MODS" "Mods desativados" + "OUTDATED_MODS" "Mods desatualizados" + "MISSING_MODS" "Mods ausentes" "CLEAR_FILTERS" "LIMPAR" "JOIN_BUTTON" "Entrar" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_russian.txt b/Northstar.Client/mod/resource/northstar_client_localisation_russian.txt index 91a0dedee..a51460bb3 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_russian.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_russian.txt @@ -214,7 +214,7 @@ "SP_SKYWAY_V1" "Искажающее орудие" "SP_SKYWAY_V1_CLASSIC_DESC" "БT и Купер были захвачены Кубеном Блиском." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Сервера" "PLAYERS_COLUMN" "Игроки" "MAP_COLUMN" "Карта" @@ -223,11 +223,19 @@ "SEARCHBAR_LABEL" "Поиск:" "MAP_FILTER" "Карта" "GAMEMODE_FILTER" "Режим игры" + "REGION_FILTER" "Фильтр регионов" + "MODS_FILTER" "Фильтр модов" "HIDE_FULL_FILTER" "Скрывать полные сервера" "HIDE_EMPTY_FILTER" "Скрывать пустые сервера" "HIDE_PROT_FILTER" "Скрывать закрытые сервера" + "SERVER_DESCRIPTION" "Описание" + "SERVER_REQUIRED_MODS" "Требуемые моды" "SERVER_MODS" "Моды" + "INSTALLED_MODS" "Установленные моды" + "DISABLED_MODS" "Отключенные моды" + "OUTDATED_MODS" "Устаревшие моды" + "MISSING_MODS" "Отсутствующие моды" "CLEAR_FILTERS" "ОЧИСТИТЬ" "JOIN_BUTTON" "ЗАЙТИ" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_spanish.txt b/Northstar.Client/mod/resource/northstar_client_localisation_spanish.txt index d4172232e..156f40109 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_spanish.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_spanish.txt @@ -271,7 +271,7 @@ Presiona Sí al estar de acuerdo. Esta opcion se puede cambiar en el menú de mo "SP_SKYWAY_V1" "El arma plegadora" "SP_SKYWAY_V1_CLASSIC_DESC" "Cooper y BT son capturados por Kuben Blisk." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "Servidores" "PLAYERS_COLUMN" "Jugadores" "MAP_COLUMN" "Mapa" @@ -280,11 +280,19 @@ Presiona Sí al estar de acuerdo. Esta opcion se puede cambiar en el menú de mo "SEARCHBAR_LABEL" "Buscar:" "MAP_FILTER" "Mapa" "GAMEMODE_FILTER" "Modo de juego" + "REGION_FILTER" "Filtrar regiones" + "MODS_FILTER" "Filtrar mods" "HIDE_FULL_FILTER" "Esconder servidores llenos" "HIDE_EMPTY_FILTER" "Esconder servidores vacios" "HIDE_PROT_FILTER" "Esconder servidores protegidos" + "SERVER_DESCRIPTION" "Descripción" + "SERVER_REQUIRED_MODS" "Mods requeridos" "SERVER_MODS" "Modificaciones" + "INSTALLED_MODS" "Mods instalados" + "DISABLED_MODS" "Mods desactivados" + "OUTDATED_MODS" "Mods obsoletos" + "MISSING_MODS" "Mods faltantes" "CLEAR_FILTERS" "LIMPIAR" "JOIN_BUTTON" "UNIR" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt b/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt index 500f8a969..72528fc3d 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt @@ -271,7 +271,7 @@ "SP_SKYWAY_V1" "折疊時空武器" "SP_SKYWAY_V1_CLASSIC_DESC" "BT和庫博被庫本布里斯克擒拿." - // Better.Serverbrowser + // Better Server Browser "SERVERS_COLUMN" "伺服器" "PLAYERS_COLUMN" "玩家" "MAP_COLUMN" "地圖" @@ -280,11 +280,19 @@ "SEARCHBAR_LABEL" "搜尋:" "MAP_FILTER" "地圖" "GAMEMODE_FILTER" "遊戲模式" + "REGION_FILTER" "過濾地區" + "MODS_FILTER" "過濾模組" "HIDE_FULL_FILTER" "隱藏滿伺服器" "HIDE_EMPTY_FILTER" "隱藏空伺服器" "HIDE_PROT_FILTER" "隱藏密碼伺服器" + "SERVER_DESCRIPTION" "說明" + "SERVER_REQUIRED_MODS" "必須的模組" "SERVER_MODS" "Mod內容" + "INSTALLED_MODS" "已安裝的模組" + "DISABLED_MODS" "禁用的模組" + "OUTDATED_MODS" "已過時的模組" + "MISSING_MODS" "遺失的模組" "CLEAR_FILTERS" "清除" "JOIN_BUTTON" "加入" diff --git a/Northstar.Client/mod/resource/ui/menus/panels/sb_map_grid.res b/Northstar.Client/mod/resource/ui/menus/panels/sb_map_grid.res new file mode 100644 index 000000000..3dd4f2cae --- /dev/null +++ b/Northstar.Client/mod/resource/ui/menus/panels/sb_map_grid.res @@ -0,0 +1,795 @@ +"resource/ui/menus/panels/sb_map_grid.res" +{ + GridInfo0x0 + { + ControlName CNestedPanel + wide 286 + tall 165 + + Classname MapGridInfo + scriptID 0 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + } + + GridInfo1x0 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + Classname MapGridInfo + scriptID 1 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo2x0 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + Classname MapGridInfo + scriptID 2 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo1x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo3x0 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + Classname MapGridInfo + scriptID 3 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo2x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo0x1 + { + ControlName CNestedPanel + wide 286 + tall 165 + ypos 2 + + Classname MapGridInfo + scriptID 4 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + } + + GridInfo1x1 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + Classname MapGridInfo + scriptID 5 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo2x1 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 6 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo1x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo3x1 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 7 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo2x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo0x2 + { + ControlName CNestedPanel + wide 286 + tall 165 + ypos 2 + + + Classname MapGridInfo + scriptID 8 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + } + + GridInfo1x2 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 9 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo2x2 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 10 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo1x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo3x2 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 11 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo2x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo0x3 + { + ControlName CNestedPanel + wide 286 + tall 165 + ypos 2 + + + Classname MapGridInfo + scriptID 12 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + } + + GridInfo1x3 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 13 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo2x3 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 14 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo1x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo3x3 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 15 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo2x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo0x4 + { + ControlName CNestedPanel + wide 286 + tall 165 + ypos 2 + + + Classname MapGridInfo + scriptID 16 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + } + + GridInfo1x4 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 17 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo0x4 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo2x4 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 18 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo1x4 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + GridInfo3x4 + { + ControlName CNestedPanel + wide 286 + tall 165 + xpos 2 + + + Classname MapGridInfo + scriptID 19 + + controlSettingsFile "resource/ui/menus/panels/map_grid_button.res" + + + pin_to_sibling GridInfo2x4 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + +//-------------------------------------------------------------------- + + GridButton0x0 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + + Classname MapGridButtons + scriptID 0 + + navDown GridButton0x1 + navRight GridButton1x0 + navUp DummyTop + } + + GridButton1x0 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 1 + + pin_to_sibling GridButton0x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navDown GridButton1x1 + navRight GridButton2x0 + navLeft GridButton0x0 + navUp DummyTop + } + + GridButton2x0 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 2 + + pin_to_sibling GridButton1x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navDown GridButton2x1 + navRight GridButton3x0 + navLeft GridButton1x0 + navUp DummyTop + } + + GridButton3x0 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 3 + + pin_to_sibling GridButton2x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navDown GridButton3x1 + navLeft GridButton2x0 + navUp DummyTop + } + + GridButton0x1 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + ypos 2 + + Classname MapGridButtons + scriptID 4 + + pin_to_sibling GridInfo0x0 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + + navUp GridButton0x0 + navRight GridButton1x1 + navDown GridButton0x2 + } + + GridButton1x1 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 5 + + pin_to_sibling GridButton0x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton1x0 + navDown GridButton1x2 + navRight GridButton2x1 + navLeft GridButton0x1 + } + + GridButton2x1 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 6 + + pin_to_sibling GridButton1x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton2x0 + navDown GridButton2x2 + navLeft GridButton1x1 + navRight GridButton3x1 + } + + GridButton3x1 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 7 + + pin_to_sibling GridButton2x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton3x0 + navDown GridButton3x2 + navLeft GridButton2x1 + } + + GridButton0x2 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + ypos 2 + + Classname MapGridButtons + scriptID 8 + + pin_to_sibling GridInfo0x1 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + + navUp GridButton0x1 + navDown GridButton0x3 + navRight GridButton1x2 + } + + GridButton1x2 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 9 + + pin_to_sibling GridButton0x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton1x1 + navDown GridButton1x3 + navRight GridButton2x2 + navLeft GridButton0x2 + } + + GridButton2x2 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 10 + + pin_to_sibling GridButton1x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton2x1 + navDown GridButton2x3 + navLeft GridButton1x2 + navRight GridButton3x2 + } + + GridButton3x2 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 11 + + pin_to_sibling GridButton2x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton3x1 + navDown GridButton3x3 + navLeft GridButton2x2 + } + + GridButton0x3 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + ypos 2 + + Classname MapGridButtons + scriptID 12 + + pin_to_sibling GridInfo0x2 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + + navUp GridButton0x2 + navRight GridButton1x3 + navDown GridButton0x4 + } + + GridButton1x3 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 13 + + pin_to_sibling GridButton0x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton1x2 + navRight GridButton2x3 + navLeft GridButton0x3 + navDown GridButton1x4 + } + + GridButton2x3 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 14 + + pin_to_sibling GridButton1x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton2x2 + navRight GridButton3x3 + navLeft GridButton1x3 + navDown GridButton2x4 + } + + GridButton3x3 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 15 + + pin_to_sibling GridButton2x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton3x2 + navLeft GridButton2x3 + navDown GridButton3x4 + } + + GridButton0x4 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + ypos 2 + + Classname MapGridButtons + scriptID 16 + + pin_to_sibling GridInfo0x3 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + + navUp GridButton0x3 + navRight GridButton1x4 + navDown DummyBottom + } + + GridButton1x4 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 17 + + pin_to_sibling GridButton0x4 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton1x3 + navRight GridButton2x4 + navLeft GridButton0x4 + navDown DummyBottom + } + + GridButton2x4 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 18 + + pin_to_sibling GridButton1x4 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton2x3 + navRight GridButton3x4 + navLeft GridButton1x4 + navDown DummyBottom + } + + GridButton3x4 + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 286 + tall 165 + xpos 2 + + Classname MapGridButtons + scriptID 19 + + pin_to_sibling GridButton2x4 + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp GridButton3x3 + navLeft GridButton2x4 + navDown DummyBottom + } + +//-------------------------------------------------------------------- + + DummyTop + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 0 + tall 0 + } + + DummyBottom + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 0 + tall 0 + } +} diff --git a/Northstar.Client/mod/resource/ui/menus/sb_map_select.menu b/Northstar.Client/mod/resource/ui/menus/sb_map_select.menu new file mode 100644 index 000000000..6bb093122 --- /dev/null +++ b/Northstar.Client/mod/resource/ui/menus/sb_map_select.menu @@ -0,0 +1,301 @@ +resource/ui/menus/sb_map_select.menu +{ + menu + { + ControlName Frame + xpos 0 + ypos 0 + zpos 3 + wide f0 + tall f0 + autoResize 0 + visible 1 + enabled 1 + pinCorner 0 + PaintBackgroundType 0 + infocus_bgcolor_override "0 0 0 0" + outoffocus_bgcolor_override "0 0 0 0" + + Vignette + { + ControlName ImagePanel + InheritProperties MenuVignette + } + + MenuTitle + { + ControlName Label + InheritProperties MenuTitle + labelText "#SELECT_MAP" + } + + ButtonRowAnchor + { + ControlName Label + labelText "" + + xpos 96 + ypos 130 // 160 + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + MapsGridPanel + { + ControlName CNestedPanel + zpos 200 + wide 1150 // 803 // 1150 + tall 833 // 728 + visible 1 + controlSettingsFile "resource/ui/menus/panels/sb_map_grid.res" + + pin_to_sibling ButtonRowAnchor + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + MapDetailsPanel + { + ControlName RuiPanel + xpos 2 + // ypos 160 + tall 833 // 782 + wide 500 // 810 + rui "ui/control_options_description.rpak" + wrap 1 + visible 1 + zpos -1 + + pin_to_sibling BtnMapGridUpArrowPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + NextMapImage + { + ControlName RuiPanel + wide 500 + tall 288 + visible 1 + scaleImage 1 + zpos 0 + + // Hud_GetRui() requires this to work + rui "ui/basic_menu_image.rpak" + + pin_to_sibling MapDetailsPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT + } + + NextMapName + { + ControlName Label + pin_to_sibling NextMapImage + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT + + labelText "testname" + + xpos -12 + ypos -10 + zpos 1 + + auto_wide_tocontents 1 + auto_tall_tocontents 1 + font Default_43_DropShadow + allcaps 1 + fgcolor_override "255 255 255 255" + } + + NextMapCreator + { + ControlName Label + pin_to_sibling NextMapImage + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + labelText "Creator: your mom" + + xpos 12 + ypos -12 + zpos 1 + + auto_wide_tocontents 1 + auto_tall_tocontents 1 + font Default_28_DropShadow + fgcolor_override "255 255 255 255" + + visible 0 + } + + NextMapVersion + { + ControlName Label + pin_to_sibling NextMapCreator + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + + labelText "Version: 0.0.0" + + xpos 0 + ypos 0 + zpos 1 + + auto_wide_tocontents 1 + auto_tall_tocontents 1 + font Default_28_DropShadow + fgcolor_override "255 255 255 255" + + visible 0 + } + + NextMapDescription + { + ControlName Label + textAlignment north + tall 500 + wide 460 + ypos -300 + xpos -20 + + labelText "testdescription" + + wrap 1 + visible 1 + zpos -1 + + pin_to_sibling MapDetailsPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + BtnMapGridUpArrowPanel + { + ControlName RuiPanel + wide 40 + tall 40 + xpos 2 + + rui "ui/control_options_description.rpak" + + visible 1 + zpos -1 + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + BtnMapGridUpArrow + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 40 + tall 40 + xpos 2 + + image "vgui/hud/white" + drawColor "255 255 255 128" + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + BtnMapGridDownArrow + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 40 + tall 40 + xpos 2 + + image "vgui/hud/white" + drawColor "255 255 255 128" + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling BOTTOM_LEFT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnMapGridDownArrowPanel + { + ControlName RuiPanel + wide 40 + tall 40 + xpos 2 + + rui "ui/control_options_description.rpak" + + visible 1 + zpos -1 + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling BOTTOM_LEFT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnMapGridSlider + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 40 + tall 749 + xpos 2 + ypos -42 + zpos 0 + + image "vgui/hud/white" + drawColor "255 255 255 128" + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + BtnMapGridSliderPanel + { + ControlName RuiPanel + wide 40 + tall 749 + xpos 2 + ypos -42 + + rui "ui/control_options_description.rpak" + + visible 1 + zpos -1 + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + + MouseMovementCapture + { + ControlName CMouseMovementCapturePanel + wide 40 + tall 749 + xpos 2 + ypos -42 + zpos 1 + + pin_to_sibling MapsGridPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + FooterButtons + { + ControlName CNestedPanel + InheritProperties FooterButtons + } + } +} diff --git a/Northstar.Client/mod/resource/ui/menus/server_browser.menu b/Northstar.Client/mod/resource/ui/menus/server_browser.menu index 4a84a714a..b7f130de0 100644 --- a/Northstar.Client/mod/resource/ui/menus/server_browser.menu +++ b/Northstar.Client/mod/resource/ui/menus/server_browser.menu @@ -169,7 +169,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // PasswordProtected @@ -1780,8 +1780,8 @@ resource/ui/menus/mods_browse.menu pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_LEFT navUp BtnServerDummmyTop - navRight BtnServerJoin navDown BtnServer2 + navRight BtnServerDescription } BtnServer2 { @@ -1796,7 +1796,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer1 navDown BtnServer3 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer3 { @@ -1811,7 +1811,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer2 navDown BtnServer4 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer4 { @@ -1827,7 +1827,7 @@ resource/ui/menus/mods_browse.menu //ypos 11 navUp BtnServer3 navDown BtnServer5 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer5 { @@ -1842,7 +1842,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer4 navDown BtnServer6 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer6 { @@ -1857,7 +1857,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer5 navDown BtnServer7 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer7 { @@ -1872,7 +1872,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer6 navDown BtnServer8 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer8 { @@ -1887,7 +1887,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer7 navDown BtnServer9 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer9 { @@ -1902,7 +1902,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer8 navDown BtnServer10 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer10 { @@ -1917,7 +1917,7 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner BOTTOM_LEFT navUp BtnServer9 navDown BtnServer11 - navRight BtnServerJoin + navRight BtnServerDescription } BtnServer11 { @@ -1933,6 +1933,7 @@ resource/ui/menus/mods_browse.menu navUp BtnServer10 navDown BtnServer12 navRight BtnServerJoin + navLeft BtnServerSearch } BtnServer12 { @@ -1948,6 +1949,7 @@ resource/ui/menus/mods_browse.menu navUp BtnServer11 navDown BtnServer13 navRight BtnServerJoin + navLeft BtnServerSearch } BtnServer13 { @@ -1963,6 +1965,7 @@ resource/ui/menus/mods_browse.menu navUp BtnServer12 navDown BtnServer14 navRight BtnServerJoin + navLeft BtnServerSearch } BtnServer14 { @@ -1978,6 +1981,7 @@ resource/ui/menus/mods_browse.menu navUp BtnServer13 navDown BtnServer15 navRight BtnServerJoin + navLeft BtnServerSearch } BtnServer15 { @@ -1993,6 +1997,7 @@ resource/ui/menus/mods_browse.menu navUp BtnServer14 navRight BtnServerJoin navDown BtnServerDummmyBottom + navLeft BtnServerSearch } BtnServerDummmyBottom { ControlName RuiButton @@ -2042,7 +2047,6 @@ resource/ui/menus/mods_browse.menu { ControlName RuiButton InheritProperties RuiSmallButton - //labelText "V" wide 40 tall 40 xpos 2 @@ -2078,7 +2082,6 @@ resource/ui/menus/mods_browse.menu { ControlName RuiButton InheritProperties RuiSmallButton - //labelText "V" wide 40 tall 562 xpos 2 @@ -2128,23 +2131,13 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner TOP_LEFT } - //MouseMovementCaptureaaaaaaa - //{ - // ControlName CMouseMovementCapturePanel - // wide %100 - // tall %100 - // xpos 0 - // ypos 0 - // zpos 2 - //} - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - +// Filter Stuff FilterPanel { ControlName RuiPanel - wide 1200 + wide 1700 tall 153 xpos -8 classname FilterPanelChild @@ -2167,7 +2160,6 @@ resource/ui/menus/mods_browse.menu textAlignment west classname FilterPanelChild - wide 500 xpos -23 ypos -16 @@ -2175,12 +2167,14 @@ resource/ui/menus/mods_browse.menu visible 1 zpos 0 + auto_wide_tocontents 1 + pin_to_sibling FilterButtonsRowAnchor pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_LEFT navUp BtnServer15 - navDown SwtBtnSelectMap + navDown BtnSelectMap } BtnServerSearch @@ -2188,8 +2182,8 @@ resource/ui/menus/mods_browse.menu ControlName TextEntry classname FilterPanelChild zpos 100 // This works around input weirdness when the control is constructed by code instead of VGUI blackbox. - xpos -400 - ypos -5 + xpos -10 + ypos -4 wide 390 tall 30 textHidden 0 @@ -2200,44 +2194,162 @@ resource/ui/menus/mods_browse.menu unicode 1 pin_to_sibling BtnSearchLabel - pin_corner_to_sibling TOP_LEFT + pin_corner_to_sibling TOP_RIGHT pin_to_sibling_corner TOP_RIGHT navUp BtnServer15 - navDown SwtBtnSelectMap + navDown BtnSelectMap + navRight SwtBtnSelectRegion } - SwtBtnSelectMap + BtnSelectMap { ControlName RuiButton - InheritProperties SwitchButton + InheritProperties RuiSmallButton labelText "#MAP_FILTER" ConVar "filter_map" classname FilterPanelChild - wide 500 + wide 400 pin_to_sibling BtnSearchLabel pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner BOTTOM_LEFT navUp BtnServerSearch - navDown SwtBtnSelectGamemode + navDown BtnSelectGamemode + navRight BtnMapFiltersClear } - SwtBtnSelectGamemode + BtnMapFiltersClear { ControlName RuiButton - InheritProperties SwitchButton + InheritProperties RuiSmallButton + labelText "#CLEAR_FILTERS" + classname FilterPanelChild + wide 100 + + scriptID 999 + + pin_to_sibling BtnSelectMap + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp BtnServerSearch + navDown BtnGamemodeFiltersClear + navLeft BtnSelectMap + navRight SwtBtnSelectMods + } + + LabelMapSelected + { + ControlName Label + labelText "" + textAlignment east + wide 350 + tall 40 + xpos -5 + classname FilterPanelChild + pin_to_sibling BtnSelectMap + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner TOP_RIGHT + } + + BtnSelectGamemode + { + ControlName RuiButton + InheritProperties RuiSmallButton labelText "#GAMEMODE_FILTER" ConVar "filter_gamemode" classname FilterPanelChild + wide 400 + + pin_to_sibling BtnSelectMap + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT + + navUp BtnSelectMap + navDown SwtBtnSelectRegion + navRight BtnGamemodeFiltersClear + } + + BtnGamemodeFiltersClear + { + ControlName RuiButton + InheritProperties RuiSmallButton + labelText "#CLEAR_FILTERS" + classname FilterPanelChild + wide 100 + + scriptID 999 + + pin_to_sibling BtnSelectGamemode + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp BtnMapFiltersClear + navDown SwtBtnSelectRegion + navLeft BtnSelectGamemode + navRight SwtBtnSelectMods + } + + LabelGamemodeSelected + { + ControlName Label + labelText "" + textAlignment east + wide 250 + tall 40 + xpos -5 + classname FilterPanelChild + pin_to_sibling BtnSelectGamemode + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner TOP_RIGHT + } + + SwtBtnSelectRegion + { + ControlName RuiButton + InheritProperties SwitchButton + labelText "#REGION_FILTER" + ConVar "filter_region" + classname FilterPanelChild + wide 500 + + list + { + "#SWITCH_ANY" "SWITCH_ANY" + } + + pin_to_sibling BtnSearchLabel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + + navUp BtnSelectGamemode + navDown SwtBtnSelectMods + } + + SwtBtnSelectMods + { + ControlName RuiButton + InheritProperties SwitchButton + labelText "#MODS_FILTER" + ConVar "filter_mods" + classname FilterPanelChild wide 500 - pin_to_sibling SwtBtnSelectMap + list + { + "#SWITCH_ANY" "SWITCH_ANY" + "#INSTALLED_MODS" "INSTALLED" + "#OUTDATED_MODS" "OUTDATED" + "#MISSING_MODS" "MISSING" + } + + pin_to_sibling SwtBtnSelectRegion pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner BOTTOM_LEFT - navUp SwtBtnSelectMap + navUp SwtBtnSelectRegion navDown SwtBtnHideFull } @@ -2253,15 +2365,15 @@ resource/ui/menus/mods_browse.menu list { - "#SWITCH_NO" 0 + "#SWITCH_ANY" 0 "#SWITCH_YES" 1 } - pin_to_sibling BtnSearchLabel + pin_to_sibling SwtBtnSelectRegion pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_RIGHT - navUp SwtBtnSelectGamemode + navUp SwtBtnSelectMods navDown SwtBtnHideEmpty } @@ -2329,10 +2441,10 @@ resource/ui/menus/mods_browse.menu pin_corner_to_sibling TOP_RIGHT pin_to_sibling_corner BOTTOM_RIGHT - navUp SwtBtnHideProtected + navUp BtnServerJoin navDown BtnDummyAfterFilterClear navLeft SwtBtnHideProtected - navRight BtnServerJoin + navRight BtnServerSearch } BtnDummyAfterFilterClear { @@ -2343,70 +2455,20 @@ resource/ui/menus/mods_browse.menu visible 1 } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - +// Server Details ServerDetailsPanel { ControlName RuiPanel xpos 1300 ypos 160 - tall 800 + tall 645 wide 500 rui "ui/control_options_description.rpak" wrap 1 visible 1 zpos -1 - } - - //TestPanel - //{ - // ControlName RuiPanel - // tall 420 - // wide 500 - // ypos -330 - // rui "ui/control_options_description.rpak" - // wrap 1 - // visible 1 - // zpos -1 - - // pin_to_sibling ServerDetailsPanel - // pin_corner_to_sibling TOP_LEFT - // pin_to_sibling_corner TOP_LEFT - //} - - LabelDescription - { - ControlName Label - textAlignment north - tall 420 - wide 460 - ypos -300 - xpos -20 - wrap 1 - visible 1 - zpos -1 - - pin_to_sibling ServerDetailsPanel - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT - } - - LabelMods - { - ControlName Label - textAlignment north - tall 420 - wide 460 - ypos -330 - xpos -20 - - wrap 1 - visible 1 - zpos -1 - - pin_to_sibling ServerDetailsPanel - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT + classname ServerDetails } NextMapImage @@ -2419,6 +2481,8 @@ resource/ui/menus/mods_browse.menu rui "ui/basic_menu_image.rpak" + classname ServerDetails + pin_to_sibling ServerDetailsPanel pin_corner_to_sibling TOP_RIGHT pin_to_sibling_corner TOP_RIGHT @@ -2433,6 +2497,8 @@ resource/ui/menus/mods_browse.menu visible 0 zpos 1 + classname ServerDetails + pin_to_sibling ServerDetailsPanel pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_LEFT @@ -2455,6 +2521,8 @@ resource/ui/menus/mods_browse.menu font Default_43_DropShadow allcaps 1 fgcolor_override "255 255 255 255" + + classname ServerDetails } NextGameModeName { @@ -2474,6 +2542,8 @@ resource/ui/menus/mods_browse.menu font Default_28_DropShadow allcaps 1 fgcolor_override "255 255 255 255" + + classname ServerDetails } NextModeIcon { @@ -2487,6 +2557,8 @@ resource/ui/menus/mods_browse.menu rui "ui/basic_image_add.rpak" + classname ServerDetails + pin_to_sibling NextGameModeName pin_corner_to_sibling BOTTOM_RIGHT pin_to_sibling_corner TOP_RIGHT @@ -2510,6 +2582,8 @@ resource/ui/menus/mods_browse.menu allcaps 1 fgcolor_override "255 255 255 255" + classname ServerDetails + pin_to_sibling ServerDetailsPanel pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_LEFT @@ -2519,30 +2593,61 @@ resource/ui/menus/mods_browse.menu { ControlName RuiButton InheritProperties RuiSmallButton - labelText "#DESCRIPTION" + labelText "#SERVER_DESCRIPTION" textAlignment center wide 250 - zpos 999 ypos -1 + classname ServerDetails + pin_to_sibling NextMapImage pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner BOTTOM_LEFT + + // navUp + navDown BtnServerJoin + navLeft BtnServer7 + navRight BtnServerMods } + BtnServerMods { ControlName RuiButton InheritProperties RuiSmallButton - labelText "#MODS" + labelText "#SERVER_REQUIRED_MODS" textAlignment center wide 250 - zpos 999 + classname ServerDetails pin_to_sibling BtnServerDescription pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_RIGHT + + // navUp + navDown BtnServerJoin + navLeft BtnServerDescription + // navRight + } + + LabelServerDetails + { + ControlName Label + textAlignment north + tall 260 + wide 500 + ypos -2 + xpos -2 + labelText "" + + wrap 1 + visible 1 + classname ServerDetails + + pin_to_sibling BtnServerDescription + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT } BtnServerJoin @@ -2550,19 +2655,154 @@ resource/ui/menus/mods_browse.menu ControlName RuiButton InheritProperties RuiSmallButton labelText "#JOIN_BUTTON" - wide 80 - xpos -17 + wide 466 + xpos -6 ypos -57 zpos 90 scriptID 999 + classname ServerDetails + pin_to_sibling ServerDetailsPanel pin_corner_to_sibling TOP_RIGHT pin_to_sibling_corner BOTTOM_RIGHT - navLeft BtnFiltersClear - navRight BtnServerSearch + navUp BtnServerDescription + navDown BtnFiltersClear + navLeft BtnServer15 + navRight BtnServerMods + } + + ///////////////////////////////////// SLIDER BAR FOR BOTH LABEL //////////////////////// + + BtnLabelListUpArrow + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 40 + tall 40 + // xpos -2 + + image "vgui/hud/white" + drawColor "255 255 255 128" + + classname ServerDetails + + pin_to_sibling BtnServerMods + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnLabelListUpArrowPanel + { + ControlName RuiPanel + wide 40 + tall 40 + // xpos -2 + + rui "ui/control_options_description.rpak" + + visible 1 + zpos -1 + + classname ServerDetails + + pin_to_sibling BtnServerMods + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnLabelListSlider + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 40 + tall 180 + zpos 0 + + image "vgui/hud/white" + drawColor "255 255 255 128" + + classname ServerDetails + + pin_to_sibling BtnLabelListUpArrow + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnLabelListSliderPanel + { + ControlName RuiPanel + wide 40 + tall 180 + + rui "ui/control_options_description.rpak" + + visible 1 + zpos -1 + + classname ServerDetails + + pin_to_sibling BtnLabelListUpArrow + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnLabelListDownArrow + { + ControlName RuiButton + InheritProperties RuiSmallButton + wide 40 + tall 40 + // xpos -2 + ypos 180 + + image "vgui/hud/white" + drawColor "255 255 255 128" + + classname ServerDetails + + pin_to_sibling BtnLabelListUpArrow + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT + } + + BtnLabelListDownArrowPanel + { + ControlName RuiPanel + wide 40 + tall 40 + // xpos -2 + ypos 180 + + rui "ui/control_options_description.rpak" + + visible 1 + zpos -1 + + classname ServerDetails + + pin_to_sibling BtnLabelListUpArrow + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT + } + + // sh_menu_models.gnut has a global function which gets called when + // left mouse button gets called while hovering and has mouse + // deltaX; deltaY which we can yoink for ourselfes + MouseMovementCaptureLabel + { + ControlName CMouseMovementCapturePanel + wide 40 + tall 180 + zpos 1 + + classname ServerDetails + + pin_to_sibling BtnLabelListUpArrow + pin_corner_to_sibling TOP_RIGHT + pin_to_sibling_corner BOTTOM_RIGHT } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut b/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut index c83381fdb..c9e843eae 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut @@ -1014,7 +1014,9 @@ void function InitMenus() AddMenu( "PrivateLobbyMenu", $"resource/ui/menus/private_lobby.menu", InitPrivateMatchMenu, "#PRIVATE_MATCH" ) AddMenu( "MapsMenu", $"resource/ui/menus/map_select.menu", InitMapsMenu ) + AddMenu( "SB_MapsMenu", $"resource/ui/menus/sb_map_select.menu", SB_InitMapsMenu ) AddMenu( "ModesMenu", $"resource/ui/menus/mode_select.menu", InitModesMenu ) + AddMenu( "SB_ModesMenu", $"resource/ui/menus/mode_select.menu", SB_InitModesMenu ) AddMenu( "MatchSettingsMenu", $"resource/ui/menus/match_settings.menu", InitMatchSettingsMenu ) AddMenu( "Advocate_Letter", $"resource/ui/menus/advocate_letter.menu", InitAdvocateLetterMenu ) diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index cdeb8b3e0..86cad0deb 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -12,6 +12,8 @@ global function TriggerConnectToServerCallbacks const int BUTTONS_PER_PAGE = 15 // Number of servers we show const float DOUBLE_CLICK_TIME_MS = 0.4 // Max time between clicks for double click registering +const int MAX_NUMBER_OF_LINES = 9 // The total number of ligne in both required mod label and description label befor cut off +const int MAX_LETTER_PER_ROWS = 38 // Stores mouse delta used for scroll bar struct { @@ -19,6 +21,12 @@ struct { int deltaY = 0 } mouseDeltaBuffer +struct { + int deltaX = 0 + int deltaY = 0 +} mouseDeltaBufferServerDetail + + // Filters struct { bool hideFull = false @@ -26,10 +34,12 @@ struct { bool hideProtected = false bool useSearch = false string searchTerm - array filterMaps string filterMap - array filterGamemodes string filterGamemode + array filterRegions = [ "SWITCH_ANY" ] + string filterRegion + string filterMods + string filterModsTypes } filterArguments @@ -72,12 +82,20 @@ struct { var menu int focusedServerIndex = 0 int scrollOffset = 0 + int serverDetailsScrollOffset = 0 + bool isRequiredModsListShow = false bool serverListRequestFailed = false float serverSelectedTime = 0 float serverSelectedTimeLast = 0 int serverButtonFocusedID = 0 bool shouldFocus = true bool cancelConnection = false + + // Server Details string (description & mods) + array serverDetailsModsStrings + array serverDetailsDescriptionStrings + + array serverDetailsActiveStrings // filtered array of servers array serversArrayFiltered @@ -116,41 +134,13 @@ void function AddNorthstarServerBrowserMenu() AddMenu( "ServerBrowserMenu", $"resource/ui/menus/server_browser.menu", InitServerBrowserMenu, "#MENU_SERVER_BROWSER" ) } -void function UpdatePrivateMatchModesAndMaps() -{ - array realMaps = [ "mp_lobby" ] - realMaps.extend( GetPrivateMatchMaps() ) - - foreach ( int enum_, string map in realMaps ) - { - if ( filterArguments.filterMaps.find( map ) != -1 ) - continue - - filterArguments.filterMaps.append( map ) - - string localized = GetMapDisplayName( map ) - Hud_DialogList_AddListItem( Hud_GetChild( file.menu, "SwtBtnSelectMap" ) , localized, string( enum_ + 1 ) ) - } - - array realModes = [ "private_match" ] - realModes.extend( GetPrivateMatchModes() ) - - foreach( int enum_, string mode in realModes ) - { - string localized = GetGameModeDisplayName( mode ) - if ( filterArguments.filterGamemodes.find( localized ) != -1 ) - continue - - filterArguments.filterGamemodes.append( localized ) - Hud_DialogList_AddListItem( Hud_GetChild( file.menu, "SwtBtnSelectGamemode" ) , localized, string( enum_ + 1 ) ) - } -} - void function InitServerBrowserMenu() { file.menu = GetMenu( "ServerBrowserMenu" ) AddMouseMovementCaptureHandler( Hud_GetChild(file.menu, "MouseMovementCapture"), UpdateMouseDeltaBuffer ) + AddMouseMovementCaptureHandler( Hud_GetChild(file.menu, "MouseMovementCaptureLabel"), UpdateMouseDeltaBuffer_ServerDetail ) + // Get menu stuff file.serverButtons = GetElementsByClassname( file.menu, "ServerButton" ) @@ -161,12 +151,6 @@ void function InitServerBrowserMenu() file.serversGamemode = GetElementsByClassname( file.menu, "ServerGamemode" ) file.serversRegion = GetElementsByClassname( file.menu, "Serverregion" ) - filterArguments.filterMaps = [ "SWITCH_ANY" ] - Hud_DialogList_AddListItem( Hud_GetChild( file.menu, "SwtBtnSelectMap" ), "SWITCH_ANY", "0" ) - - filterArguments.filterGamemodes = [ "SWITCH_ANY" ] - Hud_DialogList_AddListItem( Hud_GetChild( file.menu, "SwtBtnSelectGamemode" ), "SWITCH_ANY", "0" ) - // Event handlers AddMenuEventHandler( file.menu, eUIEvent.MENU_CLOSE, OnCloseServerBrowserMenu ) AddMenuEventHandler( file.menu, eUIEvent.MENU_OPEN, OnServerBrowserMenuOpened ) @@ -193,9 +177,8 @@ void function InitServerBrowserMenu() AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerListDownArrow"), UIE_CLICK, OnDownArrowSelected ) AddButtonEventHandler( Hud_GetChild( file.menu, "BtnDummyAfterFilterClear"), UIE_GET_FOCUS, OnHitDummyAfterFilterClear ) - - - AddButtonEventHandler( Hud_GetChild( file.menu, "BtnFiltersClear"), UIE_CLICK, OnBtnFiltersClear_Activate ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnLabelListUpArrow"), UIE_CLICK, ServerDetails_OnUpArrowSelected ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnLabelListDownArrow"), UIE_CLICK, ServerDetails_OnDownArrowSelected ) AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerNameTab"), UIE_CLICK, SortServerListByName_Activate ) @@ -204,9 +187,15 @@ void function InitServerBrowserMenu() AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerGamemodeTab"), UIE_CLICK, SortServerListByGamemode_Activate ) AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerRegionTab"), UIE_CLICK, SortServerListByRegion_Activate ) + // Filter Button and switch + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnFiltersClear"), UIE_CLICK, OnBtnFiltersClear_Activate ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnMapFiltersClear"), UIE_CLICK, OnBtnMapFiltersClear_Activate ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnGamemodeFiltersClear"), UIE_CLICK, OnBtnGamemodeFiltersClear_Activate ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnSelectMap"), UIE_CLICK, OnSelectMapButton_Activate ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnSelectGamemode"), UIE_CLICK, OnSelectModeButton_Activate ) - AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnSelectMap"), UIE_CHANGE, FilterAndUpdateList ) - AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnSelectGamemode"), UIE_CHANGE, FilterAndUpdateList ) + AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnSelectRegion"), UIE_CHANGE, FilterAndUpdateList ) + AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnSelectMods"), UIE_CHANGE, FilterAndUpdateList ) AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnHideFull"), UIE_CHANGE, FilterAndUpdateList ) AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnHideEmpty"), UIE_CHANGE, FilterAndUpdateList ) AddButtonEventHandler( Hud_GetChild( file.menu, "SwtBtnHideProtected"), UIE_CHANGE, FilterAndUpdateList ) @@ -214,33 +203,55 @@ void function InitServerBrowserMenu() AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerSearch"), UIE_CHANGE, FilterAndUpdateList ) + // Server Details AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerDescription"), UIE_CLICK, ShowServerDescription ) AddButtonEventHandler( Hud_GetChild( file.menu, "BtnServerMods"), UIE_CLICK, ShowServerMods ) AddButtonEventHandler( Hud_GetChild( file.menu, "ConnectingButton"), UIE_CLICK, ConnectingButton_Activate ) - // Hidden cause no need, if server descriptions become too long use this - Hud_SetEnabled( Hud_GetChild( file.menu, "BtnServerDescription"), false ) - Hud_SetEnabled( Hud_GetChild( file.menu, "BtnServerMods"), false ) - Hud_SetText( Hud_GetChild( file.menu, "BtnServerDescription"), "" ) - Hud_SetText( Hud_GetChild( file.menu, "BtnServerMods"), "" ) - - // Rui is a pain + RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "BtnSelectMap") ), "buttonText", "" ) + RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "BtnSelectGamemode") ), "buttonText", "" ) + RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnSelectRegion") ), "buttonText", "" ) + RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnSelectMods") ), "buttonText", "" ) RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnHideFull") ), "buttonText", "" ) RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnHideEmpty") ), "buttonText", "" ) RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnHideProtected") ), "buttonText", "" ) - RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnSelectMap") ), "buttonText", "" ) - RuiSetString( Hud_GetRui( Hud_GetChild( file.menu, "SwtBtnSelectGamemode") ), "buttonText", "" ) - ToggleConnectingHUD(false) + ToggleServerDetailsSlideBar(false) + // UI resize stuff + Hud_SetWidth(Hud_GetChild( file.menu, "BtnServerSearch"), (500 * ( GetScreenSize()[0] / 1920.0 )) - Hud_GetWidth(Hud_GetChild( file.menu, "BtnSearchLabel")) + Hud_GetPos(Hud_GetChild( file.menu, "BtnServerSearch"))[0] - 10 * ( GetScreenSize()[0] / 1920.0 )) + Hud_SetWidth(Hud_GetChild( file.menu, "BtnSearchLabel"), 500 * ( GetScreenSize()[0] / 1920.0 )) + // UI was cut off on some aspect ratios; not perfect UpdateServerInfoBasedOnRes() } +//////////////////////////// +// Button +//////////////////////////// + +void function OnSelectMapButton_Activate( var button ) +{ + if ( Hud_IsLocked( button ) ) + return + + OnCloseServerBrowserMenu() + AdvanceMenu( GetMenu( "SB_MapsMenu" ) ) +} + +void function OnSelectModeButton_Activate( var button ) +{ + if ( Hud_IsLocked( button ) ) + return + + OnCloseServerBrowserMenu() + AdvanceMenu( GetMenu( "SB_ModesMenu" ) ) +} + //////////////////////////// // Slider //////////////////////////// @@ -335,24 +346,32 @@ void function UpdateListSliderPosition( int servers ) } void function OnScrollDown( var button ) -{ - if (file.filteredServers.len() <= BUTTONS_PER_PAGE) return - file.scrollOffset += 5 - if (file.scrollOffset + BUTTONS_PER_PAGE > file.filteredServers.len()) { - file.scrollOffset = file.filteredServers.len() - BUTTONS_PER_PAGE +{ + if(GetElementsByClassname(file.menu, "ServerDetails").contains( GetFocus() )) { + ServerDetails_OnDownArrowSelected( button ) + } else { + if (file.filteredServers.len() <= BUTTONS_PER_PAGE) return + file.scrollOffset += 5 + if (file.scrollOffset + BUTTONS_PER_PAGE > file.filteredServers.len()) { + file.scrollOffset = file.filteredServers.len() - BUTTONS_PER_PAGE + } + UpdateShownPage() + UpdateListSliderPosition( file.filteredServers.len() ) } - UpdateShownPage() - UpdateListSliderPosition( file.filteredServers.len() ) } void function OnScrollUp( var button ) -{ - file.scrollOffset -= 5 - if ( file.scrollOffset < 0 ) { - file.scrollOffset = 0 +{ + if(GetElementsByClassname(file.menu, "ServerDetails").contains( GetFocus() )) { + ServerDetails_OnUpArrowSelected( button ) + } else { + file.scrollOffset -= 5 + if ( file.scrollOffset < 0 ) { + file.scrollOffset = 0 + } + UpdateShownPage() + UpdateListSliderPosition( file.filteredServers.len() ) } - UpdateShownPage() - UpdateListSliderPosition( file.filteredServers.len() ) } //////////////////////////// @@ -385,8 +404,7 @@ void function UpdateServerInfoBasedOnRes() Hud_SetWidth( Hud_GetChild(file.menu, "ServerName"), 392) Hud_SetWidth( Hud_GetChild(file.menu, "NextMapImage"), 400) Hud_SetWidth( Hud_GetChild(file.menu, "NextMapBack"), 400) - Hud_SetWidth( Hud_GetChild(file.menu, "LabelMods"), 360) - Hud_SetWidth( Hud_GetChild(file.menu, "LabelDescription"), 360) + Hud_SetWidth( Hud_GetChild(file.menu, "LabelServerDetails"), 360) Hud_SetWidth( Hud_GetChild(file.menu, "ServerDetailsPanel"), 400) } if( FloatsEqual( float( GetScreenSize()[0] ) / float( GetScreenSize()[1] ) , 1.3, 0.055 ) ) // 4/3 @@ -394,8 +412,7 @@ void function UpdateServerInfoBasedOnRes() Hud_SetWidth( Hud_GetChild(file.menu, "ServerName"), 292) Hud_SetWidth( Hud_GetChild(file.menu, "NextMapImage"), 300) Hud_SetWidth( Hud_GetChild(file.menu, "NextMapBack"), 300) - Hud_SetWidth( Hud_GetChild(file.menu, "LabelMods"), 260) - Hud_SetWidth( Hud_GetChild(file.menu, "LabelDescription"), 260) + Hud_SetWidth( Hud_GetChild(file.menu, "LabelServerDetails"), 260) Hud_SetWidth( Hud_GetChild(file.menu, "ServerDetailsPanel"), 300) } } @@ -406,7 +423,8 @@ void function UpdateServerInfoBasedOnRes() void function OnCloseServerBrowserMenu() { try - { + { + printt("Close Server Browser Menu") DeregisterButtonPressedCallback( MOUSE_WHEEL_UP , OnScrollUp ) DeregisterButtonPressedCallback( MOUSE_WHEEL_DOWN , OnScrollDown ) DeregisterButtonPressedCallback( KEY_TAB , OnKeyTabPressed ) @@ -417,10 +435,10 @@ void function OnCloseServerBrowserMenu() } void function OnServerBrowserMenuOpened() -{ +{ + printt("Open Server Browser Menu") Hud_SetText( Hud_GetChild( file.menu, "InGamePlayerLabel" ), Localize( "#INGAME_PLAYERS", "0" ) ) Hud_SetText( Hud_GetChild( file.menu, "TotalServerLabel" ), Localize( "#TOTAL_SERVERS", "0" ) ) - UpdatePrivateMatchModesAndMaps() Hud_SetText( Hud_GetChild( file.menu, "Title" ), "#MENU_TITLE_SERVER_BROWSER" ) UI_SetPresentationType( ePresentationType.KNOWLEDGEBASE_MAIN ) @@ -436,7 +454,6 @@ void function OnServerBrowserMenuOpened() thread WaitForServerListRequest() - RegisterButtonPressedCallback( MOUSE_WHEEL_UP , OnScrollUp ) RegisterButtonPressedCallback( MOUSE_WHEEL_DOWN , OnScrollDown ) RegisterButtonPressedCallback( KEY_TAB , OnKeyTabPressed ) @@ -594,18 +611,20 @@ bool function IsSearchBarFocused() //////////////////////////// -// Unused +// Server Details Button //////////////////////////// void function ShowServerDescription( var button ) { - Hud_SetVisible( Hud_GetChild( file.menu, "LabelDescription" ), true ) - Hud_SetVisible( Hud_GetChild( file.menu, "LabelMods" ), false ) + file.serverDetailsActiveStrings = file.serverDetailsDescriptionStrings + file.isRequiredModsListShow = false + UpdateServerDetails_SliderHeight() } void function ShowServerMods( var button ) { - Hud_SetVisible( Hud_GetChild( file.menu, "LabelDescription" ), false ) - Hud_SetVisible( Hud_GetChild( file.menu, "LabelMods" ), true ) + file.serverDetailsActiveStrings = file.serverDetailsModsStrings + file.isRequiredModsListShow = true + UpdateServerDetails_SliderHeight() } //////////////////////////// @@ -616,8 +635,7 @@ void function HideServerInfo() Hud_SetVisible( Hud_GetChild( file.menu, "BtnServerDescription" ), false ) Hud_SetVisible( Hud_GetChild( file.menu, "BtnServerMods" ), false ) Hud_SetVisible( Hud_GetChild( file.menu, "BtnServerJoin" ), false ) - Hud_SetVisible( Hud_GetChild( file.menu, "LabelDescription" ), false ) - Hud_SetVisible( Hud_GetChild( file.menu, "LabelMods" ), false ) + Hud_SetVisible( Hud_GetChild( file.menu, "LabelServerDetails" ), false ) Hud_SetVisible( Hud_GetChild( file.menu, "NextMapImage" ), false ) Hud_SetVisible( Hud_GetChild( file.menu, "NextMapBack" ), false ) Hud_SetVisible( Hud_GetChild( file.menu, "NextMapName" ), false ) @@ -633,8 +651,24 @@ void function OnBtnFiltersClear_Activate( var button ) SetConVarBool( "filter_hide_empty", false ) SetConVarBool( "filter_hide_full", false ) SetConVarBool( "filter_hide_protected", false ) - SetConVarInt( "filter_map", 0 ) - SetConVarInt( "filter_gamemode", 0 ) + SetConVarString( "filter_map", "SWITCH_ANY" ) + SetConVarString( "filter_gamemode", "SWITCH_ANY" ) + SetConVarString( "filter_region", "SWITCH_ANY" ) + SetConVarString( "filter_mods", "SWITCH_ANY" ) + + FilterAndUpdateList(0) +} + +void function OnBtnMapFiltersClear_Activate( var button ) +{ + SetConVarString( "filter_map", "SWITCH_ANY" ) + + FilterAndUpdateList(0) +} + +void function OnBtnGamemodeFiltersClear_Activate( var button ) +{ + SetConVarString( "filter_gamemode", "SWITCH_ANY" ) FilterAndUpdateList(0) } @@ -643,12 +677,17 @@ void function FilterAndUpdateList( var n ) { filterArguments.searchTerm = Hud_GetUTF8Text( Hud_GetChild( file.menu, "BtnServerSearch" ) ) if ( filterArguments.searchTerm == "" ) filterArguments.useSearch = false else filterArguments.useSearch = true - filterArguments.filterMap = filterArguments.filterMaps[ GetConVarInt( "filter_map" ) ] - filterArguments.filterGamemode = filterArguments.filterGamemodes[ GetConVarInt( "filter_gamemode" ) ] + filterArguments.filterMap = GetConVarString("filter_map") + filterArguments.filterGamemode = GetConVarString("filter_gamemode") + filterArguments.filterRegion = GetConVarString("filter_region") + filterArguments.filterMods = GetConVarString("filter_mods") filterArguments.hideEmpty = GetConVarBool( "filter_hide_empty" ) filterArguments.hideFull = GetConVarBool( "filter_hide_full" ) filterArguments.hideProtected = GetConVarBool( "filter_hide_protected" ) + Hud_SetText( Hud_GetChild( file.menu, "LabelMapSelected" ), "#" + filterArguments.filterMap ) + Hud_SetText( Hud_GetChild( file.menu, "LabelGamemodeSelected" ),"#" + filterArguments.filterGamemode ) + file.scrollOffset = 0 UpdateListSliderPosition( file.filteredServers.len() ) @@ -716,6 +755,7 @@ void function WaitForServerListRequest() for ( int i = 0; i < BUTTONS_PER_PAGE; i++) { Hud_SetVisible( file.serversProtected[ i ], false ) + printt(file.serverButtons[ i ]) Hud_SetVisible( file.serverButtons[ i ], false ) Hud_SetText( file.serversName[ i ], "" ) Hud_SetText( file.playerCountLabels[ i ], "" ) @@ -758,6 +798,11 @@ void function FilterServerList() { totalPlayers += server.playerCount + if(filterArguments.filterRegions.find(server.region) == -1) { + Hud_DialogList_AddListItem( Hud_GetChild( file.menu, "SwtBtnSelectRegion" ) , server.region, server.region ) + filterArguments.filterRegions.append(server.region) + } + // Filters if ( filterArguments.hideEmpty && server.playerCount == 0 ) continue; @@ -773,6 +818,9 @@ void function FilterServerList() if ( filterArguments.filterGamemode != "SWITCH_ANY" && filterArguments.filterGamemode != GetGameModeDisplayName(server.playlist) ) continue; + + if ( filterArguments.filterRegion != "SWITCH_ANY" && filterArguments.filterRegion != server.region ) + continue; // Search if ( filterArguments.useSearch ) @@ -799,7 +847,38 @@ void function FilterServerList() continue; } - file.filteredServers.append( server ) + if(filterArguments.filterMods != "SWITCH_ANY") { + bool hasMissingMod = false + bool hasOutdatedMod = false + foreach(RequiredModInfo mod in server.requiredMods) { + + if( !NSGetModNames().contains( mod.name ) ) { + hasMissingMod = true + continue + } + + array serverModVersion = StringArrayToIntArray( split( mod.version, ".") ) + array clientModVersion = StringArrayToIntArray( split( NSGetModVersionByModName( mod.name ), "." )) + + if( ( serverModVersion[0] != clientModVersion[0] || serverModVersion[1] > clientModVersion[1] )) { + hasOutdatedMod = true + continue + } + } + + if(!hasMissingMod && !hasOutdatedMod && filterArguments.filterMods == "INSTALLED") { + file.filteredServers.append( server ) + continue + } else if(hasOutdatedMod && filterArguments.filterMods == "OUTDATED") { + file.filteredServers.append( server ) + continue + } else if(hasMissingMod && filterArguments.filterMods == "MISSING") { + file.filteredServers.append( server ) + continue + } + } else { + file.filteredServers.append( server ) + } } // Update player and server count @@ -910,10 +989,20 @@ void function DisplayFocusedServerInfo( int scriptID ) Hud_SetVisible( Hud_GetChild( menu, "BtnServerDescription" ), true ) Hud_SetVisible( Hud_GetChild( menu, "BtnServerMods" ), true ) Hud_SetVisible( Hud_GetChild( menu, "BtnServerJoin" ), true ) + Hud_SetVisible( Hud_GetChild( menu, "LabelServerDetails" ), true) // text panels - Hud_SetVisible( Hud_GetChild( menu, "LabelDescription" ), true ) - Hud_SetVisible( Hud_GetChild( menu, "LabelMods" ), false ) - Hud_SetText( Hud_GetChild( menu, "LabelDescription" ), server.description + "\n\nRequired Mods:\n" + FillInServerModsLabel( server.requiredMods ) ) + + file.serverDetailsDescriptionStrings = split(FormatServerDescriptionLabel(server.description), "\n") + file.serverDetailsModsStrings = split(FormatServerModsLabel( server.requiredMods ), "\n") + + if(!file.isRequiredModsListShow) { + file.serverDetailsActiveStrings = file.serverDetailsDescriptionStrings + + } else { + file.serverDetailsActiveStrings = file.serverDetailsModsStrings + } + + UpdateServerDetails_SliderHeight() // map name/image/server name string map = server.map @@ -937,19 +1026,77 @@ void function DisplayFocusedServerInfo( int scriptID ) Hud_SetText( Hud_GetChild( menu, "NextGameModeName" ), "#NS_SERVERBROWSER_UNKNOWNMODE" ) } -string function FillInServerModsLabel( array mods ) +string function FormatServerDescriptionLabel( string description ) { + + string ret = "" + int numLetter = 0 + + foreach(string word in split(description, " ")) { + if( numLetter + word.len() + 1 <= MAX_LETTER_PER_ROWS) { + if(numLetter != 0) { + ret += " " + numLetter ++ + } + numLetter += word.len() + ret += word + } else { + ret += "\n" + numLetter = word.len() + ret += word + } + } + + return ret +} + +string function FormatServerModsLabel( array mods ) { string ret + string installed_mods = "" + string disabled_mods = "" + string outdated_mods = "" + string missing_mods = "" foreach ( RequiredModInfo mod in mods ) { - ret += format( " %s v%s\n", mod.name, mod.version ) + + if( !NSGetModNames().contains( mod.name ) ) { + missing_mods += format( " - %s v%s\n", mod.name, mod.version ) + continue + } + + array serverModVersion = StringArrayToIntArray( split( mod.version, ".") ) + array clientModVersion = StringArrayToIntArray( split( NSGetModVersionByModName( mod.name ), "." )) + + if( ( serverModVersion.len() != clientModVersion.len() || serverModVersion[0] != clientModVersion[0] || serverModVersion[1] > clientModVersion[1] ) ) { + outdated_mods += format( " - %s v%s -> v%s\n", mod.name, NSGetModVersionByModName( mod.name ), mod.version ) + continue + } + + if(NSIsModEnabled( mod.name ) && mod.name != "Northstar.Custom") { + disabled_mods += format( " - %s v%s\n", mod.name, mod.version ) + continue + } + + installed_mods += format( " - %s v%s\n", mod.name, mod.version ) + } + + if(installed_mods != "") { + ret += (Localize("#INSTALLED_MODS") + ":\n" + installed_mods) + } + if(disabled_mods != "") { + ret += (Localize("#DISABLED_MODS") + ":\n" + disabled_mods) + } + if(outdated_mods != "") { + ret += (Localize("#OUTDATED_MODS") + ":\n" + outdated_mods) + } + if(missing_mods != "") { + ret += (Localize("#MISSING_MODS") + ":\n" + missing_mods) } return ret } - void function OnServerSelected( var button ) { thread OnServerSelected_Threaded( button ) @@ -1361,3 +1508,171 @@ void function TriggerConnectToServerCallbacks( ServerInfo ornull targetServer = callback( expect ServerInfo( targetServer ) ) } } + +////////////////////////////////////// +// Mix +////////////////////////////////////// + +array function StringArrayToIntArray(array stringArray) { + array intarray = [] + foreach (string str in stringArray) { + intarray.append( str.tointeger()) + } + return intarray +} + +////////////////////////////////////// +// Server Details Slider +////////////////////////////////////// + +void function ServerDetailSliderBarUpdate() +{ + if ( file.serverDetailsActiveStrings.len() <= MAX_NUMBER_OF_LINES ) + { + FlushMouseDeltaBuffer_ServerDetail() + return + } + + var sliderButton = Hud_GetChild( file.menu , "BtnLabelListSlider" ) + var sliderPanel = Hud_GetChild( file.menu , "BtnLabelListSliderPanel" ) + var movementCapture = Hud_GetChild( file.menu , "MouseMovementCaptureLabel" ) + + Hud_SetFocused(sliderButton) + + float minYPos = 0.0 * (GetScreenSize()[1] / 1080.0) + float maxHeight = 180.0 * (GetScreenSize()[1] / 1080.0) + float maxYPos = minYPos + (maxHeight - Hud_GetHeight( sliderPanel )) + float useableSpace = ( maxHeight - Hud_GetHeight( sliderPanel )) + + // got local from official respaw scripts, without untyped throws an error + local pos = Hud_GetPos(sliderButton)[1] + local newPos = pos + mouseDeltaBufferServerDetail.deltaY + FlushMouseDeltaBuffer_ServerDetail() + + if ( newPos > maxYPos ) newPos = maxYPos + if ( newPos < minYPos ) newPos = minYPos + + + Hud_SetPos( sliderButton , 2, newPos ) + Hud_SetPos( sliderPanel , 2, newPos ) + Hud_SetPos( movementCapture , 2, newPos ) + + file.serverDetailsScrollOffset = int( ( (newPos - minYPos) / useableSpace ) * ( file.serverDetailsActiveStrings.len() - MAX_NUMBER_OF_LINES) ) + UpdateServerDetails_Label() +} + +void function UpdateServerDetails_SliderHeight() +{ + var sliderButton = Hud_GetChild( file.menu , "BtnLabelListSlider" ) + var sliderPanel = Hud_GetChild( file.menu , "BtnLabelListSliderPanel" ) + var movementCapture = Hud_GetChild( file.menu , "MouseMovementCaptureLabel" ) + + float maxHeight = 180.0 * ( GetScreenSize()[1] / 1080.0 ) + float minHeight = 40.0 * ( GetScreenSize()[1] / 1080.0 ) + + float height = maxHeight * ( MAX_NUMBER_OF_LINES / float( file.serverDetailsActiveStrings.len() ) ) + + if ( height > maxHeight ) height = maxHeight + if ( height < minHeight ) height = minHeight + + Hud_SetHeight( sliderButton , height ) + Hud_SetHeight( sliderPanel , height ) + Hud_SetHeight( movementCapture , height ) + + Hud_SetPos( sliderButton , 2, 0 ) + Hud_SetPos( sliderPanel , 2, 0 ) + Hud_SetPos( movementCapture , 2, 0 ) + + file.serverDetailsScrollOffset = 0 + + UpdateServerDetails_Label() + +} + +void function FlushMouseDeltaBuffer_ServerDetail() +{ + mouseDeltaBufferServerDetail.deltaX = 0 + mouseDeltaBufferServerDetail.deltaY = 0 +} + +void function UpdateMouseDeltaBuffer_ServerDetail(int x, int y) +{ + mouseDeltaBufferServerDetail.deltaX += x + mouseDeltaBufferServerDetail.deltaY += y + + ServerDetailSliderBarUpdate() +} + +void function UpdateServerDetails_Label() { + string texteToDisplay + + if(file.serverDetailsActiveStrings.len() > MAX_NUMBER_OF_LINES) { + ToggleServerDetailsSlideBar(true) + + for( int i = 0; i < MAX_NUMBER_OF_LINES; i++) { + texteToDisplay += (file.serverDetailsActiveStrings[i + file.serverDetailsScrollOffset] + "\n") + } + + } else { + ToggleServerDetailsSlideBar(false) + + foreach(string text in file.serverDetailsActiveStrings) { + texteToDisplay += (text + "\n") + } + + } + + Hud_SetText(Hud_GetChild( file.menu, "LabelServerDetails" ), texteToDisplay) + +} + +void function ToggleServerDetailsSlideBar(bool value) { + Hud_SetVisible( Hud_GetChild( file.menu, "BtnLabelListUpArrow" ), value ) + Hud_SetVisible( Hud_GetChild( file.menu, "BtnLabelListUpArrowPanel" ), value ) + + Hud_SetVisible( Hud_GetChild( file.menu, "BtnLabelListSlider" ), value ) + Hud_SetVisible( Hud_GetChild( file.menu, "BtnLabelListSliderPanel" ), value ) + + Hud_SetVisible( Hud_GetChild( file.menu, "BtnLabelListDownArrow" ), value ) + Hud_SetVisible( Hud_GetChild( file.menu, "BtnLabelListDownArrowPanel" ), value ) + + Hud_SetVisible( Hud_GetChild( file.menu, "MouseMovementCaptureLabel" ), value ) +} + +void function ServerDetails_OnDownArrowSelected( var button ) +{ + if ( ( file.serverDetailsScrollOffset + MAX_NUMBER_OF_LINES ) >= file.serverDetailsActiveStrings.len()) return + + file.serverDetailsScrollOffset += 1 + + UpdateServerDetails_SliderPosition() +} + + +void function ServerDetails_OnUpArrowSelected( var button ) +{ + if ( file.serverDetailsScrollOffset == 0) return + + file.serverDetailsScrollOffset -= 1 + + UpdateServerDetails_SliderPosition() +} + +void function UpdateServerDetails_SliderPosition() +{ + var sliderButton = Hud_GetChild( file.menu , "BtnLabelListSlider" ) + var sliderPanel = Hud_GetChild( file.menu , "BtnLabelListSliderPanel" ) + var movementCapture = Hud_GetChild( file.menu , "MouseMovementCaptureLabel" ) + + float minYPos = 0.0 * (GetScreenSize()[1] / 1080.0) + float maxHeight = 180.0 * (GetScreenSize()[1] / 1080.0) + float useableSpace = ( maxHeight - Hud_GetHeight( sliderPanel )) + + float jump = ((useableSpace - minYPos) / float( file.serverDetailsActiveStrings.len() - MAX_NUMBER_OF_LINES)) * float( file.serverDetailsScrollOffset ) + + Hud_SetPos( sliderButton , 2, jump ) + Hud_SetPos( sliderPanel , 2, jump ) + Hud_SetPos( movementCapture , 2, jump ) + + UpdateServerDetails_Label() +} \ No newline at end of file diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_sb_map_select.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_sb_map_select.nut new file mode 100644 index 000000000..bcce8038a --- /dev/null +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_sb_map_select.nut @@ -0,0 +1,416 @@ +untyped + + +global function SB_MenuMapSelect_Init + +global function SB_InitMapsMenu + +const int GRID_COLUMN_NUMBER = 4 +const int GRID_ROW_NUMBER = 5 + +const int MAPS_PER_PAGE = GRID_COLUMN_NUMBER * GRID_ROW_NUMBER + + +struct { + int deltaX = 0 + int deltaY = 0 +} mouseDeltaBuffer + +struct { + array< var > gridInfos + array< var > gridButtons + + array< string > mapsArray + + int scrollOffset = 0 + + int lastSelectedID + + var menu +} file + + + + + +void function SB_MenuMapSelect_Init() +{ + RegisterSignal( "OnCloseMapsMenu" ) +} + +void function SB_InitMapsMenu() +{ + file.menu = GetMenu( "SB_MapsMenu" ) + + AddMouseMovementCaptureHandler( Hud_GetChild(file.menu, "MouseMovementCapture"), UpdateMouseDeltaBuffer ) + + + AddMenuEventHandler( file.menu, eUIEvent.MENU_CLOSE, OnCloseMapsMenu ) + AddMenuEventHandler( file.menu, eUIEvent.MENU_OPEN, OnOpenMapsMenu ) + + + + AddMenuFooterOption( file.menu, BUTTON_A, "#A_BUTTON_SELECT" ) + AddMenuFooterOption( file.menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" ) + + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnMapGridUpArrow"), UIE_CLICK, OnUpArrowSelected ) + AddButtonEventHandler( Hud_GetChild( file.menu, "BtnMapGridDownArrow"), UIE_CLICK, OnDownArrowSelected ) + + file.gridInfos = GetElementsByClassname( file.menu, "MapGridInfo" ) + + file.gridButtons = GetElementsByClassname( file.menu, "MapGridButtons" ) + + AddButtonEventHandler( Hud_GetChild( Hud_GetChild( file.menu , "MapsGridPanel" ), "DummyTop" ), UIE_GET_FOCUS, OnHitDummyTop ) + AddButtonEventHandler( Hud_GetChild( Hud_GetChild( file.menu , "MapsGridPanel" ), "DummyBottom" ), UIE_GET_FOCUS, OnHitDummyBottom ) + + // uhh + foreach ( var button in file.gridButtons ) + { + AddButtonEventHandler( button, UIE_CLICK, MapButton_Activate ) + AddButtonEventHandler( button, UIE_GET_FOCUS, MapButton_Focus ) + } +} + + +// https://youtu.be/VHi2wKBKBc4 // WTF is this ?? + +void function OnCloseMapsMenu() +{ + Signal( uiGlobal.signalDummy, "OnCloseMapsMenu" ) + + try + { + DeregisterButtonPressedCallback(MOUSE_WHEEL_UP , OnScrollUp) + DeregisterButtonPressedCallback(MOUSE_WHEEL_DOWN , OnScrollDown) + } + catch ( ex ) {} +} + +void function OnOpenMapsMenu() +{ + file.mapsArray = GetPrivateMatchMaps() + + RefreshList() + + Hud_SetFocused( file.gridButtons[0] ) + + RegisterButtonPressedCallback(MOUSE_WHEEL_UP , OnScrollUp) + RegisterButtonPressedCallback(MOUSE_WHEEL_DOWN , OnScrollDown) +} + +void function OnHitDummyTop( var button ) +{ + if( file.scrollOffset == 0 ) + { + Hud_SetFocused( file.gridButtons[ file.lastSelectedID ] ) + return + } + + file.scrollOffset-- + + UpdateMapsGrid() + UpdateListSliderPosition() + UpdateNextMapInfo() + + Hud_SetFocused( file.gridButtons[ file.lastSelectedID ] ) +} + +void function OnHitDummyBottom( var button ) +{ + if ( file.mapsArray.len() <= GRID_ROW_NUMBER || file.mapsArray.len() <= MAPS_PER_PAGE ) // 12 + return + + file.scrollOffset += 1 + + int compensate = 0 + if ( file.mapsArray.len() % GRID_COLUMN_NUMBER != 0 ) + compensate = 1 + + if ((file.scrollOffset + GRID_ROW_NUMBER) * GRID_COLUMN_NUMBER > file.mapsArray.len()) + file.scrollOffset = (file.mapsArray.len() - GRID_ROW_NUMBER * GRID_COLUMN_NUMBER) / GRID_COLUMN_NUMBER + compensate + + UpdateMapsGrid() + UpdateListSliderPosition() + UpdateNextMapInfo() + + int scriptID = file.lastSelectedID + + if( scriptID > file.mapsArray.len() - 1 - file.scrollOffset * GRID_COLUMN_NUMBER ) + scriptID = file.mapsArray.len() - file.scrollOffset * GRID_COLUMN_NUMBER - 1 + + + var lastButton = file.gridButtons[ scriptID ] + + Hud_SetFocused( lastButton ) +} + +void function RefreshList() +{ + file.scrollOffset = 0 + UpdateMapsGrid() + if ( file.mapsArray.len() != 0 ) + UpdateMapsInfo( file.mapsArray[0] ) + UpdateListSliderHeight() + UpdateListSliderPosition() + UpdateNextMapInfo() +} + +void function MapButton_Activate( var button ) +{ + if ( !AmIPartyLeader() && GetPartySize() > 1 ) + return + + int mapID = int( Hud_GetScriptID( button ) ) + string mapName = file.mapsArray[ mapID + file.scrollOffset * GRID_COLUMN_NUMBER ] + + printt( mapName, mapID ) + + UpdateMapsInfo( mapName ) + SetConVarString("filter_map", mapName) + CloseActiveMenu() +} + +void function MapButton_Focus( var button ) +{ + int mapID = int( Hud_GetScriptID( button ) ) + string mapName = file.mapsArray[ mapID + file.scrollOffset * GRID_COLUMN_NUMBER ] + + file.lastSelectedID = mapID + + UpdateMapsInfo( mapName ) +} + +void function OnBtnFiltersClear_Activate( var button ) +{ + Hud_SetText( Hud_GetChild( file.menu, "BtnMapsSearch" ), "" ) + + SetConVarInt( "filter_map_hide_locked", 0 ) + + RefreshList() +} + +void function UpdateMapsInfo( string map ) +{ + RuiSetImage( Hud_GetRui( Hud_GetChild( file.menu, "NextMapImage" ) ), "basicImage", GetMapImageForMapName( map ) ) + Hud_SetText( Hud_GetChild( file.menu, "NextMapDescription" ), GetMapDisplayDesc( map ) ) + Hud_SetText( Hud_GetChild( file.menu, "NextMapName" ), GetMapDisplayName( map ) ) +} + +void function UpdateNextMapInfo() +{ + array< string > mapsArray = file.mapsArray + + if( !mapsArray.len() ) + return + + var nextMapName = Hud_GetChild( file.menu, "NextMapName" ) + Hud_SetText( nextMapName, GetMapDisplayName( mapsArray[ 0 ] ) ) +} + +void function UpdateMapsGrid() +{ + HideAllMapButtons() + + array< string > mapsArray = file.mapsArray + + printt(file.scrollOffset) + + int trueOffset = file.scrollOffset * GRID_COLUMN_NUMBER + + foreach ( int _index, var element in file.gridInfos ) + { + if ( ( _index + trueOffset ) >= mapsArray.len() ) return + + var mapImage = Hud_GetChild( element, "MapImage" ) + var mapName = Hud_GetChild( element, "MapName" ) + + string name = mapsArray[ _index + trueOffset ] + + RuiSetImage( Hud_GetRui( mapImage ), "basicImage", GetMapImageForMapName( name ) ) + Hud_SetText( mapName, GetMapDisplayName( name ) ) + + Hud_SetVisible( file.gridButtons[ _index ], true ) + MakeMapButtonVisible( element ) + } +} + +void function HideAllMapButtons() +{ + foreach ( _index, var element in file.gridInfos ) + { + Hud_SetVisible( element, false ) + + var mapButton = file.gridButtons[ _index ] + var mapFG = Hud_GetChild( element, "MapNameLockedForeground" ) + + Hud_SetLocked( mapButton, false ) + Hud_SetVisible( mapButton, false ) + Hud_SetVisible( mapFG, false ) + } +} + +// :trol: +void function MakeMapButtonVisible( var element ) +{ + Hud_SetVisible( element, true ) +} + +void function LockMapButton( var element ) +{ + var mapFG = Hud_GetChild( element, "MapNameLockedForeground" ) + + Hud_SetVisible( mapFG, true ) +} + +////////////////////////////// +// Slider +////////////////////////////// +void function UpdateMouseDeltaBuffer(int x, int y) +{ + mouseDeltaBuffer.deltaX += x + mouseDeltaBuffer.deltaY += y + + SliderBarUpdate() +} + +void function FlushMouseDeltaBuffer() +{ + mouseDeltaBuffer.deltaX = 0 + mouseDeltaBuffer.deltaY = 0 +} + + +void function SliderBarUpdate() +{ + if ( file.mapsArray.len() <= GRID_ROW_NUMBER || file.mapsArray.len() <= MAPS_PER_PAGE ) + { + FlushMouseDeltaBuffer() + return + } + + var sliderButton = Hud_GetChild( file.menu , "BtnMapGridSlider" ) + var sliderPanel = Hud_GetChild( file.menu , "BtnMapGridSliderPanel" ) + var movementCapture = Hud_GetChild( file.menu , "MouseMovementCapture" ) + + Hud_SetFocused(sliderButton) + + float minYPos = -42.0 * (GetScreenSize()[1] / 1080.0) + float maxHeight = 749.0 * (GetScreenSize()[1] / 1080.0) // 582 + float maxYPos = minYPos - (maxHeight - Hud_GetHeight( sliderPanel )) + float useableSpace = ( maxHeight - Hud_GetHeight( sliderPanel )) + + float jump = minYPos - ( useableSpace / ( file.mapsArray.len() / GRID_COLUMN_NUMBER + 1 )) + + // got local from official respaw scripts, without untyped throws an error + local pos = Hud_GetPos(sliderButton)[1] + local newPos = pos - mouseDeltaBuffer.deltaY + FlushMouseDeltaBuffer() + + if ( newPos < maxYPos ) newPos = maxYPos + if ( newPos > minYPos ) newPos = minYPos + + Hud_SetPos( sliderButton , 2, newPos ) + Hud_SetPos( sliderPanel , 2, newPos ) + Hud_SetPos( movementCapture , 2, newPos ) + + int compensate = 0 + if ( file.mapsArray.len() % GRID_COLUMN_NUMBER != 0 ) + compensate = 1 + + file.scrollOffset = -int( ( (newPos - minYPos) / useableSpace ) * ( file.mapsArray.len() / GRID_COLUMN_NUMBER + compensate - GRID_ROW_NUMBER) ) + UpdateMapsGrid() +} + +void function UpdateListSliderHeight() +{ + var sliderButton = Hud_GetChild( file.menu , "BtnMapGridSlider" ) + var sliderPanel = Hud_GetChild( file.menu , "BtnMapGridSliderPanel" ) + var movementCapture = Hud_GetChild( file.menu , "MouseMovementCapture" ) + + float maps = file.mapsArray.len() / float( GRID_COLUMN_NUMBER ) + + float maxHeight = 749.0 * (GetScreenSize()[1] / 1080.0) // 582 + float minHeight = 80.0 * (GetScreenSize()[1] / 1080.0) + + float height = maxHeight * ( float( GRID_ROW_NUMBER ) / maps ) + + printt(file.mapsArray.len()) + printt(maps) + printt(maxHeight) + printt(height) + + if ( height > maxHeight ) height = maxHeight + if ( height < minHeight ) height = minHeight + + Hud_SetHeight( sliderButton , height ) + Hud_SetHeight( sliderPanel , height ) + Hud_SetHeight( movementCapture , height ) +} + + +void function UpdateListSliderPosition() +{ + if ( file.mapsArray.len() == MAPS_PER_PAGE ) // 12 + return + + var sliderButton = Hud_GetChild( file.menu , "BtnMapGridSlider" ) + var sliderPanel = Hud_GetChild( file.menu , "BtnMapGridSliderPanel" ) + var movementCapture = Hud_GetChild( file.menu , "MouseMovementCapture" ) + + int compensate = 0 + if ( file.mapsArray.len() % GRID_COLUMN_NUMBER != 0 ) + compensate = 1 + + float maps = float ( file.mapsArray.len() / GRID_COLUMN_NUMBER + compensate ) + + float minYPos = -42.0 * (GetScreenSize()[1] / 1080.0) + float useableSpace = (749.0 * (GetScreenSize()[1] / 1080.0) - Hud_GetHeight( sliderPanel )) // 582 + + float jump = minYPos - ( useableSpace / ( maps - float( GRID_ROW_NUMBER ) ) * file.scrollOffset ) + + if ( jump > minYPos ) jump = minYPos + + Hud_SetPos( sliderButton , 2, jump ) + Hud_SetPos( sliderPanel , 2, jump ) + Hud_SetPos( movementCapture , 2, jump ) +} + +void function OnDownArrowSelected( var button ) +{ + if(file.scrollOffset * GRID_COLUMN_NUMBER + GRID_ROW_NUMBER * GRID_COLUMN_NUMBER >= file.mapsArray.len()) return + + file.scrollOffset += 1 + + UpdateMapsGrid() + UpdateListSliderPosition() +} + + +void function OnUpArrowSelected( var button ) +{ + file.scrollOffset -= 1 + if (file.scrollOffset < 0) { + file.scrollOffset = 0 + } + UpdateMapsGrid() + UpdateListSliderPosition() +} + +void function OnScrollDown( var button ) +{ + if(file.scrollOffset * GRID_COLUMN_NUMBER + GRID_ROW_NUMBER * GRID_COLUMN_NUMBER >= file.mapsArray.len()) return + file.scrollOffset += 1 + + UpdateMapsGrid() + UpdateListSliderPosition() +} + +void function OnScrollUp( var button ) +{ + file.scrollOffset -= 1 + if (file.scrollOffset < 0) { + file.scrollOffset = 0 + } + UpdateMapsGrid() + UpdateListSliderPosition() +} \ No newline at end of file diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_sb_mode_select.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_sb_mode_select.nut new file mode 100644 index 000000000..289d17141 --- /dev/null +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_sb_mode_select.nut @@ -0,0 +1,123 @@ +global function SB_InitModesMenu + +struct { + int currentModePage +} file + +const int MODES_PER_PAGE = 15 + +void function SB_InitModesMenu() +{ + var menu = GetMenu( "SB_ModesMenu" ) + + AddMenuEventHandler( menu, eUIEvent.MENU_OPEN, OnOpenModesMenu ) + + AddEventHandlerToButtonClass( menu, "ModeButton", UIE_GET_FOCUS, ModeButton_GetFocus ) + AddEventHandlerToButtonClass( menu, "ModeButton", UIE_CLICK, ModeButton_Click ) + + AddMenuFooterOption( menu, BUTTON_A, "#A_BUTTON_SELECT" ) + AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" ) + + AddMenuFooterOption( menu, BUTTON_SHOULDER_LEFT, "#PRIVATE_MATCH_PAGE_PREV", "#PRIVATE_MATCH_PAGE_PREV", CycleModesBack ) + AddMenuFooterOption( menu, BUTTON_SHOULDER_RIGHT, "#PRIVATE_MATCH_PAGE_NEXT", "#PRIVATE_MATCH_PAGE_NEXT", CycleModesForward ) +} + +void function OnOpenModesMenu() +{ + UpdateVisibleModes() + + if ( level.ui.privatematch_mode == 0 ) // set to the first mode if there's no mode focused + Hud_SetFocused( GetElementsByClassname( GetMenu( "SB_ModesMenu" ), "ModeButton" )[ 0 ] ) +} + +void function UpdateVisibleModes() +{ + // ensures that we only ever show enough buttons for the number of modes we have + array buttons = GetElementsByClassname( GetMenu( "SB_ModesMenu" ), "ModeButton" ) + foreach ( var button in buttons ) + { + Hud_SetEnabled( button, false ) + Hud_SetVisible( button, false ) + } + + array modesArray = GetPrivateMatchModes() + for ( int i = 0; i < MODES_PER_PAGE; i++ ) + { + if ( i + ( file.currentModePage * MODES_PER_PAGE ) >= modesArray.len() ) + break + + int modeIndex = i + ( file.currentModePage * MODES_PER_PAGE ) + SetButtonRuiText( buttons[ i ], GetGameModeDisplayName( modesArray[ modeIndex ] ) ) + + Hud_SetEnabled( buttons[ i ], true ) + Hud_SetVisible( buttons[ i ], true ) + + Hud_SetLocked( buttons[ i ], false ) + } +} + +void function ModeButton_GetFocus( var button ) +{ + int modeId = int( Hud_GetScriptID( button ) ) + ( file.currentModePage * MODES_PER_PAGE ) + + var menu = GetMenu( "SB_ModesMenu" ) + var nextModeImage = Hud_GetChild( menu, "NextModeImage" ) + var nextModeIcon = Hud_GetChild( menu, "ModeIconImage" ) + var nextModeName = Hud_GetChild( menu, "NextModeName" ) + var nextModeDesc = Hud_GetChild( menu, "NextModeDesc" ) + + array modesArray = GetPrivateMatchModes() + + if ( modeId > modesArray.len() ) + return + + string modeName = modesArray[modeId] + + asset playlistImage = GetPlaylistImage( modeName ) + RuiSetImage( Hud_GetRui( nextModeImage ), "basicImage", playlistImage ) + RuiSetImage( Hud_GetRui( nextModeIcon ), "basicImage", GetPlaylistThumbnailImage( modeName ) ) + Hud_SetText( nextModeName, GetGameModeDisplayName( modeName ) ) + + string mapName = PrivateMatch_GetSelectedMap() + bool mapSupportsMode = PrivateMatch_IsValidMapModeCombo( mapName, modeName ) + if ( IsFDMode( modeName ) ) // HACK! + Hud_SetText( nextModeDesc, Localize( "#FD_PLAYERS_DESC", Localize( GetGameModeDisplayHint( modeName ) ) ) ) + else + Hud_SetText( nextModeDesc, GetGameModeDisplayHint( modeName ) ) +} + +void function ModeButton_Click( var button ) +{ + // this never activates on custom servers, but keeping it for parity with official + if ( !AmIPartyLeader() && GetPartySize() > 1 ) + return + + if ( Hud_IsLocked( button ) ) + return + + int modeID = int( Hud_GetScriptID( button ) ) + ( file.currentModePage * MODES_PER_PAGE ) + + array modesArray = GetPrivateMatchModes() + string modeName = GetGameModeDisplayName(modesArray[ modeID ]) + + SetConVarString("filter_gamemode", modeName) + CloseActiveMenu() +} + +void function CycleModesBack( var button ) +{ + if ( file.currentModePage == 0 ) + return + + file.currentModePage-- + UpdateVisibleModes() +} + +void function CycleModesForward( var button ) +{ + if ( ( file.currentModePage + 1 ) * MODES_PER_PAGE >= GetPrivateMatchModes().len() ) + return + + file.currentModePage++ + UpdateVisibleModes() +} \ No newline at end of file