diff --git a/ReallifeGamemode.Client/FactionManagement/main.ts b/ReallifeGamemode.Client/FactionManagement/main.ts
index 7b157da4..b9ae499a 100644
--- a/ReallifeGamemode.Client/FactionManagement/main.ts
+++ b/ReallifeGamemode.Client/FactionManagement/main.ts
@@ -19,7 +19,7 @@ export default function factionManagement() {
mp.events.add('onManageFactionRanksLoaded', () => {
if (manageFactionRanksBrowser !== null) {
-
+ manageFactionRanksBrowser.execute(`setFactionName('${rankData.FactionName}')`);
manageFactionRanksBrowser.execute(`loadData(` + JSON.stringify(rankData.Ranks) + `)`);
mp.gui.cursor.show(true, true);
}
diff --git a/ReallifeGamemode.Client/assets/css/factionmanagement/ranks/style.css b/ReallifeGamemode.Client/assets/css/factionmanagement/ranks/style.css
index 06f18745..b5d60c39 100644
--- a/ReallifeGamemode.Client/assets/css/factionmanagement/ranks/style.css
+++ b/ReallifeGamemode.Client/assets/css/factionmanagement/ranks/style.css
@@ -73,3 +73,7 @@
background-color: dimgrey;
cursor: move;
}
+
+h2 {
+ text-align:center;
+}
\ No newline at end of file
diff --git a/ReallifeGamemode.Client/assets/html/factionmanagement/ranks/index.html b/ReallifeGamemode.Client/assets/html/factionmanagement/ranks/index.html
index 4333b802..d27f359e 100644
--- a/ReallifeGamemode.Client/assets/html/factionmanagement/ranks/index.html
+++ b/ReallifeGamemode.Client/assets/html/factionmanagement/ranks/index.html
@@ -13,9 +13,10 @@
+
: Ränge bearbeiten
-
+
diff --git a/ReallifeGamemode.Client/assets/js/factionmanagement/ranks/script.js b/ReallifeGamemode.Client/assets/js/factionmanagement/ranks/script.js
index 5903bb67..913c34ba 100644
--- a/ReallifeGamemode.Client/assets/js/factionmanagement/ranks/script.js
+++ b/ReallifeGamemode.Client/assets/js/factionmanagement/ranks/script.js
@@ -23,7 +23,7 @@ $(document).ready(function () {
$("table#rank-table").append("
| | X |
");
$("table#rank-table").tableDnD(dndConfig);
});
-
+
$(".save-btn").click(function () {
var rows = $("table#rank-table tr");
rows = rows.slice(1);
@@ -54,10 +54,14 @@ $(document).ready(function () {
function loadData(rankData) {
$("table#rank-table tr").remove();
$("table#rank-table").append("
| ID | Fraktions-Ränge |
|---|
");
-
+
rankData.forEach(function (rank) {
$("table#rank-table").append("
| | X |
");
});
$("table#rank-table").tableDnD(dndConfig);
+}
+
+function setFactionName(name) {
+ $("#faction-name").text(name);
}
\ No newline at end of file
diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs
index 00a8e244..fafd4e01 100644
--- a/ReallifeGamemode.Server/Commands/AdminCommands.cs
+++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs
@@ -2474,7 +2474,7 @@ namespace ReallifeGamemode.Server.Commands
return;
}
- List
factionRanks = context.FactionRanks.ToList().FindAll(r => r.FactionId == f.Id).OrderByDescending(o => o.Order).ToList();
+ List factionRanks = context.FactionRanks.Where(r => r.FactionId == f.Id).OrderByDescending(o => o.Order).ToList();
List rankList = new List();
factionRanks.ForEach(r =>
@@ -2488,6 +2488,7 @@ namespace ReallifeGamemode.Server.Commands
FactionRankHelper helper = new FactionRankHelper
{
+ FactionName = f.Name,
FactionId = f.Id,
Ranks = rankList
};
diff --git a/ReallifeGamemode.Server/Util/FactionRankHelper.cs b/ReallifeGamemode.Server/Util/FactionRankHelper.cs
index 2e252f3d..20df8fe4 100644
--- a/ReallifeGamemode.Server/Util/FactionRankHelper.cs
+++ b/ReallifeGamemode.Server/Util/FactionRankHelper.cs
@@ -6,6 +6,7 @@ namespace ReallifeGamemode.Server.Util
{
class FactionRankHelper
{
+ public string FactionName { get; set; }
public int FactionId { get; set; }
public List Ranks { get; set; }
}