public void CreateChannel(SPARAMS sp, CHANNEL channel, WINDOW window, MEASUREMENT measurement) { Tuple <CHANNEL, MEASUREMENT> t = new Tuple <CHANNEL, MEASUREMENT>(channel, measurement); if (m_measureChannelDic.ContainsKey(t) == true) { return; } driver.Channels.AddMeasurement("Standard", SparamName[(int)sp], (int)channel, (int)window); // Setup convineient pointers to Channels and Measurements agNAChannel[(int)channel - 1] = driver.Channels.get_Item(GetChannelName(channel)); IAgNAMeasurement chMeasurement; if (measurement != MEASUREMENT.LIKE_CHANNEL) { chMeasurement = agNAChannel[(int)channel - 1].Measurements.get_Item("Measurement" + (int)measurement); m_measureChannelDic.Add(new Tuple <CHANNEL, MEASUREMENT>(channel, measurement), sp); } else { chMeasurement = agNAChannel[(int)channel - 1].Measurements.get_Item("Measurement" + (int)channel); m_measureChannelDic.Add(new Tuple <CHANNEL, MEASUREMENT>(channel, (MEASUREMENT)channel), sp); } }
public void SetItemData(long _iid, ItemData _data, int _count, WINDOW _window, int _pos) { this.iid = _iid; this.data = _data; this.count = _count; this.window = _window; this.position = _pos; lastPos = this.position; lastWindow = this.window; }
private void UpdateItemPosition() { Name = "icon_" + data.vnum + "_" + position; if (lastPos != position || lastWindow != window) { setPosition(); } PlayerEquip.UpdateExistingItem(window, lastWindow, this); lastPos = position; lastWindow = window; }
public void UpdateFromServer(Item server_item) { if (SceneManager.Warping) { return; } this.position = server_item.position; this.window = server_item.window; this.count = server_item.count; UpdateItemCountLabel(); UpdateItemPosition(); }
private static void InitializeWindow(Stack <BehaviorGraph> behaviorGraphs) { WINDOW = GetWindow <BehaviorWindow>(false, TITLE, true); WINDOW.wantsMouseMove = true; if (behaviorGraphs.Count > 0) { BehaviorGraph current = behaviorGraphs.Pop(); WINDOW.behaviorGraph = current; WINDOW.stackBehaviorGraphs = behaviorGraphs; WINDOW.OnEnable(); } WINDOW.Show(); }
private void dequip() { int cid = Server.the_core.getClientFromPid(ownerPid); if (!Server.the_core.Clients[cid].player.inventory.hasSpaceForItem()) { ChatHandler.sendLocalChatMessage(cid, "You have no free space for this."); return; } this.window = WINDOW.INVENTORY; this.position = Server.the_core.Clients[cid].player.inventory.getAppropriateWindowPositionForItem(window, this.data.vnum); Server.the_core.Clients[cid].player.UpdateClientInventory(); Server.the_core.Clients[cid].player.UpdateStats(); Logger.ItemLog(this.data.vnum, this.iid, "DEQUIP"); }
private void requestItemMove(WINDOW target_window, int newPos) { PlayerEquip.UpdatePlayerEquip(this); if (PlayerEquip.hasWeaponEquipped && target_window != WINDOW.EQUIPABLES && window == WINDOW.EQUIPABLES && data.type == ITEM_TYPES.WEAPON) { PlayerEquip.DequipWeapon(); } using (Packet packet = new Packet((int)ClientPackets.itemChangePosition)) { packet.Write(Client.instance.getCID()); packet.Write(Client.instance.getSessionId()); packet.Write(iid); packet.Write(newPos); packet.Write((int)target_window); Client.SendTCPData(packet); } }
public void EndDrag() { WINDOW targetWindow = getTargetWindow(); int pos = getSlotPositionUnderMouse(); if (targetWindow == WINDOW.NONE) { GD.Print("thow item away?"); } else { requestItemMove(targetWindow, pos); } interruptDragging(); clearSlotModulates(); }
private void lightUpTargetSlot() { if (Inventory.instance == null) { return; } WINDOW targetWindow = getTargetWindow(); if (targetWindow == WINDOW.NONE) { clearSlotModulates(); return; } int slotPos = getSlotPositionUnderMouse(); clearSlotModulates(); Inventory.inventory_slots[slotPos].Modulate = new Color(1f, 0.8f, 1f); }
public Item(int owner, WINDOW _window, int _pos, ItemData data, long _iid = -1, int _count = -1) { this.ownerPid = owner; this.data = data; this.window = _window; this.position = _pos; if (_count > 0) { this.count = _count; } else { this.count = 1; } if (_iid == -1) { createItemInDb(); } else { this.iid = _iid; } }
private void equip() { int cid = Server.the_core.getClientFromPid(ownerPid); if (Server.the_core.Clients[cid].player.inventory.hasEquipped(this.data.type)) { ChatHandler.sendLocalChatMessage(cid, "You are already equipped with this type of item."); return; } this.window = WINDOW.EQUIPABLES; if (this.data.type == ITEM_TYPES.WEAPON) { this.position = 1; } if (this.data.type == ITEM_TYPES.ARMOR) { this.position = 2; } Server.the_core.Clients[cid].player.UpdateClientInventory(); Server.the_core.Clients[cid].player.UpdateStats(); Logger.ItemLog(this.data.vnum, this.iid, "EQUIP"); }
public void Execute() { WINDOW.Close(); AfterLogoutHandler(null, null); }