Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat

Author Topic: DAMN Development Thread (formerly known as "Custom Submenus")  (Read 150529 times)

0 Members and 1 Guest are viewing this topic.

Offline jackal22

Re: Custom Submenus
« Reply #40 on: November 19, 2007, 03:58:43 PM »
this will be sooo good you cant imagine how badly my scroll finger is looking forward to this.

and it seems your finally getting those advisers to do something worth while, pitty you couldn't have used the environmental kill all factories woman.

Offline powerpill-pacman

Re: Custom Submenus
« Reply #41 on: November 21, 2007, 04:46:49 AM »
 &apls I'm so looking forward to this (allthough it won't change the loading time ;)). Thanks very much for your efforts.

Offline GoaSkin

  • NAM Team
  • Forums Mayor
  • *
  • Posts: 204
  • Total likes: 0
  • Reputation: 3
  • Kopyright Liberation Front
Re: Custom Submenus
« Reply #42 on: November 24, 2007, 08:11:12 PM »
I am studying actually the assembler code of the game to find out how to add new standard IDs - meaning to find out if there are unused submenukeys and/or occupant groups that are handled by menu classes (button IDs in the UIs) that are also unknown.

Well... there isn't any hidden occupant group or submenukey but two empty CLSIDs for new tertiary menus in the traffic menus.

I found also out what changes on the binary are necessary to implement new menus. But I don't know how to make use of it.

Does any body know how to strip out symbols of an EXE and link them to a DLL? That makes enhancing the assembler code quite easier.
download SC4Config public BETA (RC1)

Offline powerpill-pacman

Re: Custom Submenus
« Reply #43 on: November 25, 2007, 02:31:18 AM »
Not that i understand very much of whar you're saying, but it sounds promising. I hope somebody can help you.

Offline daeley

  • BSC Team
  • Forums Senator
  • *
  • Posts: 574
  • Total likes: 20
  • Reputation: 32
  • CL: The Wizard of MODS
Re: Custom Submenus
« Reply #44 on: November 27, 2007, 04:37:16 PM »
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

Offline figui

Re: Custom Submenus
« Reply #45 on: November 27, 2007, 05:09:16 PM »
%BUd% %BUd%
lovely!
 &bis&

mauricio.

(1/4 thousand posts!)
« Last Edit: November 27, 2007, 05:28:02 PM by figui »
first forums inhabitant from Uruguay..   first forums citizen from Uruguay..  first forums councilman from Uruguay..   first forums mayor from Uruguay..  first forums governor from Uruguay..
...i'm still the only one from Uruguay!

________

Offline Filasimo

Re: Custom Submenus
« Reply #46 on: November 27, 2007, 05:24:09 PM »
thats pretty sick daeley keep pumpin em teasers out  :thumbsup:
Plaza Mall Project
http://sc4devotion.com/forums/index.php?topic=2171.0
Coming Soon to the LEX!

NAM Team
What can NAM do for you?
 

Offline bwatterud

Re: Custom Submenus
« Reply #47 on: November 27, 2007, 06:20:00 PM »
Look what you've done daeley.  You just put diggis out of a job.   :D

Just wondering, how does the program (or whatever it is) know what lots are part of what set (I know its not important as long as it works, but I'm curious?  And if someone released a new set of canals/seawalls/anything that would be considered a set, would this have to be updated?

Offline GoaSkin

  • NAM Team
  • Forums Mayor
  • *
  • Posts: 204
  • Total likes: 0
  • Reputation: 3
  • Kopyright Liberation Front
Re: Custom Submenus
« Reply #48 on: November 27, 2007, 06:29:47 PM »
I will explain a little bit about the submenu mechanisms in the game. At first, there are three menu levels:

primary menus: first menu instance (f.e. godmode, mayor and mysim)
secondary menus: submenus right beside the primaries (buildings, terrain tools)
tertiary menus: everything that contains tools or buildings as scrollable lists of icons

Implemented in the game is one additional secondary menu called fences menu. I have not figured out yet if it is possible to make use of it. But to get more space for buildings, the tertiary menu algotitm is more interesting.

Bound to the button click event of any UI button ID, the following function is called:

Code: [Select]
cSC4View3DWin::HandleButtonActivated(cIGZWin*, cGZMessage&)

The first parameter contains the address of the parent game window and the second a structure of delivered parameters (here there only may interest us the CLSID set in the UI the button links to). Because UI button IDs have very different functions from submenus over game speed to sound settings, the function checks the function this button belongs to. It forces different function calls referenced by the button ID. If a tertiary menu should be opened that only can contain buildings (identified by an occupant group), the function

Code: [Select]
cSC4View3DWin::CreateBuildingMenu(unsigned long, std::set<unsigned long, \
std::less<unsigned long>,std::allocator<unsigned long> > \
const&, std::set<unsigned long, std::less<unsigned long>, \
std::allocator<unsigned long> > const&, unsigned long, long)

is called and anyhow, the necessary parameters are either transmitted staticly or as result of a function call. For example the valid occupant groups for that menu are delivered here. This function identifies additional information from the building exemplars and finally calls

Code: [Select]
cSC4View3DWin::InvokeTertiaryMenu(unsigned long, cIGZWin*, \
unsigned long, cISC4WinCatalogView*, unsigned long, cSC4View3DWin::CatalogState*)

The final function illustrates (paints) the menu widget. For special menus where tools are allowed (networks, zones or other functions), the button handling function calls a META function first. For example, there are:

Code: [Select]
cSC4View3DWin::DoTransportMenu(cIGZWin*, cGZMessage&)
cSC4View3DWin::DoZoningMenu(cIGZWin*, cGZMessage&)

These functions assign SubMenuKeys for tool exemplars (used in non-building item exemplars to identify the menu to be placed in...) to the button-IDs and link buttons in the secondary menus that directly call a game function instead of a item list to their destination functions.
These functions do some extra steps for these special menus and call at last CreateBuildingMenu too.

Well... theoretically it is easy to understand what extra assembler instructions in the EXE make as many submenus as we want possible. The bad side is that I have no idea how to replace existing objects with enhanced versions (or how to knock out a single symbol into a working DLL).






« Last Edit: November 28, 2007, 05:24:14 AM by GoaSkin »
download SC4Config public BETA (RC1)

Offline SimRabbit123

Re: Custom Submenus
« Reply #49 on: November 27, 2007, 06:41:17 PM »
How will this work? Will you have to query a lot to open up the subemenus?

Thanks  ;)

Offline vester

  • Administrator
  • Forums Legend
  • *
  • Posts: 4843
  • Total likes: 691
  • Reputation: 27
    • My bat cave.
  • CL: Tickets Please
Re: Custom Submenus
« Reply #50 on: November 27, 2007, 06:42:49 PM »
GoaSkin: I know the title of the thread is Custom Submenus, but still....

this is Daeleys thread, showcasing his work. Please open up a new thread for your project.

Offline GoaSkin

  • NAM Team
  • Forums Mayor
  • *
  • Posts: 204
  • Total likes: 0
  • Reputation: 3
  • Kopyright Liberation Front
Re: Custom Submenus
« Reply #51 on: November 27, 2007, 07:44:06 PM »
Vester: I do not have any concrete project. This is actually just knowledge.
download SC4Config public BETA (RC1)

Offline vester

  • Administrator
  • Forums Legend
  • *
  • Posts: 4843
  • Total likes: 691
  • Reputation: 27
    • My bat cave.
  • CL: Tickets Please
Re: Custom Submenus
« Reply #52 on: November 28, 2007, 04:15:00 PM »
Still not sure this is the right place to post it.

Offline Meastro444

Re: Custom Submenus
« Reply #53 on: November 29, 2007, 11:32:23 AM »
maybe it is Vester....

it might be helpful knowledge to dealey.

anyway, i like this project very much, but i do have a few questions.

has it the same 'bug' as the MML's, that you have to plop the building and then reselect it or not?
if i plop one lot, will the menu go away so i have to reselect it, or wil the menu stay?
Friend of the Certified Drama Queen :)

Offline Serkanner

Re: Custom Submenus
« Reply #54 on: November 29, 2007, 12:42:36 PM »
I agree with Vester that, although very interesting, the info provided by GoaSkin should be posted in a separate topic and as such doesn't take away any of the attention to Daeley's current work on the menu mod.

Offline jeronij

Re: Custom Submenus
« Reply #55 on: November 29, 2007, 01:38:16 PM »
I would suggest Goaskin to open a separate thread because this information would be easilier availble in such a thread, and more useful. I dont think this information will disturb Daeley's engineer mind in any way  $%Grinno$% ;)

I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


Offline FromTheAshes

  • Forums Governor
  • *
  • Posts: 412
  • Total likes: 0
  • Reputation: 3
  • Njoy the sunshine!
Re: Custom Submenus
« Reply #56 on: November 29, 2007, 02:13:51 PM »
What about colecting thousands of signatures and write an open letter to Maxis which says, that we -the SC4 comunity- would appreciate a patch or something that allows you to build your own menus in a small editor? Maybe they got the time to do this... :D

EDIT: Cross out those lines beyond. I didn't see the menu browser. Ingenious &apls
« Last Edit: November 29, 2007, 02:15:46 PM by FromTheAshes »
Visit Vorsfelde.

Offline GoaSkin

  • NAM Team
  • Forums Mayor
  • *
  • Posts: 204
  • Total likes: 0
  • Reputation: 3
  • Kopyright Liberation Front
Re: Custom Submenus
« Reply #57 on: November 29, 2007, 02:24:48 PM »
...because thousands of signatures go to someone at Maxis but the change that it is forwarded to the right person is very small. There are better changes if you meet a developer on any computer fair.

With this code-hacking I am currently asking in coders forums for help. I think no one can help here so details may not be discussed at SC4Devotion. I asked for help in all known SC4 forums but nobody can help. I am looking for help in developer forums now.

download SC4Config public BETA (RC1)

Offline jeronij

Re: Custom Submenus
« Reply #58 on: November 29, 2007, 02:28:13 PM »
Our community has not that many professional programmers atm  ::) , but I hope that in due time some more will arrive to us. In the meantime I wish you the best luck in your search and I hope you can get fruitful results soon  ;)

Now back to topic. Daeley, please, keep us updated  :thumbsup:
« Last Edit: November 29, 2007, 02:30:12 PM by jeronij »
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


Offline daeley

  • BSC Team
  • Forums Senator
  • *
  • Posts: 574
  • Total likes: 20
  • Reputation: 32
  • CL: The Wizard of MODS
Re: Custom Submenus
« Reply #59 on: November 29, 2007, 04:35:19 PM »
has it the same 'bug' as the MML's, that you have to plop the building and then reselect it or not?
if i plop one lot, will the menu go away so i have to reselect it, or wil the menu stay?

nope :thumbsup: one you select you can plop away to your heart's delight  :satisfied:

And to answer another question, lots are not automatically detected by this mod, however the process of adding lots to the menu system is not very complicated. Once the internals are finalised (and I'm almost there), we will start adding some existing sets to this system (probably replacing some MML's in the process).
« Last Edit: November 29, 2007, 04:41:21 PM by daeley »
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!