Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.52 KB | None | 0 0
  1. -- Initialise config
  2. local cfg = F4Menu:CreateConfig()
  3.  
  4. /*
  5.     Set the language!
  6.     You can find the languages you can use here: https://gitlab.com/sleeppyy/xenin-languages/tree/master/f4menu
  7.     You don't need to write the .json part
  8.  
  9.     If you want to add your own language you can
  10.     1. Create a pull request (create new file) that will be uploaded to that website with the language
  11.     2. Use a second argument in the :SetLanguage function
  12.  
  13.     How to do now #2. This will set the language without needing to use the version from a website.
  14.     cfg:SetLanguage("french", [[
  15.         {
  16.             "phrases": {
  17.                 "dashboard": {
  18.                    
  19.                 }
  20.             }
  21.         }
  22.     ]])
  23.  
  24.     So for example
  25.     cfg:SetLanguage("russian", [[
  26.         -- copy the contents of english.json and translate it here
  27.     ]])
  28.  
  29.     It's recommended you use method #1, but you can use method #2 till the file you upload have been approved
  30. */
  31. cfg:SetLanguage("english")
  32.  
  33. -- Set the title of the F4
  34. -- This can be a string, e.g. "Xenin F4"
  35. -- Or it can be a function
  36. -- e.g. function() return "Xenin F4 - " .. LocalPlayer():getDarkRPVar("money") end
  37. -- A function will refresh every 10 seconds, so you can have things that change
  38. cfg:SetTitle("RealismRP")
  39.  
  40. -- Lets set the amount of columns per row for jobs & items
  41. cfg:SetColumnsPerRow(2)
  42.  
  43. -- Should the menu close after changing job?
  44. cfg:SetCloseMenuAfterJobChange(true)
  45.  
  46. -- Default sequence for jobs in the slideout menu?
  47. -- Set to false if you want to disable
  48. cfg:SetDefaultJobSequence("pose_standing_02")
  49.  
  50. -- Should models be rendered in real time?
  51. -- If you have a ton of things in your F4 I recommend you changing this to false, it helps with performance a lot
  52. -- It does look worse, and not every model might have an icon (it's the models fault)
  53. cfg:SetRealtimeModelsEnabled(true)
  54.  
  55. -- Should models be hidden? If true it'll hide no matter if realtime or not models.
  56. cfg:SetHideModels(false)
  57.  
  58. -- Should weapons use the addon Easy Skins to skin weapons if you have any equipped?
  59. cfg:SetEasySkins(true)
  60.  
  61. -- How long should it take between typing the last letter of a search to it happens
  62. -- This is so it doesn't constantly update & lags while you search for something
  63. cfg:SetDebounceLength(0.2)
  64.  
  65. -- Empty the search bar when you switch tabs in the items menu?
  66. cfg:SetEmptySearchOnTabSwitch(true)
  67.  
  68. -- Should categories start expanded?
  69. cfg:SetCategoriesStartExpanded(true)
  70.  
  71. -- Should the category color be the color of the category box?
  72. -- Example of how true looks: https://i.imgur.com/VB5rHXd.png
  73. cfg:SetCategoriesBackgroundFullyColored(false)
  74.  
  75. -- Should the canSee property on categories have priority?
  76. -- If this is set to true, if canSee returns true/false it wont care for other checks for the category
  77. cfg:SetPrioritizeCanSee(false)
  78.  
  79. -- Should jobs that use NeedToChangeFrom be shown even if they can't become that job?
  80. cfg:SetShowNeedToChangeFrom(false)
  81.  
  82. -- Should jobs that fail customCheck **NOT** be shown
  83. cfg:SetHideOnCustomCheckFail(false)
  84.  
  85. -- Should "Total Money" circle in the dashboard also count people that's offline?
  86. cfg:SetUseOfflineMoney(true)
  87.  
  88. -- For the total money.
  89. cfg:SetMoneyConfig({
  90.     -- How often should it cache the total amount of money?
  91.     -- This is in seconds
  92.     CacheInterval = 120,
  93.     -- Only count active players money
  94.     -- Set to false to disable, and any number to determine the amount of days since last login to count as active
  95.     DaysSinceLastLogin = 14,
  96.     -- Should Blue's ATM/SlownLS ATM data be included? Only works if installed
  97.     IncludeBATM = true
  98. })
  99.  
  100. cfg:SetRichestPlayerConfig({
  101.     -- How often should it cache the total amount of money?
  102.     -- This is in seconds
  103.     CacheInterval = 1800,
  104.     -- Should Blue's ATM/SlownLS ATM data be included? Only works if installed
  105.     IncludeBATM = true
  106. })
  107.  
  108. -- Setup the order of how tabs should be in the items menu
  109. cfg:SetItemsOrder({
  110.     "Entities", "Weapons", "Shipments", "Ammo", "Vehicles", "Food"
  111. })
  112.  
  113. -- Sort order for jobs. This will determine the order of "sort by" dropdown for jobs
  114. -- The first part will also be the selected sort when you open menu
  115. -- "default" is DarkRP sortOrder btw.
  116. cfg:SetJobSortOrder({
  117.     "default", "alphabetically", "highestSalary", "lowestSalary", "mostPeople", "leastPeople"
  118. })
  119.  
  120. -- Sort order for the dashboard tabs.
  121. -- If you want to remove a tab, just remove the "string" here
  122. cfg:SetDashboardTabOrder({
  123.     "General", "Economy"
  124. })
  125.  
  126. -- Sort order for the circle graphs in the dashboard in the general tab
  127. -- If you want to remove a certain graph, just remove the "string" here
  128. cfg:SetDashboardGeneralInfoOrder({
  129.     "Online", "Money", "Jobs", "Richest Player"
  130. })
  131.  
  132. -- The sidebar colors. These are gradients. The first part is the start color, the second is the end color
  133. cfg:SetSidebarColors({
  134.     Player = { Color(208, 62, 106), Color(200, 60, 123) },
  135.     PlayerAvatar = { Color(251, 211, 50), Color(69, 198, 103) },
  136.     Commands = { Color(200, 60, 123), Color(176, 55, 180) },
  137. })
  138.  
  139. -- You can change the colours of the menu slightly.
  140. -- The defaults values you can just replace with Color(r, g, b), it will work
  141. cfg:SetColors({
  142.     Top = XeninUI.Theme.Primary,
  143.     Sidebar = XeninUI.Theme.Primary,
  144.     Background = XeninUI.Theme.Background
  145. })
  146.  
  147.  
  148. -- Add staff
  149. -- :AddStaff(usergroup, display_name, color [optional], sortOrder [optional, default = 1])
  150. -- Essentially, you could do:
  151. -- cfg:AddStaff("owner", "Owner", Color(255, 0, 0), 999)
  152. -- That would make it so owner would always be at the top, unless you have another rank with a sortOrder above 999
  153. cfg:AddStaff("superadmin", "Super Admin", XeninUI.Theme.Blue)
  154.  
  155. -- Set the tab that'll it will open up on when you open the menu first time
  156. cfg:SetActiveTab("Dashboard")
  157.  
  158. -- Set the resolution of the addon
  159. -- width, height
  160. -- If the resolution is higher than a users resolution it will be scaled down to 100% of the users resolution.
  161. -- So if you set it to 1920x1080, but a user got 1280x720 resolution it will be 1280x720.
  162. -- You can set this to 9999, 9999 and it'll be fullscreen no matter what
  163. --
  164. -- This can also be a function!
  165. -- If it's a function it HAS to return a fraction (0-1)
  166. -- 1 = fullscreen
  167. -- 0 = nothing
  168. -- Please be aware that the smallest it can go is 960x600. This is due to a lack of pixels, it simply doesn't have space to draw anything.
  169. --
  170. -- Example function:
  171. -- This is equal to the default aspect ratio that 1280x750 pixels provide on 1080p
  172. -- cfg:SetResolution(function()
  173. --  return 0.67, 0.7
  174. -- end)
  175. --
  176. cfg:SetResolution(1280, 750)
  177.  
  178. -- Add custom commands easily.
  179. -- Advanced custom commands beyond just a simple chat command can be added in commands.lua with Lua knowledge
  180. -- Commands are not translated, so you can type what you want.
  181.  
  182. -- If you want to you can create a custom category.
  183. ------
  184. -- cfg:AddCategory("My Category")
  185. ------
  186.  
  187. -- Add a command
  188. -- The first parameter is the name of the category it belongs to. Check commands.lua for default categories names
  189. -- The second parameter is the text shown in the menu
  190. -- The third parameter is the chat message you make the player say.
  191. ------
  192. -- cfg:AddCommand("options.general.name", "Say Hi", "/ooc hi")
  193. ------
  194.  
  195. --------------------------
  196. -- The sidebar content  --
  197. --------------------------
  198.  
  199. -- Add a divider from the top player part
  200. -- You can make it a custom color by doing :AddDivider(Color(r, g, b), Color(r, g, b))
  201. -- If you don't add any colours, it'll use the default colour
  202. cfg:AddDivider()
  203.  
  204. -- Add the first tab
  205. -- name = the display name of the tab
  206. -- desc = the description
  207. -- panel = the Lua VGUI panel. This can be used for custom tabs easily if the addon uses vgui.Register for UI
  208. -- icon is optional, if you don't want an icon just remove the field
  209. -- If you want an icon it uses imgur id, so if you want "https://i.imgur.com/0HYmtUy.png" you will need to set icon to "0HYmtUy"
  210. -- colors is optional, if you don't use this it will use the default tab colors
  211. -- If you want to use custom colors, add this: colors = { Color(255, 0, 0), Color(0, 0, 255) },
  212. -- Of course remember to change the colors as you like.
  213. -- recreateOnSwitch is optional, you should probably enable this for most custom panels (not Xenin addons)
  214. -- This will allow the menu to work with addons that don't update the UI if it ain't open (most addons)
  215.  
  216. cfg:AddTab({
  217.     name = "Dashboard",
  218.     desc = "Server stats & more",
  219.     panel = "F4Menu.Dashboard",
  220.     -- If your server/players are Turkish, you need to set it up differently as Imgur is blocked in Turkey
  221.     -- You can set it up as a table with different URLs.
  222.     -- An example for Imgur + non Imgur fallback
  223.     --  {
  224.     --      If you don't setup any URL it'll use imgur. If you don't setup any type it'll use png. You can use png/jpg
  225.     --      { id = "Tpm965d" },
  226.     --      { id = "va1Y1D", url = "https://i.hizliresim.com", type = "png" }
  227.     --  }
  228.     icon = "Tpm965d"
  229. })
  230. cfg:AddTab({
  231.     name = "Jobs",
  232.     desc = "Get a career!",
  233.     panel = "F4Menu.Jobs",
  234.     icon = "MsBaa8Y"
  235. })
  236. cfg:AddTab({
  237.     name = "Items",
  238.     desc = "Entities & more",
  239.     panel = "F4Menu.Items",
  240.     icon = "HVnAVBY"
  241. })
  242.  
  243. --[[
  244. -- You can have URLs
  245. -- It will try to open the URL in the Steam Browser upon pressing the tab.
  246. cfg:AddURL({
  247.     name = "Donate",
  248.     desc = "Give me shekels",
  249.     -- Used to display title once you have pressed on the tab.
  250.     tabName = "Donation Shop",
  251.     url = "https://store.xeningaming.com"
  252. })
  253.  
  254. -- You can also add a website that'll be shown in the F4 menu itself instead of Steam Browser
  255. -- You don't need a tab name here.
  256. cfg:AddWebsite({
  257.     name = "Donate website",
  258.     desc = "Give me shekels",
  259.     url = "https://store.xeningaming.com"
  260. })
  261. --]]
  262.  
  263. -- If you have Xenin Inventory you can set enabled to true
  264. -- You don't need panel for these
  265. cfg:SetXeninInventory({
  266.     enabled = false,
  267.     name = "Inventory",
  268.     desc = "Store your things",
  269.     icon = "iCAiL7W"
  270. })
  271.  
  272. -- If you have Xenin Battle Pass you can set enabled to true
  273. -- Requires Battle Pass 1.0.7a or higher!
  274. cfg:SetXeninBattlePass({
  275.     enabled = false,
  276.     name = "Battle Pass",
  277.     desc = "Rewards & challenges",
  278.     icon = "hnalpdT"
  279. })
  280.  
  281. -- If you have Xenin Coinflips you can set enabled to true
  282. -- At least version 1.0.8b
  283. cfg:SetXeninCoinflips({
  284.     enabled = false,
  285.     name = "Coinflips",
  286.     desc = "Flip a coin",
  287.     icon = "C3MyKJE"
  288. })
  289.  
  290. -- If you have Xenin Deathscreen you can enable this
  291. cfg:SetXeninDeathscreen({
  292.     enabled = false,
  293.     name = "Deathscreen",
  294.     desc = "Buy & equip cards",
  295.     icon = "eQg85qn"
  296. })
  297.  
  298. cfg:AddDivider()
  299. cfg:AddWebsite({
  300.     name = "Discord",
  301.     desc = "Join our Discord",
  302.     url = "https://discord.gg/GuXWEmN",
  303.     icon = "vHESvbx"
  304. })
  305. cfg:AddWebsite({
  306.     name = "Donate",
  307.     desc = "Donate to help the server out!",
  308.     url = "https://realismrp.com/donate",
  309.     icon = "jvjxAQK"
  310. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement