Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - linq

#1
EDIT: I have looked at Christopho's tutorial videos and figured out how to get rid of the pause button icon, and that I just need to import the magic meter from another project. The only thing is that I still don't know how to make the action button stay on the HUD at all times - setting its is_enabled to true just doesn't do it and I don't see anywhere else in the code that would affect this.


Hi Everyone,

First time posting, of many, I am sure. I'm starting to learn Solarus and develop a game.

I am trying to customize the HUD to my preferences, and I have two questions. The first is: I want the pause button icon to never show (I don't consider it necessary), and I want the action button to always show up, even if there is no action.

I have tried editing this section of the script hud.lua as follows:
    elseif hud.mode == "normal" then
      if attack_icon ~= nil then
        attack_icon:set_dst_position(attack_icon:get_normal_position())
        local attack_icon_enabled = false
        local effect = game.get_custom_command_effect ~= nil and game:get_custom_command_effect("attack") or game:get_command_effect("attack")
        if effect then
          attack_icon_enabled = true
        else
          -- Still display the attack icon when the hero does not have a sword, at the beginning of the game.
          local hero_sword = game:get_ability("sword")
          attack_icon_enabled = hero_sword == nil or hero_sword == 0
        end
        attack_icon:set_enabled(attack_icon_enabled)
        attack_icon:set_active(true)
      end

      if action_icon ~= nil then
        action_icon:set_dst_position(action_icon:get_normal_position())
        local effect = game.get_custom_command_effect ~= nil and game:get_custom_command_effect("action") or game:get_command_effect("action")
        action_icon:set_enabled(true)   --changed from effect ~= nil
        action_icon:set_active(true)
      end

      if pause_icon ~= nil then
        pause_icon:set_enabled(false) --changed from true
        pause_icon:set_active(false)    --changed from true
      end

      for _, item_icon in ipairs(item_icons) do
        if item_icon ~= nil then
          item_icon:set_enabled(true)
          item_icon:set_active(true)
        end
      end


What I am getting is that the pause icon still shows up for one frame, before the script kicks in, I suppose. And the action icon still only displays when I am next to a block to grab or a chest to open; i.e., nothing has changed at all with it. What do I need to do to get these buttons to behave the way I want.

The second question is: I want the button icons on the right and the hearts and magic meter on the left, as it is in every official Zelda game other than LTTP. I have managed to move the buttons and hearts by changing the values in hud_config.lua, but I do not see where I define the location of the magic meter. I also don't see where it gets drawn in any of the scripts. What have I missed here?