4
0
Fork 0
mirror of https://github.com/Anvilcraft/modpacktools synced 2024-06-11 06:59:28 +02:00

contributors in modlists will now be colored

This commit is contained in:
LordMZTE 2020-08-03 00:03:24 +02:00
parent fb0ed7b19d
commit c99a1f8bdb
2 changed files with 17 additions and 10 deletions

View file

@ -7,7 +7,6 @@ import ley.anvil.addonscript.wrapper.ArtifactDestination
import ley.anvil.addonscript.wrapper.MetaData
import ley.anvil.modpacktools.MPJH
import ley.anvil.modpacktools.command.CommandReturn
import ley.anvil.modpacktools.command.CommandReturn.Companion.fail
import ley.anvil.modpacktools.command.CommandReturn.Companion.success
import ley.anvil.modpacktools.command.ICommand
import ley.anvil.modpacktools.command.LoadCommand
@ -47,7 +46,7 @@ object CreateModlist : ICommand {
.help("What format the mod list should be made in")
parser.addArgument("file")
.type(FileArgumentType())
.type(FileArgumentType().verifyNotExists())
.help("What file the mod list should be written to")
parser
@ -56,9 +55,6 @@ object CreateModlist : ICommand {
override fun execute(args: Namespace): CommandReturn {
val outFile = args.get<File>("file")
if(outFile.exists())
return fail("File already exists!")
val all = args.get<Boolean>("all") ?: false
val sorting: Comparator<MetaData> = when(args.get<Sorting>("sorting")!!) {
Sorting.NAME -> comparing<MetaData, String> {it.name}
@ -128,6 +124,8 @@ object CreateModlist : ICommand {
td(ul(
each(it.contributors) {contr ->
li(contr.key)
//for contributor colors
.withClass("contributor_${contr.value.getOrElse(0) {""}}")
}
)),
td(each(it.description?.asList() ?: listOf()) {d: String ->

View file

@ -1,21 +1,30 @@
a:link {
color: #ff5555;
color: #f55;
}
a:visited {
color: #cc55cc;
color: #c5c;
}
body {
background-color: #333333;
color: #ffffff;
background-color: #333;
color: #fff;
font-family: sans-serif;
}
.img {
width: 100px;
}
td {
border: #999999 3px;
border: #999 3px;
border-style: solid;
}
.description {
width: 100%;
}
.contributor_owner {
color: #f55;
}
.contributor_author {
color: orange;
}
.contributor_contributor {
color: green;
}