private bool SelectItem(int column, int index, bool immediateMove) { if (immediateMove) { if (column == 0) { this.index1 = index; } else { this.index2 = index; } UICursor.UpdateTargetLoc(); } if (column == 0) { if (!can_trade(this.actor1, this.actor2, index)) { return(false); } Mode = column + 1; Grey_Cursor.force_loc(UICursor.target_loc); Grey_Cursor.visible = true; Selected = new int[] { 0, index }; refresh(true); if (!Input.IsControllingOnscreenMouse) { this.index2 = Items2 < Num ? Items2 : Math.Min(Items2, Selected[1]); } Items2 = Math.Min(Num, Items2 + 1); } else { if (!can_trade(this.actor2, this.actor1, index)) { return(false); } Mode = column + 1; Grey_Cursor.force_loc(UICursor.target_loc); Grey_Cursor.visible = true; Selected = new int[] { 1, index }; refresh(true); if (!Input.IsControllingOnscreenMouse) { this.index1 = Items1 < Num ? Items1 : Math.Min(Items1, Selected[1]); } Items1 = Math.Min(Num, Items1 + 1); } if (immediateMove) { UICursor.UpdateTargetLoc(); UICursor.move_to_target_loc(); } return(true); }
public bool SelectSetting(bool selected) { switch (Settings.SettingType(this.index)) { case ConfigTypes.Button: // Simply execute the button's operation if (selected) { Settings.ConfirmSetting(this.index, null); RefreshItemValues(); SelectedSettingCursor.force_loc(UICursor.loc); selected = false; } break; case ConfigTypes.SubSettings: if (selected) { OpenSubMenu = true; SelectedSettingCursor.force_loc(UICursor.loc); selected = false; } break; case ConfigTypes.Keyboard: case ConfigTypes.Gamepad: break; default: Items[this.index].set_text_color(selected ? "Green" : "White"); break; } SettingSelected = selected; Greyed_Cursor = SettingSelected; if (SettingSelected) { TempSelectedSettings = (ISettings)Settings.Clone(); TempOriginalSettings = (ISettings)Settings.Clone(); SelectedSettingCursor.force_loc(UICursor.loc); SelectedSettingCursor.set_loc(UICursor.target_loc + new Vector2(VALUE_OFFSET, 0)); SelectedSettingCursor.update(); } else { TempSelectedSettings = null; TempOriginalSettings = null; RefreshCurrentValue(Settings); UICursor.force_loc(SelectedSettingCursor.loc); UICursor.update(); } active = !SettingSelected; return(SettingSelected); }
public Window_Command_Item_Preparations_Repair(int actor_id, Vector2 loc, bool facing_right, int active_item) : base(actor_id, loc, facing_right, true) { // Set items again, after setting the Active_Item Active_Item = active_item; add_commands(new List <string>()); refresh_equipped_tag(); this.immediate_index = active_item; Active_Item_Cursor = new Hand_Cursor(); Active_Item_Cursor.tint = new Color(192, 192, 192, 255); Active_Item_Cursor.draw_offset = new Vector2(-16, 0); Active_Item_Cursor.force_loc(UICursor.target_loc); }
public Window_Command_Item_Target_Inventory(int unit_id, Vector2 loc, int active_item) { Unit_Id = unit_id; Active_Item = active_item; if (this.unit.items[Active_Item].to_item.can_repair) { WIDTH += 24; } initialize(loc, WIDTH, new List <string>()); this.immediate_index = active_item; Active_Item_Cursor = new Hand_Cursor(); Active_Item_Cursor.tint = new Color(192, 192, 192, 255); Active_Item_Cursor.draw_offset = new Vector2(-16, 0); Active_Item_Cursor.force_loc(UICursor.target_loc); }
protected virtual void update_movement(bool input) { if (Items == null) { return; //Debug } int index = this.index; Items.Update(input && !Movement_Locked, -(loc + text_draw_vector())); UICursor.update(); if (Grey_Cursor != null) { Grey_Cursor.force_loc(UICursor.target_loc); } if (index != this.index) { on_index_changed(index); } }