RaZgRiZ

re-main_menu_redux

Sep 16th, 2020 (edited)
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. newui "main" [
  2.     // segments are independently placed
  3.  
  4.     if (! $isconnected) [
  5.         // middle-top aligned by default, slightly offset from top, only shows in main menu
  6.         uispace 0 0.04 [
  7.             uialign 0 -1
  8.             uiimage "textures/logo" $ui_default 0 0.9 0.45 [uiimageshadow $ui_menu_s]
  9.         ]
  10.         // center aligned by default, has uifill offset to push it left, only shows in main menu
  11.         if $showmainplayerprev [
  12.             uihlist 0 [
  13.                 uiplayerpreview 1 1 $ui_mainw $ui_mainh [
  14.                     uiplayerpreviewmodel (getplayermodel)
  15.                     uiplayerpreviewpattern (getplayerpattern)
  16.                     uiplayerpreviewcolour (getplayercolour -1)
  17.                     uiplayerpreviewteam (getplayerteam 1)
  18.                     uiplayerpreviewweapselect (weapselect)
  19.                     uiplayerpreviewvanity (getplayervanity)
  20.                     uiplayerpreviewweapselect $weapidxmelee
  21.                 ] [
  22.                     uipreviewinteractive 1
  23.                     uialtrelease [uipreviewresetoffset]
  24.                     if (! $isconnected) [
  25.                         uipreviewskycol (modcolour (skewcolour $backgroundcolour $colourwhite 0.4) 0.2)
  26.                         uipreviewsuncol (skewcolour $backgroundcolour $colourwhite 0.5)
  27.                         uipreviewsundir 0 1 2
  28.                         uipreviewexcol (modcolour $backgroundcolour 0.4)
  29.                         uipreviewexdir 0 0 -2
  30.                         uipreviewyaw 140
  31.                     ]
  32.                     ui_playerprev_easteregg
  33.                 ]
  34.                 uifill 0.4
  35.             ]
  36.         ]
  37.         // bottom-left aligned by default, only shows in main menu
  38.         uispace 0.01 0.01 [
  39.             uialign -1 1
  40.             uitext (format "v%1 (%2) %3" $versionstring $versionrelease (
  41.                 if $versionbuild [format "[%1:%2]" $versionbranch $versionbuild]
  42.             )) $ui_textsmall
  43.         ]
  44.     ]
  45.  
  46.     // center aligned by default
  47.     uivlist $ui_padbutton [
  48.         uibuttonm "Play Online" "textures/servers/list" [uiopen "servers"] 0 main_servers
  49.         uibuttonm (? $isconnected "Vote Map/Mode" "Offline Practice") "textures/icons/maps" [uiopen "maps"] 0 main_maps
  50.         uibuttonm "Parkour Challenges" "textures/modes/race" [uiopen "challengemenu"] 0 main_sp
  51.         uifill 0 $ui_padwin
  52.         uibuttonm "Profile Setup" "textures/icons/player" [uiopen "profile"] 0 main_profile
  53.         uibuttonm "Settings" "textures/icons/settings" [uiopen "settings"] 0 main_settings
  54.         uibuttonm "Help and Support" $questiontex [uiopen "help"] 0 main_help
  55.         if $isconnected [
  56.             uibuttonm "Disconnect" "textures/servers/disconnect" [
  57.                 if (= $gamemode $modeidxediting) [uiopen "disconnectwarn"] [disconnect]
  58.             ] 0 main_disconnect
  59.         ]
  60.         uibuttonm "Quit" "textures/icons/warning" [
  61.             if (&& (= $gamemode $modeidxediting) $isconnected) [uiopen "quitwarn"] [quit]
  62.         ] 0 main_quit
  63.     ]
  64. ]
  65.  
RAW Paste Data