Skip to content

Commit

Permalink
v1.0.1 upsi wopsi
Browse files Browse the repository at this point in the history
  • Loading branch information
spthiel committed Jun 8, 2018
1 parent 9ab18c7 commit 04192d0
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 7 deletions.
21 changes: 20 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
Docs
<html>
<head>
<script type="text/javascript" src="main.js"> </script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="usage">

</div>
<div class="variables">
<div class="flex-table">
<div class="table-row table-header">
<div class="table-row-item">Variabke</div>
<div class="table-row-item">Applicable for</div>
<div class="table-row-item">Description</div>
</div>
</div>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions docs/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function addTablerow(contents) {
let table = document.getElementsByClass("flex-table")[0];
let row = document.createElement('div');
row.className = "table-row";
for(let i = 0; i < contents.length; i++) {
let dom = document.createElement('div');
dom.className = "table-row-item";
dom.innerHTML = contents[i];
row.appendChild(dom);
}
table.appendChild(row);
}

addTablerow("hi","he","hu")
44 changes: 44 additions & 0 deletions docs/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.flex-table :not(.table-header) .table-row-item:not(.empty):hover:after {
position: absolute;
background: rgb(30,30,30);
padding: 2px 10px;
color: white;
text-align: center;
max-width: 200px;
margin-top: 24px;
border-radius: 4px;
pointer-events: none;
}

.flex-table {
display: flex;
justify-content: space-between;
flex-flow: column nowrap;
font-weight: 100;
border: 1px solid black;
margin: 0 10px;
border-radius: 2px;
}

.table-row {
display: flex;
background-color: #f1f1f1;
padding: 10px;
}

.table-header {
background: rgba(0,0,0, .07);
border-bottom: 1px solid black;
}

.table-row-item {
display: flex;
flex-flow: row nowrap;
flex-grow: 1;
flex-basis: 0;
justify-content: center;
text-align: center;
margin: auto;
font-weight: 500;
word-break: break-word;
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ group=net.eq2online.examplemodule
archivesBaseName=entityIterator

#Version of your project
version=1.0
version=1.0.1

################################################################################
# Module settings
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/me/spthiel/entities/main/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public boolean allowed(Entity entity) {
// if we do not find a filter which matches, allow will remain false.
// if we do find a filter that matches, it will flip to true.
// only after going thru all filters (ensuring no inverses) do we return "allow"
// wrong, if we set an inverse filter it would say it's not allowed if there's no filter found
//boolean allow = false;
boolean allow = false;

for(Entry4<List<EntityTypes>, String, Boolean,Class<? extends Entity>> filter : this.filters) {
boolean inverse = filter.getValue2();
Expand All @@ -90,11 +89,15 @@ public boolean allowed(Entity entity) {

if(filter.getValue() != null && !entityName.matches(filter.getValue())) {
debug("continue 1: " + entityName + " " + filter.getValue());
if(inverse)
allow = true;
continue;
}

if(filter.getValue3() != null && !filter.getValue3().isInstance(entity)) {
debug("continue 2: " + entity.getClass().getName() + " " + filter.getValue3().getName());
if(inverse)
allow = true;
continue;
}

Expand All @@ -108,8 +111,11 @@ public boolean allowed(Entity entity) {
break;
}
}
if (found)
if (!found) {
if(inverse)
allow = true;
continue;
}
}

// If we have arrived here, this means we have matched on whatever our filter is.
Expand All @@ -120,9 +126,10 @@ public boolean allowed(Entity entity) {
debug(this.toString());
return false;
}
allow = true;
}
debug("Out end");
return true;
debug("Out end: " + allow);
return allow;
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 04192d0

Please sign in to comment.