mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-05-31 20:42:43 -05:00
goto shortcut
This commit is contained in:
parent
5855ac38ab
commit
8027842299
|
|
@ -39,3 +39,7 @@ Name = '''Items'''
|
|||
Image = '''graphics.overworld.sprites/59/data/0/sprites/0/sprite/'''
|
||||
Destination = '''data.items.stats'''
|
||||
|
||||
[[GotoShortcut]]
|
||||
Name = '''Maps'''
|
||||
Image = '''data.maps.banks/0/maps/9/map/0/layout/0/blockmap/'''
|
||||
Destination = '''maps.0-9 (LITTLEROOTTOWN)'''
|
||||
|
|
|
|||
|
|
@ -690,3 +690,8 @@ Destination = '''data.pokemon.moves.stats.battle'''
|
|||
Name = '''Items'''
|
||||
Image = '''graphics.items.sprites/13/sprite/'''
|
||||
Destination = '''data.items.stats'''
|
||||
|
||||
[[GotoShortcut]]
|
||||
Name = '''Maps'''
|
||||
Image = '''data.maps.banks/0/maps/9/map/0/layout/0/blockmap/'''
|
||||
Destination = '''maps.0-9 (LITTLEROOT TOWN)'''
|
||||
|
|
|
|||
|
|
@ -773,6 +773,11 @@ Name = '''Items'''
|
|||
Image = '''graphics.items.sprites/13/sprite/'''
|
||||
Destination = '''data.items.stats'''
|
||||
|
||||
[[GotoShortcut]]
|
||||
Name = '''Maps'''
|
||||
Image = '''data.maps.banks/3/maps/0/map/0/layout/0/blockmap/'''
|
||||
Destination = '''maps.3-0 (PALLET TOWN)'''
|
||||
|
||||
[[List]]
|
||||
Name = '''effectanimations'''
|
||||
0 = [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using HavenSoft.HexManiac.Core.Models.Runs;
|
||||
using HavenSoft.HexManiac.Core.Models.Runs.Sprites;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.DataFormats;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.Images;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.QuickEditItems;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.Tools;
|
||||
using System;
|
||||
|
|
@ -1186,10 +1187,20 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
|||
var results = new List<GotoShortcutViewModel>();
|
||||
for (int i = 0; i < model.GotoShortcuts.Count; i++) {
|
||||
var destinationAddress = model.GetAddressFromAnchor(new ModelDelta(), -1, model.GotoShortcuts[i].GotoAnchor);
|
||||
if (destinationAddress == Pointer.NULL) continue; // skip this one
|
||||
if (destinationAddress == Pointer.NULL) {
|
||||
var count = model.GetMatchingMaps(model.GotoShortcuts[i].GotoAnchor).Count;
|
||||
if (count != 1) continue;
|
||||
}
|
||||
var spriteAddress = model.GetAddressFromAnchor(new ModelDelta(), -1, model.GotoShortcuts[i].ImageAnchor);
|
||||
var spriteRun = model.GetNextRun(spriteAddress) as ISpriteRun;
|
||||
var sprite = SpriteDecorator.BuildSprite(viewPort.Model, spriteRun, useTransparency: true);
|
||||
var run = model.GetNextRun(spriteAddress) as BaseRun;
|
||||
IPixelViewModel sprite;
|
||||
if (run is ISpriteRun spriteRun) {
|
||||
sprite = SpriteDecorator.BuildSprite(viewPort.Model, spriteRun, useTransparency: true);
|
||||
} else if (run.CreateDataFormat(viewPort.Model, run.Start, true, 16) is SpriteDecorator decorator) {
|
||||
sprite = decorator.Pixels;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
var anchor = model.GotoShortcuts[i].GotoAnchor;
|
||||
var text = model.GotoShortcuts[i].DisplayText;
|
||||
results.Add(new GotoShortcutViewModel(gotoViewModel, viewPort, sprite, anchor, text));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user