mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-12 22:59:26 +01:00
Allow Images as background for Theme
This commit is contained in:
parent
aaaa634638
commit
d9a35e587e
@ -1,6 +1,5 @@
|
||||
package main.java.com.djrapitops.plan.command.commands;
|
||||
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.djrapitops.plugin.command.CommandType;
|
||||
import com.djrapitops.plugin.command.CommandUtils;
|
||||
import com.djrapitops.plugin.command.ISender;
|
||||
@ -107,24 +106,6 @@ public class InspectCommand extends SubCommand {
|
||||
}).runTaskAsynchronously();
|
||||
}
|
||||
|
||||
private void runMessageSenderTask(UUID uuid, ISender sender, String playerName) {
|
||||
plugin.getRunnableFactory().createNew(new AbsRunnable("InspectMessageSenderTask") {
|
||||
private int timesrun = 0;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
timesrun++;
|
||||
// TODO better message sending.
|
||||
if (timesrun > 10) {
|
||||
Log.debug("Command Timeout Message, Inspect.");
|
||||
sender.sendMessage(Locale.get(Msg.CMD_FAIL_TIMEOUT).parse("Inspect"));
|
||||
this.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}).runTaskTimer(TimeAmount.SECOND.ticks(), 5 * TimeAmount.SECOND.ticks());
|
||||
}
|
||||
|
||||
private void sendInspectMsg(ISender sender, String playerName) {
|
||||
sender.sendMessage(Locale.get(Msg.CMD_HEADER_INSPECT) + " " + playerName);
|
||||
// Link
|
||||
|
@ -42,20 +42,33 @@ public enum Colors {
|
||||
this.setting = setting;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method responsible for parsing the setting into a usable css background property.
|
||||
*
|
||||
* @return #HEXCOD or url("url") for images.
|
||||
*/
|
||||
public String getColor() {
|
||||
String settingValue = setting.toString();
|
||||
try {
|
||||
String returnValue = "";
|
||||
if ("base".equalsIgnoreCase(settingValue)) {
|
||||
return "#" + Theme.valueOf(Settings.THEME_BASE.toString().toUpperCase()).getColor(id);
|
||||
returnValue = "#" + Theme.valueOf(Settings.THEME_BASE.toString().toUpperCase()).getColor(id);
|
||||
} else if ('#' == settingValue.charAt(0)) {
|
||||
return settingValue;
|
||||
returnValue = settingValue;
|
||||
} else {
|
||||
for (Theme t : Theme.values()) {
|
||||
if (t.name().equalsIgnoreCase(settingValue)) {
|
||||
return "#" + t.getColor(id);
|
||||
returnValue = "#" + t.getColor(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (returnValue.isEmpty()) {
|
||||
returnValue = "#" + Theme.valueOf(Settings.THEME_BASE.toString().toUpperCase()).getColor(id);
|
||||
}
|
||||
if (settingValue.contains(".")) {
|
||||
returnValue += " url(\"" + settingValue + "\")";
|
||||
}
|
||||
return returnValue;
|
||||
} catch (Exception | NoSuchFieldError e) {
|
||||
Log.error("Something went wrong with getting color " + id + " for theme: " + settingValue);
|
||||
}
|
||||
|
@ -51,7 +51,8 @@
|
||||
|
||||
body {
|
||||
font-family: 'Quicksand', sans-serif;
|
||||
background-color: #ddd;
|
||||
background: #ddd;
|
||||
background-repeat: repeat;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
}
|
||||
@ -62,7 +63,8 @@ header {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
padding: 0;
|
||||
background-color: #348e0f;
|
||||
background: #348e0f;
|
||||
background-repeat: repeat;
|
||||
z-index: 1;
|
||||
}
|
||||
header h1 {
|
||||
@ -86,27 +88,32 @@ header div {
|
||||
float: left;
|
||||
}
|
||||
.button {
|
||||
background-color: #5da341;
|
||||
background: #5da341;
|
||||
background-repeat: repeat;
|
||||
text-decoration: none!important;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.button:hover {
|
||||
background-color: #348e0f;
|
||||
background: #348e0f;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
.link {
|
||||
color: #5da341;
|
||||
text-decoration: none!important;
|
||||
}
|
||||
.button:hover {
|
||||
background-color: #348e0f;
|
||||
background: #348e0f;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
.disabled {
|
||||
background-color: #89c471;
|
||||
background: #89c471;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
.disabled:hover {
|
||||
background-color: #89c471;
|
||||
background: #89c471;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
.content {
|
||||
@ -123,13 +130,15 @@ header div {
|
||||
}
|
||||
.box-header {
|
||||
color: #fff;
|
||||
background-color: #5da341;
|
||||
background: #5da341;
|
||||
background-repeat: repeat;
|
||||
padding: 5px 20px;
|
||||
text-align: left;
|
||||
margin: 5px 5px 0 5px;
|
||||
}
|
||||
.box {
|
||||
background-color: #fff;
|
||||
background: #fff;
|
||||
background-repeat: repeat;
|
||||
padding: 5px 20px;
|
||||
color: #000;
|
||||
text-align: left;
|
||||
@ -138,7 +147,8 @@ header div {
|
||||
.box-footer {
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
background: #fff;
|
||||
background-repeat: repeat;
|
||||
padding: 5px 10px 5px 20px;
|
||||
color: #000;
|
||||
text-align: left;
|
||||
@ -178,13 +188,16 @@ header div {
|
||||
margin: 5px;
|
||||
text-decoration: none!important;
|
||||
color: #fff;
|
||||
background-color: #5da341;
|
||||
background: #5da341;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
.nav-button:hover {
|
||||
background-color: #348e0f;
|
||||
background: #348e0f;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
.active {
|
||||
background-color: #348e0f;
|
||||
background: #348e0f;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
table {
|
||||
@ -193,7 +206,8 @@ table {
|
||||
|
||||
thead th {
|
||||
color: #fff;
|
||||
background-color: #5da341;
|
||||
background: #5da341;
|
||||
background-repeat: repeat;
|
||||
font-weight: 600;
|
||||
}
|
||||
th {
|
||||
|
Loading…
Reference in New Issue
Block a user