}
TextureIndex tex_index;
master.GetEnv().loader.LoadBlockTypes("default", block_types, tex_index);
+ interface.SetInventorySlots(block_types.Size() - 1);
chunk_renderer.LoadTextures(master.GetEnv().loader, tex_index);
chunk_renderer.FogDensity(master.GetWorldConf().fog_density);
skeletons.Load();
hud.FocusBlock(input.BlockFocus().GetChunk(), input.BlockFocus().block);
} else if (input.EntityFocus()) {
hud.FocusEntity(*input.EntityFocus().entity);
+ } else {
+ hud.FocusNone();
}
hud.Display(block_types[player.GetInventorySlot() + 1]);
loop_timer.Update(dt);
, unload(env, world.Chunks(), save) {
TextureIndex tex_index;
env.loader.LoadBlockTypes("default", block_types, tex_index);
+ interface.SetInventorySlots(block_types.Size() - 1);
chunk_renderer.LoadTextures(env.loader, tex_index);
chunk_renderer.FogDensity(wc.fog_density);
skeletons.Load();
hud.FocusBlock(input.BlockFocus().GetChunk(), input.BlockFocus().block);
} else if (input.EntityFocus()) {
hud.FocusEntity(*input.EntityFocus().entity);
+ } else {
+ hud.FocusNone();
}
hud.Display(block_types[player.GetInventorySlot() + 1]);
hud.Update(dt);
float yaw;
bool dirty;
- int active_slot;
-
IntervalTimer place_timer;
IntervalTimer remove_timer;
, pitch(0.0f)
, yaw(0.0f)
, dirty(true)
-, active_slot(0)
, place_timer(256)
, remove_timer(256) {
// nothing
}
-void DirectInput::SelectInventory(int) {
+void DirectInput::SelectInventory(int i) {
+ player.SetInventorySlot(i);
}
void DirectInput::UpdatePlayer() {
while (slot < 0) {
slot += num_slots;
}
+ player_ctrl.SelectInventory(slot);
}
void Interface::InvRel(int delta) {
Player::Player(Entity &e, ChunkIndex &c)
: entity(e)
-, chunks(c) {
+, chunks(c)
+, inv_slot(0) {
}