Is there a way for the game to determine which display size you are using and show the correct size of moon?
Look for the definition of the variable showWindow.width which is used in battleinterface.c
Hook
Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Is there a way for the game to determine which display size you are using and show the correct size of moon?
string widescreen = "";
float screen_x = stf(showWindow.width);
float screen_y = stf(showWindow.height);
float screen_ratio = screen_x/screen_y;
if(screen_ratio > 1.4){ widescreen = "\widescreen";}
string moonpic = "weather\sun\glow" + widescreen + "\moonglowfull.tga"; //default in case moon state is not known
switch (getMoonStateName(getMoonState())){
case FULL_MOON:
moonpic = "weather\sun\glow" + widescreen + "\moonglowfull.tga";
break;
case NEW_MOON:
moonpic = "weather\sun\glow" + widescreen + "\moonglownew.tga";
break;
case QUARTER_ONE:
moonpic = "weather\sun\glow" + widescreen + "\moonglowwaxc.tga";
break;
case QUARTER_TWO:
moonpic = "weather\sun\glow" + widescreen + "\moonglowwax.tga";
break;
case QUARTER_THREE:
moonpic = "weather\sun\glow" + widescreen + "\moonglowwan.tga";
break;
case QUARTER_FOUR:
moonpic = "weather\sun\glow" + widescreen + "\moonglowwanc.tga";
break;
}
The showWindow variable is defined and set in the LogInterface.c file. (It took me a while to find my Code::Blocks for the PotC code.)
In one version of the game I had to set tvused manually to get the compass round. Probably in COAS.
Hook
@DeathDaisy's moon fix has had an interesting effect on my crew.
void setTelescopeInitParameters(ref rTelescope, aref arItmScope)
{
string texName = "telescope.tga";
float fZoom = 5.5;
int nShowItm = 7;
int activateTime = 500;
int updateTime = 150; //KB spyglasses - orig 150.
if (CheckAttribute(arItmScope, "scope.texture")) texName = arItmScope.scope.texture;
if (CheckAttribute(arItmScope, "scope.zoom")) fZoom = stf(arItmScope.scope.zoom);
if (CheckAttribute(arItmScope, "scope.time_activate")) activateTime = sti(arItmScope.scope.time_activate);
if (CheckAttribute(arItmScope, "scope.time_update")) updateTime = sti(arItmScope.scope.time_update);
// ChezJfrey & PB: Automatic Switch -->
string widescreen = "";
float screen_x = stf(showWindow.width);
float screen_y = stf(showWindow.height);
float screen_ratio = screen_x/screen_y;
if(screen_ratio > 1.4){ widescreen = "\\battle_interface\\widescreen\\";}
texName = widescreen + texName;
// ChezJfrey & PB: Automatic Switch <--
SendMessage(rTelescope, "lsflll", MSG_TELESCOPE_SET_TYPE, texName, fZoom, nShowItm, activateTime, updateTime);
}
Just those two.Are those the only textures affected by the switch between wide screen and normal? Or do any other textures change if you pick wide screen?
Technically true.Don't forget that if the check on wide screen is now being handled like that, you'll also need to provide the extra texture files. This, of course, also means that everyone is installing twice as many texture files for spyglass and moon as they actually need.
if (sti(Weathers.Sun.Glow.Enable) == true)
{
string widescreen = "";
float screen_x = stf(showWindow.width);
float screen_y = stf(showWindow.height);
float screen_ratio = screen_x/screen_y;
if(screen_ratio > 1.4){ widescreen = "\widescreen";}
Weathers.Sun.Glow.Dist = 3500.0;
Weathers.Sun.Glow.Size = 1250.0;
Weathers.Sun.Glow.RotateSpeed = 1.0;
Weathers.Sun.Glow.Texture = "weather\sun\glow" + widescreen + "\sunglow.tga"; // <-- was it a mistake to put this here...?
Weathers.Sun.Glow.DecayTime = 8.0;
Weathers.Sun.Glow.TechniqueNoZ = "sunglow_noz";
Weathers.Sun.Glow.TechniqueZ = "sunglow_z";
Weathers.Sun.Glow.Color = argb(0,255,255,255);
}