/// <summary> /// Draw item /// </summary> /// <param Name="index">item index</param> public void DrawItem(int index) { Skill skill = data[index]; if (actor.IsSkillCanUse(skill.Id)) { this.Contents.Font.Color = NormalColor; } else { this.Contents.Font.Color = DisabledColor; } int posX = 4 + index % 2 * (288 * GeexEdit.GameWindowWidth / 640 + 32); int posY = index / 2 * 32; Rectangle _rect = new Rectangle(posX, posY, this.Width / columnMax - 32, 32); this.Contents.FillRect(_rect, new Color(0, 0, 0, 0)); byte _opacity = this.Contents.Font.Color == NormalColor ? (byte)255 : (byte)128; this.Contents.Blit(posX + index % 2 * 8, posY + 4, Cache.IconBitmap, Cache.IconSourceRect(skill.IconName), _opacity); this.Contents.DrawText(posX + 28 * GeexEdit.GameWindowWidth / 640, posY, 204, 32, skill.Name, 0); this.Contents.DrawText(posX + 232 * GeexEdit.GameWindowWidth / 640, posY, 48, 32, skill.SpCost.ToString(), 2); }
/// <summary> /// Frame Update (if skill window is active) /// </summary> void UpdateSkill() { // If B button was pressed if (Input.RMTrigger.B) { // Play cancel SE InGame.System.SoundPlay(Data.System.CancelSoundEffect); // Switch to menu screen Main.Scene = new SceneMenu(1); return; } // If C button was pressed if (Input.RMTrigger.C) { // Get currently selected data on the skill window skill = skillWindow.Skill; // If unable to use if (skill == null || !actor.IsSkillCanUse(skill.Id)) { // Play buzzer SE InGame.System.SoundPlay(Data.System.BuzzerSoundEffect); return; } // Play decision SE InGame.System.SoundPlay(Data.System.DecisionSoundEffect); // If effect scope is ally if (skill.Scope >= 3) { // Activate target window skillWindow.IsActive = false; targetWindow.X = (skillWindow.Index + 1) % 2 * 304; targetWindow.IsVisible = true; targetWindow.IsActive = true; // Set cursor position to effect scope (single / all) if (skill.Scope == 4 || skill.Scope == 6) { targetWindow.Index = -1; } else if (skill.Scope == 7) { targetWindow.Index = actorIndex - 10; } else { targetWindow.Index = 0; } } // If effect scope is other than ally else { // If common event ID is valid if (skill.CommonEventId > 0) { // Common event call reservation InGame.Temp.CommonEventId = skill.CommonEventId; // Play use skill SE InGame.System.SoundPlay(skill.MenuSoundEffect); // Use up SP actor.Sp -= skill.SpCost; // Remake each window content statusWindow.Refresh(); skillWindow.Refresh(); targetWindow.Refresh(); // Switch to map screen Main.Scene = new SceneMap(); return; } } return; } // If R button was pressed if (Input.RMTrigger.R) { // Play cursor SE InGame.System.SoundPlay(Data.System.CursorSoundEffect); // To next actor actorIndex += 1; actorIndex %= InGame.Party.Actors.Count; // Switch to different skill screen Main.Scene = new SceneSkill(actorIndex); return; } // If L button was pressed if (Input.RMTrigger.L) { // Play cursor SE InGame.System.SoundPlay(Data.System.CursorSoundEffect); // To previous actor actorIndex += InGame.Party.Actors.Count - 1; actorIndex %= InGame.Party.Actors.Count; // Switch to different skill screen Main.Scene = new SceneSkill(actorIndex); return; } }