Skip to content

Commit

Permalink
Merge pull request #3 from GeftGames/dev
Browse files Browse the repository at this point in the history
0.1.26.0 Update
  • Loading branch information
GeftGames committed Jan 22, 2022
2 parents 4921b51 + ea8e708 commit 900eb58
Show file tree
Hide file tree
Showing 180 changed files with 112,733 additions and 96,559 deletions.
10 changes: 8 additions & 2 deletions rabcrClient.sln
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rabcrClient", "rabcrClient\rabcrClient.csproj", "{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x64.ActiveCfg = Debug|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x64.Build.0 = Debug|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x86.ActiveCfg = Debug|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Debug|x86.Build.0 = Debug|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x64.ActiveCfg = Release|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x64.Build.0 = Release|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x86.ActiveCfg = Release|x86
{B0E7EE60-C50B-43B6-8CD2-2A5B6D87E15E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
Expand Down
52 changes: 26 additions & 26 deletions rabcrClient/AchievmentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AchievmentControl : Control{
int alpha=200;
int need=255;
Image image;

enum State :byte{
None,
Enter,
Expand Down Expand Up @@ -123,31 +123,31 @@ enum State :byte{
//g.SmoothingMode = SmoothingMode.None;
Font=new Font(Font.FontFamily,14);
Size =new Size(Size.Width,64);

Brush b = new LinearGradientBrush(ClientRectangle, Color.FromArgb((int)alpha,(int)alpha,(int)alpha), Color.FromArgb((int)alpha-40,(int)alpha-40,(int)alpha-40), 90);
// Pen sb = new Pen(new SolidBrush(Color.Black));

// Pen sb = new Pen(new SolidBrush(Color.Black));

//Back
g.DrawRectangle(new Pen(new LinearGradientBrush(ClientRectangle, Color.FromArgb(100,(int)alpha,(int)alpha,(int)alpha), Color.FromArgb(100,(int)alpha-40,(int)alpha-40,(int)alpha-40), 90)),new Rectangle(0, 0, Size.Width-1, Size.Height-1));
g.DrawRectangle(new Pen(new LinearGradientBrush(ClientRectangle, Color.FromArgb(200,(int)alpha,(int)alpha,(int)alpha), Color.FromArgb(200,(int)alpha-40,(int)alpha-40,(int)alpha-40), 90)),new Rectangle(1, 1, Size.Width-3, Size.Height-3));
g.FillRectangle(b,new Rectangle(2, 2, Size.Width-4, Size.Height-4));
g.InterpolationMode=InterpolationMode.NearestNeighbor;

if (Image!=null)g.DrawImage(image, 0,0,64,64);
if (Done) {
g.DrawImage(rabcrClient.Properties.Resources.Done,new Point(Width-60,6));
}
}
g.InterpolationMode=InterpolationMode.HighQualityBicubic;

g.TextContrast=0;
g.TextRenderingHint=System.Drawing.Text.TextRenderingHint.AntiAlias;
// if (Setting.TextShadow) {
g.PixelOffsetMode = PixelOffsetMode.Half;
//g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Point(textX + 1 - (int)(g.MeasureString(Text, Font).Width / 2), textY + 1 - (int)(g.MeasureString(Text, Font).Height / 2)));
//g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Point(textX + 1 - (int)(g.MeasureString(Text, Font).Width / 2), textY - (int)(g.MeasureString(Text, Font).Height / 2)));
//g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(50, 0, 0, 0)), new Point(textX - (int)(g.MeasureString(Text, Font).Width / 2), textY + 1 - (int)(g.MeasureString(Text, Font).Height / 2)));

g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(70+1, 32 - (int)(g.MeasureString(Text, Font).Height / 2)+0));
g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(70+0, 32 - (int)(g.MeasureString(Text, Font).Height / 2)+1));
g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(70+1, 32 - (int)(g.MeasureString(Text, Font).Height / 2)+1));
Expand All @@ -157,42 +157,42 @@ enum State :byte{

//g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(textX - (int)(g.MeasureString(Text, Font).Width / 2)+2, textY - (int)(g.MeasureString(Text, Font).Height / 2)+1));
//g.DrawString(Text, Font, new SolidBrush(Color.FromArgb(30, 0, 0, 0)), new Point(textX - (int)(g.MeasureString(Text, Font).Width / 2)+1, textY - (int)(g.MeasureString(Text, Font).Height / 2)+2));

g.PixelOffsetMode = PixelOffsetMode.HighQuality;
//}
//Draw.Text(g, Font, Text, textX + 1 - (int)(g.MeasureString(Text, Font).Width / 2), textY + 1 - (int)(g.MeasureString(Text, Font).Height / 2));
//Draw.TextBig(g,Text, (int)((buttonSize.Width - g.MeasureString(Text, Font).Width)/2), (int)((buttonSize.Height - g.MeasureString(Text, Font).Height) / 2));

g.DrawString(Text, Font, new SolidBrush(Color.Black), new Point(70, 32 - (int)(g.MeasureString(Text, Font).Height / 2)));
//ds.DrawText(g, textX - (int)(g.MeasureString(Text, Font).Width / 2), textY - (int)(g.MeasureString(Text, Font).Height / 2), new SolidBrush(Color.Gray));
//else ds.DrawText(g, textX - (int)(g.MeasureString(Text, Font).Width / 2), textY - (int)(g.MeasureString(Text, Font).Height / 2), new SolidBrush(Color.Black));
}

public static Bitmap SetBitmapOpacity(Bitmap image, float opacity) {
//create a Bitmap the size of the image provided
Bitmap bmp = new Bitmap(image.Width, image.Height);
public static Bitmap SetBitmapOpacity(Bitmap image, float opacity) {
//create a Bitmap the size of the image provided
Bitmap bmp = new Bitmap(image.Width, image.Height);

//create a graphics object from the image
using (Graphics gfx = Graphics.FromImage(bmp)) {
//create a graphics object from the image
using (Graphics gfx = Graphics.FromImage(bmp)) {

//create a color matrix object
ColorMatrix matrix = new ColorMatrix();
//create a color matrix object
ColorMatrix matrix = new ColorMatrix();

//set the opacity
matrix.Matrix33 = opacity;
//set the opacity
matrix.Matrix33 = opacity;
matrix.Matrix00=-1;
matrix.Matrix11 = matrix.Matrix22 = -1;

//create image attributes
ImageAttributes attributes = new ImageAttributes();
//create image attributes
ImageAttributes attributes = new ImageAttributes();

//set the color(opacity) of the image
attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
//set the color(opacity) of the image
attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);

//now draw the image
//now draw the image
gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes);
}
return bmp;
}
}
}
}
8 changes: 1 addition & 7 deletions rabcrClient/ClothesTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
using Microsoft.Xna.Framework.Graphics;

namespace rabcrClient {
public class FallingBlockInfo{
public NormalBlock block;
public DInt to, to16;
public bool side;
}

public class ClothesTypeUnderwearDown {
public Texture2D TextureStatic, TextureWalking, TextureSwimming;
public bool Colorize;
Expand Down Expand Up @@ -63,7 +57,7 @@ public class ClothesTypeHelmet{
public bool ShinkHair;
public Color Color;
}
public enum HandClothSize : byte{
public enum HandClothSize : int{
None=0,
Half=18/2,
NearlyFull=18-4,
Expand Down
49 changes: 49 additions & 0 deletions rabcrClient/Commands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace rabcrClient {
public enum Command : byte {
Null,
CheckInMenu, //Status of server
Check, //Status of server
Blank,

// Starting
GetStatus, // get req to join
Login, // Login into the server with pasword (or without)
LoggedState, // Server say ok or wrong
SetPassword, // Set password enter
Logout, // Logout of the server
Exit, // End
Message, // Send a text message to all the chat clients

// World
SendingWorldData, //Get chunk of blocks
GetWorldData,
ListPlayersPositions, //get pos of player

Request, // Check if player exists
EditTerrain,

// Others
PlayersList, // Get a list of users in the chat room from the server
SomeoneLogout,
ConnectDuringGame,
PlayersTeleportMessageToTarget,
PlayersTeleportMessageToSource,

// Player data
PlayerBasicStates, // lives, food, water, ...
PlayerInventory, // my inv, ...
EatFood,
SetInventory,
SetInventoryMachine,
SpawnChanged,
PlayerPosition,
JoinWorld,

}

enum ErrorJoinWorld {
None,
NotAllowedToJoin,
NotFound,
}
}
70 changes: 70 additions & 0 deletions rabcrClient/Default/Effects/Fog.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Texture2D SpriteTexture;
//float4 ColorWhite = float4(1, 1, 1, 1);
float Time;
float PosX;
float PosY;
float Opacity=1;
float4 Color;

sampler2D SpriteTextureSampler = sampler_state {
Texture = <SpriteTexture>;
};

struct VertexShaderOutput {
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};

float rand(float2 vec) {
return frac(sin(dot(vec, float2(/*56*/56, 78/*78*/)) /**1.0*/) * 1000.0);
//return frac(sin(dot(vec, float2(12.9898, 78.233))) * 43758.5453);
//return 1.0;
}

float noise(float2 pos) {
float2 i = floor(pos);
float2 f = frac(pos);

float a = rand(i);
float b = rand(i+float2(1.0,0.0));
float c = rand(i+float2(0.0,1.0));
float d = rand(i+float2(1.0,1.0));

float2 cubic = f*f*(3-2*f);
return lerp(a, b, cubic.x) + (c-a)*cubic.y *(1.0-cubic.x)+(d-b)*cubic.x*cubic.y;
}

float fbm(float2 coord) {
float value=0.0;
float scale=0.5;

for (int i = 0; i < 3/*Octaves*/; i++) {
value+=noise(coord) *scale;
coord*=2.0;
scale*=0.4;
}
return value;
}

float4 MainPS(VertexShaderOutput input) : COLOR {
float2 coord = input.TextureCoordinates*5.0+float2(PosX,PosY);
float motion = fbm(coord+float2(Time,Time/4));
float final = fbm(coord+motion);

//return float4(final, final, final, 1);
return Color*final*Opacity;
}

technique SpriteDrawing {
pass P0 {
PixelShader = compile /*ps_4_0_level_9_1*/ps_4_0_level_9_3 MainPS();
//VertexShader = compile vs_5_0 VertexShaderFunction();
}
};
/*
float4 PixelshaderFunc(float4 pos : SV_POSITION, float2 texCoord : TEXCOORD0) : SV_TARGET0
{
float4 pixelShift = ScreenTexture.Sample(LinearSampler, texCoord.xy + float2(0.1f, 0.0f));
return pixelShift;
}*/
37 changes: 37 additions & 0 deletions rabcrClient/Default/Effects/Vignetting.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
float WSize; // half window width if bigger than height than with height salt
float HSize; // half window height if bigger than width than with width salt
float Intensity;

sampler2D SpriteTextureSampler = sampler_state {
Texture = <SpriteTexture>;
};

struct VertexShaderOutput {
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};

float rand(float2 vec) {
return frac(sin(dot(vec, float2(56, 78))) * 1000.0);
}

float4 MainPS(VertexShaderOutput input) : COLOR {
float x;
float y;

if (input.TextureCoordinates.x < 0.5f) x = (0.5f-input.TextureCoordinates.x) * WSize;
else x = (input.TextureCoordinates.x-0.5f) * WSize;

if (input.TextureCoordinates.y < 0.5f) y = (0.5f-input.TextureCoordinates.y) * HSize;
else y = (input.TextureCoordinates.y - 0.5f) * HSize;


return float4(0, 0, 0, Intensity * (y * y + x * x) + rand(input.TextureCoordinates.xy)/256);
}

technique SpriteDrawing {
pass P0 {
PixelShader = compile ps_4_0_level_9_1 MainPS();
}
};
Loading

0 comments on commit 900eb58

Please sign in to comment.