Hi!
I just got a laptop and I figured out how to synchronize my achaea profile folder from my desktop onto my laptop. It works great!
The only thing is my UI was set up for my desktop and I never thought I'd get a laptop, so it's all in pixel count rather than percentages. I'm unsure how to handle this! I'm thinking there are three possibilities for solutions, ranked from easiest to most difficult!
1. Change all the numbers stuff into percentages. This will be rough because most of it is like... eolUIHeight = 275 eolUIWidth 295, etc
2. Make an alias to disable the UI. This is troublesome because you have to restart mudlet for it to take effect, and if it saves, then it'll save on the other computer too.
3. Make a home directory check like Jacen mentioned and use currect UI if it's one directory, use a giant map if it's laptop directory.
I think the home directory check would work the best. That way if it's one computer it'll make the windows, and if it's another computer, it won't. So if the windows aren't even made, then mudlet doesn't have to restart to get rid of them.
However I have no idea how to make a home directory check or if that's even possible. I asked on mudlet clan and someone was unsure that it's possible. Anyone have any ideas?
Thanks!
i'm a rebel
0
Comments
and etc, etc, for whatever consoles and stuff you have. "Teshas_Laptop" would obviously be the username of whatever computer you're designing for.
gui_width, gui_height = getMainWindowSize() (may need to change them around, i forget which is calculated first)
then, as an example for gui pieces...
gui_randomwindow = Geyser.Label:new({
name = "gui_randomwindow",
width = "30%", height = "50%",
x = "70%", y = 0
})
gui_randomwindow:setStyleSheet([[
background-color: black;
border-color: red;
border-width: 2px;
border-style: groove;
border-radius: 7
]])
Will create a black background, red bordered, rectangular-ish box 70% of the way across your screen, and at the top. Which covers half your screens height, and the remaining 30% of the width.
Then if you want a box directly below that, just change the 'y' value to "50%"
edit; variables aren't needed for the windows and such specifically, but can be utilised by other things, like setting font size inside the labels.
Basically, if you can simply scale your GUI down, use Cynlael's method. If you might have to do some rearranging or nonlinear scaling, use my method.
Svof
Mudlet Discord join up
For example, instead of doing:
I might do:
This has the same effect, but allows me to call GUI.init() any time something changes while my profile is loaded, without labels being re-created needlessly etc.
By doing things in a way similar to this, any run-time changes to your GUI are perfectly easy to do. Having to restart your profile simply to change something in your GUI sucks and I'd really recommend coding your GUI in such a way that this is never needed.
→My Mudlet Scripts
Eta: because positioning via percentage is a nightmare for me. I just use
tx,ty = getMainWindowSize()
x = tx-buttonwidth, y = ty-buttonheight