UO-Orion

Member
UOMaddog submitted a new resource:

Organized Runebooks and Runic Atlases - Can now re-organize runes with your runebook or runic atlas

Replaces your existing RunebookGump and RunicAtlas files to allow players to re-organize the runes with having to drop runes out of the books.

Also, for runic atlases, removes the auto-opening of the gump when a rune is dropped on it to allow you to quickly drop multiple runes on them without having to re-close the gump every time.

View attachment 22548
View attachment 22549

Read more about this resource...
 
It's been 15 years since I've tinkered with RunUO. I know I'm out of the loop here.

Fresh build of ServUO 57.3,
First attempt, I dropped these two files in the scripts folder, lots of errors.
Second attempt, I overwrote the original files in their proper locations (Zipped the original files as a backup) I was left with these two errors regarding Swap;

C#:
Scripts: Compiling C# scripts...Failed with: 2 errors, 0 warnings
Errors:
 + Gumps/RunebookGump.cs:
    CS1061: Line 378: 'List<RunebookEntry>' does not contain a definition for 'Swap' and no accessible extension method 'Swap' accepting a first argument of type 'List<RunebookEntry>' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 389: 'List<RunebookEntry>' does not contain a definition for 'Swap' and no accessible extension method 'Swap' accepting a first argument of type 'List<RunebookEntry>' could be found (are you missing a using directive or an assembly reference?)
 + Items/Books/RunicAtlas.cs:
    CS1061: Line 298: 'List<RunebookEntry>' does not contain a definition for 'Swap' and no accessible extension method 'Swap' accepting a first argument of type 'List<RunebookEntry>' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 309: 'List<RunebookEntry>' does not contain a definition for 'Swap' and no accessible extension method 'Swap' accepting a first argument of type 'List<RunebookEntry>' could be found (are you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
 
Last edited:
Sorry! I was using a VitaNex Swap<T> function without paying attention! I'll post up replacement snippets for those lines in a new version!

RunebookGump.cs:
            else if (buttonID >= 800) //Moving rune down
            {
                int curIndex = buttonID % 800;
                int newIndex = buttonID % 800 + 1;
                if(Book.Entries.ElementAt(curIndex) != null && Book.Entries.ElementAt(newIndex) != null) //Check just to be safe
                {
                    //Book.Entries.Swap<RunebookEntry>(curIndex,newIndex); //Only useable with VitaNex
                    var a = Book.Entries.ElementAt(curIndex);
                    var b = Book.Entries.ElementAt(newIndex);

                    Book.Entries[curIndex] = b;
                    Book.Entries[newIndex] = a;
                }
                from.CloseGump(typeof(RunebookGump));
                from.SendGump(new RunebookGump(from, Book));
            }
            else if (buttonID >= 700) //Moving rune up
            {
                int curIndex = buttonID % 700;
                int newIndex = buttonID % 700 - 1;
                if(Book.Entries.ElementAt(curIndex) != null && Book.Entries.ElementAt(newIndex) != null) //Check just to be safe
                {
                    //Book.Entries.Swap<RunebookEntry>(curIndex,newIndex); //Only useable with VitaNex
                    var a = Book.Entries.ElementAt(curIndex);
                    var b = Book.Entries.ElementAt(newIndex);

                    Book.Entries[curIndex] = b;
                    Book.Entries[newIndex] = a;
                }
                from.CloseGump(typeof(RunebookGump));
                from.SendGump(new RunebookGump(from, Book));
            }

RunicAtlas.cs:
            else if(info.ButtonID >= 8000) //Move down
            {
                int curIndex = info.ButtonID % 8000;
                int newIndex = info.ButtonID % 8000 + 1;
                if(Atlas.Entries[curIndex] != null && Atlas.Entries[newIndex] != null) //Check just to be safe
                {
                    //Atlas.Entries.Swap<RunebookEntry>(curIndex,newIndex); //Only useable with VitaNex
                    var a = Atlas.Entries[curIndex];
                    var b = Atlas.Entries[newIndex];

                    Atlas.Entries[curIndex] = b;
                    Atlas.Entries[newIndex] = a;
                }
                Atlas.Openers.Remove(User);
                Refresh();
            }
            else if(info.ButtonID >= 7000) //Move up
            {
                int curIndex = info.ButtonID % 7000;
                int newIndex = info.ButtonID % 7000 - 1;
                if(Atlas.Entries[curIndex] != null && Atlas.Entries[newIndex] != null) //Check just to be safe
                {
                    //Atlas.Entries.Swap<RunebookEntry>(curIndex,newIndex); //Only useable with VitaNex
                    var a = Atlas.Entries[curIndex];
                    var b = Atlas.Entries[newIndex];

                    Atlas.Entries[curIndex] = b;
                    Atlas.Entries[newIndex] = a;
                }
                Atlas.Openers.Remove(User);
                Refresh();
            }
 
Last edited:
I got two errors when trying to compile this, on line 54 and 285. I resolved line 54 by switching
C#:
public Runebook Book { get; }
C#:
public Runebook Book { get{ return m_Book; } }
to this but still getting an error on line 285, here's the results. Any help would be appreciated :)
 

Attachments

  • error.png
    error.png
    14.8 KB · Views: 12

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back