quick check with linters

This commit is contained in:
MihailRis
2024-05-10 12:34:05 +03:00
parent 92f185ab51
commit 9522aedeec
55 changed files with 129 additions and 184 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ void Button::refresh() {
}
}
void Button::drawBackground(const DrawContext* pctx, Assets* assets) {
void Button::drawBackground(const DrawContext* pctx, Assets*) {
glm::vec2 pos = calcPos();
auto batch = pctx->getBatch2D();
batch->texture(nullptr);
+2 -2
View File
@@ -10,7 +10,7 @@ CheckBox::CheckBox(bool checked) : UINode(glm::vec2(32.0f)), checked(checked) {
setColor(glm::vec4(0.0f, 0.0f, 0.0f, 0.5f));
}
void CheckBox::draw(const DrawContext* pctx, Assets* assets) {
void CheckBox::draw(const DrawContext* pctx, Assets*) {
if (supplier) {
checked = supplier();
}
@@ -21,7 +21,7 @@ void CheckBox::draw(const DrawContext* pctx, Assets* assets) {
batch->rect(pos.x, pos.y, size.x, size.y);
}
void CheckBox::mouseRelease(GUI*, int x, int y) {
void CheckBox::mouseRelease(GUI*, int, int) {
checked = !checked;
if (consumer) {
consumer(checked);
+1 -1
View File
@@ -93,7 +93,7 @@ void Container::draw(const DrawContext* pctx, Assets* assets) {
}
}
void Container::drawBackground(const DrawContext* pctx, Assets* assets) {
void Container::drawBackground(const DrawContext* pctx, Assets*) {
glm::vec4 color = calcColor();
if (color.a <= 0.001f)
return;
+1 -1
View File
@@ -15,7 +15,7 @@ InputBindBox::InputBindBox(Binding& binding, glm::vec4 padding)
setScrollable(false);
}
void InputBindBox::drawBackground(const DrawContext* pctx, Assets* assets) {
void InputBindBox::drawBackground(const DrawContext* pctx, Assets*) {
glm::vec2 pos = calcPos();
auto batch = pctx->getBatch2D();
batch->texture(nullptr);
+1 -1
View File
@@ -116,7 +116,7 @@ void SlotView::draw(const DrawContext* pctx, Assets* assets) {
const int slotSize = InventoryView::SLOT_SIZE;
ItemStack& stack = *bound;
const ItemStack& stack = *bound;
glm::vec4 tint(1.0f);
glm::vec2 pos = calcPos();
glm::vec4 color = getColor();
+2 -2
View File
@@ -47,7 +47,7 @@ namespace gui {
};
class SlotView : public gui::UINode {
const Content* content;
const Content* content = nullptr;
SlotLayout layout;
bool highlighted = false;
@@ -77,7 +77,7 @@ namespace gui {
};
class InventoryView : public gui::Container {
const Content* content;
const Content* content = nullptr;
std::shared_ptr<Inventory> inventory;
+2 -1
View File
@@ -26,8 +26,9 @@ void LabelCache::update(const std::wstring& text, bool multiline, bool wrap) {
if (font == nullptr) {
wrap = false;
}
size_t len = 0;
if (multiline) {
size_t len = 0;
for (size_t i = 0; i < text.length(); i++, len++) {
if (text[i] == L'\n') {
lines.push_back(LineScheme {i+1, false});
+4 -5
View File
@@ -56,13 +56,12 @@ void TextBox::draw(const DrawContext* pctx, Assets* assets) {
batch->setColor(glm::vec4(0.8f, 0.9f, 1.0f, 0.25f));
int start = font->calcWidth(input, selectionStart-label->getTextLineOffset(startLine));
int end = font->calcWidth(input, selectionEnd-label->getTextLineOffset(endLine));
int startY = label->getLineYOffset(startLine);
int endY = label->getLineYOffset(startLine);
int lineY = label->getLineYOffset(startLine);
if (startLine == endLine) {
batch->rect(lcoord.x + start, lcoord.y+startY, end-start, lineHeight);
batch->rect(lcoord.x + start, lcoord.y+lineY, end-start, lineHeight);
} else {
batch->rect(lcoord.x + start, lcoord.y+endY, label->getSize().x-start-padding.z-padding.x-2, lineHeight);
batch->rect(lcoord.x + start, lcoord.y+lineY, label->getSize().x-start-padding.z-padding.x-2, lineHeight);
for (uint i = startLine+1; i < endLine; i++) {
batch->rect(lcoord.x, lcoord.y+label->getLineYOffset(i), label->getSize().x-padding.z-padding.x-2, lineHeight);
}
@@ -71,7 +70,7 @@ void TextBox::draw(const DrawContext* pctx, Assets* assets) {
}
}
void TextBox::drawBackground(const DrawContext* pctx, Assets* assets) {
void TextBox::drawBackground(const DrawContext* pctx, Assets*) {
glm::vec2 pos = calcPos();
auto batch = pctx->getBatch2D();
+2 -2
View File
@@ -23,7 +23,7 @@ TrackBar::TrackBar(
setHoverColor(glm::vec4(0.01f, 0.02f, 0.03f, 0.5f));
}
void TrackBar::draw(const DrawContext* pctx, Assets* assets) {
void TrackBar::draw(const DrawContext* pctx, Assets*) {
if (supplier) {
value = supplier();
}
@@ -48,7 +48,7 @@ void TrackBar::setConsumer(doubleconsumer consumer) {
this->consumer = consumer;
}
void TrackBar::mouseMove(GUI*, int x, int y) {
void TrackBar::mouseMove(GUI*, int x, int) {
glm::vec2 pos = calcPos();
value = x - trackWidth/2;
value -= pos.x;
+1 -1
View File
@@ -64,7 +64,7 @@ UINode* UINode::listenAction(onaction action) {
return this;
}
void UINode::click(GUI*, int x, int y) {
void UINode::click(GUI*, int, int) {
pressed = true;
}