Skip to content

Commit

Permalink
[Crosshair] Fixed size on smaller screens.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Mar 11, 2020
1 parent 4a954b7 commit 3591734
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
9 changes: 3 additions & 6 deletions client/source/hud/Crosshair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ Crosshair::Crosshair() {
}

void Crosshair::setup() {
float xFactor = Config::screenWidth * Config::screenHeight / 100;
float yFactor = Config::screenHeight * Config::screenWidth / 100;

m_hShape.setSize(0.002 * xFactor, 0.0002 * yFactor);
m_vShape1.setSize(0.0002 * xFactor, 0.001 * yFactor - m_hShape.height() / 2);
m_vShape2.setSize(0.0002 * xFactor, 0.001 * yFactor - m_hShape.height() / 2);
m_hShape.setSize(41, 4);
m_vShape1.setSize(4, 19);
m_vShape2.setSize(4, 19);

m_hShape.setFillColor(gk::Color{200, 200, 200, 180});
m_vShape1.setFillColor(gk::Color{200, 200, 200, 180});
Expand Down
2 changes: 0 additions & 2 deletions client/source/hud/Crosshair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class Crosshair : public gk::Drawable {
private:
void draw(gk::RenderTarget &target, gk::RenderStates states) const override;

gk::VertexBuffer m_vbo;

gk::RectangleShape m_hShape;
gk::RectangleShape m_vShape1;
gk::RectangleShape m_vShape2;
Expand Down
4 changes: 2 additions & 2 deletions mods/default/furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ mod:block {
data.inventory:set_stack(2, 0, fuel_stack:item():string_id(), fuel_stack:amount() - 1)
ticks_remaining = fuel_stack:item():burn_time()
current_burn_time = fuel_stack:item():burn_time()
data.useAltTiles = true;
data.use_alt_tiles = true;
-- world:set_data(pos.x, pos.y, pos.z, 1)
elseif ticks_remaining > 0 then
ticks_remaining = ticks_remaining - 1
Expand All @@ -192,7 +192,7 @@ mod:block {
end
elseif ticks_remaining == 0 then
current_burn_time = 0
data.useAltTiles = false;
data.use_alt_tiles = false;
-- world:set_data(pos.x, pos.y, pos.z, 0)
end

Expand Down
2 changes: 1 addition & 1 deletion server/source/lua/ScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void ScriptEngine::initUsertypes() {
m_lua.new_usertype<BlockData>("BlockData",
"inventory", &BlockData::inventory,
"meta", &BlockData::meta,
"useAltTiles", &BlockData::useAltTiles
"use_alt_tiles", &BlockData::useAltTiles
);

m_lua.new_usertype<Block>("Block",
Expand Down

0 comments on commit 3591734

Please sign in to comment.