Jump to content

Recommended Posts

Posted

good days

im maken a little experiment to try to workaround another problem

and found another and one more problem but first

 

i put some buttons in one of mi gui class to change the relative position of another gui, mi guns gui on screen to solve the probem for the other post http://www.minecraftforge.net/forum/index.php/topic,35924.0.html

 

 

 

the gui class whith buttons read pos X and pos Y values from mi config file

 

gui {
    # you can disable gui if becomes a trouble
    B:"Gui Enable"=true

    # Gui size default 30
    I:"Gui Size"=30

    # fix the gui position 
    I:"Gui pos X"=0
    I:"Gui pos Y"=0
}

 

and set the values based on what you press and send this values to the guns gui, this actually works

the guns gui change in size and position, the thing is i dont get how writte this changes back to the config file

 

the method i been using to writte values to the config

 

Property cfg_guiSize = configFile.get("Gui", "Gui Size", 30, "Gui size");

 

is more of the type: if there is no value write this and set it to 30, but if it is a value du nothing

the gui whith the buttons can change this 30 per  50 or something but this method dont let me writte the changes back to the config

 

looking in the Configuration.class there seems to be not a  .set("propertiname", int value)

or something like, to allow to change from inside the game the values in the config file

 

i du config file  reading the  "How to make an advanced configuration file" in

http://www.minecraftforge.net/wiki/How_to_make_an_advanced_configuration_file#Loading_and_Saving_the_Configuration

 

####

question 1

how do change the values in the config file from the game and written to config file

 

 

####################

the other problem i run into  is like the problem in the original post

the butons in the gui whith butons are positionated based on the minecraft window sizes so

if i set it where i want when the window is at 854x480 size this is rigth side of the gui aligned whit the first upper line of slots,  if i change the windows size (maximaze or whatever)

the buttons get out of place causing impact in the laligment layout of the gui

 

https://drive.google.com/file/d/0B8sU_NyZQBd7TG1tMVp0YmxkcDA/view?usp=sharing

view?usp=sharing

 

####

quetion 2

how do make the buttons keep their aligment whith the rest of the gui

 

 

####################

and last

the forum has img tags to put images on the posts but seems not load mi images from google drive

¿is not compatible whith google

 

 

thanks for reading

 

 

 

 

 

 

 

Posted

config.set (property)

 

Use your IDE

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

 

du not know

 

if i write  configFile.prop  and let eclipse autoComplete the closest to setProperty is 

 

configFile.setCategoryPropertyOrder(category, propOrder)

 

and looks not like..  usefull for what i want

 

in this case i wanna change an integer value but if i writte configFile.int and let it autocomplete

 

well it only returns  .getMethods

 

https://drive.google.com/file/d/0B8sU_NyZQBd7ZzJ2ZFNCaW5iVmM/view?usp=sharing

https://drive.google.com/file/d/0B8sU_NyZQBd7Z0xfNm00X2lUbVE/view?usp=sharing

 

looks like there is no tools to do this, but i been see mods doing it before

so there must be a trick  some workaround

 

 

 

 

 

 

 

 

 

configFile.

 

 

Posted

getInteger(...) is a convenience method wrapped around getProperty(...).getInt()

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

yaa

 

but thats to get the value, i wanna changeit

 

int posY = configFile.get("Gui", "Gui pos Y", ppy, "").getInt();

 

i need someting more like

 

configFile.get("Gui", "Gui pos Y", ppy, "").setInt(99);

 

and then could write the chane to the config file doing

 

configFile.save();

Posted

that is the answer

 

"suers in spanish"

 

i dont du that for begining coz i think i must write the property to the config file

something like

 

configFile.set( configFile.get("Gui", "Gui pos Y", ppy, "").setInt(99); );

 

 

for the other things scavenging code from the minions, ZyinsHUD and ClockHUD i now understand

than in the chest based gui you align things based on the center of the screen  rater than the top left like i supoust before so i fix the buttons positions now are where i want and keep that position

 

but this is not valid for the other types of gui, like mi gun stats gui, the gui elemets end missplaced if i alignenm whit the ceter coz the center moves also when you change size or the guiscale

well i actualy could forget that, just let the gui whith buttons to let the player set the guns stat gui position like he likes thats what they do in the zyins mod  in  ClockHUD they just let it in x0 y0

 

but i really like to know how to calculate the render position of the gui

is this really posible or is this the result from a (bug o|r feature)

 

thanks for reading

now i gona back to work whi the other trouble of the textures size's crash

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.