xboxscene.org forums

Author Topic: Xml Includes  (Read 776 times)

Splice

  • Archived User
  • Newbie
  • *
  • Posts: 10
Xml Includes
« on: April 14, 2004, 07:36:00 PM »

I've been looking around and I don't think this is even part of XML yet, but is there a way to include a seperate file as part of the menu.xml?

I'm working on an actionscript that sort of works like the recent file list in windows. At the moment, it directly edits the menu.xml file, and seems to work fine that way. However, I'd rather have it edit it's own file, say recent.xml, and then have that file parsed as part of the menu.xml (just in case it somehow hoses the file, it'll just mess up the recent list, not the whole menu.xml).

What I'm looking for would be similar to "<?php include("file.ext"); ?>" in php.

Any way to do this, and if not, could it be concidered for a future version? :)

Thanks.
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
Xml Includes
« Reply #1 on: April 14, 2004, 08:06:00 PM »

you just want to run a script from the menu?  or you want the menu edited and update realtime?  

if its the later, its not going to happen since (just like evox, ava etc) the menus are loaded on boot and not reloaded. You would have to reboot to reflect any changes.


Logged

chilin_dude

  • Archived User
  • Hero Member
  • *
  • Posts: 3068
Xml Includes
« Reply #2 on: April 14, 2004, 10:49:00 PM »

QUOTE (koldfuzion @ Apr 15 2004, 04:59 AM)
you just want to run a script from the menu?  or you want the menu edited and update realtime?  

if its the later, its not going to happen since (just like evox, ava etc) the menus are loaded on boot and not reloaded. You would have to reboot to reflect any changes.

I know exactly what he's doing, just what I wanted to do at one point:

Record what game/app is launched into say recent.xml which will look like this:

<Itemlaunched>boxplorer</Itemlaunched>
<timeoflaunch>5:53pm</timeoflaunch>

etc.
He then wants his menu to scan the recent.xml and add the last 10 things to the menu, so each time he boots he can see the last ten things he booted.

I would like to see this progres!
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Xml Includes
« Reply #3 on: April 14, 2004, 10:55:00 PM »

The future version has pretty much everything needed for the recent items list.

Except maybe ability to add items to the menu on the fly.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Xml Includes
« Reply #4 on: April 15, 2004, 01:38:00 AM »

Try this. On F: put a folder called RECENT. And like 10 Sub folders in that. Now have a script make MXM_entry.xmls and put then in those folders as you need to. Then put an AutoDir F:\Recent tag in your Menu.xml. You might need to be sure to include the stuff like ID though so it doesn't try to get them when there's no XBE files in the RECENT folder
Logged

Splice

  • Archived User
  • Newbie
  • *
  • Posts: 10
Xml Includes
« Reply #5 on: April 16, 2004, 07:39:00 PM »

Reloading the menu.xml while MXM is running is not needed. The way I have the script now, when you launch a game, it first edits the menu.xml file to reflect that this game has been launched recently, then it actually launches the game. When you've finished playing, you reboot to MXM and it loads up the modified menu.xml.

What I'm trying to avoid is the possibility of the script failing and corrupting the entire menu.xml. I'd like the script to instead edit a secondary xml file, which would then be "included" in the menu.xml. Something like the following...

CODE
Menu.xml


 Game 1
 ...



 Game 2
 ...


recent.xml


CODE
Recent.xml


 Recent 1
 ...



 Recent 2
 ...



... which would end up with a menu in MXM looking like

Game 1
Game 2
Recent 1
Recent 2

----------------------------------------

flatspot,

I haven't really used mxm_entry.xml files myself, so I don't know much about them without looking it all up :P Would this allow MXM to autodir that recent folder without actually copying the xbe and supporting files into said folder?

This post has been edited by Splice: Apr 17 2004, 02:44 AM
Logged

chilin_dude

  • Archived User
  • Hero Member
  • *
  • Posts: 3068
Xml Includes
« Reply #6 on: April 16, 2004, 11:52:00 PM »

Why not just edit the cache.xml??? That way the menu.xml is always fine!
Logged

Splice

  • Archived User
  • Newbie
  • *
  • Posts: 10
Xml Includes
« Reply #7 on: April 17, 2004, 06:29:00 AM »

QUOTE (chilin_dude @ Apr 17 2004, 12:45 AM)
Why not just edit the cache.xml??? That way the menu.xml is always fine!

Well, for myself that would be fine, seeing as I don't really use the cache at all. But if you do use the cache as intended (with autodir entries and such), you'de loose your recent list every time you add a new game (since you have to clear the cache). Not the end of the world, but a potential frustration :)
Logged

chilin_dude

  • Archived User
  • Hero Member
  • *
  • Posts: 3068
Xml Includes
« Reply #8 on: April 17, 2004, 06:31:00 AM »

QUOTE (Splice @ Apr 17 2004, 03:22 PM)
Well, for myself that would be fine, seeing as I don't really use the cache at all. But if you do use the cache as intended (with autodir entries and such), you'de loose your recent list every time you add a new game (since you have to clear the cache). Not the end of the world, but a potential frustration smile.gif

True, I hadn't thought of that as I don't use autodir  laugh.gif
But it wouldn't be too much of a big deal would it? Maybe you could get it to record the list in cache.xml AND in recent.xml.
So if you had to rebuild your cache.xml it could cut and paste from recent.xml by using a seperate script???
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Xml Includes
« Reply #9 on: April 17, 2004, 09:47:00 AM »

How abot something like so.

OpenRead MenuXML ::Menu
OpenRead RecentXML $ActualPath$\recent.xml
OpenWrite NewMenuXML $ActualPath$\newMenu.xml

Then you'd have a loop to read each line of the original Menu.xml and write it out the the new one. Then you do the recent one. Basically you'd be appending the the rencent one to the menu. Then do a remane Menu.xml to Menu.xml.bak and newMenu.xml to Menu.xml
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
Xml Includes
« Reply #10 on: April 17, 2004, 12:40:00 PM »

if you used x-select it would be even easier,  

you write out the button preference so when you boot up - or reboot, you can start the last used app/game with a touch of a button and not even load mxm
Logged