Note: I have compass panel turned off cause I'm using the Plugin Compass for Rust
but anyone is more than welcome to use
InfoPanel
Moved
Total Downloads: 55,749 - First Release: Sep 25, 2015 - Last Update: Mar 13, 2018
- 5/5, 160 likes
-
Attached Files:
-
-
How do we get it to show RP instead of Economics?
-
-
Guys, who can throw off a config of a similar panel?
http://rustexact.ru/forum/index.php?attachments/20170712090017_1-jpg.301 -
-
Find:
Code:{ "Balance", new PanelConfig { Available = true, Dock = "BottomLeftDock", Order = 7, AnchorX = "Left", AnchorY = "Bottom", Margin = "0 0 0 0.01", Width = 0.8f, Height = 0.95f, BackgroundColor = "0 0 0 0.4" , Image = new PanelImageConfig { Order = 1, Width = 0.1f, Height = 0.8f, Margin = "0 0.01 0.1 0.01", Url = "http://i.imgur.com/HhL5TvU.png", }, Text = new PanelTextConfig { Order = 2, Width = 0.848f, Height = 1f, Align = TextAnchor.MiddleCenter, FontColor = DefaultFontColor, FontSize = 12, Margin = "0 0.02 0 0", }, PanelSettings = new Dictionary<string,object> { { "RefreshRate(s)", "5" }, } } },
Code:{ "BalanceRP", new PanelConfig { Available = true, Dock = "BottomLeftDock", Order = 7, AnchorX = "Left", AnchorY = "Bottom", Margin = "0 0 0 0.01", Width = 0.8f, Height = 0.95f, BackgroundColor = "0 0 0 0.4" , Image = new PanelImageConfig { Order = 1, Width = 0.1f, Height = 0.8f, Margin = "0 0.01 0.1 0.01", Url = "http://i.imgur.com/HhL5TvU.png", }, Text = new PanelTextConfig { Order = 2, Width = 0.848f, Height = 1f, Align = TextAnchor.MiddleCenter, FontColor = DefaultFontColor, FontSize = 12, Margin = "0 0.02 0 0", }, PanelSettings = new Dictionary<string,object> { { "RefreshRate(s)", "5" }, } } },
Code:void Init() { LoadConfigValues(); LoadData(); }
Code:[PluginReference] Plugin ServerRewards; static InfoPanel instance;
Code:void OnServerInitialized() { Clock = new Watch
Code:void OnServerInitialized() { instance = this; Clock = new Watch
Code:Bala = new Balance ( Settings.GetPanelSettingsValue("Balance", "RefreshRate(s)", 3) );
Code:Balarp = new BalanceRP ( Settings.GetPanelSettingsValue("BalanceRP", "RefreshRate(s)", 3) );
Code:if (Settings.CheckPanelAvailability("Balance")) { BalanceUpdater = timer.Repeat(Bala.RefreshRate, 0, () => Bala.Refresh(storedData, PlayerPanels)); }
Code:if (Settings.CheckPanelAvailability("BalanceRP")) { BalanceUpdater = timer.Repeat(Balarp.RefreshRate, 0, () => Balarp.Refresh(storedData, PlayerPanels)); }
Code:public double GetBalance(string PlayerID) { var player = RustCore.FindPlayerByIdString(PlayerID); if (player == null) return 0; return (double)(Interface.Oxide.CallHook("Balance", player.UserIDString) ?? 0.0); }
Code:public int GetBalance(string id) { var player = RustCore.FindPlayerByIdString(id); if (player == null) return 0; return (int)instance.ServerRewards?.Call("CheckPoints", Convert.ToUInt64(id)); }
Code:panelText.Content = balance; panelText.Refresh();
Code:panelText.Content = balance; panelText.Refresh(); } } } } private BalanceRP Balarp; public class BalanceRP { public int RefreshRate = 3; public BalanceRP(int RefreshRate) { this.RefreshRate = RefreshRate; } public double GetBalanceRP(string PlayerID) { var player = RustCore.FindPlayerByIdString(PlayerID); if (player == null) return 0; return (double)(Interface.Oxide.CallHook("GetPlayerMoney", player.userID) ?? 0.0); } public void Refresh(StoredData storedData, Dictionary<string, Dictionary<string, IPanel>> panels) { if (!Settings.CheckPanelAvailability("BalanceRP")) return; foreach (var panel in panels) { IPanel iPanel; if (!panel.Value.TryGetValue("BalanceRPText", out iPanel)) continue; var balancerp = $"{GetBalanceRP(panel.Key):N}"; var panelText = (IPanelText)iPanel; if (!balancerp.Equals(panelText.Content)) { panelText.Content = balancerp; panelText.Refresh();
Code:case "BalanceText": ((IPanelText) Panel.Value).Content = $"{Bala.GetBalance(player.UserIDString):N}"; break;
Code:case "BalanceRPText": ((IPanelText)Panel.Value).Content = $"{Balarp.GetBalanceRP(player.UserIDString):N}"; break;
(Change as required)
In "Docks":{
Code:"DockRP": { "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0", "Height": 0.028, "Margin": "0.005 0.1458 0.015 0.005", "Width": 0.15 }
Code:"BalanceRP": { "AnchorX": "Left", "AnchorY": "Bottom", "Autoload": true, "Available": true, "BackgroundColor": "0.32 0.32 0.31 0.4", "Dock": "DockRP", "FadeOut": 0.0, "Height": 1, "Image": { "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0.4", "Height": 0.8, "Margin": "0 0.01 0.1 0.01", "Order": 1, "Url": "http://i.imgur.com/Ve8H6tD.png", "Width": 0.1 }, "Margin": "0 0 0 0.01", "Order": 7, "PanelSettings": { "RefreshRate(s)": "5" }, "Text": { "Align": "MiddleCenter", "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0.4", "Content": "No Content", "FadeIn": 0.0, "FadeOut": 0.0, "FontColor": "1 1 1 1", "FontSize": 12, "Height": 1.0, "Margin": "0 0.02 0 0", "Order": 2, "Width": 0.9 }, "Width": 1 }
I have only got ServerRewards and have to have "BalanceRP": { as "Balance": {
I think BalanceRP only works if you have both
[DOUBLEPOST=1511376062][/DOUBLEPOST]If you can't be bothered to do the above here is the .cs file (removed by forum admin, don't have a go at me. Thanks) and my .json (attached) enjoy!
Panel Preview:
Attached Files:
Last edited by a moderator: Nov 22, 2017 -
-
it wil be so nice
-
can you pleas upload the good infopanel.cs for the RP i dont everythink but it not working ! -
Wulf Community Admin
-
Participants:
You may not start a conversation with the following recipients: PryMary -
@Wulf could you add the RP changes to infopanel as so many people have asked for it i tried to put a working copy on but forgot it's not allowed.
-
Wulf Community Admin
-
Thank you
I'm sure others will appreciate it
-
-
-
Originally I had both economics and Server Rewards and it took me some time to get the right Balance/BalanceRP to show the information correctly. As I originally put in the post:
Code:I have only got ServerRewards and have to have "BalanceRP": { as "Balance": {I think BalanceRP only works if you have both
-
-
-
I went back through my back ups to august and found the infopanel.json that i had for both economics and RP (attached)
[DOUBLEPOST=1511709185][/DOUBLEPOST]In Docks:
Code:"BottomLeftDockEconomics": { "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0", "Height": 0.028, "Margin": "0.005 0.1458 0.05 0.005", "Width": 0.15 }, "BottomLeftDockRP": { "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0", "Height": 0.028, "Margin": "0.005 0.1458 0.015 0.005", "Width": 0.15 }
Code:"Balance": { "AnchorX": "Left", "AnchorY": "Bottom", "Autoload": true, "Available": true, "BackgroundColor": "0.32 0.32 0.31 0.4", "Dock": "BottomLeftDockEconomics", "FadeOut": 0.0, "Height": 1, "Image": { "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0.4", "Height": 0.8, "Margin": "0 0.01 0.1 0.01", "Order": 1, "Url": "http://i.imgur.com/Ve8H6tD.png", "Width": 0.1 }, "Margin": "0 0 0 0.01", "Order": 7, "PanelSettings": { "RefreshRate(s)": "5" }, "Text": { "Align": "MiddleCenter", "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0.4", "Content": "No Content", "FadeIn": 0.0, "FadeOut": 0.0, "FontColor": "1 1 1 1", "FontSize": 12, "Height": 1.0, "Margin": "0 0.02 0 0", "Order": 2, "Width": 0.9 }, "Width": 1 }, "BalanceRP": { "AnchorX": "Left", "AnchorY": "Bottom", "Autoload": true, "Available": true, "BackgroundColor": "0.32 0.32 0.31 0.4", "Dock": "BottomLeftDockRP", "FadeOut": 0.0, "Height": 1, "Image": { "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0.4", "Height": 0.8, "Margin": "0 0.01 0.1 0.01", "Order": 1, "Url": "http://i.imgur.com/HhL5TvU.png", "Width": 0.1 }, "Margin": "0 0 0 0.01", "Order": 7, "PanelSettings": { "RefreshRate(s)": "5" }, "Text": { "Align": "MiddleCenter", "AnchorX": "Left", "AnchorY": "Bottom", "Available": true, "BackgroundColor": "0 0 0 0.4", "Content": "No Content", "FadeIn": 0.0, "FadeOut": 0.0, "FontColor": "1 1 1 1", "FontSize": 12, "Height": 1.0, "Margin": "0 0.02 0 0", "Order": 2, "Width": 0.9 }, "Width": 1 }
Attached Files:
-
-