Request: Change to Layout.lua

Request: Change to Layout.lua

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Request: Change to Layout.lua

Post by Argh »

I sent this to jK awhile ago, nothing happened, thought I'd try again here.

Please alter the line:

Code: Select all

reTexCmds[cmdSlot] = FrameScale..'#'..(-cmd.id)..'&'..FrameTex
To this:

Code: Select all

reTexCmds[cmdSlot] = FrameScale..'(-cmd.id)..'&'..FrameTex
...this will make Unit buildpics the exact size of the frame dimensions, and they will no longer get distorted by being resized.

Sorry for bothering you with this, but it's annoying as hell, when you get the UI crunched down to a small size in terms of button dimensions :P
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Request: Change to Layout.lua

Post by lurker »

Because it's not at all deliberate that the pics are inside the frame that way. And you definitely can't include your own layout function like even BA does. :P
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Request: Change to Layout.lua

Post by Argh »

Because it's not at all deliberate that the pics are inside the frame that way. And you definitely can't include your own layout function like even BA does.
There isn't any real reason to need two images where we could just use one.

Moreover, sticking one or more elements like that into the game sounds like a great way to wake up and find stuff's broken down the road, due to further hacking on that area.

If you want a "framed" look, then use that look for the unit picture. If you want to do some fancy Lua stuff over the top of that, then do that. We only ever needed one image there.

It's not a big deal to me, personally. I'm going to release a full Windows installer that includes that fix, and other customizations. I just don't like that it won't match the Linux builds in terms of behavior.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Request: Change to Layout.lua

Post by lurker »

Bad argh. Just put your own layout function into your game like everyone else. It's simpler and a lot more flexible to have seperate frame images. You can set them per faction, per person, or anything. Also, if you bake frames directly into the buildpic then people would be forced to "get the UI crunched down to a small size in terms of button dimensions."

As a side note, you haven't even removed the frame image with that change like you should be doing if it's not going to be visible, so don't you dare call it a 'fix'.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Request: Change to Layout.lua

Post by jK »

And a small tip: your `fix` even crashes ...

And sorry, the bug is that obvious that you really have to question if you ever wrote 1 line of lua code. (that's why I didn't answered on the private message ...)
reivanen
Posts: 180
Joined: 12 Feb 2008, 15:52

Re: Request: Change to Layout.lua

Post by reivanen »

Nice attitude there.

Its fun to see all the "write a patch" shouts to feature requests and then when a novice developer is trying to ask for help so he actually could make it himself you start to grief about the fact one asked. How about just shutting the fuck up if you don't want to help, and not try rub the shit in his face just so you could feel big and good about your mad coding skillz?

Is it just spring, or are all coders so fond of their hard earned coding skillz they don't want to give that information away (atleast for free) as the rationalization behind these answers are usually "go read a few lua books and some c++ on top of that and you have your answer"

And yes, i have wrote 1 line of lua code, and i have no clue what would be wrong with arghs suggestion. I'm a modder and a noob coder.


C'MON! Usually people get a satisfaction from teaching others, it feels good in your heart when you know you have been of an assistance to someone. Are you not human?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Request: Change to Layout.lua

Post by jK »

1. it is the academic attitude -> You won't get more help than necessary, you have to find/learn the rest yourself
2. he didn't wanted help, instead he thinks his way is the only right way ... (wanted to replace engine stuff)
3. he didn't even asked how to it in the mod itself instead (he even already should know how to, but he just don't open his mind enough to see the reality, instead he persist on wrong ideas how the engine works ...)

PS: I am willing to help if ppl really ask question, which they can't answer themselves, but I am not willing to give copy-paste answers just cuz the one is too lazy to search it by himself (-> I am not a googlebot)!
reivanen
Posts: 180
Joined: 12 Feb 2008, 15:52

Re: Request: Change to Layout.lua

Post by reivanen »

Ok, maybe i came on too strong in my post, it just snapped as i myself have encountered what i described in my post.

The academic model is there because in that (when you are studying) situation you are learning how a programming language works. If you are a modder and want to focus on content creation/modding you maybe don't want to focus on mastering lua as you have no interest in trying to write a GUI or a nice shader, but you still might need some basic understanding about lua code so you can get your mod working. This is where you ask for help. Afterall, doing it yourself and asking help in the process is more teaching then begging for someone else to step in the moment you need to even think about the lua.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Request: Change to Layout.lua

Post by Argh »

It doesn't crash over here, at least with P.U.R.E.

Look, my whole point here is merely that the background image isn't necessary, and distorting the UnitPic is just plain bad design. If you'd like to address this in an alternative way, fine. Ok? And no, that wasn't something that was obvious on my end, and yes, even an answer, "no, because it crashes on my end" would have been a lot more useful than silence.
Last edited by Argh on 21 Nov 2008, 02:44, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Request: Change to Layout.lua

Post by smoth »

reivanen wrote:C'MON! Usually people get a satisfaction from teaching others, it feels good in your heart when you know you have been of an assistance to someone. Are you not human?
I have wasted time trying to teach so many people.

so first humans need a patch.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Request: Change to Layout.lua

Post by Argh »

Secondly, mod files don't overwrite base files. Therefore, you cannot simply drop Layout.lua into your game, and overwrite Spring's behavior. Just tried it, and it doesn't work.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Request: Change to Layout.lua

Post by lurker »

Look at BA; it's trivial.

I committed a change to make it not distort the buildpics, I'll probably do some changes later to make the whole thing somewhat more workable...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Request: Change to Layout.lua

Post by Argh »

Thanks, I'll take a look. Meh, all I wanted was for the icons to quit getting distorted. It looks horrible, when you scale things small enough, and my new UI has very small buttons.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Request: Change to Layout.lua

Post by AF »

Argh wrote:Thanks, I'll take a look. Meh, all I wanted was for the icons to quit getting distorted. It looks horrible, when you scale things small enough, and my new UI has very small buttons.
Not too small or we might see the words "usability bug" rear its head again =p

Instead keep them as flexible as possible. I know you don't like flexible GUIs but this is more a case fo "I changed my mind, oh sh*t I have to redux all the icons ahk"
Post Reply

Return to “Engine”