Esempio n. 1
0
 public void ActionUpdate(AtavismAction action)
 {
     if (action.slot >= actions.Length)
         return;
     actions[action.slot] = action;
     //actionButtons[action.slot].SendMessage("ActionUpdate", action);
 }
Esempio n. 2
0
	public void ActionUpdate(AtavismAction action) {
		this.action = action;
		if (action == null || action.actionObject == null) {
			//TODO: set to blank icon
		} else {
			/*GetComponentInChildren<UISprite>().spriteName = action.actionObject.icon.name;
			GetComponent<UIImageButton>().hoverSprite = action.actionObject.icon.name;
			GetComponent<UIImageButton>().normalSprite = action.actionObject.icon.name;
			GetComponent<UIImageButton>().pressedSprite = action.actionObject.icon.name;*/
		}
	}
Esempio n. 3
0
 public void ActionUpdate(AtavismAction action)
 {
     actions[action.slot] = action;
     //actionButtons[action.slot].SendMessage("ActionUpdate", action);
 }
Esempio n. 4
0
    void UpdateActions()
    {
        if (ClientAPI.GetPlayerObject() == null || !ClientAPI.GetPlayerObject().PropertyExists("actions"))
            return;

        LinkedList<object> actions_prop = (LinkedList<object>)ClientAPI.GetPlayerObject().GetProperty("actions");
        AtavismLogger.LogDebugMessage("Got player actions property change: " + actions_prop);
        int pos = 0;
        int bar = 0;
        foreach (string actionString in actions_prop) {
            AtavismAction action = new AtavismAction();
            if (actionString.StartsWith("a")) {
                action.actionType = ActionType.Ability;
                int abilityID = int.Parse(actionString.Substring(1));
                action.actionObject = GetComponent<Abilities>().GetAbility(abilityID);
            } else if (actionString.StartsWith("i")) {
                action.actionType = ActionType.Item;
            } else {
                action.actionType = ActionType.None;
            }
            action.slot = pos;
            if (actionBars[bar] != null)
                actionBars[bar].SendMessage("ActionUpdate", action);
            pos++;
        }
           		// dispatch a ui event to tell the rest of the system
        string[] event_args = new string[1];
        AtavismEventSystem.DispatchEvent("ACTION_UPDATE", event_args);
    }