Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 79 80 [81] 82 83 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1123375 times)

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1200 on: October 24, 2014, 10:04:41 am »

So I'm trying to work with the gui and have some questions.

I can create screens and frames and all that, and I can put text in them, with columns and rows and overall it looks nice, but my issue is that some of the lists I want to put in are variable in length, and the only examples I have seen of organization is either all in a single list (e.g. room-list) or set columns and rows (e.g. autobutcher). I've been trying to look over the API documentation about the gui, but am still very much a novice when it comes to anything gui related (my only work with guis has been in python) and am having a hard time understanding everything.

So, long story short, my question is, does anyone have any knowledge they can impart about creating a gui that would, ideally, look something like this
Spoiler (click to show/hide)
Where the VARIABLE LENGTH parts can be 0-whatever rows in length.
Logged

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1201 on: October 24, 2014, 10:23:15 am »

So I'm trying to work with the gui and have some questions.

I can create screens and frames and all that, and I can put text in them, with columns and rows and overall it looks nice, but my issue is that some of the lists I want to put in are variable in length, and the only examples I have seen of organization is either all in a single list (e.g. room-list) or set columns and rows (e.g. autobutcher). I've been trying to look over the API documentation about the gui, but am still very much a novice when it comes to anything gui related (my only work with guis has been in python) and am having a hard time understanding everything.

So, long story short, my question is, does anyone have any knowledge they can impart about creating a gui that would, ideally, look something like this
Spoiler (click to show/hide)
Where the VARIABLE LENGTH parts can be 0-whatever rows in length.

I think you could use something like
Code: [Select]
classes = {
--code to obtain classes from unit
}
list:setChoices(classes)

I'm really new to this whole lua scripting thing though, so I'm not sure at all. Also, I might have completely misunderstood your question, and if this is the case, I'm sorry. :( It's just something that I stumbled upon checking out gui/gm-editor.lua in my attemps to learn how to create a custom UI screen.
« Last Edit: October 24, 2014, 10:27:30 am by TheDorf »
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1202 on: October 24, 2014, 10:31:44 am »

So I'm trying to work with the gui and have some questions.

I can create screens and frames and all that, and I can put text in them, with columns and rows and overall it looks nice, but my issue is that some of the lists I want to put in are variable in length, and the only examples I have seen of organization is either all in a single list (e.g. room-list) or set columns and rows (e.g. autobutcher). I've been trying to look over the API documentation about the gui, but am still very much a novice when it comes to anything gui related (my only work with guis has been in python) and am having a hard time understanding everything.

So, long story short, my question is, does anyone have any knowledge they can impart about creating a gui that would, ideally, look something like this
Spoiler (click to show/hide)
Where the VARIABLE LENGTH parts can be 0-whatever rows in length.
I'm not sure exactly what you're asking.  TheDorf addressed getting the data; this is about the formatting.

If you want "column G" to scoot over to accommodate the variable-length stuff in the middle, you'd need a way to figure out the right-most extent of the middle and just put your "column G" a space or two after that.

Alternatively, you could lift a word-wrap algorithm from the Lua wiki String Recipes repository and guarantee a maximum width for each column (although if this is to be C++, the newlines involve moving the pen around).

Edit: On the other hand, if you meant a variable number of ROWS rather than COLUMNS, the same logic applies.  Determine the lowest-most point and place the next item a row or two under that.
« Last Edit: October 24, 2014, 10:33:51 am by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1203 on: October 24, 2014, 10:35:12 am »

The variable length would be in the row direction, not the column (sorry, was unsure of how to represent that in the image). The columns are all fixed to what they will be, but the skills might appear up or down from there, depending on how many classes the unit has.
Logged

breadman

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1204 on: October 24, 2014, 11:46:29 am »

Seems like the easiest way to handle a variable number of rows is to start at the top and write one row at a time.  When you run out of items, skip a line or three and start the next section.

Of course, then you need to figure out what to do if there isn't enough room on the screen.  DF mostly uses paging, but there are interfaces that scroll instead, with up and down arrows at the side to indicate that there's more to see.

It's the standard shortcut key for search-and-replace.

Very few shortcut keys are standardized, and even the standard ones are frequently changed.  (Even something as basic as Paste.  Depending on how I copied it and what I'm pasting into, it could be Ctrl-V, Shift-Ctrl-V, `], "+p, Ctrl-R +, Shift-Ins, or the middle mouse button.  I also get into trouble when trying to erase the previous word in programs that use Ctrl-W to close a window.)

To me, Ctrl-H usually means Backspace, and gc is my most common shortcut for search-and-replace.
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1205 on: October 24, 2014, 11:50:07 am »

Seems like the easiest way to handle a variable number of rows is to start at the top and write one row at a time.  When you run out of items, skip a line or three and start the next section.

Of course, then you need to figure out what to do if there isn't enough room on the screen.  DF mostly uses paging, but there are interfaces that scroll instead, with up and down arrows at the side to indicate that there's more to see.

Yes, the issue I was having with this was how to place it in a specific column on the screen, but I think I have it figured out with multiple subviews.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1206 on: October 24, 2014, 12:34:57 pm »

As you learn the GUI system, we could use a tutorial on it. People who don't know it well enough can't write one, and people who know it too well don't remember what parts are confusing and what parts aren't. The dwarffortresswiki might be a good place for it to live if you have time to write it. If not, well, we can't blame you. We're busy too.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1207 on: October 24, 2014, 12:40:55 pm »

Sure, I can keep notes of what I find difficult, interesting, and anything else

Here is the first pass mock-up
Spoiler (click to show/hide)
Now obviously I need to do some work in prettying it up. Change color of different texts, center things, justify other things, change skill rating number to actual description (e.g. Dabbling), and some other things. I'm also thinking of splitting up the skill list to work/social/military for easier reading.

But it's coming along nicely. Still to add are active syndromes and known interactions (already have the code to get the information, just need to put it on the gui). What is some other information people would like to see on the unit view? Maybe happiness level? Health problems? Orientation? Lot's of information that can be put there. Just need to keep in mind the size of the screen.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1208 on: October 24, 2014, 01:20:22 pm »

Different colors for data and names of lists (Attributes / Skills vs AGILITY / PACIFY) would make them stand out more than just making them brighter.

The name of the dwarf should be capitalized. Maybe give the english form of the name too?

I like it so far.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1209 on: October 24, 2014, 02:17:44 pm »

It took me far longer than I thought it would to make the colors like this
Spoiler (click to show/hide)
Now I have to take a break and go back to actual work.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1210 on: October 24, 2014, 02:30:30 pm »

Out of curiosity, how did you do that? Did you just end up making separate lists and label widgets?
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1211 on: October 24, 2014, 08:48:17 pm »

Yep, there are four different subviews there, 3 lists (classes, attributes, and skills) and one label (name information). Really they could all be lists, and probably will be when I am finished.

EDIT: You can do some pretty fun stuff with colors and such. Like I figured out how to make every other entry in the list have a different background color for easier reading
« Last Edit: October 24, 2014, 08:53:46 pm by Roses »
Logged

palu

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1212 on: October 25, 2014, 10:11:13 am »

Any idea what the architect, builder1, and builder2 numbers in building.design represent? It doesn't seem to be unit ids.
Logged
Hmph, palu showing off that reading-the-instructions superpower.
The internet encourages thoughtful, intelligent discussion and if you disagree I hate you.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1213 on: October 25, 2014, 06:29:03 pm »

Is it possible to find the profession name and description attached to each skill token? (e.g. given DETAILSTONE I want to get Engraver and Engraving). I know I can get the profession name of a specific unit, but would like the profession name for each skill.
Logged

LeoCean

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1214 on: October 25, 2014, 06:39:58 pm »

Wouldn't it be best to ask that in the dwarf therapist thread? They deal with those things but your thing is pretty neat in it's own way so you should continue it. There's also another pluggin within dfhack that deals with skills to, I just forget what it is.
Logged
Pages: 1 ... 79 80 [81] 82 83 ... 360