1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 |
local SETTING_PANEL_GAMEPAD_CATEGORIES_ROOT = - 1
local DONT_ACTIVATE_ON_SHOW = false
ZO_Gamepad_ParametricList_Screen . Initialize ( self , control , ZO_GAMEPAD_HEADER_TABBAR_DONT_CREATE , DONT_ACTIVATE_ON_SHOW )
if GAMEPAD_OPTIONS_FRAGMENT : IsShowing ( ) and not self : AreDeferredSettingsForPanelLoading ( self . currentCategory ) then
if system == SETTING_TYPE_ACCOUNT and settingId == ACCOUNT_SETTING_ACCOUNT_EMAIL and result == ACCOUNT_EMAIL_REQUEST_RESULT_SUCCESS_EMAIL_UPDATED then
end
end
end
control : RegisterForEvent ( EVENT_DEFERRED_SETTING_REQUEST_COMPLETED , OnDeferredSettingRequestCompleted )
control : RegisterForEvent ( EVENT_MOST_RECENT_GAMEPAD_TYPE_CHANGED , function ( ) self : RefreshGamepadInfoPanel ( ) end )
end
if newState == SCENE_SHOWING then
elseif newState == SCENE_HIDDEN then
end
end )
if newState == SCENE_SHOWING then
if ZO_SharedOptions . DoesPanelDisableShareFeatures ( self . currentCategory ) and DoesPlatformSupportDisablingShareFeatures ( ) then
end
if isDeferredLoading then
end
elseif newState == SCENE_HIDDEN then
if ZO_SharedOptions . DoesPanelDisableShareFeatures ( self . currentCategory ) and DoesPlatformSupportDisablingShareFeatures ( ) then
end
end
end )
end
-- make sure to handle both start and end of screen resize (start only matters for resetting to defautlt)
end
end
local GAMEPAD_OPTIONS_SCENE_GROUP = ZO_SceneGroup : New ( "gamepad_options_root" , "gamepad_options_panel" )
if newState == SCENE_GROUP_SHOWING then
elseif newState == SCENE_GROUP_HIDDEN then
end
end )
end
end
end
-- Include update functionality here if the screen uses self.dirty to track needing to update
end
if selectedControl then
elseif selectedControl . horizontalListObject then
end
end
end
end
end
local headerText
else
end
local headerData =
{
}
end
end
end
if controlType == OPTIONS_CHECKBOX then
--When a checkbox is toggled that controls subsettings refreshVisible to show the dependent controls in their disabled state
--TODO: Call RefreshVisible when Sliders/Horizontal Lists change if ever needed.
end
elseif controlType == OPTIONS_INVOKE_CALLBACK then
elseif controlType == OPTIONS_COLOR then
elseif controlType == OPTIONS_CHAT_COLOR then
end
end
do
local categoriesWithoutDefaults =
{
[ SETTING_PANEL_CINEMATIC ] = true ,
[ SETTING_PANEL_ACCOUNT ] = true ,
}
{
{
end ,
} ,
{
end ,
} ,
}
ZO_Gamepad_AddBackNavigationKeybindDescriptors ( self . keybindStripDescriptor , GAME_NAVIGATION_TYPE_BUTTON , function ( ) SCENE_MANAGER : HideCurrentScene ( ) end )
{
{
end ,
} ,
}
{
}
{
{
else
end
end ,
end ,
} ,
}
end
end
return OPTIONS_MENU_INFO_PANEL_FRAGMENT ~= nil
end
end
function ZO_GamepadOptions_OptionsHorizontalListSetup ( control , data , selected , reselectingDuringRebuild , enabled , selectedFromParent )
ZO_GamepadDefaultHorizontalListEntrySetup ( control , data , selected , reselectingDuringRebuild , enabled , selectedFromParent )
end
end
end
end
end
end
local GAMEPAD_OPTIONS_HEADER_SELECTED_PADDING = - 20
list : AddDataTemplate ( "ZO_GamepadMenuEntryTemplate" , ZO_SharedGamepadEntry_OnSetup , ZO_GamepadMenuEntryTemplateParametricListFunction )
end
end
list : AddDataTemplate ( "ZO_GamepadOptionsSliderRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction )
list : AddDataTemplateWithHeader ( "ZO_GamepadOptionsSliderRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction , nil , "ZO_GamepadOptionsHeaderTemplate" )
list : AddDataTemplate ( "ZO_GamepadOptionsCheckboxRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction )
list : AddDataTemplateWithHeader ( "ZO_GamepadOptionsCheckboxRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction , nil , "ZO_GamepadOptionsHeaderTemplate" )
list : AddDataTemplate ( "ZO_GamepadOptionsHorizontalListRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction )
list : AddDataTemplateWithHeader ( "ZO_GamepadOptionsHorizontalListRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction , nil , "ZO_GamepadOptionsHeaderTemplate" )
list : SetDataTemplateWithHeaderReleaseFunction ( "ZO_GamepadOptionsHorizontalListRow" , ReleaseHorizontalList )
list : AddDataTemplate ( "ZO_GamepadOptionsLabelRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction )
list : AddDataTemplateWithHeader ( "ZO_GamepadOptionsLabelRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction , nil , "ZO_GamepadOptionsHeaderTemplate" )
list : AddDataTemplate ( "ZO_GamepadOptionsColorRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction )
list : AddDataTemplateWithHeader ( "ZO_GamepadOptionsColorRow" , OptionsSetup , ZO_GamepadMenuEntryTemplateParametricListFunction , nil , "ZO_GamepadOptionsHeaderTemplate" )
end
end
do
local CONTROL_TYPES_WITH_PRIMARY_ACTION =
{
[ OPTIONS_CHECKBOX ] = true ,
[ OPTIONS_INVOKE_CALLBACK ] = true ,
[ OPTIONS_COLOR ] = true ,
[ OPTIONS_CHAT_COLOR ] = true ,
}
return
end
return
end
else
--Update incase its name changed based on it being a different control type
end
else
end
--Controller Info Panel
if showingInfoPanel then
else
end
--Camera Options (Enables the camera matching the option so you can test it)
local isFirstPersonCameraSetting = settingId == CAMERA_SETTING_FIRST_PERSON_FIELD_OF_VIEW
or settingId == CAMERA_SETTING_FIRST_PERSON_HEAD_BOB
local isThirdPersonCameraSetting = settingId == CAMERA_SETTING_THIRD_PERSON_FIELD_OF_VIEW
or settingId == CAMERA_SETTING_THIRD_PERSON_HORIZONTAL_POSITION_MULTIPLIER
or settingId == CAMERA_SETTING_THIRD_PERSON_HORIZONTAL_OFFSET
local showingCameraPreview = data . system == SETTING_TYPE_CAMERA and ( isFirstPersonCameraSetting or isThirdPersonCameraSetting )
if showingCameraPreview then
local option = CAMERA_OPTIONS_PREVIEW_FORCE_FIRST_PERSON
if isThirdPersonCameraSetting then
option = CAMERA_OPTIONS_PREVIEW_FORCE_THIRD_PERSON
end
-- pregame does not have FRAGMENT_GROUP so make sure it exists before trying this
if FRAGMENT_GROUP then
end
else
-- pregame does not have FRAGMENT_GROUP so make sure it exists before trying this
if FRAGMENT_GROUP then
end
end
--Tooltip (only shown if there is tooltip text and the controller info isn't shown and we aren't adjusting a camera setting)
if not showingInfoPanel and not showingCameraPreview and ( data . tooltipText or data . gamepadCustomTooltipFunction ) then
else
end
else
end
else
end
end
end
end
if checkBox then
end
end
end
else
end
end
-- Determine if this control should be disabled because of a dependency
end
local IS_GAMEPAD_CONTROL = false
else
end
end
end
local formatString = isHoldKey and SI_BINDING_NAME_GAMEPAD_HOLD_LEFT or SI_BINDING_NAME_GAMEPAD_TAP_LEFT
local localizedToggleCameraName = zo_strformat ( formatString , GetString ( SI_BINDING_NAME_GAMEPAD_TOGGLE_FIRST_PERSON ) )
labelToUse = labelToUse + 1 --use an extra label to show Toggle
local chordedActionString = control . alignment == RIGHT and SI_BINDING_NAME_GAMEPAD_CHORD_LEFT or SI_BINDING_NAME_GAMEPAD_CHORD_RIGHT --put bind texture on left if right aligned
control : GetNamedChild ( "Label" .. labelToUse ) : SetText ( zo_strformat ( GetString ( chordedActionString ) , ZO_Keybinding_GetGamepadActionName ( "GAME_CAMERA_GAMEPAD_ZOOM" ) , zo_iconFormat ( GetGamepadBothDpadDownAndRightStickScrollIcon ( ) , 80 , 40 ) ) )
return labelToUse , linesUsed
end
local localizedQuickSlotName = zo_strformat ( SI_BINDING_NAME_GAMEPAD_TAP_LEFT , GetString ( SI_BINDING_NAME_GAMEPAD_ACTION_BUTTON_9 ) )
labelToUse = labelToUse + 1 --use an extra label to show hold
local localizedQuickSlotHoldName = zo_strformat ( SI_BINDING_NAME_GAMEPAD_HOLD_LEFT , GetString ( SI_BINDING_NAME_GAMEPAD_ASSIGN_QUICKSLOT ) )
return labelToUse , linesUsed
end
if newState == SCENE_FRAGMENT_SHOWING then
end
end
end )
end
end
do
internalassert ( GAMEPAD_TYPE_MAX_VALUE == 7 , "Make sure every gamepad type is properly handled in ZO_GamepadOptions:RefreshGamepadInfoPanel()" )
local GAMEPAD_TYPE_HAS_SOUTHERN_LEFT_STICK = ZO_CreateSetFromArguments ( GAMEPAD_TYPE_PS4 , GAMEPAD_TYPE_PS4_NO_TOUCHPAD , GAMEPAD_TYPE_PS5 , GAMEPAD_TYPE_HERON , GAMEPAD_TYPE_SWITCH )
local backKeyCode
backKeyCode = KEY_GAMEPAD_TOUCHPAD_PRESSED
else
backKeyCode = KEY_GAMEPAD_BACK
end
{
}
if GAMEPAD_TYPE_HAS_SOUTHERN_LEFT_STICK [ mostRecentGamepadType ] then
-- swap dpad and left stick
end
if GAMEPAD_TYPE_HAS_SWAPPED_FACE_BUTTONS [ mostRecentGamepadType ] then
-- swap a/b, x/y
end
local isChordedKeySetupMap = { }
local labelToUse = 1
local linesUsed = 0
--regular key
if actionName and actionName ~= "" then
if actionName == "GAME_CAMERA_GAMEPAD_ZOOM" then --special keybind that chords a button with a thumbstick direction and also can toggle camera
local NOT_HOLD_KEY = false
elseif actionName == "ACTION_BUTTON_9" then -- special keybind that handles hold functionality in lua to show a radial menu
else
localizedActionName = holdActionName and holdActionName ~= "" and zo_strformat ( SI_BINDING_NAME_GAMEPAD_TAP_LEFT , localizedActionName ) or localizedActionName
end
labelToUse = labelToUse + 1
end
--hold key
if holdActionName and holdActionName ~= "" then
if holdActionName == "GAME_CAMERA_GAMEPAD_ZOOM" then --special keybind that chords a button with a thumbstick direction
local HOLD_KEY = true
else
control : GetNamedChild ( "Label" .. labelToUse ) : SetText ( zo_strformat ( SI_BINDING_NAME_GAMEPAD_HOLD_LEFT , localizedActionName ) )
end
labelToUse = labelToUse + 1
end
--chorded keys
if chordedKeys then
if actionName and actionName ~= "" then
if linesUsed < 4 and not isChordedKeySetupMap [ chordedKey ] then
local chordedActionString = control . alignment == RIGHT and SI_BINDING_NAME_GAMEPAD_CHORD_LEFT or SI_BINDING_NAME_GAMEPAD_CHORD_RIGHT --put bind texture on left if right aligned
control : GetNamedChild ( "Label" .. labelToUse ) : SetText ( zo_strformat ( GetString ( chordedActionString ) , localizedActionName , buttonMarkup ) )
if linesUsed == 3 and numLines > 1 then --the last label is using two lines
isChordedKeySetupMap [ chordedKey ] = false
else
labelToUse = labelToUse + 1
linesUsed = linesUsed + numLines
isChordedKeySetupMap [ chordedKey ] = true --this chord has been setup, ignore it when check the second key
end
elseif isChordedKeySetupMap [ chordedKey ] == nil then
isChordedKeySetupMap [ chordedKey ] = false --We ran out of space in this group, we'll try again on the chords other key
end
end
end
end
--clean up unused labels
while labelToUse < 5 do
labelToUse = labelToUse + 1
end
end
end
end
end
if key ~= KEY_INVALID then
-- If the key matches the preferred mode then just use it
end
end
end
end
end
local TEMPLATE_NAMES =
{
[ OPTIONS_HORIZONTAL_SCROLL_LIST ] = "ZO_GamepadOptionsHorizontalListRow" ,
[ OPTIONS_SLIDER ] = "ZO_GamepadOptionsSliderRow" ,
[ OPTIONS_CHECKBOX ] = "ZO_GamepadOptionsCheckboxRow" ,
[ OPTIONS_INVOKE_CALLBACK ] = "ZO_GamepadOptionsLabelRow" ,
[ OPTIONS_COLOR ] = "ZO_GamepadOptionsColorRow" ,
[ OPTIONS_CHAT_COLOR ] = "ZO_GamepadOptionsColorRow" ,
}
end
end
do
local CATEGORY_ICONS =
{
[ SETTING_PANEL_CINEMATIC ] = "EsoUI/Art/Options/Gamepad/gp_options_social.dds" ,
[ SETTING_PANEL_VIDEO ] = "EsoUI/Art/Options/Gamepad/gp_options_video.dds" ,
[ SETTING_PANEL_AUDIO ] = "EsoUI/Art/Options/Gamepad/gp_options_audio.dds" ,
[ SETTING_PANEL_GAMEPLAY ] = "EsoUI/Art/Options/Gamepad/gp_options_gameplay.dds" ,
[ SETTING_PANEL_CAMERA ] = "EsoUI/Art/Options/Gamepad/gp_options_camera.dds" ,
[ SETTING_PANEL_INTERFACE ] = "EsoUI/Art/Options/Gamepad/gp_options_interface.dds" ,
[ SETTING_PANEL_SOCIAL ] = "EsoUI/Art/Options/Gamepad/gp_options_social.dds" ,
[ SETTING_PANEL_NAMEPLATES ] = "EsoUI/Art/Options/Gamepad/gp_options_nameplates.dds" ,
[ SETTING_PANEL_COMBAT ] = "EsoUI/Art/Options/Gamepad/gp_options_combat.dds" ,
[ SETTING_PANEL_ACCOUNT ] = "EsoUI/Art/Options/Gamepad/gp_options_account.dds" ,
}
local settings = GAMEPAD_SETTINGS_DATA [ panelId ]
if settings then
local entryData = ZO_GamepadEntryData : New ( GetString ( "SI_SETTINGSYSTEMPANEL" , panelId ) , CATEGORY_ICONS [ panelId ] )
entryData . panelId = panelId
end
end
end
local settings = GAMEPAD_SETTINGS_DATA [ panelId ]
if settings then
return true
end
end
end
return false
end
local settings = GAMEPAD_SETTINGS_DATA [ panelId ]
if settings then
if IsSettingDeferred ( setting . system , setting . settingId ) and IsDeferredSettingLoading ( setting . system , setting . settingId ) then
return true
end
end
end
return false
end
local settings = GAMEPAD_SETTINGS_DATA [ panelId ]
if settings then
if IsSettingDeferred ( setting . system , setting . settingId ) and IsDeferredSettingLoaded ( setting . system , setting . settingId ) then
return true
end
end
end
return false
end
local isDeferredLoading = false
local settings = GAMEPAD_SETTINGS_DATA [ panelId ]
if settings then
isDeferredLoading = true
end
end
end
return isDeferredLoading
end
self . optionsList : SetNoItemText ( zo_strformat ( SI_INTERFACE_OPTIONS_SETTINGS_PANEL_UNAVAILABLE , panelName ) )
local readyToRefresh = true
readyToRefresh = false
end
end
if readyToRefresh then
else
end
else
end
end
local settings = GAMEPAD_SETTINGS_DATA [ panelId ]
if settings then
local lastHeader = nil
-- This setting isn't available on this platform
elseif IsSettingDeferred ( data . system , data . settingId ) and not IsDeferredSettingLoaded ( data . system , data . settingId ) then
-- If this is a deferred setting and it isn't loaded, then don't show it
end
-- Clear header data when calling header function so the previous result of function is not retained
else
end
end
if controlType == OPTIONS_CUSTOM then
end
local templateName = TEMPLATE_NAMES [ controlType ]
if newHeader and newHeader ~= lastHeader then
templateName = templateName .. "WithHeader"
end
end
lastHeader = newHeader
end
end
end
end
local NO_CONTROL = nil
end
end
end
end
end
else
if settings then
end
end
end |